1
0
Fork 0

various changes

various changes
This commit is contained in:
Luca Bilke 2022-08-22 20:33:37 +02:00
parent 5dda28e34b
commit 601aa80b00
23 changed files with 111 additions and 340 deletions

View File

@ -20,9 +20,10 @@ export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export PYENVS_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/virtualenv"
export KEYMAPS_DIR="$HOME/.local/bin/keymaps"
export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/x11/xinitrc"
export ZSH_COMPDUMP="${XDG_CACHE_HOME:-$HOME/.cache}/zcompdump"
# export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs.
export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs.
export NOTMUCH_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/notmuch-config"
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"
export LESSHISTFILE="-"
@ -235,3 +236,5 @@ ex=:\
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"
[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ] && setsid shortcuts >/dev/null 2>&1
sudo -n loadkeys ${XDG_DATA_HOME:-$HOME/.local/share}/ttymaps.kmap 2>/dev/null

View File

@ -1,86 +1,81 @@
!! Set cursor size (Check GTK in .config too):
Xcursor.size: 24
Xcursor.theme: Fluent-dark-cursors
!! Set transparency (0-1):
*.alpha: 0.8
!! Set a default font and font size:
*.font: NotoSans Nerd Font:style=Regular:pixelsize=14:antialias=true:autohint=true;
*.font: NotoSans Nerd Font:style=Regular:pixelsize=14:antialias=true;
/* name dark light */
/* black 0 8 */
/* red 1 9 */
/* green 2 10 */
/* yellow 3 11 */
/* blue 4 12 */
/* purple 5 13 */
/* cyan 6 14 */
/* white 7 15 */
!! DWM Settings
dwm.bordernorm: #1D202F
dwm.bordersel: #414868
/* name dark light */
/* black 0 8 */
/* red 1 9 */
/* green 2 10 */
/* yellow 3 11 */
/* blue 4 12 */
/* purple 5 13 */
/* cyan 6 14 */
/* white 7 15 */
! TokyoNight colors for Xresources
*background: #1a1b26
*foreground: #c0caf5
*color0: #15161E
*color1: #f7768e
*color2: #9ece6a
*color3: #e0af68
*color4: #7aa2f7
*color5: #bb9af7
*color6: #7dcfff
*color7: #a9b1d6
*color8: #414868
*color9: #f7768e
*color10: #9ece6a
*color11: #e0af68
*color12: #7aa2f7
*color13: #bb9af7
*color14: #7dcfff
*color15: #c0caf5
*.background: #1a1b26
*.foreground: #c0caf5
*.color0: #15161E
*.color1: #f7768e
*.color2: #9ece6a
*.color3: #e0af68
*.color4: #7aa2f7
*.color5: #bb9af7
*.color6: #7dcfff
*.color7: #a9b1d6
*.color8: #414868
*.color9: #f7768e
*.color10: #9ece6a
*.color11: #e0af68
*.color12: #7aa2f7
*.color13: #bb9af7
*.color14: #7dcfff
*.color15: #c0caf5
! TokyoNight colors for Xresources
! *background: #24283b
! *foreground: #c0caf5
! *color0: #1D202F
! *color1: #f7768e
! *color2: #9ece6a
! *color3: #e0af68
! *color4: #7aa2f7
! *color5: #bb9af7
! *color6: #7dcfff
! *color7: #a9b1d6
! *color8: #414868
! *color9: #f7768e
! *color10: #9ece6a
! *color11: #e0af68
! *color12: #7aa2f7
! *color13: #bb9af7
! *color14: #7dcfff
! *color15: #c0caf5
! *.background: #24283b
! *.foreground: #c0caf5
! *.color0: #1D202F
! *.color1: #f7768e
! *.color2: #9ece6a
! *.color3: #e0af68
! *.color4: #7aa2f7
! *.color5: #bb9af7
! *.color6: #7dcfff
! *.color7: #a9b1d6
! *.color8: #414868
! *.color9: #f7768e
! *.color10: #9ece6a
! *.color11: #e0af68
! *.color12: #7aa2f7
! *.color13: #bb9af7
! *.color14: #7dcfff
! *.color15: #c0caf5
! TokyoNight colors for Xresources
! *background: #e1e2e7
! *foreground: #3760bf
! *color0: #e9e9ed
! *color1: #f52a65
! *color2: #587539
! *color3: #8c6c3e
! *color4: #2e7de9
! *color5: #9854f1
! *color6: #007197
! *color7: #6172b0
! *color8: #a1a6c5
! *color9: #f52a65
! *color10: #587539
! *color11: #8c6c3e
! *color12: #2e7de9
! *color13: #9854f1
! *color14: #007197
! *color15: #3760bf
! *.background: #e1e2e7
! *.foreground: #3760bf
! *.color1: #f52a65
! *.color2: #587539
! *.color3: #8c6c3e
! *.color4: #2e7de9
! *.color5: #9854f1
! *.color6: #007197
! *.color7: #6172b0
! *.color8: #a1a6c5
! *.color9: #f52a65
! *.color10: #587539
! *.color11: #8c6c3e
! *.color12: #2e7de9
! *.color13: #9854f1
! *.color14: #007197
! *.color15: #3760bf

2
.local/bin/keymaps/dvorak Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
setxkbmap -layout dvorak -option caps:super

2
.local/bin/keymaps/qwertz Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
setxkbmap -layout de -variant nodeadkeys -option caps:super

View File

@ -1,11 +1,6 @@
#!/bin/sh
# This script is called on startup to remap keys.
# Decrease key repeat delay to 300ms and increase key repeat rate to 50 per second.
mapdir="${KEYMAPS_DIR:-$HOME/.local/bin/keymaps}"
xset r rate 300 50
# Map the caps lock key to super, and map the menu key to right super.
setxkbmap -layout de -variant nodeadkeys -option caps:super
# When caps lock is pressed only once, treat it as escape.
killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape'
# Turn off caps lock if on since there is no longer a key for it.
xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock
eval "$mapdir/$(ls "$mapdir" | dmenu -i -p 'Mapping: ')"

View File

@ -1,7 +1,5 @@
#!/bin/sh
clock=$(date '+%I')
case "$clock" in
"00") icon="" ;;
"01") icon="" ;;
@ -17,23 +15,4 @@ case "$clock" in
"11") icon="" ;;
"12") icon="" ;;
esac
case $BLOCK_BUTTON in
1) notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
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\`
- Middle click opens calcurse if installed" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
expireTime=3000
appoint="$(calcurse -d7 --output-datefmt '%A')" # Easier reading on this output
case $BLOCK_BUTTON in
1) notify-send --expire-time=$expireTime "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/span><\/b>/")" && [ ${#appoint} -gt 0 ] && notify-send --expire-time=$expireTime "Appointments" "$appoint" ;;
2) setsid -f "$TERMINAL" -e calcurse ;;
3) notify-send " Time/date module" "\- Left click to show upcoming appointments for the next three days (if there are any) and the month.
- Middle click opens calcurse if installed" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
date "+%d.%M.%Y $icon %H:%M"
printf "%s \033[11m%s\033[10m %s\n" "$(date "+%d.%M.%Y")" "$icon" "$(date "+%H:%M")"

View File

@ -1,12 +1,3 @@
#!/bin/sh
# TODO: Add color
case $BLOCK_BUTTON in
1) notify-send "﬙ CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)\\n(100% per core)" ;;
2) setsid -f "$TERMINAL" -e htop ;;
3) notify-send "﬙ CPU module " "\- Shows CPU temperature.
- Click to show intensive processes.
- Middle click to open htop." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
sensors | awk '/Core 0/ {print "🌡" $3}'
sensors | awk '/Core 0/ {print "\033[11m🌡\033[10m" $3}'

View File

@ -1,44 +1,25 @@
#!/bin/sh
# Module showing CPU load as a changing bars.
# Just like in polybar.
# Each bar represents amount of load on one core since
# last run.
# Cache in tmpfs to improve speed and reduce SSD load
cache=/tmp/cpubarscache
case $BLOCK_BUTTON in
2) setsid -f "$TERMINAL" -e htop ;;
3) notify-send "﬙ CPU load module" "Each bar represents
one CPU core";;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
# id total idle
stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat)
[ ! -f $cache ] && echo "$stats" > "$cache"
old=$(cat "$cache")
printf "﬙ "
printf "\033[11m﬙\033[10m "
echo "$stats" | while read -r row; do
id=${row%% *}
rest=${row#* }
total=${rest%% *}
idle=${rest##* }
case "$(echo "$old" | awk '{if ($1 == id)
printf "%d\n", (1 - (idle - $3) / (total - $2))*100 /12.5}' \
id="$id" total="$total" idle="$idle")" in
"0") printf "\033[32m▁\033[0m";;
"1") printf "\033[32m▂\033[0m";;
"2") printf "\033[32m▃\033[0m";;
"3") printf "\033[33m▄\033[0m";;
"4") printf "\033[33m▅\033[0m";;
"5") printf "\033[33m▆\033[0m";;
"6") printf "\033[31m▇\033[0m";;
"7") printf "\033[31m█\033[0m";;
"8") printf "\033[31m█\033[0m";;
"6"|"7"|"8") printf "\033[31m▇\033[0m";;
esac
done; printf "\\n"
echo "$stats" > "$cache"

View File

@ -1,17 +1,5 @@
#!/bin/sh
# Status bar module for disk space
# $1 should be drive mountpoint, otherwise assumed /.
location=${1:-/}
[ -d "$location" ] || exit
case $BLOCK_BUTTON in
1) notify-send " Disk space" "$(df -h --output=target,used,size)" ;;
3) notify-send " Disk module" "\- Shows used hard drive space.
- Click to show all disk info." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
printf "%s\n" " $(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')"
printf "%s\n" "\033[11m\033[10m $(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')"

View File

@ -1,6 +1,13 @@
#!/bin/sh
weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
weatheremoji="${XDG_CACHE_HOME:-$HOME/.cache}/weatheremoji"
# Usually intended for the statusbar.
# If we have internet, get a weather report from wttr.in and store it locally.
# You could set up a shell alias to view the full file in a pager in the
# terminal if desired. This function will only be run once a day when needed.
# Options can be found at https://wttr.in/:help
weatherfile="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
emojifile="${XDG_CACHE_HOME:-$HOME/.cache}/weatheremoji"
url="wttr.in/Karlsruhe"
opt="?F"
emojiopt="?format=1"
@ -17,26 +24,13 @@ s/🌧//
s/🌨//
s/🌩//
s/🌫//
' "${weatheremoji}"
' "$emojifile"
}
getforecast() { curl -sf "$url$opt" > "$weatherreport" && curl -sf "$url$emojiopt" > "$weatheremoji" ;}
showweather() { emoji=$(cat "$weatheremoji") && printf "%s" "$(sed '16q;d' "$weatherreport" |
grep -wo "[0-9]*%" | sort -rn | sed "s/^/ $(printf %.1s "$emoji") /g;1q" | tr -d '\n')"
sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sed 's/+//g' | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " " $1 "°"," " $2 "°"}' ;}
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;;
2) getforecast && showweather ;;
3) notify-send " Weather module" "\- Left click for full forecast.
- Middle click to update forecast.
${emoji}: Chance of rain/snow
: Daily low
: Daily high" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
[ "$(stat -c %y "$weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
getforecast && convertemoji
getforecast() { curl -sf "$url$opt" > "$weatherfile" && curl -sf "$url$emojiopt" > "$emojifile" || exit 1 ;}
showweather() {
emoji="$(printf "\033[12m%s\033[10m" "$(cut -d ' ' -f 1 "$emojifile")")"
sed '16q;d' "$weatherfile" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/$emoji /g;1q" | tr -d '\n'
sed '13q;d' "$weatherfile" | grep -o "m\\([-+]\\)*[0-9]\\+" | sed 's/+//g' | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print "  " $1 "°"," " $2 "°"}';
}
getforecast && convertemoji
showweather

View File

@ -1,26 +1,7 @@
#!/bin/sh
# Show wifi 直 and percent strength or 睊 if none.
# Show  if connected to ethernet or  if none.
# Show 嬨 if a vpn connection is active
case $BLOCK_BUTTON in
1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;;
3) notify-send " Internet module" "\- Click to connect
: wifi disabled
睊: no wifi connection
直: wifi connection with quality
: no ethernet
: ethernet working
嬨: vpn is active
" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then
wifiicon="$(awk '/^\s*w/ { print " 直", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
wifiicon="$(awk '/^\s*w/ { print "直", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then
grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon=" 睊" || wifiicon="  "
grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="睊" || wifiicon=" "
fi
printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/  /;s/up/  /" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/ 嬨/" /sys/class/net/tun*/operstate 2>/dev/null)"
printf "%s%s%s%s\n" "$wifiicon" "$(sed "s/down/ /;s/up/ /" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/嬨/" /sys/class/net/tun*/operstate 2>/dev/null)" "$(ip route get 8.8.8.8 | sed 's/.*src \([^ ]*\).*/\1/;t;d')"

View File

@ -1,10 +1,5 @@
#!/bin/sh
# Gets your public ip address checks which country you are in and
# displays that information in the statusbar
#
# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
ifinstalled "geoip" || exit
addr="$(curl snaile.de/ip 2>/dev/null)" || exit
grep "flag: " "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji" | grep "$(geoiplookup "$addr" | sed 's/.*, //')" | sed "s/flag: //;s/;.*//"

View File

@ -1,16 +0,0 @@
#!/bin/sh
# works on any init system
# requirements: dmenu, xorg-setxkbmap
kb="$(setxkbmap -query | grep -oP 'layout:\s*\K\w+')" || exit 1
case $BLOCK_BUTTON in
1) kb_choice="$(awk '/! layout/{flag=1; next} /! variant/{flag=0} flag {print $2, "- " $1}' /usr/share/X11/xkb/rules/base.lst | dmenu -l 15)"
kb="$(echo "$kb_choice" | awk '{print $3}')"
setxkbmap "$kb"
pkill -RTMIN+30 "${STATUSBAR:-dwmblocks}";;
3) notify-send "⌨ Keyboard/language module" "$(printf "%s" "\- Current layout: $(setxkbmap -query | grep -oP 'layout:\s*\K\w+')")
- Left click to change keyboard.";;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
echo "$kb"

View File

@ -1,20 +1,4 @@
#!/bin/sh
# Displays number of unread mail and an loading icon if updating.
# When clicked, brings up `neomutt`.
case $BLOCK_BUTTON in
1) setsid -f claws-mail --alternate-config-dir "$CLAWSRC" ;;
2) setsid -f mw -Y >/dev/null ;;
3) notify-send " Mail module" "\- Shows unread mail
- Shows 痢 if syncing mail
- Left click opens claws mail
- Middle click syncs mail" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
unread="$(find "${XDG_DATA_HOME:-$HOME/.config}"/claws-mail/imapcache/imap.gmail.com/luca.bilke/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
pidof mbsync >/dev/null 2>&1 && icon="痢"
[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "  $unread$icon"

View File

@ -1,12 +1,2 @@
#!/bin/sh
case $BLOCK_BUTTON in
1) notify-send " Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;;
2) setsid -f "$TERMINAL" -e htop ;;
3) notify-send " Memory module" "\- Shows Memory Used/Total.
- Click to show memory hogs.
- Middle click to open htop." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
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 ("\033[11m\033[10m %2.2fGiB / %2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}'

View File

@ -1,8 +1,4 @@
#!/bin/sh
# This loop will update the mpd statusbar module whenever a command changes the
# music player's status. mpd must be running on X's start for this to work.
while : ; do
mpc idle >/dev/null && kill -45 "$(pidof dwm)" || break
done

View File

@ -11,19 +11,4 @@ filter() {
exit 1
fi
}
pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 &
case $BLOCK_BUTTON in
1) mpc status | filter ; setsid -f "$TERMINAL" -e ncmpcpp ;; # right click, pause/unpause
2) mpc toggle | filter ;; # right click, pause/unpause
3) mpc status | filter ; notify-send " Music module" "\- Shows mpd song playing.
- ⏸ when paused.
- Left click opens ncmpcpp.
- Middle click pauses.
- Scroll changes track.";; # right click, pause/unpause
4) mpc prev | filter ;; # scroll up, previous
5) mpc next | filter ;; # scroll down, next
6) mpc status | filter ; "$TERMINAL" -e "$EDITOR" "$0" ;;
*) mpc status | filter ;;
esac

View File

@ -1,15 +1,4 @@
#!/bin/sh
# Module showing network traffic. Shows how much data has been received (RX) or
# transmitted (TX) since the previous time this script ran. So if run every
# second, gives network traffic per second.
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e bmon ;;
3) notify-send "歷 Network traffic module" ": Traffic received : Traffic transmitted" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
update() {
sum=0
for arg; do
@ -21,8 +10,6 @@ update() {
printf %d\\n "$sum" > "$cache"
printf %d\\n $(( sum - old ))
}
rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)
tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes)
printf " %4sB %4sB \\n" $(numfmt --to=iec $rx $tx)
printf "%5sB %5sB\\n" $(numfmt --to=iec $rx $tx)

View File

@ -1,17 +1,2 @@
#!/bin/sh
# Displays number of unread news items and an loading icon if updating.
# When clicked, brings up `newsboat`.
case $BLOCK_BUTTON in
1) setsid "$TERMINAL" -e newsboat ;;
2) setsid -f newsup >/dev/null exit ;;
3) notify-send " News module" "\- Shows unread news items
- Shows  if updating with \`newsup\`
- Left click opens newsboat
- Middle click syncs RSS feeds
<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
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)"

View File

@ -1,10 +1,6 @@
#!/bin/sh
# Displays number of upgradeable packages.
# For this to work, have a `pacman -Sy` command run in the background as a
# cronjob every so often as root. This script will then read those packages.
# When clicked, it will run an upgrade via pacman.
#
# Add the following text as a file in /usr/share/libalpm/hooks/statusbar.hook:
#
# [Trigger]
@ -16,14 +12,4 @@
# Description = Updating statusbar...
# When = PostTransaction
# Exec = /usr/bin/pkill -RTMIN+8 dwmblocks # Or i3blocks if using i3.
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e sb-popupgrade ;;
2) notify-send "$(/usr/bin/pacman -Qu)" ;;
3) notify-send " Upgrade module" ": number of upgradable packages
- Left click to upgrade packages
- Middle click to show upgradable packages" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/  /;s/$/ /;s/^  0 $//g"
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/ /;s/^ 0$//g"

View File

@ -1,20 +1,5 @@
#!/bin/sh
# Originally by Andr3as07 <https://github.com/Andr3as07>
# Some changes by Luke
# Rebuild by Tenyun
# This block displays the number running background tasks. Requires tsp.
# Requires tsp
num=$(tsp -l | awk -v numr=0 -v numq=0 '{if (/running/)numr++; if (/queued/)numq++} END{print numr+numq"("numq")"}')
# Handle mouse clicks
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e tsp -l ;;
3) notify-send "Tasks module" ": number of running/queued background tasks
- Left click opens tsp" ;; # Right click
2) $EDITOR "$0" ;; # Middle click
esac
[ "$num" != "0(0)" ] &&
echo " $num"
echo " $num"

View File

@ -1,19 +1,6 @@
#!/bin/sh
# Prints the current volume or ﱝ if muted.
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e pulsemixer ;;
2) pamixer -t ;;
4) pamixer --allow-boost -i 1 ;;
5) pamixer --allow-boost -d 1 ;;
3) notify-send "蓼Volume module" "\- Shows volume , ﱝ if muted.
- Middle click to mute.
- Scroll to change." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
[ "$(pamixer --get-mute)" = true ] && echo "ﱝ" && exit
vol="$(pamixer --get-volume)"
if [ "$vol" -gt "70" ]; then
@ -27,5 +14,4 @@ elif [ "$vol" -eq "0" ]; then
else
echo "   " && exit
fi
echo "$icon $vol%"
printf "\033[11m%s\033[10m %s" "$icon" "$vol"

View File

@ -1,9 +1,6 @@
#!/bin/sh
printf "Beginning upgrade.\\n"
paru -Syu
pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}"
printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n"
read -r _