Skip to content

Commit

Permalink
WindowServer: Move configuration file to /etc/WindowServer.ini
Browse files Browse the repository at this point in the history
This was in the /etc/WindowServer/ directory which had nothing else in
it, so let's just get rid of the directory and move this up one step.
  • Loading branch information
awesomekling committed Apr 29, 2021
1 parent b88b192 commit def1f14
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion Base/usr/share/man/man2/unveil.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The `unveil()` system call was first introduced by OpenBSD.
unveil("/res", "r");

// Allow the process to read, write, and create the config file:
unveil("/etc/WindowServer/WindowServer.ini", "rwc");
unveil("/etc/WindowServer.ini", "rwc");

// Allow the process to execute Calendar:
unveil("/bin/Calendar", "x");
Expand Down
4 changes: 2 additions & 2 deletions Meta/build-root-filesystem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ $CP "$SERENITY_SOURCE_DIR"/Toolchain/Local/i686/i686-pc-serenity/lib/libgcc_s.so
# the permissions needed in the image.
chmod -R g+rX,o+rX "$SERENITY_SOURCE_DIR"/Base/* mnt/

chmod 660 mnt/etc/WindowServer/WindowServer.ini
chown $window_uid:$window_gid mnt/etc/WindowServer/WindowServer.ini
chmod 660 mnt/etc/WindowServer.ini
chown $window_uid:$window_gid mnt/etc/WindowServer.ini
echo "/bin/sh" > mnt/etc/shells

chown 0:$wheel_gid mnt/bin/su
Expand Down
2 changes: 1 addition & 1 deletion Ports/neofetch/patches/add-serenity-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
unset gtk2_theme gtk3_theme theme path

+ if [[ "$os" == "SerenityOS" ]]; then
+ theme=$(ini /etc/WindowServer/WindowServer.ini Theme Name)
+ theme=$(ini /etc/WindowServer.ini Theme Name)
+ if [ -z "$theme" ]; then
+ theme="Default"
+ fi
Expand Down
4 changes: 2 additions & 2 deletions Userland/Applications/DisplaySettings/DisplaySettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void DisplaySettingsWidget::create_frame()

void DisplaySettingsWidget::load_current_settings()
{
auto ws_config(Core::ConfigFile::open("/etc/WindowServer/WindowServer.ini"));
auto ws_config(Core::ConfigFile::open("/etc/WindowServer.ini"));
auto wm_config = Core::ConfigFile::get_for_app("WindowManager");

/// Wallpaper path ////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -253,7 +253,7 @@ void DisplaySettingsWidget::load_current_settings()
void DisplaySettingsWidget::send_settings_to_window_server()
{
// Store the current screen resolution and scale factor in case the user wants to revert to it.
auto ws_config(Core::ConfigFile::open("/etc/WindowServer/WindowServer.ini"));
auto ws_config(Core::ConfigFile::open("/etc/WindowServer.ini"));
Gfx::IntSize current_resolution;
current_resolution.set_width(ws_config->read_num_entry("Screen", "Width", 1024));
current_resolution.set_height(ws_config->read_num_entry("Screen", "Height", 768));
Expand Down
2 changes: 1 addition & 1 deletion Userland/Services/WindowServer/AppletManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ AppletManager::AppletManager()
{
s_the = this;

auto wm_config = Core::ConfigFile::open("/etc/WindowServer/WindowServer.ini");
auto wm_config = Core::ConfigFile::open("/etc/WindowServer.ini");
auto order = wm_config->read_entry("Applet", "Order");
order_vector = order.split(',');
}
Expand Down
2 changes: 1 addition & 1 deletion Userland/Services/WindowServer/ClientConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ OwnPtr<Messages::WindowServer::SetSystemThemeResponse> ClientConnection::handle(

OwnPtr<Messages::WindowServer::GetSystemThemeResponse> ClientConnection::handle(const Messages::WindowServer::GetSystemTheme&)
{
auto wm_config = Core::ConfigFile::open("/etc/WindowServer/WindowServer.ini");
auto wm_config = Core::ConfigFile::open("/etc/WindowServer.ini");
auto name = wm_config->read_entry("Theme", "Name");
return make<Messages::WindowServer::GetSystemThemeResponse>(name);
}
Expand Down
4 changes: 2 additions & 2 deletions Userland/Services/WindowServer/WindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ NonnullRefPtr<Cursor> WindowManager::get_cursor(const String& name)

void WindowManager::reload_config()
{
m_config = Core::ConfigFile::open("/etc/WindowServer/WindowServer.ini");
m_config = Core::ConfigFile::open("/etc/WindowServer.ini");

m_double_click_speed = m_config->read_num_entry("Input", "DoubleClickSpeed", 250);
m_hidden_cursor = get_cursor("Hidden");
Expand Down Expand Up @@ -1547,7 +1547,7 @@ bool WindowManager::update_theme(String theme_path, String theme_name)
});
MenuManager::the().did_change_theme();
AppletManager::the().did_change_theme();
auto wm_config = Core::ConfigFile::open("/etc/WindowServer/WindowServer.ini");
auto wm_config = Core::ConfigFile::open("/etc/WindowServer.ini");
wm_config->write_entry("Theme", "Name", theme_name);
wm_config->sync();
Compositor::the().invalidate_occlusions();
Expand Down
6 changes: 3 additions & 3 deletions Userland/Services/WindowServer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ int main(int, char**)
return 1;
}

if (unveil("/etc/WindowServer/WindowServer.ini", "rwc") < 0) {
perror("unveil /etc/WindowServer/WindowServer.ini");
if (unveil("/etc/WindowServer.ini", "rwc") < 0) {
perror("unveil /etc/WindowServer.ini");
return 1;
}

Expand All @@ -54,7 +54,7 @@ int main(int, char**)
return 1;
}

auto wm_config = Core::ConfigFile::open("/etc/WindowServer/WindowServer.ini");
auto wm_config = Core::ConfigFile::open("/etc/WindowServer.ini");
auto theme_name = wm_config->read_entry("Theme", "Name", "Default");

auto theme = Gfx::load_system_theme(String::formatted("/res/themes/{}.ini", theme_name));
Expand Down

0 comments on commit def1f14

Please sign in to comment.