From 34e6673c3e4a443faaa00a5cd2cf532385734a1b Mon Sep 17 00:00:00 2001 From: Stefan Ellmauthaler Date: Tue, 9 May 2023 13:41:50 +0200 Subject: [PATCH] xmonad base configuration and setup --- modules/graphical.nix | 5 +- modules/users.nix | 2 + modules/xmonad.nix | 9 ++ users/ellmau/conf/rofi/theme.rafi | 195 +++++++++++++++++++++++++++ users/ellmau/dunst.nix | 2 +- users/ellmau/polybar_xmonad.nix | 216 ++++++++++++++++++++++++++++++ users/ellmau/rofi.nix | 19 +++ users/ellmau/xmonad.nix | 37 +++++ 8 files changed, 483 insertions(+), 2 deletions(-) create mode 100644 users/ellmau/conf/rofi/theme.rafi create mode 100644 users/ellmau/polybar_xmonad.nix create mode 100644 users/ellmau/rofi.nix create mode 100644 users/ellmau/xmonad.nix diff --git a/modules/graphical.nix b/modules/graphical.nix index 746544a..ae84048 100644 --- a/modules/graphical.nix +++ b/modules/graphical.nix @@ -22,7 +22,10 @@ with lib; { ''; }; xserver.enable = mkEnableOption "enable X server"; - xmonad.enable = mkEnableOption "enable xmonad"; + xmonad = { + enable = mkEnableOption "enable xmonad"; + polybar.enable = mkEnableOption "enable Polybar for xmonad"; + }; i3.enable = mkEnableOption "enable i3"; }; config = let diff --git a/modules/users.nix b/modules/users.nix index 04f4754..4039775 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -11,6 +11,8 @@ with lib; { x11.enable = mkEnableOption "Activate XSession related options in user-configs"; + dunst.enable = mkEnableOption "Activate Dunst"; + users = mkOption { description = "logins of non-admin users to configure"; type = types.listOf types.str; diff --git a/modules/xmonad.nix b/modules/xmonad.nix index a80243a..9655587 100644 --- a/modules/xmonad.nix +++ b/modules/xmonad.nix @@ -10,13 +10,22 @@ with lib; { in mkIf cfg.enable { elss.graphical.xserver.enable = true; + elss.users.dunste.enable = true; + cfg.polybar.enable = true; services = { xserver = { + startDbusSession = true; windowManager.xmonad = { enable = true; enableContribAndExtras = true; }; + displaymanager.defaultSession = "none+xmonad"; + libinput = { + enable = true; + disableWhileTyping = true; + }; }; + upower.enable = true; }; }; } diff --git a/users/ellmau/conf/rofi/theme.rafi b/users/ellmau/conf/rofi/theme.rafi new file mode 100644 index 0000000..2ffe01a --- /dev/null +++ b/users/ellmau/conf/rofi/theme.rafi @@ -0,0 +1,195 @@ +/** + * official theme arthur.rasi + * ROFI Color theme + * User: Qball + * Copyright: Dave Davenport + */ + +configuration { + + // The display name of this browser + display-ssh: " "; + // The display name of this browser + display-run: ""; + // The display name of this browser + display-drun: ""; + // The display name of this browser + display-window: ""; + display-combi: ""; + show-icons: true; +} + + +/** + * User: Qball + * Copyright: Dave Davenport + */ +* { + foreground: #ffeedd; + backlight: #ccffeedd; + background-color: transparent; + dark: #1c1c1c; + // Black + black: #3d352a; + lightblack: #554444; + tlightblack: #554444cc; + // + // Red + red: #cd5c5c; + lightred: #cc5533; + // + // Green + green: #86af80; + lightgreen: #88cc22; + // + // Yellow + yellow: #e8ae5b; + lightyellow: #ffa75d; + // + // Blue + blue: #6495ed; + lightblue: #87ceeb; + // + // Magenta + magenta: #deb887; + lightmagenta: #996600; + // + // Cyan + cyan: #b0c4de; + tcyan: #ccb0c4de; + lightcyan: #b0c4de; + // + // White + white: #bbaa99; + lightwhite: #ddccbb; + // + // Bold, Italic, Underline + highlight: underline bold #ffffff; + + transparent: rgba(0,0,0,0); + font: "Source Code Pro 10"; +} +#window { + location: center; + anchor: center; + transparency: "screenshot"; + padding: 10px; + border: 0px; + border-radius: 10px; + color: @magenta; + background-color: @transparent; + spacing: 0; + children: [mainbox]; + orientation: horizontal; +} + +#mainbox { + spacing: 0; + children: [ inputbar, message, listview ]; +} + +#message { + border-color: @foreground; + border: 0px 2px 2px 2px; +// border-radius: 10px; + padding: 5; + background-color: @tcyan; +} +#message { + font: "Source Code Pro 8"; + color: @black; +} + +#inputbar { + color: @lightgreen; + padding: 11px; + background-color: @tlightblack; + border: 2px 2px 2px 2px; + border-radius: 15px 15px 0px 0px; + border-color: @foreground; + font: "Source Code Pro 18"; +} +#entry,prompt,case-indicator { + text-font: inherit; + text-color:inherit; +} +#prompt { + margin: 0px 0.3em 0em 0em ; +} +#listview { + padding: 8px; + border-radius: 0px 0px 15px 15px; + border-color: @foreground; + border: 0px 2px 2px 2px; + background-color: #1c1c1ccc; + dynamic: false; + lines: 10; +} +#element { + padding: 3px; + vertical-align: 0.5; +// border: 2px; + border-radius: 4px; + background-color: transparent; + color: @foreground; + font:inherit; +} +#element selected.normal { + background-color: @blue; +} +#element normal active { + foreground: @lightblue; +} +#element normal urgent { + foreground: @lightred; +} +#element alternate normal { +} +#element alternate active { + foreground: @lightblue; +} +#element alternate urgent { + foreground: @lightred; +} +#element selected active { + background-color: @lightblue; + foreground: @dark; +} +#element selected urgent { + background-color: @lightred; + foreground: @dark; +} +#element normal normal { + +} + +#vertb { + expand: false; + children: [ dummy0, mode-switcher, dummy1 ]; +} +#dummy0, dummy1 { + expand: true; +} + +#mode-switcher { + expand: false; + orientation: vertical; + spacing: 0px; + border: 0px 0px 0px 0px; +} +#button { + font: "FontAwesome 22"; + padding: 6px; + border: 2px 0px 2px 2px; + border-radius: 4px 0px 0px 4px; + background-color: @tlightblack; + border-color: @foreground; + color: @foreground; + horizontal-align: 0.5; +} +#button selected normal { + color: @dark; + border: 2px 0px 2px 2px; + background-color: @backlight; + border-color: @foreground; +} \ No newline at end of file diff --git a/users/ellmau/dunst.nix b/users/ellmau/dunst.nix index d12f103..93a4435 100644 --- a/users/ellmau/dunst.nix +++ b/users/ellmau/dunst.nix @@ -7,7 +7,7 @@ }: with lib; { config = let - cfg = nixosConfig.elss.graphical.i3; + cfg = nixosConfig.elss.users.dunst; in mkIf cfg.enable { services.dunst = { diff --git a/users/ellmau/polybar_xmonad.nix b/users/ellmau/polybar_xmonad.nix new file mode 100644 index 0000000..a8d043d --- /dev/null +++ b/users/ellmau/polybar_xmonad.nix @@ -0,0 +1,216 @@ +{ + config, + pkgs, + lib, + nixosConfig, + ... +}: +with lib; { + config = let + cfg = nixosConfig.elss.graphical.xmonad; + in + mkIf cfg.polybar.enable { + services.polybar = { + enable = true; + packages = pkgs.polybarFull; + settings = let + fonts = [ + "Hasklig:style=Regular" + "all-the-icons:style=Regular" + "Webdings:style=Regular" + "Noto Emoji:scale=10" + "Unifont:style=Regular" + "Material Icons:size=12;0" + "Weather Icons:size=12;0" + "Hasklug Nerd Font,Hasklig Medium:style=Medium,Regular" + ]; + in { + "bar/main" = { + font = fonts; + modules = { + left = "xmonad"; + center = ""; + right = "xbacklight xkeyboard eth wlan battery date powermenu dunst volume "; + }; + tray = { + position = "right"; + padding = 2; + }; + + monitor = '' + ''${env:MONITOR:} + ''; + }; + + "bar/aux" = { + font = fonts; + modules = { + left = "xmonad"; + center = ""; + right = " xbacklight xkeyboard eth wlan battery date powermenu volume "; + }; + monitor = '' + ''${env:MONITOR:} + ''; + }; + + "module/xmonad" = { + type = "custom/script"; + exec = "${pkgs.xmonad-log} /bin/xmonad-log"; + tail = true; + }; + "module/xkeyboard" = { + type = "internal/xkeyboard"; + blacklist-0 = "num lock"; + interval = "5"; + + format-prefix = ''""''; + label-layout = "%layout%"; + + label-indicator-padding = "2"; + label-indicator-margin = "1"; + }; + "module/wlan" = { + type = "internal/network"; + interface = "wlp0s20f3"; + interval = "3.0"; + + format-connected = " "; + format-connected-underline = "#9f78e1"; + label-connected = "%essid%"; + + ramp-signal-0 = ''"0.0"''; + ramp-signal-1 = ''"0.5"''; + ramp-signal-2 = ''"1.0"''; + ramp-signal-3 = ''"1.0"''; + ramp-signal-4 = ''"1.0"''; + + format-disconnected = ""; + # ;format-disconnected = + #;format-disconnected-underline = ${self.format-connected-underline} + #;label-disconnected = %ifname% disconnected + #;label-disconnected-foreground = ${colors.foreground-alt} + }; + "module/eth" = { + type = "internal/network"; + interface = "eno1"; + interval = "3.0"; + + format-connected-underline = "#55aa55"; + format-connected = " "; + label-connected = "%local_ip%"; + + format-disconnected = ""; + format-disconnected-background = "#5479b7"; + #;format-disconnected = + #;format-disconnected-underline = ${self.format-connected-underline} + #;label-disconnected = %ifname% disconnected + #;label-disconnected-foreground = ${colors.foreground-alt} + }; + "module/date" = { + type = "internal/date"; + interval = "5"; + + date = ''" %Y-%m-%d"''; + date-alt = ''" %Y-%m-%d"''; + + time = "%H:%M"; + time-alt = "%H:%M:%S"; + + #format-prefix = ""; + #format-prefix-foreground = foreground_altcol; + format-underline = "#0a6cf5"; + + label = "%{A} %date% %time%"; + }; + "module/battery" = { + type = "internal/battery"; + battery = "BAT0"; + adapter = "ADP1"; + full-at = "98"; + + format-charging-background = "#689d6a"; + format-charging-prefix = ''" "''; + format-charging = ""; + format-discharging-prefix = ''" "''; + format-discharging = ""; + format-discharging-background = "#689d6a"; + format-full-prefix = ''" "''; + + format-charging-underline = "#ffaa55"; + format-full-underline = "#ffaa55"; + + ormat-full-padding = "1"; + format-charging-padding = "1"; + format-discharging-padding = "1"; + }; + "module/temperature" = { + type = "internal/temperature"; + thermal-zone = "0"; + warn-temperature = "60"; + + format = "