diff options
Diffstat (limited to 'modules/hosts/desktop/labwc')
| -rw-r--r-- | modules/hosts/desktop/labwc/default.nix | 203 | ||||
| -rw-r--r-- | modules/hosts/desktop/labwc/sfwbar.nix | 142 |
2 files changed, 172 insertions, 173 deletions
diff --git a/modules/hosts/desktop/labwc/default.nix b/modules/hosts/desktop/labwc/default.nix index fd7c062..b62dbbe 100644 --- a/modules/hosts/desktop/labwc/default.nix +++ b/modules/hosts/desktop/labwc/default.nix @@ -7,7 +7,7 @@ }: let - inherit (lib) mkEnableOption mkIf; + inherit (lib) mkEnableOption mkOption mkIf types optional; cfg = config.nx.desktop.labwc; gruvbox-openbox = pkgs.stdenv.mkDerivation { @@ -30,11 +30,56 @@ let }; in { - imports = [ - ./sfwbar.nix - ]; + options.nx.desktop.labwc = { + enable = mkEnableOption "Enable labwc"; + monitors = mkOption { + type = types.attrsOf (types.submodule { + options = { + mode = mkOption { + type = types.str; + description = "Monitor resolution and refresh rate"; + example = "1920x1080@240"; + }; + position = mkOption { + type = types.str; + default = "0,0"; + description = "Monitor position"; + example = "1920,0"; + }; + }; + }); + default = { }; + description = "Monitor configuration for kanshi"; + }; + wallpaper = mkOption { + type = types.nullOr types.path; + default = null; + description = "Wallpaper image path"; + }; + theme = { + gtk = mkOption { + type = types.str; + default = "Gruvbox-Material-Dark"; + description = "GTK theme name"; + }; + icons = mkOption { + type = types.str; + default = "Gruvbox-Dark"; + description = "Icon theme name"; + }; + cursor = mkOption { + type = types.str; + default = "Adwaita"; + description = "Cursor theme name"; + }; + openbox = mkOption { + type = types.str; + default = "gruvbox-material-dark-blocks"; + description = "Openbox/LabWC theme name"; + }; + }; + }; - options.nx.desktop.labwc.enable = mkEnableOption "Enable labwc"; config = mkIf cfg.enable { home-manager.users.${username} = { home.packages = with pkgs; [ @@ -42,26 +87,26 @@ in labwc-gtktheme gruvbox-material-gtk-theme gruvbox-dark-icons-gtk - swaybg wl-clipboard - - gruvbox-openbox - ]; + sfwbar + gtk-layer-shell + ] ++ optional (cfg.wallpaper != null) swaybg + ++ [ gruvbox-openbox ]; services.cliphist.enable = true; gtk = { enable = true; theme = { - name = "Gruvbox-Material-Dark"; + name = cfg.theme.gtk; package = pkgs.gruvbox-material-gtk-theme; }; iconTheme = { - name = "Gruvbox-Dark"; + name = cfg.theme.icons; package = pkgs.gruvbox-dark-icons-gtk; }; cursorTheme = { - name = "Adwaita"; + name = cfg.theme.cursor; package = pkgs.adwaita-icon-theme; }; gtk3.extraConfig = { @@ -72,17 +117,15 @@ in }; }; - services.kanshi = { + services.kanshi = mkIf (cfg.monitors != { }) { enable = true; profiles = { - home = { - outputs = [ - { - criteria = "DP-1"; - mode = "1920x1080@240"; - position = "1920,0"; - } - ]; + default = { + outputs = lib.mapAttrsToList (name: monitor: { + criteria = name; + mode = monitor.mode; + position = monitor.position; + }) cfg.monitors; }; }; }; @@ -91,28 +134,21 @@ in enable = true; autostart = [ "${pkgs.sfwbar}/bin/sfwbar" - "${pkgs.swaybg}/bin/swaybg -m fill -i /home/${username}/Developer/nix/images/pond.jpg & disown" - ]; + ] ++ optional (cfg.wallpaper != null) "${pkgs.swaybg}/bin/swaybg -m fill -i ${cfg.wallpaper} & disown"; environment = [ - "XKB_DEFAULT_LAYOUT=de" + "XKB_DEFAULT_LAYOUT=${config.console.keyMap}" "XCURSOR_SIZE=24" "XDG_CURRENT_DESKTOP=wlroots" ]; - menu = [ - ]; - rc = { core = { decoration = "server"; gap = 5; - adaptiveSync = "no"; - reuseOutputMode = "yes"; }; theme = { - # "gruvbox-dark", "gruvbox-material-dark", "gruvbox-material-dark-blocks" - name = "gruvbox-material-dark-blocks"; + name = cfg.theme.openbox; }; keyboard = { @@ -150,6 +186,111 @@ in }; }; }; + + # sfwbar configuration + xdg.configFile."sfwbar/sfwbar.config".text = '' + # Term setup + Set Term = "foot" + Set ThicknessHint = "20px" + + # Actions + TriggerAction "SIGRTMIN+1", SwitcherEvent "forward" + TriggerAction "SIGRTMIN+2", SwitcherEvent "back" + + # Initialization + Function("SfwbarInit") { + SetLayer "top" + SetMirror "*" + SetExclusiveZone "auto" + } + + # Placer (Window positioning) + placer { + xorigin = 5 + yorigin = 5 + xstep = 5 + ystep = 5 + children = true + } + + # Task Switcher + switcher { + interval = 700 + icons = true + labels = false + cols = 5 + } + + # Load Standard Library Winops + include("${pkgs.sfwbar}/share/sfwbar/winops.widget") + + # Main Layout + layout { + + # Start Menu + include("${pkgs.sfwbar}/share/sfwbar/startmenu.widget") + + # Show Desktop + include("${pkgs.sfwbar}/share/sfwbar/showdesktop.widget") + + # Taskbar + taskbar { + rows = 1 + icons = true + labels = false + sort = false + action[3] = Menu "winops" + action[Drag] = Focus + } + + # Spacer + label { + value = "" + style = "spacer" + } + + # Pager + pager { + rows = 1 + pins = "1","2","3","4" + preview = true + action[Drag] = WorkspaceActivate + } + + # Tray + tray { + rows = 1 + } + + # Modules + include("${pkgs.sfwbar}/share/sfwbar/volume.widget") + + # Clock + grid { + style = "clock_grid" + label { + value = Time("%H:%M") + tooltip = Time("%H:%M\n%x") + } + } + } + + #CSS + #spacer { + -GtkWidget-hexpand: true; + } + + button#taskbar_item { + padding: 5px; + border-radius: 0px; + border-width: 0px; + -GtkWidget-hexpand: false; + } + + button#taskbar_item:hover { + background-color: rgba(255, 255, 255, 0.1); + } + ''; }; }; } diff --git a/modules/hosts/desktop/labwc/sfwbar.nix b/modules/hosts/desktop/labwc/sfwbar.nix deleted file mode 100644 index 7021374..0000000 --- a/modules/hosts/desktop/labwc/sfwbar.nix +++ /dev/null @@ -1,142 +0,0 @@ -{ - config, - username, - pkgs, - lib, - ... -}: - -let - inherit (lib) mkEnableOption mkIf; - cfg = config.nx.desktop.sfwbar; -in -{ - options.nx.desktop.sfwbar.enable = mkEnableOption "Enable sfwbar" // { - default = config.nx.desktop.labwc.enable; - }; - - config = mkIf cfg.enable { - home-manager.users.${username} = { - home.packages = with pkgs; [ - sfwbar - gtk-layer-shell - ]; - - # CONFIGURATION - xdg.configFile."sfwbar/sfwbar.config".text = '' - # Term setup - Set Term = "foot" - Set ThicknessHint = "20px" - - # Actions - TriggerAction "SIGRTMIN+1", SwitcherEvent "forward" - TriggerAction "SIGRTMIN+2", SwitcherEvent "back" - - # Initialization - Function("SfwbarInit") { - SetLayer "top" - SetMirror "*" - SetExclusiveZone "auto" - } - - # Placer (Window positioning) - placer { - xorigin = 5 - yorigin = 5 - xstep = 5 - ystep = 5 - children = true - } - - # Task Switcher - switcher { - interval = 700 - icons = true - labels = false - cols = 5 - } - - # Load Standard Library Winops - include("${pkgs.sfwbar}/share/sfwbar/winops.widget") - - # Main Layout - layout { - - # Start Menu - include("${pkgs.sfwbar}/share/sfwbar/startmenu.widget") - - # Show Desktop - include("${pkgs.sfwbar}/share/sfwbar/showdesktop.widget") - - # Taskbar - taskbar { - rows = 1 - icons = true - labels = false - sort = false - action[3] = Menu "winops" - action[Drag] = Focus - } - - # Spacer - label { - value = "" - style = "spacer" - } - - # Pager - pager { - rows = 1 - pins = "1","2","3","4" - preview = true - action[Drag] = WorkspaceActivate - } - - # System Monitors - #include("${pkgs.sfwbar}/share/sfwbar/cpu.widget") - #include("${pkgs.sfwbar}/share/sfwbar/memory.widget") - - # Tray - tray { - rows = 1 - } - - # --- MODULES --- - #include("${pkgs.sfwbar}/share/sfwbar/upower.widget") - #include("${pkgs.sfwbar}/share/sfwbar/battery-svg.widget") - - #include("${pkgs.sfwbar}/share/sfwbar/idle.widget") - #include("${pkgs.sfwbar}/share/sfwbar/backlight.widget") - include("${pkgs.sfwbar}/share/sfwbar/volume.widget") - #include("${pkgs.sfwbar}/share/sfwbar/network-module.widget") - #include("${pkgs.sfwbar}/share/sfwbar/sway-lang.widget") - - # Clock - grid { - style = "clock_grid" - label { - value = Time("%H:%M") - tooltip = Time("%H:%M\n%x") - } - } - } - #CSS - - #spacer { - -GtkWidget-hexpand: true; - } - - button#taskbar_item { - padding: 5px; - border-radius: 0px; - border-width: 0px; - -GtkWidget-hexpand: false; - } - - button#taskbar_item:hover { - background-color: rgba(255, 255, 255, 0.1); - } - ''; - }; - }; -} |
