fix: some work related fixes

This commit is contained in:
Leon Schwarzäugl 2025-01-15 10:27:20 +01:00
parent bd3e18169f
commit bfe416b708
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
9 changed files with 40 additions and 3 deletions

View file

@ -3615,6 +3615,25 @@ This script allows for quick git branch switching.
}) })
#+end_src #+end_src
**** swarsel-displaypower
A crude script to power on all displays that might be attached. Needed because sometimes displays do not awake from sleep.
#+begin_src shell :tangle scripts/swarsel-displaypower.sh
swaymsg output eDP-1 power on > /dev/null 2>&1 || true
swaymsg output eDP-2 power on > /dev/null 2>&1 || true
#+end_src
#+begin_src nix :tangle pkgs/swarsel-displaypower/default.nix
{ self, name, writeShellApplication, sway }:
writeShellApplication {
inherit name;
runtimeInputs = [ sway ];
text = builtins.readFile "${self}/scripts/${name}.sh";
}
#+end_src
*** Overlays (additions, overrides, nixpkgs-stable) *** Overlays (additions, overrides, nixpkgs-stable)
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: h:5e3e21e0-57af-4dad-b32f-6400af9b7aab :CUSTOM_ID: h:5e3e21e0-57af-4dad-b32f-6400af9b7aab
@ -6055,7 +6074,7 @@ Since I hide the waybar completely during normal operation, I run the risk of no
Type = "simple"; Type = "simple";
ExecStart = pkgs.writeShellScript "battery-low-notification" ExecStart = pkgs.writeShellScript "battery-low-notification"
'' ''
if (( 10 >= $(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%" | ${lib.getExe pkgs.ripgrep} -o "\d+"))); if (( 10 >= $(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%" | ${lib.getExe pkgs.ripgrep} -o "\d+") && $(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%" | ${lib.getExe pkgs.ripgrep} -o "\d+") > 0 ));
then ${lib.getExe pkgs.libnotify} --urgency=critical "low battery" "$(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%")"; then ${lib.getExe pkgs.libnotify} --urgency=critical "low battery" "$(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%")";
fi; fi;
''; '';
@ -8321,6 +8340,7 @@ This holds packages that I can use as provided, or with small modifications (as
audacity audacity
sox sox
stable.feishin stable.feishin
calibre
# printing # printing
cups cups
@ -8353,6 +8373,7 @@ This holds packages that I can use as provided, or with small modifications (as
nix-diff nix-diff
nix-visualize nix-visualize
nix-init nix-init
nix-inspect
manix manix
comma comma
@ -8513,6 +8534,7 @@ This is just a separate container for derivations defined in [[#h:64a5cc16-6b16-
project project
fhs fhs
swarsel-bootstrap swarsel-bootstrap
swarsel-displaypower
]; ];
} }
#+end_src #+end_src
@ -10601,6 +10623,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se
"${modifier}+Shift+Down" = "move down 40px"; "${modifier}+Shift+Down" = "move down 40px";
"${modifier}+Shift+Up" = "move up 40px"; "${modifier}+Shift+Up" = "move up 40px";
"${modifier}+Ctrl+Shift+c" = "reload"; "${modifier}+Ctrl+Shift+c" = "reload";
"${modifier}+Ctrl+Shift+r" = "exec swarsel-displaypower";
"${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; "${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
"${modifier}+r" = "mode resize"; "${modifier}+r" = "mode resize";
"${modifier}+Return" = "exec kitty"; "${modifier}+Return" = "exec kitty";
@ -10994,6 +11017,7 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]]
rclone rclone
awscli2 awscli2
libguestfs-with-appliance libguestfs-with-appliance
stable.prometheus.cli
]; ];
home.sessionVariables = { home.sessionVariables = {

View file

@ -0,0 +1,6 @@
{ self, name, writeShellApplication, sway }:
writeShellApplication {
inherit name;
runtimeInputs = [ sway ];
text = builtins.readFile "${self}/scripts/${name}.sh";
}

View file

@ -24,5 +24,6 @@
project project
fhs fhs
swarsel-bootstrap swarsel-bootstrap
swarsel-displaypower
]; ];
} }

View file

@ -13,6 +13,7 @@
audacity audacity
sox sox
stable.feishin stable.feishin
calibre
# printing # printing
cups cups
@ -45,6 +46,7 @@
nix-diff nix-diff
nix-visualize nix-visualize
nix-init nix-init
nix-inspect
manix manix
comma comma

View file

@ -100,6 +100,7 @@ in
"${modifier}+Shift+Down" = "move down 40px"; "${modifier}+Shift+Down" = "move down 40px";
"${modifier}+Shift+Up" = "move up 40px"; "${modifier}+Shift+Up" = "move up 40px";
"${modifier}+Ctrl+Shift+c" = "reload"; "${modifier}+Ctrl+Shift+c" = "reload";
"${modifier}+Ctrl+Shift+r" = "exec swarsel-displaypower";
"${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; "${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
"${modifier}+r" = "mode resize"; "${modifier}+r" = "mode resize";
"${modifier}+Return" = "exec kitty"; "${modifier}+Return" = "exec kitty";

View file

@ -9,6 +9,7 @@
rclone rclone
awscli2 awscli2
libguestfs-with-appliance libguestfs-with-appliance
stable.prometheus.cli
]; ];
home.sessionVariables = { home.sessionVariables = {

View file

@ -9,7 +9,7 @@
Type = "simple"; Type = "simple";
ExecStart = pkgs.writeShellScript "battery-low-notification" ExecStart = pkgs.writeShellScript "battery-low-notification"
'' ''
if (( 10 >= $(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%" | ${lib.getExe pkgs.ripgrep} -o "\d+"))); if (( 10 >= $(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%" | ${lib.getExe pkgs.ripgrep} -o "\d+") && $(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%" | ${lib.getExe pkgs.ripgrep} -o "\d+") > 0 ));
then ${lib.getExe pkgs.libnotify} --urgency=critical "low battery" "$(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%")"; then ${lib.getExe pkgs.libnotify} --urgency=critical "low battery" "$(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%")";
fi; fi;
''; '';

View file

@ -77,7 +77,7 @@ set notificationlimitsmall=3
set notificationposition=bottomright set notificationposition=bottomright
set pdfbehavior=download set pdfbehavior=download
set permissioncamera=ask set permissioncamera=ask
set permissioncertificateerror=ask set permissioncertificateerror=allow
set permissionclipboardread=allow set permissionclipboardread=allow
set permissionclipboardwrite=allow set permissionclipboardwrite=allow
set permissionclosepage=allow set permissionclosepage=allow

View file

@ -0,0 +1,2 @@
swaymsg output eDP-1 power on > /dev/null 2>&1 || true
swaymsg output eDP-2 power on > /dev/null 2>&1 || true