script fixes (#1386)
* fix typo in lfub * use setsid when editing scripts * fix immediate exit on middle click --------- Co-authored-by: 2084x <2084x@noreply.codeberg.org>
This commit is contained in:
parent
0795202675
commit
7a96fb100c
22 changed files with 23 additions and 23 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# This is a wrapper script for lb that allows it to create image previews with
|
# This is a wrapper script for lf that allows it to create image previews with
|
||||||
# ueberzug. This works in concert with the lf configuration file and the
|
# ueberzug. This works in concert with the lf configuration file and the
|
||||||
# lf-cleaner script.
|
# lf-cleaner script.
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ case $BLOCK_BUTTON in
|
||||||
- Scroll to change adjust xbacklight." ;;
|
- Scroll to change adjust xbacklight." ;;
|
||||||
4) xbacklight -inc 10 ;;
|
4) xbacklight -inc 10 ;;
|
||||||
5) xbacklight -dec 10 ;;
|
5) xbacklight -dec 10 ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Loop through all attached batteries and format the info
|
# Loop through all attached batteries and format the info
|
||||||
|
|
|
@ -23,7 +23,7 @@ case $BLOCK_BUTTON in
|
||||||
2) setsid -f "$TERMINAL" -e calcurse ;;
|
2) setsid -f "$TERMINAL" -e calcurse ;;
|
||||||
3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
|
3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
|
||||||
- Middle click opens calcurse if installed" ;;
|
- Middle click opens calcurse if installed" ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
date "+%Y %b %d (%a) $icon%I:%M%p"
|
date "+%Y %b %d (%a) $icon%I:%M%p"
|
||||||
|
|
|
@ -6,7 +6,7 @@ case $BLOCK_BUTTON in
|
||||||
3) notify-send "🖥 CPU module " "\- Shows CPU temperature.
|
3) notify-send "🖥 CPU module " "\- Shows CPU temperature.
|
||||||
- Click to show intensive processes.
|
- Click to show intensive processes.
|
||||||
- Middle click to open htop." ;;
|
- Middle click to open htop." ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
sensors | awk '/Core 0/ {print "🌡" $3}'
|
sensors | awk '/Core 0/ {print "🌡" $3}'
|
||||||
|
|
|
@ -12,7 +12,7 @@ case $BLOCK_BUTTON in
|
||||||
2) setsid -f "$TERMINAL" -e htop ;;
|
2) setsid -f "$TERMINAL" -e htop ;;
|
||||||
3) notify-send "🪨 CPU load module" "Each bar represents
|
3) notify-send "🪨 CPU load module" "Each bar represents
|
||||||
one CPU core";;
|
one CPU core";;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# id total idle
|
# id total idle
|
||||||
|
|
|
@ -11,7 +11,7 @@ case $BLOCK_BUTTON in
|
||||||
1) notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;;
|
1) notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;;
|
||||||
3) notify-send "💽 Disk module" "\- Shows used hard drive space.
|
3) notify-send "💽 Disk module" "\- Shows used hard drive space.
|
||||||
- Click to show all disk info." ;;
|
- Click to show all disk info." ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$location" in
|
case "$location" in
|
||||||
|
|
|
@ -274,7 +274,7 @@ case $BLOCK_BUTTON in
|
||||||
3) notify-send "🗺️ Doppler RADAR module" "\- Left click for local Doppler RADAR.
|
3) notify-send "🗺️ Doppler RADAR module" "\- Left click for local Doppler RADAR.
|
||||||
- Middle click to update RADAR location.
|
- Middle click to update RADAR location.
|
||||||
After $secs seconds, new clicks will also automatically update the doppler RADAR." ;;
|
After $secs seconds, new clicks will also automatically update the doppler RADAR." ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo 🌅
|
echo 🌅
|
||||||
|
|
|
@ -45,7 +45,7 @@ case $BLOCK_BUTTON in
|
||||||
☔: Chance of rain/snow
|
☔: Chance of rain/snow
|
||||||
🥶: Daily low
|
🥶: Daily low
|
||||||
🌞: Daily high" ;;
|
🌞: Daily high" ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
checkforecast || getforecast
|
checkforecast || getforecast
|
||||||
|
|
|
@ -13,5 +13,5 @@ case $BLOCK_BUTTON in
|
||||||
2) restartwm ;;
|
2) restartwm ;;
|
||||||
3) notify-send "❓ Help module" "\- Left click to open LARBS guide.
|
3) notify-send "❓ Help module" "\- Left click to open LARBS guide.
|
||||||
- Middle click to refresh window manager." ;;
|
- Middle click to refresh window manager." ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac; echo "❓"
|
esac; echo "❓"
|
||||||
|
|
|
@ -14,7 +14,7 @@ case $BLOCK_BUTTON in
|
||||||
🌐: ethernet working
|
🌐: ethernet working
|
||||||
🔒: vpn is active
|
🔒: vpn is active
|
||||||
" ;;
|
" ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Wifi
|
# Wifi
|
||||||
|
|
|
@ -11,7 +11,7 @@ case $BLOCK_BUTTON in
|
||||||
pkill -RTMIN+30 "${STATUSBAR:-dwmblocks}";;
|
pkill -RTMIN+30 "${STATUSBAR:-dwmblocks}";;
|
||||||
3) notify-send "⌨ Keyboard/language module" "$(printf "%s" "\- Current layout: $(setxkbmap -query | grep -oP 'layout:\s*\K\w+')")
|
3) notify-send "⌨ Keyboard/language module" "$(printf "%s" "\- Current layout: $(setxkbmap -query | grep -oP 'layout:\s*\K\w+')")
|
||||||
- Left click to change keyboard.";;
|
- Left click to change keyboard.";;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "$kb"
|
echo "$kb"
|
||||||
|
|
|
@ -10,7 +10,7 @@ case $BLOCK_BUTTON in
|
||||||
- Shows 🔃 if syncing mail
|
- Shows 🔃 if syncing mail
|
||||||
- Left click opens neomutt
|
- Left click opens neomutt
|
||||||
- Middle click syncs mail" ;;
|
- Middle click syncs mail" ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
|
unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
|
||||||
|
|
|
@ -6,7 +6,7 @@ case $BLOCK_BUTTON in
|
||||||
3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total.
|
3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total.
|
||||||
- Click to show memory hogs.
|
- Click to show memory hogs.
|
||||||
- Middle click to open htop." ;;
|
- Middle click to open htop." ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
free --mebi | sed -n '2{p;q}' | awk '{printf ("🧠%2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}'
|
free --mebi | sed -n '2{p;q}' | awk '{printf ("🧠%2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}'
|
||||||
|
|
|
@ -33,5 +33,5 @@ case $BLOCK_BUTTON in
|
||||||
- 🌖: Waning Gibbous
|
- 🌖: Waning Gibbous
|
||||||
- 🌗: Last Quarter
|
- 🌗: Last Quarter
|
||||||
- 🌘: Waning Crescent" ;;
|
- 🌘: Waning Crescent" ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -14,6 +14,6 @@ case $BLOCK_BUTTON in
|
||||||
- Scroll changes track.";; # right click, pause/unpause
|
- Scroll changes track.";; # right click, pause/unpause
|
||||||
4) mpc prev | filter ;; # scroll up, previous
|
4) mpc prev | filter ;; # scroll up, previous
|
||||||
5) mpc next | filter ;; # scroll down, next
|
5) mpc next | filter ;; # scroll down, next
|
||||||
6) mpc status | filter ; "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) mpc status | filter ; setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
*) mpc status | filter ;;
|
*) mpc status | filter ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -8,7 +8,7 @@ case $BLOCK_BUTTON in
|
||||||
1) setsid -f "$TERMINAL" -e bmon ;;
|
1) setsid -f "$TERMINAL" -e bmon ;;
|
||||||
3) notify-send "🌐 Network traffic module" "🔻: Traffic received
|
3) notify-send "🌐 Network traffic module" "🔻: Traffic received
|
||||||
🔺: Traffic transmitted" ;;
|
🔺: Traffic transmitted" ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) setsid "$TERMINAL" -e newsboat ;;
|
1) setsid "$TERMINAL" -e newsboat ;;
|
||||||
2) setsid -f newsup >/dev/null exit ;;
|
2) setsid -f newsup >/dev/null && exit ;;
|
||||||
3) notify-send "📰 News module" "\- Shows unread news items
|
3) notify-send "📰 News module" "\- Shows unread news items
|
||||||
- Shows 🔃 if updating with \`newsup\`
|
- Shows 🔃 if updating with \`newsup\`
|
||||||
- Left click opens newsboat
|
- Left click opens newsboat
|
||||||
- Middle click syncs RSS feeds
|
- Middle click syncs RSS feeds
|
||||||
<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;;
|
<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ if($1>0) print "📰" $1}')$(cat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsboat/.update 2>/dev/null)"
|
cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ if($1>0) print "📰" $1}')$(cat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsboat/.update 2>/dev/null)"
|
||||||
|
|
|
@ -23,7 +23,7 @@ case $BLOCK_BUTTON in
|
||||||
3) notify-send "🎁 Upgrade module" "📦: number of upgradable packages
|
3) notify-send "🎁 Upgrade module" "📦: number of upgradable packages
|
||||||
- Left click to upgrade packages
|
- Left click to upgrade packages
|
||||||
- Middle click to show upgradable packages" ;;
|
- Middle click to show upgradable packages" ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/📦/;s/^📦0$//g"
|
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/📦/;s/^📦0$//g"
|
||||||
|
|
|
@ -44,7 +44,7 @@ case $BLOCK_BUTTON in
|
||||||
- Shows 🔃 if updating prices.
|
- Shows 🔃 if updating prices.
|
||||||
- <b>Last updated:
|
- <b>Last updated:
|
||||||
$uptime</b>" ;;
|
$uptime</b>" ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[ -n "$updateme" ] &&
|
[ -n "$updateme" ] &&
|
||||||
|
|
|
@ -13,7 +13,7 @@ case $BLOCK_BUTTON in
|
||||||
1) setsid -f "$TERMINAL" -e tsp -l ;;
|
1) setsid -f "$TERMINAL" -e tsp -l ;;
|
||||||
3) notify-send "Tasks module" "🤖: number of running/queued background tasks
|
3) notify-send "Tasks module" "🤖: number of running/queued background tasks
|
||||||
- Left click opens tsp" ;; # Right click
|
- Left click opens tsp" ;; # Right click
|
||||||
2) $EDITOR "$0" ;; # Middle click
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[ "$num" != "0(0)" ] &&
|
[ "$num" != "0(0)" ] &&
|
||||||
|
|
|
@ -23,5 +23,5 @@ Module shows number of torrents:
|
||||||
🔽: downloading
|
🔽: downloading
|
||||||
✅: done
|
✅: done
|
||||||
🌱: done and seeding" ;;
|
🌱: done and seeding" ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -10,7 +10,7 @@ case $BLOCK_BUTTON in
|
||||||
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
|
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
|
||||||
- Middle click to mute.
|
- Middle click to mute.
|
||||||
- Scroll to change." ;;
|
- Scroll to change." ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
|
vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
|
||||||
|
|
Loading…
Reference in a new issue