From 17c942e4b17e51fd506730a63b7a46526d2ef328 Mon Sep 17 00:00:00 2001 From: lelgenio Date: Sun, 13 Feb 2022 20:25:47 -0300 Subject: [PATCH] sway: remove caffeinated dependency --- dotfiles/fish/wm.fish | 2 +- dotfiles/scripts/_sway_idle_toggle | 9 +++++++++ dotfiles/sway/keys-run | 2 +- dotfiles/waybar/config | 6 +++--- 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100755 dotfiles/scripts/_sway_idle_toggle diff --git a/dotfiles/fish/wm.fish b/dotfiles/fish/wm.fish index d5f16cb..c9f8218 100644 --- a/dotfiles/fish/wm.fish +++ b/dotfiles/fish/wm.fish @@ -11,7 +11,7 @@ function esway # You get a wayland, and you get a wayland. Everybody get's a wayland! - set -x MOZ_ENABLE_WAYLAND 1 + # set -x MOZ_ENABLE_WAYLAND 1 set -x CLUTTER_BACKEND wayland set -x QT_QPA_PLATFORM wayland-egl set -x ECORE_EVAS_ENGINE wayland-egl diff --git a/dotfiles/scripts/_sway_idle_toggle b/dotfiles/scripts/_sway_idle_toggle new file mode 100755 index 0000000..a5a5066 --- /dev/null +++ b/dotfiles/scripts/_sway_idle_toggle @@ -0,0 +1,9 @@ +#!/bin/sh + +export SVDIR="$HOME/.config/runit/runsvdir/default/" + +if pidof swayidle; then + sv down swayidle +else + sv up swayidle +fi diff --git a/dotfiles/sway/keys-run b/dotfiles/sway/keys-run index 9bf4cbb..93e7ab1 100644 --- a/dotfiles/sway/keys-run +++ b/dotfiles/sway/keys-run @@ -23,7 +23,7 @@ $mod+g exec emoji $mod+d exec sway-displays # Insert special characters -$mod+Alt+c exec pidof caffeinated && pkill caffeinated || caffeinated -d +$mod+Alt+c exec _sway_idle_toggle # Kill focused window $mod+x kill diff --git a/dotfiles/waybar/config b/dotfiles/waybar/config index 21df77d..f6d739f 100644 --- a/dotfiles/waybar/config +++ b/dotfiles/waybar/config @@ -187,9 +187,9 @@ }, "custom/caffeine":{ "format":"{}", - "exec":"pidof caffeinated > /dev/null && echo  || echo 鈴", - "on-click":"pidof caffeinated && pkill caffeinated || caffeinated -d", - "interval": 5, + "exec":"pidof swayidle > /dev/null && echo 鈴 || echo ", + "on-click":"_sway_idle_toggle", + "interval": 1, "tooltip":false }, "sway/language": {