Add Idle Inhibitor to Waybar

This commit is contained in:
Tyler Kelley 2024-01-24 01:46:33 -06:00
parent df95ecabf1
commit 5559faffce
3 changed files with 19 additions and 27 deletions

View File

@ -16,7 +16,6 @@
(import ./../scripts/wallsetter.nix { inherit pkgs; inherit wallpaperDir; (import ./../scripts/wallsetter.nix { inherit pkgs; inherit wallpaperDir;
inherit username; inherit wallpaperGit; }) inherit username; inherit wallpaperGit; })
(import ./../scripts/themechange.nix { inherit pkgs; inherit flakeDir; }) (import ./../scripts/themechange.nix { inherit pkgs; inherit flakeDir; })
(import ./../scripts/idle-switcher.nix { inherit pkgs; })
(import ./../scripts/theme-selector.nix { inherit pkgs; }) (import ./../scripts/theme-selector.nix { inherit pkgs; })
]; ];
} }

View File

@ -11,7 +11,7 @@
modules-left = [ "hyprland/window" "custom/startmenu" ]; modules-left = [ "hyprland/window" "custom/startmenu" ];
modules-center = [ "network" "pulseaudio" "cpu" "hyprland/workspaces" "memory" "disk" "clock" ]; 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" = { "hyprland/workspaces" = {
format = "{icon}"; format = "{icon}";
format-icons = { format-icons = {
@ -44,15 +44,6 @@
format = " {free}"; format = " {free}";
tooltip = true; tooltip = true;
}; };
"idle_inhibitor" = {
format = "{icon}";
tooltip = true;
format-icons = {
activated = "";
deactivated = "";
};
on-click-right = "trnoffmon";
};
"network" = { "network" = {
format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"]; format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"];
format-ethernet = ": {bandwidthDownOctets}"; format-ethernet = ": {bandwidthDownOctets}";
@ -93,6 +84,14 @@
# exec = "rofi -show drun"; # exec = "rofi -show drun";
on-click = "rofi -show drun"; on-click = "rofi -show drun";
}; };
"idle_inhibitor" = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
};
tooltip = "true";
};
"custom/notification" = { "custom/notification" = {
tooltip = false; tooltip = false;
format = "{icon} {}"; format = "{icon} {}";
@ -257,10 +256,10 @@
} }
#custom-themeselector { #custom-themeselector {
color: #${config.colorScheme.colors.base0D}; color: #${config.colorScheme.colors.base0D};
background: transparent; background: #${config.colorScheme.colors.base00};
border-radius: 5px; border-radius: 15px 50px 15px 50px;
margin: 5px; margin: 5px;
padding: 2px 2px; padding: 2px 20px;
} }
#custom-startmenu { #custom-startmenu {
color: #${config.colorScheme.colors.base03}; color: #${config.colorScheme.colors.base03};
@ -269,6 +268,13 @@
margin: 5px; margin: 5px;
padding: 2px 20px; 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;
}
''; '';
}; };
} }

View File

@ -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
''