diff --git a/nixos/flake.lock b/nixos/flake.lock index 2124167..de6ae4c 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1763334038, - "narHash": "sha256-LBVOyaH6NFzQ3X/c6vfMZ9k4SV2ofhpxeL9YnhHNJQQ=", + "lastModified": 1760862643, + "narHash": "sha256-PXwG0TM7Ek87DNx4LbGWuD93PbFeKAJs4FfALtp7Wo0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4c8cdd5b1a630e8f72c9dd9bf582b1afb3127d2c", + "rev": "33c6dca0c0cb31d6addcd34e90a63ad61826b28c", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1763283776, - "narHash": "sha256-Y7TDFPK4GlqrKrivOcsHG8xSGqQx3A6c+i7novT85Uk=", + "lastModified": 1760878510, + "narHash": "sha256-K5Osef2qexezUfs0alLvZ7nQFTGS9DL2oTVsIXsqLgs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "50a96edd8d0db6cc8db57dab6bb6d6ee1f3dc49a", + "rev": "5e2a59a5b1a82f89f2c7e598302a9cacebb72a67", "type": "github" }, "original": { @@ -174,11 +174,11 @@ ] }, "locked": { - "lastModified": 1763417348, - "narHash": "sha256-n5xDOeNN+smocQp3EMIc11IzBlR9wvvTIJZeL0g33Fs=", + "lastModified": 1760998189, + "narHash": "sha256-ee2e1/AeGL5X8oy/HXsZQvZnae6XfEVdstGopKucYLY=", "owner": "Mic92", "repo": "sops-nix", - "rev": "3f66a7fb9626a9a9c077612ef10a0ce396286c7d", + "rev": "5a7d18b5c55642df5c432aadb757140edfeb70b3", "type": "github" }, "original": { @@ -265,11 +265,11 @@ ] }, "locked": { - "lastModified": 1763352549, - "narHash": "sha256-hzLnXm0v1snDENpF3KvUQBO8XOAh45qg+y4D46K3rz8=", + "lastModified": 1761105987, + "narHash": "sha256-d01CGcdNlsqIn4ncGCWHM0Velnii/Ggef1iybQvEOfc=", "owner": "youwen5", "repo": "zen-browser-flake", - "rev": "5d002fcacbc5423090f2bba19818adda471fe0c8", + "rev": "e7d9fefd8665be5d4c77466140f21a15f6d29e93", "type": "github" }, "original": { diff --git a/nixos/modules/desktop/waybar/default.nix b/nixos/modules/desktop/waybar/default.nix index d893470..273e4ce 100644 --- a/nixos/modules/desktop/waybar/default.nix +++ b/nixos/modules/desktop/waybar/default.nix @@ -14,7 +14,5 @@ in { ]; programs.waybar.enable = true; - - services.atd.enable = true; # Command scheduler }; } diff --git a/scripts/sunset.sh b/scripts/sunset.sh new file mode 100755 index 0000000..f185115 --- /dev/null +++ b/scripts/sunset.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Script to disable for an hour or immediately continue wlsunset. 'Toggle' + +# Check if wlsunset is still running +pid=$(pgrep wlsunset) + +if [[ -z ${pid} ]] ; then + # Start wlsunset right away. + wlsunset -l 50.50 -L 4.00 -t 3000 -T 6500 & +else + # Currently stop wlsunset but restart in an hour. + kill ${pid} + notify-send 'Stopping sunset' 'Restarting in an hour' + at now +1 hours -f "${0}" +fi diff --git a/scripts/toggle-nightlight.sh b/scripts/toggle-nightlight.sh deleted file mode 100755 index b4902b0..0000000 --- a/scripts/toggle-nightlight.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash -# Script to disable for an hour or immediately continue wlsunset. 'Toggle' - -# Queue for at, check man page for options -ATQUEUE='T' - -# Get current state -pid=$(pgrep wlsunset) - -while getopts ":g" option; do - case "${option}" in - g) - if [[ -z "${pid}" ]]; then - state='active' - tooltip='Turn off nightlight' - class='activated' - else - state='inactive' - tooltip='Turn on nightlight' - class='none' - fi -printf '{"alt": "%s", "tooltip": "%s", "class": "%s" }' \ - "${state}" "${tooltip}" "${class}" - exit 0 - ;; - *) - echo 'Invalid option' - exit 1 - ;; - esac -done - -# Toggle -if [[ -z ${pid} ]] ; then - # Clear queue - for job in $(at -l -q "${ATQUEUE}" | cut -f1); do - at -r "${job}" - done - - if [ "$( command -v wlsunset )" ]; then - notify-send 'Starting nightlight' - wlsunset -l 50.50 -L 4.00 -t 3000 -T 6500 & - else - notify-send 'Nightlight is not available' - exit 1 - fi -else - # Currently stop wlsunset but restart in an hour. - kill ${pid} - notify-send 'Stopping nightlight' 'Restarting in an hour' - at now +1 hours -f "${0}" -q "${ATQUEUE}" -fi diff --git a/stow/waybar/.config/waybar/config.jsonc b/stow/waybar/.config/waybar/config.jsonc index a83d47c..ff861e3 100644 --- a/stow/waybar/.config/waybar/config.jsonc +++ b/stow/waybar/.config/waybar/config.jsonc @@ -51,7 +51,6 @@ "privacy", "tray", "group/control-center", - "group/display", "group/network", "pulseaudio", "group/power", diff --git a/stow/waybar/.config/waybar/modules.json b/stow/waybar/.config/waybar/modules.json index 683d70b..6cec15d 100644 --- a/stow/waybar/.config/waybar/modules.json +++ b/stow/waybar/.config/waybar/modules.json @@ -1,15 +1,4 @@ { - "backlight": { - "device": "intel_backlight", - "format": "{percent}% {icon}", - "format-icons": [ - "\uf111", /*  */ - "\uf185" /*  */ - ], - "on-click": "brightnessctl -sq set 0", - "on-click-right": "wl-mirror $(hyprctl monitors -j | jq --raw-output '.[] | select(.focused) | .name')" - }, - "battery": { "format": "{capacity}% {icon}", "format-alt": "{time} {icon}", @@ -82,12 +71,6 @@ "tooltip": false }, - "custom/display": { - "format": "\ue163", /*  */ - "tooltip": false, - "on-click": "wdisplays" - }, - "custom/meta": { "format": "\uf17c", /*  */ "tooltip": false, @@ -151,19 +134,6 @@ "tooltip": true }, - "custom/toggle-nightlight": { - "exec": "bash ${SCRIPT_DIR}/toggle-nightlight.sh -g", - "interval": 60, - "return-type": "json", - "on-click": "bash ${SCRIPT_DIR}/toggle-nightlight.sh", - "format": "{icon}", - "format-icons": { - "active": "\uf186", /*  */ - "inactive": "\uf0eb" /*  */ - }, - "tooltip": true - }, - "custom/toggle-notifications": { "exec": "bash ${SCRIPT_DIR}/toggle-notifications.sh -g", "interval": 60, @@ -193,31 +163,12 @@ "group/control-center": { "orientation": "inherit", "modules": [ - /* Preview */ "custom/control-center", - /* Left-most */ "group/language", - "custom/toggle-notifications" - /* Right-most */ - ], - "drawer": { - "transition-duration": 500, - "transition-left-to-right": false, - "children-class": "drawer-child" - } - }, - - "group/display": { - "orientation": "inherit", - "modules": [ - /* Preview */ - "custom/display", - /* Most-left */ - "idle_inhibitor", - "custom/toggle-nightlight", + /* "hyprland/language", "sway/language", */ + "custom/toggle-notifications", "custom/toggle-light-dark", - "backlight" - /* Most-right */ + "bluetooth" ], "drawer": { "transition-duration": 500, @@ -248,7 +199,6 @@ /* Preview */ "network", /* Most-left */ - "bluetooth", "custom/toggle-tailscale" /* Most-right */ ], @@ -270,7 +220,8 @@ "custom/system-hibernate", "custom/system-sleep", "custom/system-lock", - "power-profiles-daemon" + "power-profiles-daemon", + "idle_inhibitor" /* Most-right */ ], "drawer": { diff --git a/stow/waybar/.config/waybar/style.css b/stow/waybar/.config/waybar/style.css index 39880dd..ecc08fc 100644 --- a/stow/waybar/.config/waybar/style.css +++ b/stow/waybar/.config/waybar/style.css @@ -82,13 +82,12 @@ window#waybar { #privacy, #privacy-item, #privacy-item.screenshare, -#privacy-item.audio-in, -#privacy-item.audio-out { +#privacy-item.audio-in { background-color: @safety; } -#privacy-item { - padding: 0; +#privacy-item.screenshare { + background-color: #000000; } #pulseaudio.muted {