diff --git a/SwarselSystems.org b/SwarselSystems.org index b887b77..111aa5c 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -3615,6 +3615,25 @@ This script allows for quick git branch switching. }) #+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) :PROPERTIES: :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"; 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+%")"; fi; ''; @@ -8321,6 +8340,7 @@ This holds packages that I can use as provided, or with small modifications (as audacity sox stable.feishin + calibre # printing cups @@ -8353,6 +8373,7 @@ This holds packages that I can use as provided, or with small modifications (as nix-diff nix-visualize nix-init + nix-inspect manix comma @@ -8513,6 +8534,7 @@ This is just a separate container for derivations defined in [[#h:64a5cc16-6b16- project fhs swarsel-bootstrap + swarsel-displaypower ]; } #+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+Up" = "move up 40px"; "${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}+r" = "mode resize"; "${modifier}+Return" = "exec kitty"; @@ -10994,6 +11017,7 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]] rclone awscli2 libguestfs-with-appliance + stable.prometheus.cli ]; home.sessionVariables = { diff --git a/pkgs/swarsel-displaypower/default.nix b/pkgs/swarsel-displaypower/default.nix new file mode 100644 index 0000000..4c65c9f --- /dev/null +++ b/pkgs/swarsel-displaypower/default.nix @@ -0,0 +1,6 @@ +{ self, name, writeShellApplication, sway }: +writeShellApplication { + inherit name; + runtimeInputs = [ sway ]; + text = builtins.readFile "${self}/scripts/${name}.sh"; +} diff --git a/profiles/home/common/custom-packages.nix b/profiles/home/common/custom-packages.nix index 3cef388..6645489 100644 --- a/profiles/home/common/custom-packages.nix +++ b/profiles/home/common/custom-packages.nix @@ -24,5 +24,6 @@ project fhs swarsel-bootstrap + swarsel-displaypower ]; } diff --git a/profiles/home/common/packages.nix b/profiles/home/common/packages.nix index 58d5ca1..201c985 100644 --- a/profiles/home/common/packages.nix +++ b/profiles/home/common/packages.nix @@ -13,6 +13,7 @@ audacity sox stable.feishin + calibre # printing cups @@ -45,6 +46,7 @@ nix-diff nix-visualize nix-init + nix-inspect manix comma diff --git a/profiles/home/common/sway.nix b/profiles/home/common/sway.nix index 153ed9c..6df4860 100644 --- a/profiles/home/common/sway.nix +++ b/profiles/home/common/sway.nix @@ -100,6 +100,7 @@ in "${modifier}+Shift+Down" = "move down 40px"; "${modifier}+Shift+Up" = "move up 40px"; "${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}+r" = "mode resize"; "${modifier}+Return" = "exec kitty"; diff --git a/profiles/home/optional/work.nix b/profiles/home/optional/work.nix index 8eef134..a79211d 100644 --- a/profiles/home/optional/work.nix +++ b/profiles/home/optional/work.nix @@ -9,6 +9,7 @@ rclone awscli2 libguestfs-with-appliance + stable.prometheus.cli ]; home.sessionVariables = { diff --git a/profiles/nixos/common/lowbattery.nix b/profiles/nixos/common/lowbattery.nix index 3c41b4f..0b76548 100644 --- a/profiles/nixos/common/lowbattery.nix +++ b/profiles/nixos/common/lowbattery.nix @@ -9,7 +9,7 @@ Type = "simple"; 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+%")"; fi; ''; diff --git a/programs/vieb/viebrc b/programs/vieb/viebrc index 6a404c1..2a0f075 100644 --- a/programs/vieb/viebrc +++ b/programs/vieb/viebrc @@ -77,7 +77,7 @@ set notificationlimitsmall=3 set notificationposition=bottomright set pdfbehavior=download set permissioncamera=ask -set permissioncertificateerror=ask +set permissioncertificateerror=allow set permissionclipboardread=allow set permissionclipboardwrite=allow set permissionclosepage=allow diff --git a/scripts/swarsel-displaypower.sh b/scripts/swarsel-displaypower.sh new file mode 100644 index 0000000..c1fc668 --- /dev/null +++ b/scripts/swarsel-displaypower.sh @@ -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