diff --git a/configuration.nix b/configuration.nix index 324cf01..a7c7ad8 100644 --- a/configuration.nix +++ b/configuration.nix @@ -113,6 +113,7 @@ shell = pkgs.zsh; extraGroups = [ "dialout" + "input" "networkmanager" "wheel" ]; diff --git a/desktop/default.nix b/desktop/default.nix index cb5c41a..d3748fb 100644 --- a/desktop/default.nix +++ b/desktop/default.nix @@ -1,13 +1,13 @@ { ... }: { imports = [ + ./waybar + ./cursor.nix ./hyprland.nix ./hyprpaper.nix ]; - programs.waybar.enable = true; - services.hyprlauncher = { enable = true; settings = { diff --git a/desktop/hyprland.nix b/desktop/hyprland.nix index af1bed3..08cbec5 100644 --- a/desktop/hyprland.nix +++ b/desktop/hyprland.nix @@ -16,7 +16,7 @@ # autostart exec-once = [ - "waybar &" + # "waybar &" "1password --silent &" "hyprpaper &" ]; diff --git a/desktop/waybar/default.nix b/desktop/waybar/default.nix new file mode 100644 index 0000000..af2f383 --- /dev/null +++ b/desktop/waybar/default.nix @@ -0,0 +1,127 @@ +{ + programs.waybar = { + enable = true; + systemd.enable = true; + + settings.main = { + height = 34; + spacing = 10; + + modules-left = [ + "hyprland/workspaces" + "hyprland/submap" + ]; + modules-center = [ + "hyprland/window" + ]; + modules-right = [ + "keyboard-state" + "pulseaudio" + "network" + "cpu" + "memory" + "temperature" + "clock" + "tray" + "custom/power" + ]; + + "hyprland/window" = { + rewrite = { + "(.*) — Mozilla Firefox" = "🌎 $1"; + "(.*) - Discord" = "📱 $1"; + }; + separate-outputs = true; + }; + + keyboard-state = { + numlock = true; + capslock = true; + format = { + capslock = "C {icon}"; + numlock = "{icon} N"; + }; + format-icons = { + locked = " "; + unlocked = " "; + }; + }; + + pulseaudio = { + format = "{volume}% {icon} {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-muted = " {format_source}"; + format-source = "{volume}% "; + format-source-muted = " "; + format-icons = { + headphone = ""; + default = [ + " " + " " + " " + ]; + }; + on-click = "pavucontrol"; + }; + + network = { + format-wifi = "{essid} ({signalStrength}%)  "; + format-ethernet = "{ipaddr}/{cidr} 🔌"; + tooltip-format = "{ifname} via {gwaddr} "; + format-linked = "{ifname} (No IP) "; + format-disconnected = "Disconnected ⚠"; + format-alt = "{ifname}: {ipaddr}/{cidr}"; + }; + + cpu = { + format = "{usage}%  "; + tooltip = true; + }; + + memory = { + format = "{used}/{total} GiB ({percentage}%)  "; + tooltip = false; + }; + + temperature = { + critical-threshold = 80; + format = "{temperatureC}°C {icon}"; + format-icons = [ + "" + "" + "" + ]; + }; + + clock = { + tooltip-format = "{calendar}"; + format = "{0:%H:%M} {0:%Y-%m-%d}"; + }; + + tray = { + spacing = 20; + }; + + "custom/power" = { + format = "⏻ "; + tooltip = false; + menu = "on-click"; + menu-file = "$HOME/.config/waybar/power_menu.xml"; + menu-actions = { + shutdown = "hyprshutdown --post-cmd 'shutdown -P 0'"; + reboot = "hyprshutdown --post-cmd 'reboot'"; + }; + }; + }; + + style = ./style.css; + }; + + home.file = { + waybar-custom-power = { + target = ".config/waybar/power_menu.xml"; + source = ./power_menu.xml; + }; + }; +} diff --git a/desktop/waybar/power_menu.xml b/desktop/waybar/power_menu.xml new file mode 100644 index 0000000..f3314dd --- /dev/null +++ b/desktop/waybar/power_menu.xml @@ -0,0 +1,18 @@ + + + + + + Shutdown + + + + + + + + Reboot + + + + diff --git a/desktop/waybar/style.css b/desktop/waybar/style.css new file mode 100644 index 0000000..505514e --- /dev/null +++ b/desktop/waybar/style.css @@ -0,0 +1,41 @@ +* { + border: none; + border-radius: 0; + font-family: 'Berkeley Mono', 'Iosevka Nerd Font'; + font-size: 13px; + min-height: 0; +} + +window#waybar { + background: rgba(43, 48, 59, 0.5); + border-bottom: 3px solid rgba(100, 114, 125, 0.5); + color: white; +} + +tooltip { + background: rgba(43, 48, 59, 0.75); + border: 1px solid rgba(100, 114, 125, 0.5); +} + +tooltip label { + color: white; +} + +#workspaces button { + padding: 0 5px; + background: transparent; + color: white; + border-bottom: 3px solid transparent; +} + +/* highlight active workspace */ +#workspaces button.active { + border-top: 3px solid #a3a3a3; + border-bottom: 3px solid #a3a3a3; + +} + +#clock { + background-color: #64727D; +} + diff --git a/home.nix b/home.nix index 19d2691..6fecb63 100644 --- a/home.nix +++ b/home.nix @@ -43,6 +43,7 @@ dig glibcInfo hyprpaper + hyprshutdown imagemagick man-pages man-pages-posix