Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 1 | { pkgs, ... }: { |
Skyler Grey | a124e5f | 2022-08-26 06:49:46 +0100 | [diff] [blame] | 2 | home = { |
| 3 | programs.waybar = { |
| 4 | enable = true; |
| 5 | settings = [ |
| 6 | { |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 7 | modules-left = [ "sway/workspaces" ]; |
Skyler Grey | a124e5f | 2022-08-26 06:49:46 +0100 | [diff] [blame] | 8 | |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 9 | modules-center = [ "sway/window" ]; |
Skyler Grey | a124e5f | 2022-08-26 06:49:46 +0100 | [diff] [blame] | 10 | |
| 11 | modules-right = [ |
| 12 | "backlight" |
| 13 | "pulseaudio" |
| 14 | "network" |
| 15 | "battery" |
| 16 | "clock" |
| 17 | "custom/coffee" |
| 18 | "custom/notification" |
| 19 | "tray" |
| 20 | ]; |
| 21 | |
| 22 | pulseaudio = { |
| 23 | format = "{icon} {volume}%"; |
| 24 | format-tooltip = "{desc}"; |
| 25 | format-muted = "đ Muted"; |
| 26 | format-icons = [ |
| 27 | "đ" |
| 28 | "đ" |
| 29 | "đ" |
| 30 | ]; |
| 31 | states.muted = 0; |
| 32 | }; |
| 33 | backlight = { |
| 34 | format = "{icon} {percent}%"; |
| 35 | on-scroll-up = "${pkgs.light}/bin/light -A 3"; |
| 36 | on-scroll-down = "${pkgs.light}/bin/light -N 1 && ${pkgs.light}/bin/light -U 3"; |
| 37 | format-icons = [ |
| 38 | "đ
" |
| 39 | "đ" |
| 40 | "âī¸" |
| 41 | "â¨" |
| 42 | ]; |
| 43 | }; |
| 44 | network = { |
| 45 | format = "đ {ifname}"; |
| 46 | format-wifi = "đĄ {essid} ({ifname})"; |
| 47 | format-disabled = ""; |
| 48 | format-disconnected = "đ No network"; |
| 49 | tooltip-format = "{ipaddr}/{cidr}"; |
| 50 | tooltip-format-wifi = "{ipaddr}/{cidr} ({signalStrength}%)"; |
| 51 | tooltip-format-disconnected = "Disconnected"; |
| 52 | }; |
| 53 | battery = { |
| 54 | states = { |
| 55 | full = 100; |
| 56 | warning = 30; |
| 57 | critical = 10; |
| 58 | }; |
| 59 | format = "{icon} {capacity}%"; |
| 60 | format-charging = "đ {capacity}%"; |
Skyler Grey | 167be13 | 2022-09-04 11:38:58 +0100 | [diff] [blame] | 61 | format-plugged = "đ {capacity}%"; |
| 62 | format-full-full = "đ Full"; |
Skyler Grey | a124e5f | 2022-08-26 06:49:46 +0100 | [diff] [blame] | 63 | format-icons = { |
| 64 | full = "đ"; |
| 65 | warning = "đĒĢ"; |
| 66 | critical = "đĒĢ"; |
| 67 | }; |
| 68 | }; |
| 69 | "sway/window" = { |
| 70 | max-length = 50; |
| 71 | }; |
| 72 | clock = { |
| 73 | format = "â° {:%T}"; |
| 74 | interval = 1; |
| 75 | }; |
| 76 | "custom/notification" = { |
| 77 | tooltip = false; |
| 78 | format = "{icon}"; |
| 79 | format-icons = { |
| 80 | notification = "đ<sup><span color='#dd2e41'>â</span></sup>"; |
| 81 | none = "đ"; |
| 82 | dnd-notification = "đ<sup><span color='#dd2e41'>â</span></sup>"; |
| 83 | dnd-none = "đ"; |
| 84 | }; |
| 85 | "return-type" = "json"; |
| 86 | "exec-if" = "which ${pkgs.swaynotificationcenter}/bin/swaync-client"; |
| 87 | "exec" = "${pkgs.swaynotificationcenter}/bin/swaync-client -swb"; |
| 88 | on-click = "${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw"; |
| 89 | on-click-right = "${pkgs.swaynotificationcenter}/bin/swaync-client -d -sw"; |
| 90 | escape = true; |
| 91 | }; |
| 92 | "custom/coffee" = { |
| 93 | tooltip = false; |
| 94 | format = "{icon}"; |
| 95 | format-icons = { |
| 96 | none = "đ´"; |
| 97 | inhibiting = "â"; |
| 98 | }; |
| 99 | "return-type" = "json"; |
Skyler Grey | 52e7adc | 2022-10-31 00:15:48 +0000 | [diff] [blame] | 100 | "exec" = "while sleep 0.1; do ${pkgs.systemd}/bin/systemd-inhibit --list | grep idle | wc -l | jq '{alt: (if . == 0 then \"none\" else \"inhibiting\" end)} | tostring' -r; done"; |
Skyler Grey | a124e5f | 2022-08-26 06:49:46 +0100 | [diff] [blame] | 101 | on-click = ./systemd-inhibit/stop-inhibiting-idle.sh; |
| 102 | on-click-right = ./systemd-inhibit/inhibit-idle.sh; |
| 103 | escape = true; |
| 104 | }; |
| 105 | } |
| 106 | ]; |
| 107 | style = builtins.readFile ./waybar/main.css; |
| 108 | }; |
| 109 | |
| 110 | wayland.windowManager.sway.config.startup = [ |
| 111 | { |
| 112 | command = "\"pkill swaync; pkill waybar; ${pkgs.swaynotificationcenter}/bin/swaync & waybar\""; |
| 113 | always = true; |
| 114 | } |
| 115 | ]; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 116 | home.packages = with pkgs; [ libappindicator swaynotificationcenter ]; |
Skyler Grey | a124e5f | 2022-08-26 06:49:46 +0100 | [diff] [blame] | 117 | }; |
| 118 | } |