Compare commits

...

4 Commits

Author SHA1 Message Date
John Mertz baba42bff9 Switch to Xterm for htop window 2021-08-11 18:41:22 -04:00
John Mertz e474d0b057 Remove timeout for disk usage notification 2021-08-11 18:40:48 -04:00
John Mertz 0c915f4d17 Add a shortcut to (re)start yubioath-desktop 2021-08-11 18:36:36 -04:00
John Mertz 627ee855a7 Dump waybar config to semi-permanent destination
Since a previous change combined all displays into a single file, it is
no longer necessary to create many temporary configs. The latest config
can just be dumped to the standard path so that running `waybar` on it's
own will load it.
2021-08-11 18:05:30 -04:00
6 changed files with 24 additions and 13 deletions

View File

@ -59,7 +59,8 @@ Quick VPN switcher.
[**rofi/rofi-power-menu.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/rofi/rofi-power-menu.sh)
Lock, log out, restart Sway/i3, restart waybar, hibernate, reboot, shutdown.
Lock, toggle displays, reload yubico authenticator, log out, restart Sway/i3,
reload waybar, hibernate, reboot, shutdown.
[**rofi/rofi-send-to-kodi.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/rofi/rofi-send-to-kodi.sh)

View File

@ -12,17 +12,19 @@ fi
if [[ $WM == 'i3' ]]; then
res=$(printf "🔒 Lock|↩ Logout|↻ Reload i3|↹ Restart i3|↯ Hibernate|🡙 Reboot|⏻ Shutdown" | rofi -sep "|" -dmenu -i -p 'Power: ' "" -columns 1 -rows 7 -width 32 -l 1 -hide-scrollbar -eh 1 -location 0 -padding 12 -opacity 100 -auto-select -no-fullscreen)
else
res=$(echo "🔒 Lock|🖵 Toggle Displays|↩ Logout|↻ Reload Sway|↻ Reload Waybar|↯ Hibernate|🡙 Reboot|⏻ Shutdown" | rofi -sep "|" -dmenu -i -p 'Power: ' "" -no-lazy-grab -auto-select -no-fullscreen)
res=$(echo "🔒 Lock|🖵 Toggle Displays|⚿ Yubico Authenticator|↻ Reload Sway|↻ Reload Waybar|↩ Logout|↯ Hibernate|🡙 Reboot|⏻ Shutdown" | rofi -sep "|" -dmenu -i -p 'Power: ' "" -no-lazy-grab -auto-select -no-fullscreen)
fi
if [ "$res" == "🔒 Lock" ]; then
${WM}lock -c 323232
${WM}lock -c 1D2021
elif [ "$res" == "↩ Logout" ]; then
# Prevent auto-login
rm /home/jpm/.config/last_login_gui
${WM} exit
elif [ "$res" == "🖵 Toggle Displays" ]; then
/home/jpm/scripts/sway/toggle_outputs.sh
elif [ "$res" == "⚿ Yubico Authenticator" ]; then
/home/jpm/scripts/rofi/rofi-yubioath.sh
elif [ "$res" == "↻ Reload i3" ]; then
i3 reload
elif [ "$res" == "↹ Restart i3" ]; then

12
rofi/rofi-yubioath.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
RUNNING=$(pgrep yubioath-deskto)
if [ "$RUNNING" ]; then
kill $RUNNING
sudo systemctl stop pcscd.socket
sudo systemctl restart pcscd.service
sudo systemctl start pcscd.socket
fi
QT_QPA_PLATFORMTHEME=qt5ct QT_QPA_PLATFORM=wayland QT_PLUGIN_PATH=/usr/lib/qt/plugins /usr/bin/yubioath-desktop &

View File

@ -30,8 +30,8 @@
# "width": __WIDTH__ (optional)
my $waybar_template = "$ENV{'HOME'}/.config/waybar/config.template";
# Temporary directory to save generated waybar config(s)
my $waybar_temporary = '/tmp';
# Path to actual config file generated from template
my $waybar_config = "$ENV{'HOME'}/.config/waybar/config";
# File to log and recover last used layout name
my $last = "$ENV{'HOME'}/.config/last_display";
@ -382,12 +382,8 @@ unless ($pid) {
open STDOUT, '>>/dev/null';
open STDERR, '>>/dev/null';
# Write config to a temporary file
my $tmp = $waybar_temporary . "/waybar-" . time() .".config";
open ($fh, '>', $tmp);
open ($fh, '>', $waybar_config);
print $fh $waybar;
close $fh;
`nohup waybar --config=$tmp >> waybar.log`;
# Remove config
unlink $tmp;
`nohup waybar --config=$waybar_config >> waybar.log`;
}

View File

@ -3,5 +3,5 @@
if [ "$(pgrep -c htop)" -gt 0 ]; then
pkill htop
else
/usr/bin/uxterm -e htop
/usr/bin/xterm -e htop
fi

View File

@ -1,6 +1,6 @@
#!/bin/bash
notify-send -t 3000 Disks \
notify-send Disks \
"$(lsblk -o NAME,SIZE,FSUSE%,MOUNTPOINT | grep -vP '^loop' | \
sed 's/MOUNTPOINT/MOUNT/' | sed -e 's/│ └─/+---/' | \
sed -e 's/ └─/+---/' | sed -e 's/├─/+-/' | sed -e 's/└─/+-/' | \