diff --git a/README.md b/README.md index 4c3de3bd..a92c0033 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,8 @@ When the tiling is active SuperShiftTab selects A default user configuration, `user.js`, is created in `~/.config/paperwm/` with three functions `init`, `enable` and `disable`. `init` will run only once on startup, `enable` and `disable` will be run whenever extensions are being told to disable and enable themselves. Eg. when locking the screen with SuperL. +You can also supply a custom `stylesheet.css` in `~/.config/paperwm/`, and paperwm will override its own default stylesheet located at the extension installation location, e.g., `~/.local/share/gnome-shell/extensions/paperwm@hedning:matrix.org/stylesheet.css or `/usr/share/gnome-shell/extensions/paperwm@hedning:matrix.org/stylesheet.css`. + We also made an emacs package, [gnome-shell-mode](https://github.com/paperwm/gnome-shell-mode), to make hacking on the config and writing extensions a more pleasant experience. To support this out of the box we also install a `metadata.json` so gnome-shell-mode will pick up the correct file context, giving you completion and interactive evaluation ala. looking glass straight in emacs. Pressing SuperInsert will assign the active window to a global variable `metaWindow`, its [window actor](https://developer.gnome.org/meta/stable/MetaWindowActor.html) to `actor`, its [workspace](https://developer.gnome.org/meta/stable/MetaWorkspace.html) to `workspace` and its PaperWM style workspace to `space`. This makes it easy to inspect state and test things out. diff --git a/extension.js b/extension.js index ceda8596..3c8e693e 100644 --- a/extension.js +++ b/extension.js @@ -1,3 +1,5 @@ +const { St } = imports.gi; + // polyfill workspace_manager that was introduced in 3.30 (must happen before modules are imported) if (!global.workspace_manager) { global.workspace_manager = global.screen; @@ -180,6 +182,12 @@ function initUserConfig() { if (hasUserConfigFile()) { Extension.imports.searchPath.push(getConfigDir().get_path()); } + + let userStylesheet = getConfigDir().get_child("stylesheet.css"); + if (userStylesheet.query_exists(null)) { + let themeContext = St.ThemeContext.get_for_stage(global.stage); + themeContext.get_theme().load_stylesheet(userStylesheet); + } } /**