From 2122ffe26b358724dd0d064795ff1fdc8a86cfbf Mon Sep 17 00:00:00 2001 From: Tyler Kelley Date: Tue, 23 Jan 2024 16:43:57 -0600 Subject: [PATCH] removing button from waybar and fixing script --- config/home/packages.nix | 2 +- config/home/waybar.nix | 6 +++--- config/scripts/idle-switcher.nix | 15 +++++++++++++++ config/scripts/trnoffmon.nix | 20 -------------------- system.nix | 1 + 5 files changed, 20 insertions(+), 24 deletions(-) create mode 100644 config/scripts/idle-switcher.nix delete mode 100644 config/scripts/trnoffmon.nix diff --git a/config/home/packages.nix b/config/home/packages.nix index 02050d2..adc7d93 100644 --- a/config/home/packages.nix +++ b/config/home/packages.nix @@ -16,7 +16,7 @@ (import ./../scripts/wallsetter.nix { inherit pkgs; inherit wallpaperDir; inherit username; inherit wallpaperGit; }) (import ./../scripts/themechange.nix { inherit pkgs; inherit flakeDir; }) - (import ./../scripts/trnoffmon.nix { inherit pkgs; }) + (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 63a748c..1e06fa9 100644 --- a/config/home/waybar.nix +++ b/config/home/waybar.nix @@ -11,7 +11,7 @@ modules-left = [ "hyprland/window" ]; modules-center = [ "network" "pulseaudio" "cpu" "hyprland/workspaces" "memory" "disk" "clock" ]; - modules-right = [ "idle_inhibitor" "custom/themeselector" "custom/notification" "tray" ]; + modules-right = [ "custom/themeselector" "custom/notification" "tray" ]; "hyprland/workspaces" = { format = "{icon}"; format-icons = { @@ -48,8 +48,8 @@ format = "{icon}"; tooltip = true; format-icons = { - activated = ""; - deactivated = ""; + activated = ""; + deactivated = ""; }; on-click-right = "trnoffmon"; }; diff --git a/config/scripts/idle-switcher.nix b/config/scripts/idle-switcher.nix new file mode 100644 index 0000000..c2d867c --- /dev/null +++ b/config/scripts/idle-switcher.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: + +pkgs.writeShellScriptBin "idle-switcher" '' + IDLECOMMAND=$(swayidle -w timeout 5 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on') + + if [ $SWAYIDLESTATE == "1" ]; then + SWAYIDLESTATE="2" + notify-send -t 2500 "Killing SwayIdle Sir." + killall swayidle + else + SWAYIDLESTATE="1" + notify-send -t 2500 "Starting SwayIdle Sir." + $IDLECOMMAND + fi +'' diff --git a/config/scripts/trnoffmon.nix b/config/scripts/trnoffmon.nix deleted file mode 100644 index 64fb946..0000000 --- a/config/scripts/trnoffmon.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs, ... }: - -pkgs.writeShellScriptBin "trnoffmon" '' - # IDLECOMMAND=$(swayidle -w timeout 5 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on') - - # while : - # do - # done - - # if [ $SWAYIDLESTATE == 1 ]; then - # export SWAYIDLESTATE=2 - # pkill swayidle - # else - # IDLESTATE=true - # $IDLECOMMAND - # fi - # pkill swayidle - # IDLESTATE=true - # $IDLECOMMAND -'' diff --git a/system.nix b/system.nix index 9846fa2..b8d18d3 100644 --- a/system.nix +++ b/system.nix @@ -50,6 +50,7 @@ v4l-utils ydotool wl-clipboard socat cowsay lsd pkg-config meson hugo gnumake ninja go nodejs symbola noto-fonts-color-emoji material-icons brightnessctl + toybox ]; programs.steam.gamescopeSession.enable = true;