From 2786009b764c9f7831ab8978e25eacdbf0c2413e Mon Sep 17 00:00:00 2001 From: Dejvino Date: Sun, 14 Jun 2020 10:11:44 +0200 Subject: [PATCH] Fixed backlight and menuselect delays. --- home/config/waybar/config_0 | 2 +- home/config/waybar/config_1 | 2 +- usr/local/bin/swayphone_backlightselect | 2 ++ usr/local/bin/swayphone_menuselect | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/home/config/waybar/config_0 b/home/config/waybar/config_0 index 82fd058..854039e 100755 --- a/home/config/waybar/config_0 +++ b/home/config/waybar/config_0 @@ -39,7 +39,7 @@ "format": " {:%e %b %Y}", // Icon: calendar-alt //"tooltip-format": "{:%e %B %Y}" "tooltip": true, - "on-click": "termite -e sleep 1; swayphone_menuselect" + "on-click": "termite -e swayphone_menuselect" }, "battery": { diff --git a/home/config/waybar/config_1 b/home/config/waybar/config_1 index 8495dc7..6b566d1 100755 --- a/home/config/waybar/config_1 +++ b/home/config/waybar/config_1 @@ -134,7 +134,7 @@ "format": "{icon} {percent}% ", "states": [0,50], "format-icons": ["", ""], - "on-click": "termite -e sleep 1; swayphone_backlightselect" + "on-click": "termite -e swayphone_backlightselect" }, "tray": { "icon-size": 22 diff --git a/usr/local/bin/swayphone_backlightselect b/usr/local/bin/swayphone_backlightselect index 739f515..4a90378 100755 --- a/usr/local/bin/swayphone_backlightselect +++ b/usr/local/bin/swayphone_backlightselect @@ -2,6 +2,8 @@ BACKLIGHT=~/.backlight +usleep 250000 # term stabilization + dialog --scrollbar --default-item `pptk-backlight get` --menu Backlight 0 0 10 \ 10 FULL \ 9 :::: \ diff --git a/usr/local/bin/swayphone_menuselect b/usr/local/bin/swayphone_menuselect index 21dcf16..bbb08e7 100755 --- a/usr/local/bin/swayphone_menuselect +++ b/usr/local/bin/swayphone_menuselect @@ -16,5 +16,7 @@ then echo '"sudo poweroff" Shutdown' >> $MENUOPTIONS fi +usleep 250000 # term stabilization + cat $MENUOPTIONS | xargs dialog --menu EXECUTE $HEIGHT $WIDTH $LINES 2>$MENUSELECT && swaymsg exec "`cat $MENUSELECT`"