Adding Idle Inhibitor script and button for waybar

This commit is contained in:
Tyler Kelley 2024-01-23 14:49:39 -06:00
parent ff5eefa7d1
commit 53a1a87948
2 changed files with 26 additions and 1 deletions

View File

@ -11,7 +11,7 @@
modules-left = [ "hyprland/window" ];
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,6 +44,15 @@
format = " {free}";
tooltip = true;
};
"idle_inhibitor" = {
format = "{icon}";
tooltip = true;
format-icons = {
activated = "";
deactivated = "";
};
on-click-right = "swaylock";
};
"network" = {
format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"];
format-ethernet = ": {bandwidthDownOctets} : {bandwidthUpOctets}";
@ -183,6 +192,13 @@
margin: 5px;
padding: 2px 20px;
}
#idle_inhibitor {
color: #${config.colorScheme.colors.base0A};
background: #${config.colorScheme.colors.base00};
border-radius: 50px 15px 50px 15px;
margin: 5px;
padding: 2px 20px;
}
#cpu {
color: #${config.colorScheme.colors.base07};
background: #${config.colorScheme.colors.base00};

View File

@ -0,0 +1,9 @@
{ config, pkgs, ... }:
pkgs.writeShellScriptBin "trnoffmon" ''
if [[ ! $@ ]]; then
pkill swayidle
else
swayidle -w timeout 5 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on'
fi
''