Kieran's opinionated (and probably slightly dumb) nix config

feat: allow hyprnix config to build

+9 -763
+4 -62
home-manager/hyprland/config.nix
··· 1 1 { lib, ... }: 2 - let 3 - inherit (lib.birdos.colors) grayRGB; 4 - hyprRGBA = rgb: a: "rgba(${lib.birdos.colors.hexRGBA rgb a})"; 5 - gb = (lib.birdos.colors.formats.custom hyprRGBA).gruvbox.dark; 6 - shadow = hyprRGBA (grayRGB 6.0e-2); # 6% of each channel 7 - in { 2 + { 8 3 wayland.windowManager.hyprland = { 9 4 # <https://wiki.hyprland.org/Configuring/Variables/#general> 10 5 config.general = { 11 6 border_size = 2; 12 7 gaps_inside = 5; 13 8 gaps_outside = 10; 14 - active_border_color = gb.fg3 1.0; 15 - inactive_border_color = gb.bg3 1.0; 16 - cursor_inactive_timeout = 10; 17 - no_cursor_warps = true; 18 9 resize_on_border = true; 19 10 extend_border_grab_area = 10; 20 11 }; ··· 24 15 rounding = 0; 25 16 shadow_range = 8; 26 17 shadow_render_power = 2; 27 - active_shadow_color = shadow 0.9; 28 - inactive_shadow_color = shadow 0.6; 29 18 blur = { 30 19 size = 3; # 8 31 20 passes = 2; # 1 ··· 44 33 in { 45 34 follow_mouse = LOOSE; 46 35 float_switch_override_focus = DISABLED; 36 + touchpad = { 37 + natural_scroll = true; 38 + }; 47 39 }; 48 40 49 41 # <https://wiki.hyprland.org/Configuring/Variables/#binds> ··· 83 75 insert_after_current = true; 84 76 focus_removed_window = true; 85 77 86 - active_border_color = gb.hl_yellow 1.0; 87 - inactive_border_color = gb.bg3 1.0; 88 - locked_active_border_color = gb.hl_blue 1.0; 89 - locked_inactive_border_color = gb.bg3 1.0; 90 - 91 78 # These features are not polished yet: 92 79 # <https://github.com/hyprwm/Hyprland/issues/2415> 93 80 # @MightyPlaza is working on this, but not doing it how we expect. ··· 97 84 gradients = false; 98 85 render_titles = true; 99 86 scrolling = true; 100 - text_color = gb.fg0 1.0; 101 - 102 - active_color = gb.fg3 1.0; 103 - inactive_color = gb.bg1 0.6; 104 - locked_active_color = active_color; 105 - locked_inactive_color = inactive_color; 106 87 }; 107 88 }; 108 89 ··· 115 96 }; 116 97 117 98 # <https://wiki.hyprland.org/Configuring/Animations/#curves> 118 - animations.animation = { 119 - # window creation 120 - windowsIn = { 121 - enable = true; 122 - duration = 200; 123 - curve = "easeOutCirc"; 124 - style = "popin 60%"; 125 - }; 126 - fadeIn = { 127 - enable = true; 128 - duration = 100; 129 - curve = "easeOutCirc"; 130 - }; 131 - # window destruction 132 - windowsOut = { 133 - enable = true; 134 - duration = 200; 135 - curve = "easeOutCirc"; 136 - style = "popin 60%"; 137 - }; 138 - fadeOut = { 139 - enable = true; 140 - duration = 100; 141 - curve = "easeOutCirc"; 142 - }; 143 - # window movement 144 - windowsMove = { 145 - enable = true; 146 - duration = 300; 147 - curve = "easeInOutCubic"; 148 - style = "popin"; 149 - }; 150 - workspaces = { 151 - enable = true; 152 - duration = 200; 153 - curve = "easeOutCirc"; 154 - style = "slide"; 155 - }; 156 - }; 157 99 }; 158 100 }
+4 -23
home-manager/hyprland/default.nix
··· 1 1 { self, config, lib, pkgs, inputs, ... }: { 2 2 imports = [ 3 3 inputs.hyprnix.homeManagerModules.hyprland 4 - # inputs.hyprland-nix.homeManagerModules.xdg-desktop-portals 5 - #./config.nix 6 - #./windowrules.nix 7 - #./keybinds.nix 8 - #./waybar.nix 4 + ./config.nix 5 + ./windowrules.nix 6 + ./keybinds.nix 7 + ../waybar.nix 9 8 ]; 10 9 11 10 wayland.windowManager.hyprland = { ··· 26 25 "${lib.getExe pkgs.xorg.xhost} +local:" 27 26 ]; 28 27 }; 29 - 30 - # xdg.desktopPortals = { 31 - # enable = true; 32 - # extraPortals = [ 33 - # pkgs.xdg-desktop-portal-hyprland 34 - # pkgs.xdg-desktop-portal-kde 35 - # pkgs.xdg-desktop-portal-gtk 36 - # ]; 37 - # configPackages = [ config.wayland.windowManager.hyprland.package ]; 38 - # config = { 39 - # x-cinnamon = { default = [ "xapp" "gtk" ]; }; 40 - # pantheon = { 41 - # default = [ "pantheon" "gtk" ]; 42 - # "org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ]; 43 - # }; 44 - # common = { default = [ "gtk" ]; }; 45 - # }; 46 - # }; 47 28 }
+1 -58
home-manager/hyprland/keybinds.nix
··· 11 11 MOUSE_EX1 = "mouse:275"; 12 12 MOUSE_EX2 = "mouse:276"; 13 13 14 - exec = { 15 - screenshotWindow = pkgs.patchShellScript ./scripts/screenshot.sh { 16 - runtimeInputs = with pkgs; [ 17 - jq 18 - grim 19 - wl-clipboard 20 - libnotify 21 - config.wayland.windowManager.hyprland.package 22 - ]; 23 - }; 24 - playerctl = lib.getExe pkgs.playerctl; 25 - slight = lib.getExe pkgs.slight; 26 - osdFunc = lib.getExe config.utilities.osd-functions.package; 27 - airplaneMode = "sudo /run/current-system/sw/bin/airplane-mode"; 28 - toggleGroupOrLock = 29 - pkgs.patchShellScript ./scripts/toggle-group-or-lock.sh { 30 - runtimeInputs = with pkgs; [ 31 - jq 32 - config.wayland.windowManager.hyprland.package 33 - ]; 34 - }; 35 - }; 36 - 37 14 # Collections of keybinds common across multiple submaps are collected into 38 15 # groups, which can be merged together granularly. 39 16 groups = { ··· 47 24 launchPrograms = { 48 25 # Launch the program with a shortcut. 49 26 bind."SUPER, E" = "exec, dolphin"; 50 - bind."SUPER, Enter" = "exec, alacritty"; 27 + bind."SUPER, Enter" = "exec, foot"; 51 28 }; 52 29 53 30 # Kill the active window. ··· 217 194 # Forcefully kill a program after selecting its window with the mouse. 218 195 bind."SUPER_SHIFT, Q" = "exec, hyprctl kill"; 219 196 220 - # Screenshot the currently focused window and copy to clipboard. 221 - bind."SUPER, print" = "exec, ${exec.screenshotWindow}"; 222 - 223 197 # Select a region and take a screenshot, saving to the clipboard. 224 198 bind."SUPER_SHIFT, print" = "exec, prtsc -c -m r -D -b 00000066"; 225 199 ··· 235 209 bind."SUPER, Space" = "exec, rofi -show drun -show-icons"; 236 210 # Open Rofi to run a command. 237 211 bind."SUPER, R" = "exec, rofi -show run"; 238 - } 239 - ### FUNCTION KEYS ### 240 - { 241 - # The names of these keys can be found at: 242 - # <https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h> 243 - 244 - bindl."SHIFT, XF86WLAN" = "exec, ${exec.airplaneMode}"; 245 - 246 - # Mute/unmute the active audio output. 247 - bindl.", XF86AudioMute" = "exec, ${exec.osdFunc} output mute"; 248 - 249 - # Raise and lower the volume of the active audio output. 250 - bindel.", XF86AudioRaiseVolume" = "exec, ${exec.osdFunc} output +0.05"; 251 - bindel.", XF86AudioLowerVolume" = "exec, ${exec.osdFunc} output -0.05"; 252 - 253 - # Mute the active microphone or audio source. 254 - bindl.", XF86AudioMicMute" = "exec, ${exec.osdFunc} input mute"; 255 - 256 - # Raise and lower display brightness. 257 - bindel.", XF86MonBrightnessUp" = "exec, ${exec.slight} inc 10 -t 300ms"; 258 - bindel.", XF86MonBrightnessDown" = "exec, ${exec.slight} dec 10 -t 300ms"; 259 - 260 - # Regular media control keys, if your laptop or bluetooth device has them. 261 - bindl.", XF86AudioPlay" = "exec, ${exec.playerctl} play-pause"; 262 - bindl.", XF86AudioPrev" = "exec, ${exec.playerctl} previous"; 263 - bindl.", XF86AudioNext" = "exec, ${exec.playerctl} next"; 264 - 265 - # Poor-man's media player control keys. 266 - bindl."SUPER, slash" = "exec, ${exec.playerctl} play-pause"; 267 - bindl."SUPER, comma" = "exec, ${exec.playerctl} previous"; 268 - bindl."SUPER, period" = "exec, ${exec.playerctl} next"; 269 212 } 270 213 ### WINDOW FOCUS & MOVEMENT ### 271 214 groups.moveFocusOrWindow
-384
home-manager/hyprland/waybar.nix
··· 1 - { config, lib, pkgs, ... }: 2 - let 3 - package = pkgs.waybar; 4 - 5 - # the fonts that will be included with the waybar package 6 - fontPackages = [ pkgs.ubuntu_font_family pkgs.material-design-icons ]; 7 - 8 - # patch those fonts in 9 - package' = let super = package; 10 - in pkgs.symlinkJoin { 11 - inherit (super) name pname version meta; 12 - paths = [ super ] ++ fontPackages; 13 - }; 14 - 15 - compileSCSS = name: source: 16 - "${ 17 - pkgs.runCommandLocal name { } '' 18 - mkdir -p $out 19 - ${lib.getExe pkgs.sassc} -t expanded '${source}' > $out/${name}.css 20 - '' 21 - }/${name}.css"; 22 - 23 - # TODO when using store paths to executables, they do not inherit the user's 24 - # environment (at least with systemd) and therefore GUIs use the default theme 25 - commands = let 26 - slight = "${lib.getExe pkgs.slight}"; 27 - hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl"; 28 - # TODO this is duplicated from the hyprland config, make it a module 29 - kbFns = lib.getExe config.utilities.osd-functions.package; 30 - pavucontrol = lib.getExe pkgs.lxqt.pavucontrol-qt; 31 - blueman-manager = "${pkgs.blueman}/bin/blueman-manager"; 32 - bluetoothctl = "${pkgs.bluez}/bin/bluetoothctl"; 33 - systemctl = "${pkgs.systemd}/bin/systemctl"; 34 - iwgtk = lib.getExe pkgs.iwgtk; 35 - in { 36 - backlightUp = "${slight} inc 5% -t 150ms"; 37 - backlightDown = "${slight} dec 5% -t 150ms"; 38 - # TODO --tab no longer works, what is the identifier to use? 39 - outputSoundSettings = "${pavucontrol} --tab 'Output Devices'"; 40 - outputVolumeMute = "${kbFns} output mute"; 41 - outputVolumeUp = "${kbFns} output +0.05"; 42 - outputVolumeDown = "${kbFns} output -0.05"; 43 - # TODO --tab no longer works, what is the identifier to use? 44 - inputSoundSettings = "${pavucontrol} --tab 'Input Devices'"; 45 - inputVolumeMute = "${kbFns} input mute"; 46 - # inputVolumeUp = "${kbFns} input +0.05"; 47 - # inputVolumeDown = "${kbFns} input -0.05"; 48 - bluetoothSettings = (pkgs.writeShellScript "waybar-bluetooth-settings" '' 49 - set -eux 50 - export PATH="${ 51 - lib.makeBinPath 52 - (with pkgs; [ coreutils gawk util-linux bluez nettools blueman ]) 53 - }:$PATH" 54 - is_powered_on="$( 55 - bluetoothctl show | \ 56 - awk '/Name: '"$(hostname)"'$/{p=1} p && /Powered: yes/{print "true"; exit} END{if(!NR || !p) print "false"}' 57 - )" 58 - if [[ $is_powered_on == 'true' ]]; then 59 - blueman-manager 60 - else 61 - rfkill unblock bluetooth && sleep 1 || true 62 - bluetoothctl power on 63 - sleep 0.5 64 - blueman-manager 65 - fi 66 - '').outPath; 67 - bluetoothToggle = (pkgs.writeShellScript "waybar-bluetooth-toggle" '' 68 - set -eux 69 - export PATH="${ 70 - lib.makeBinPath 71 - (with pkgs; [ coreutils gawk util-linux bluez nettools ]) 72 - }:$PATH" 73 - is_powered_on="$( 74 - bluetoothctl show | \ 75 - awk '/Name: '"$(hostname)"'$/{p=1} p && /Powered: yes/{print "true"; exit} END{if(!NR || !p) print "false"}' 76 - )" 77 - if [[ $is_powered_on == 'true' ]]; then 78 - bluetoothctl power off 79 - else 80 - rfkill unblock bluetooth && sleep 1 || true 81 - bluetoothctl power on 82 - fi 83 - '').outPath; 84 - bluetoothKill = 85 - "rfkill block bluetooth && ${systemctl} restart bluetooth.service"; 86 - bluetoothOff = "${bluetoothctl} power off"; 87 - wirelessSettings = iwgtk; 88 - workspaceSwitchPrev = "${hyprctl} dispatch workspace m-1"; 89 - workspaceSwitchNext = "${hyprctl} dispatch workspace m+1"; 90 - }; 91 - in { 92 - programs.waybar.enable = true; 93 - programs.waybar.package = package'; 94 - 95 - programs.waybar.systemd.enable = true; 96 - 97 - programs.waybar.style = 98 - builtins.readFile (compileSCSS "waybar-style" ./waybar.scss); 99 - 100 - programs.waybar.settings = { 101 - mainBar = { 102 - layer = "top"; 103 - position = "top"; 104 - # Causes tooltips to be shown behind windows. 105 - # mode = "dock"; 106 - height = 26; 107 - 108 - modules-left = [ # # 109 - "clock#time" 110 - "clock#date" 111 - # "wlr/workspaces" 112 - "tray" 113 - "mpris" 114 - ]; 115 - 116 - modules-center = [ # # 117 - "hyprland/workspaces" 118 - ]; 119 - 120 - modules-right = [ 121 - "hyprland/submap" 122 - "pulseaudio#output" 123 - "pulseaudio#input" 124 - "backlight" 125 - "memory" 126 - "cpu" 127 - "temperature" 128 - "battery" 129 - "network" 130 - "bluetooth" 131 - "idle_inhibitor" 132 - ]; 133 - 134 - ## MODULES-LEFT ## 135 - 136 - # Hyprland dropped support unfortunately. 137 - 138 - # "wlr/workspaces" = { 139 - # sort-by-number = true; 140 - 141 - # on-click = "activate"; 142 - # on-scroll-up = commands.workspaceSwitchPrev; 143 - # on-scroll-down = commands.workspaceSwitchNext; 144 - # }; 145 - 146 - "hyprland/workspaces" = { 147 - format = "{name}"; 148 - # sort-by-number = true; 149 - 150 - # on-click = "activate"; 151 - on-scroll-up = commands.workspaceSwitchPrev; 152 - on-scroll-down = commands.workspaceSwitchNext; 153 - }; 154 - 155 - tray = { 156 - show-passive-items = true; 157 - icon-size = 12; 158 - spacing = 16; 159 - }; 160 - 161 - mpris = { 162 - player = "playerctld"; 163 - interval = 1; 164 - 165 - format = "{status_icon} {dynamic}"; 166 - dynamic-len = 70; 167 - dynamic-separator = " — "; 168 - dynamic-order = [ "title" "artist" "position" "length" ]; 169 - dynamic-importance = [ "position" "title" "artist" ]; 170 - status-icons = { 171 - playing = "󰐊"; 172 - paused = "󰏤"; 173 - stopped = "󰓛"; 174 - }; 175 - 176 - tooltip-format = lib.trim '' 177 - <b>Player:</b> {player} ({status}) 178 - <b>Title:</b> {title} 179 - <b>Artist:</b> {artist} 180 - <b>Album:</b> {album} 181 - <b>Length:</b> {position}/{length} 182 - ''; 183 - }; 184 - 185 - "hyprland/submap" = { 186 - format = "󰘳 {}"; 187 - tooltip = false; 188 - }; 189 - 190 - "hyprland/window" = { max-length = 50; }; 191 - 192 - ## MODULES-CENTER ## 193 - 194 - "clock#time" = { format = "{:%I:%M %p}"; }; 195 - 196 - "clock#date" = { format = "{:%A, %B %d}"; }; 197 - 198 - ## MODULES-RIGHT ## 199 - 200 - "pulseaudio#output" = { 201 - format = "{icon} {volume}%"; 202 - format-muted = "󰖁 {volume}%"; 203 - format-icons = { 204 - headphone = "󰋋"; 205 - # speaker = "󰓃"; 206 - hdmi = "󰽟"; 207 - headset = "󰋎"; 208 - # hands-free = "󰋎"; 209 - # portable = ""; 210 - # car = "󰄋"; 211 - # hifi = "󰓃"; 212 - # phone = "󰏲"; 213 - default = [ "󰕿" "󰖀" "󰕾" ]; 214 - }; 215 - 216 - # anything below 100% is "safe" volume levels, 217 - # the default style will be used, 218 - # anything higher than this will have no CSS class, 219 - # that will be considered "warning" state 220 - # `#pulseaudio.output:not(.safe)` 221 - states = { safe = 100; }; 222 - 223 - ignored-sinks = [ "Easy Effects Sink" ]; 224 - 225 - on-click = commands.outputSoundSettings; 226 - on-click-right = commands.outputVolumeMute; 227 - on-scroll-up = commands.outputVolumeUp; 228 - on-scroll-down = commands.outputVolumeDown; 229 - }; 230 - 231 - # TODO volume 232 - "pulseaudio#input" = { 233 - format = "{format_source}"; 234 - # format-source = "󰍬 {volume}%"; 235 - # format-source-muted = "󰍭 {volume}%"; 236 - format-source = "󰍬"; 237 - format-source-muted = "󰍭"; 238 - 239 - on-click = commands.inputSoundSettings; 240 - on-click-right = commands.inputVolumeMute; 241 - # on-scroll-up = commands.inputVolumeUp; 242 - # on-scroll-down = commands.inputVolumeDown; 243 - }; 244 - 245 - backlight = { 246 - device = "amdgpu_bl0"; 247 - format = "{icon} {percent}%"; 248 - # format-icons = ["󰃜" "󰃛" "󰃝" "󰃟" "󰃠"]; 249 - format-icons = [ "󱩎" "󱩏" "󱩐" "󱩑" "󱩒" "󱩓" "󱩔" "󱩕" "󱩖" "󰛨" ]; 250 - 251 - on-scroll-up = commands.backlightUp; 252 - on-scroll-down = commands.backlightDown; 253 - }; 254 - 255 - memory = { 256 - interval = 10; 257 - format = "󰆼 {used:.2g}/{total:.2g}GiB"; 258 - }; 259 - 260 - cpu = { 261 - interval = 5; 262 - format = "󰘚 {usage}%"; 263 - }; 264 - 265 - temperature = { 266 - interval = 5; 267 - hwmon-path-abs = "/sys/devices/pci0000:00/0000:00:18.3/hwmon"; 268 - input-filename = "temp1_input"; 269 - critical-threshold = 270 - 90; # 15C lower than Tjmax <https://www.amd.com/en/product/9686> 271 - format = "{icon} {temperatureC}°C"; 272 - format-critical = "󰈸 {temperatureC}°C"; 273 - # 4x low, 2x mid, 3x high, for 0-90 274 - format-icons = [ "󱃃" "󱃃" "󱃃" "󱃃" "󰔏" "󰔏" "󱃂" "󱃂" "󱃂" ]; 275 - }; 276 - 277 - network = let 278 - tooltip = '' 279 - <b>Address:</b> {ipaddr} 280 - <b>Netmask:</b> {netmask} 281 - <b>Gateway:</b> {gwaddr} 282 - <b>Speeds:</b> {bandwidthUpBytes} UL, {bandwidthDownBytes} DL 283 - ''; 284 - in { 285 - format-ethernet = "󰈀 {bandwidthDownBytes}"; 286 - format-wifi = "{icon} {bandwidthDownBytes}"; 287 - format-linked = "󱫱 {bandwidthDownBytes}"; 288 - format-disconnected = "󰲛"; 289 - format-icons = [ "󰤟" "󰤢" "󰤥" "󰤨" ]; 290 - 291 - tooltip-format = lib.trim '' 292 - <b>Interface</b>: {ifname} 293 - ${tooltip} 294 - ''; 295 - tooltip-format-wifi = lib.trim '' 296 - <b>SSID:</b> {essid} 297 - <b>Strength:</b> {signaldBm} dBmW ({signalStrength}%) 298 - <b>Frequency:</b> {frequency} GHz 299 - ${tooltip} 300 - ''; 301 - tooltip-format-disconnected = "Network disconnected."; 302 - 303 - on-click = commands.wirelessSettings; 304 - }; 305 - 306 - bluetooth = { 307 - controller = "C0:3C:59:02:25:C3"; 308 - format-on = "󰂯"; 309 - format-off = "󰂲"; 310 - format-disabled = "󰂲"; 311 - format-connected = "󰂱 {num_connections}"; 312 - format-connected-battery = 313 - "󰂱 {device_alias} ({device_battery_percentage}%) ({num_connections})"; 314 - 315 - on-click = commands.bluetoothSettings; 316 - on-click-middle = commands.bluetoothKill; 317 - on-click-right = commands.bluetoothToggle; 318 - }; 319 - 320 - battery = { 321 - interval = 5; 322 - bat = "BAT0"; 323 - # full-at = 94; 324 - format = "{icon} {capacity}%"; 325 - format-icons = [ "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ]; 326 - states = { 327 - battery-10 = 10; 328 - battery-20 = 20; 329 - battery-30 = 30; 330 - battery-40 = 40; 331 - battery-50 = 50; 332 - battery-60 = 60; 333 - battery-70 = 70; 334 - battery-80 = 80; 335 - battery-90 = 90; 336 - battery-100 = 100; 337 - }; 338 - # <https://github.com/Alexays/Waybar/issues/1938> 339 - # the wiki lies about this, does not match 340 - # /sys/class/power_supply/BAT0/status 341 - format-plugged = "󰚥 AC"; 342 - format-charging-battery-10 = "󰢜 {capacity}%"; 343 - format-charging-battery-20 = "󰂆 {capacity}%"; 344 - format-charging-battery-30 = "󰂇 {capacity}%"; 345 - format-charging-battery-40 = "󰂈 {capacity}%"; 346 - format-charging-battery-50 = "󰢝 {capacity}%"; 347 - format-charging-battery-60 = "󰂉 {capacity}%"; 348 - format-charging-battery-70 = "󰢞 {capacity}%"; 349 - format-charging-battery-80 = "󰂊 {capacity}%"; 350 - format-charging-battery-90 = "󰂋 {capacity}%"; 351 - format-charging-battery-100 = "󰂅 {capacity}%"; 352 - }; 353 - 354 - idle_inhibitor = { 355 - format = "{icon}"; 356 - format-icons = { 357 - activated = "󰈈"; 358 - deactivated = "󱎫"; 359 - }; 360 - tooltip-format-activated = 361 - "Idle timer inhibited, device will not sleep."; 362 - tooltip-format-deactivated = 363 - "Idle timer enabled, device will sleep when not in use."; 364 - }; 365 - }; 366 - }; 367 - 368 - imports = [ 369 - (lib.mkIf config.programs.waybar.systemd.enable { 370 - xdg.configFile."waybar/config".onChange = lib.mkOverride 90 '' 371 - if [ -z "''${_reloaded_waybar-}" ]; then 372 - _reloaded_waybar=1 373 - ${pkgs.systemd}/bin/systemctl --user restart waybar.service 374 - fi 375 - ''; 376 - xdg.configFile."waybar/style.css".onChange = lib.mkOverride 90 '' 377 - if [ -z "''${_reloaded_waybar-}" ]; then 378 - _reloaded_waybar=1 379 - ${pkgs.systemd}/bin/systemctl --user restart waybar.service 380 - fi 381 - ''; 382 - }) 383 - ]; 384 - }
-236
home-manager/hyprland/waybar.scss
··· 1 - $default-foreground: #ebdbb2; 2 - $highlight-foreground: #fbf1c7; 3 - 4 - * { 5 - all: unset; 6 - font-family: Ubuntu, "Material Design Icons"; 7 - font-size: 10.5pt; 8 - color: $default-foreground; 9 - } 10 - 11 - @mixin oscillate-highlight($function, $stop, $background, $duration) { 12 - $name: inline-#{unique-id()}; 13 - 14 - @keyframes #{$name} { 15 - #{$stop} { 16 - background: $background; 17 - color: $highlight-foreground; 18 - } 19 - } 20 - 21 - animation-name: $name; 22 - animation-duration: $duration; 23 - animation-iteration-count: infinite; 24 - animation-timing-function: $function; 25 - } 26 - 27 - @mixin breathe-highlight($background, $duration) { 28 - @include oscillate-highlight(ease-in-out, 50%, $background, $duration); 29 - } 30 - 31 - @mixin pulse-highlight($stop, $background, $duration) { 32 - @include oscillate-highlight(ease-out, $stop, $background, $duration); 33 - } 34 - 35 - @mixin indicate-active($color, $selector) { 36 - transition: 37 - box-shadow 300ms ease-in, 38 - background 300ms ease-in; 39 - 40 - #{$selector} { 41 - transition: 42 - box-shadow 600ms ease-out, 43 - background 600ms ease-out; 44 - box-shadow: 0 2px 0 0 $color inset; 45 - background: #3c3836; 46 - } 47 - } 48 - 49 - @mixin indicate-hover($color) { 50 - transition: 51 - background 120ms ease-in; 52 - 53 - &:hover { 54 - transition: 55 - background 120ms ease-out; 56 - background: $color; 57 - } 58 - } 59 - 60 - #clock, 61 - #submap, 62 - #backlight, 63 - #network, 64 - #bluetooth, 65 - #cpu, 66 - #temperature, 67 - #pulseaudio, 68 - #memory, 69 - #battery, 70 - #idle_inhibitor, 71 - #tray, 72 - #mpris, 73 - #window { 74 - padding-left: 8px; 75 - padding-right: 8px; 76 - } 77 - 78 - window#waybar { 79 - // background: #1d2021; 80 - background: #000000; 81 - // border-bottom: 1px solid #3c3836; 82 - } 83 - 84 - tooltip, 85 - window.popup { 86 - background: #282828; 87 - border: 1px solid #665c54; 88 - // border-radius: 3px; 89 - } 90 - 91 - window.popup { 92 - menu { 93 - padding: 5px 0; 94 - 95 - arrow { 96 - min-width: 16px; 97 - min-height: 16px; 98 - 99 - &.top { 100 - -gtk-icon-source: -gtk-icontheme("pan-up-symbolic"); 101 - } 102 - 103 - &.bottom { 104 - -gtk-icon-source: -gtk-icontheme("pan-down-symbolic"); 105 - } 106 - 107 - &.right { 108 - -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); 109 - } 110 - 111 - &.left { 112 - -gtk-icon-source: -gtk-icontheme("pan-start-symbolic"); 113 - } 114 - } 115 - 116 - menuitem { 117 - padding: 4px 8px; 118 - 119 - transition: 120 - color 66ms ease-in, 121 - background 66ms ease-in; 122 - 123 - &:hover { 124 - transition: 125 - color 100ms ease-out, 126 - background 100ms ease-out; 127 - 128 - color: $highlight-foreground; 129 - background: #689d6a; 130 - } 131 - } 132 - 133 - separator { 134 - min-height: 1px; 135 - background: #665c54; 136 - margin: 4px 0; 137 - } 138 - } 139 - } 140 - 141 - #clock.time { 142 - font-weight: bold; 143 - } 144 - 145 - #tray { 146 - &>* { 147 - @include indicate-hover(#282828); 148 - } 149 - } 150 - 151 - #mpris { 152 - @include indicate-hover(#282828); 153 - } 154 - 155 - #submap { 156 - @include indicate-active(#d3869b, "&"); 157 - } 158 - 159 - #workspaces { 160 - button { 161 - min-width: 26px; 162 - padding: 6px; 163 - 164 - @include indicate-hover(#282828); 165 - @include indicate-active(#f38019, "&.active"); 166 - 167 - &.urgent { 168 - animation-delay: 5s; 169 - @include pulse-highlight(10%, #458588, 1.5s); 170 - } 171 - } 172 - } 173 - 174 - #network { 175 - @include indicate-hover(#282828); 176 - @include indicate-active(#689d6a, "&.wifi"); 177 - @include indicate-active(#458588, "&.ethernet"); 178 - @include indicate-active(#b16286, "&.linked"); 179 - } 180 - 181 - #bluetooth { 182 - @include indicate-hover(#282828); 183 - @include indicate-active(#458588, "&.on"); 184 - @include indicate-active(#98971a, "&.connected"); 185 - 186 - &.on { 187 - @include breathe-highlight(#458588, 5s); 188 - } 189 - 190 - // &.discoverable { 191 - // @include breathe-highlight(#b16286, 5s); 192 - // } 193 - 194 - // &.discovering { 195 - // @include breathe-highlight(#b16286, 5s); 196 - // } 197 - 198 - // &.pairable:not(.connected) { 199 - // @include breathe-highlight(#b16286, 5s); 200 - // } 201 - } 202 - 203 - #battery { 204 - &.battery-30:not(.charging) { 205 - @include breathe-highlight(#d64d0e, 10s); 206 - } 207 - 208 - &.battery-20:not(.charging) { 209 - @include pulse-highlight(10%, #d64d0e, 5s); 210 - } 211 - 212 - &.battery-10:not(.charging) { 213 - @include pulse-highlight(30%, #cc241d, 750ms); 214 - } 215 - } 216 - 217 - #temperature.critical { 218 - @include pulse-highlight(30%, #cc241d, 750ms); 219 - } 220 - 221 - #idle_inhibitor { 222 - @include indicate-hover(#282828); 223 - @include indicate-active(#d79921, "&.activated"); 224 - 225 - &.activated { 226 - @include pulse-highlight(10%, #d79921, 5s); 227 - } 228 - } 229 - 230 - #pulseaudio { 231 - @include indicate-hover(#282828); 232 - 233 - &.output:not(.safe) { 234 - @include breathe-highlight(#cc241d, 10s); 235 - } 236 - }