From 5559faffce3bf627ab2f1b763c44954b0b8839c6 Mon Sep 17 00:00:00 2001 From: Tyler Kelley Date: Wed, 24 Jan 2024 01:46:33 -0600 Subject: [PATCH] Add Idle Inhibitor to Waybar --- config/home/packages.nix | 1 - config/home/waybar.nix | 32 +++++++++++++++++++------------- config/scripts/idle-switcher.nix | 13 ------------- 3 files changed, 19 insertions(+), 27 deletions(-) delete mode 100644 config/scripts/idle-switcher.nix diff --git a/config/home/packages.nix b/config/home/packages.nix index adc7d93..9e8612d 100644 --- a/config/home/packages.nix +++ b/config/home/packages.nix @@ -16,7 +16,6 @@ (import ./../scripts/wallsetter.nix { inherit pkgs; inherit wallpaperDir; inherit username; inherit wallpaperGit; }) (import ./../scripts/themechange.nix { inherit pkgs; inherit flakeDir; }) - (import ./../scripts/idle-switcher.nix { inherit pkgs; }) (import ./../scripts/theme-selector.nix { inherit pkgs; }) ]; } diff --git a/config/home/waybar.nix b/config/home/waybar.nix index 4ce5d79..f16666e 100644 --- a/config/home/waybar.nix +++ b/config/home/waybar.nix @@ -11,7 +11,7 @@ modules-left = [ "hyprland/window" "custom/startmenu" ]; modules-center = [ "network" "pulseaudio" "cpu" "hyprland/workspaces" "memory" "disk" "clock" ]; - modules-right = [ "custom/themeselector" "custom/notification" "tray" ]; + modules-right = [ "idle_inhibitor" "custom/themeselector" "custom/notification" "tray" ]; "hyprland/workspaces" = { format = "{icon}"; format-icons = { @@ -44,15 +44,6 @@ format = " {free}"; tooltip = true; }; - "idle_inhibitor" = { - format = "{icon}"; - tooltip = true; - format-icons = { - activated = ""; - deactivated = ""; - }; - on-click-right = "trnoffmon"; - }; "network" = { format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"]; format-ethernet = ": {bandwidthDownOctets}"; @@ -93,6 +84,14 @@ # exec = "rofi -show drun"; on-click = "rofi -show drun"; }; + "idle_inhibitor" = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + tooltip = "true"; + }; "custom/notification" = { tooltip = false; format = "{icon} {}"; @@ -257,10 +256,10 @@ } #custom-themeselector { color: #${config.colorScheme.colors.base0D}; - background: transparent; - border-radius: 5px; + background: #${config.colorScheme.colors.base00}; + border-radius: 15px 50px 15px 50px; margin: 5px; - padding: 2px 2px; + padding: 2px 20px; } #custom-startmenu { color: #${config.colorScheme.colors.base03}; @@ -269,6 +268,13 @@ margin: 5px; padding: 2px 20px; } + #idle_inhibitor { + color: #${config.colorScheme.colors.base09}; + background: #${config.colorScheme.colors.base00}; + border-radius: 15px 50px 15px 50px; + margin: 5px; + padding: 2px 20px; + } ''; }; } diff --git a/config/scripts/idle-switcher.nix b/config/scripts/idle-switcher.nix deleted file mode 100644 index 4967d14..0000000 --- a/config/scripts/idle-switcher.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, ... }: - -pkgs.writeShellScriptBin "idle-switcher" '' - IDLECOMMAND=$(swayidle -w timeout 5 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on') - - if [[ ! $@ ]]; then - notify-send -t 2500 "Killing SwayIdle Sir." - killall swayidle - else - notify-send -t 2500 "Starting SwayIdle Sir." - $IDLECOMMAND - fi -''