mirror of
https://codeberg.org/frosty/dotfiles.git
synced 2024-09-19 11:47:09 -04:00
add block button handles for status bar scripts
This commit is contained in:
parent
e1766d7081
commit
31e692b48e
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
BATTERY="BAT1"
|
BATTERY="BAT1"
|
||||||
|
|
||||||
|
case "$BLOCK_BUTTON" in
|
||||||
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
get_status_icon() {
|
get_status_icon() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"Full" | "Charging") printf ' \n' ;;
|
"Full" | "Charging") printf ' \n' ;;
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
case "$BLOCK_BUTTON" in
|
||||||
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
value=$(top -b -n 1 | awk '/%Cpu\(s\)/{print int($2)}')
|
value=$(top -b -n 1 | awk '/%Cpu\(s\)/{print int($2)}')
|
||||||
icon=" "
|
icon=" "
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
case "$BLOCK_BUTTON" in
|
||||||
|
1) notify-send "$(cal)" ;;
|
||||||
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
value=$(date '+%b %-d %Y %-I:%M %p')
|
value=$(date '+%b %-d %Y %-I:%M %p')
|
||||||
icon=" "
|
icon=" "
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
DEFAULT_LOCATION="/"
|
DEFAULT_LOCATION="/"
|
||||||
|
|
||||||
|
case "$BLOCK_BUTTON" in
|
||||||
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
get_location_icon() {
|
get_location_icon() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"/home"*) printf ' \n' ;;
|
"/home"*) printf ' \n' ;;
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
value=$(free -h | awk '/Mem/ {gsub(/Gi/, "G", $3); gsub(/Mi/, "M", $3); print $3"/"$2}')
|
case "$BLOCK_BUTTON" in
|
||||||
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
value=$(free -h | awk '/Mem/ {print $3"/"$2}' | sed 's/Gi/G/g; s/Mi/M/g')
|
||||||
icon=" "
|
icon=" "
|
||||||
|
|
||||||
printf ' %s %s\n' "$icon" "$value"
|
printf ' %s %s\n' "$icon" "$value"
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
case "$BLOCK_BUTTON" in
|
||||||
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
get_local_ip() {
|
get_local_ip() {
|
||||||
if ! local_ip=$(ip route get 1); then
|
if ! local_ip=$(ip route get 1); then
|
||||||
printf 'Offline\n'
|
printf 'Offline\n'
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
case "$BLOCK_BUTTON" in
|
||||||
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
value=$(uptime -p | sed 's/ day[s]*\b/d/g; s/ hour[s]*\b/h/g; s/ minute[s]*\b/m/g; s/up //; s/,//g')
|
value=$(uptime -p | sed 's/ day[s]*\b/d/g; s/ hour[s]*\b/h/g; s/ minute[s]*\b/m/g; s/up //; s/,//g')
|
||||||
icon=" "
|
icon=" "
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
case "$BLOCK_BUTTON" in
|
||||||
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
value=$(whoami)
|
value=$(whoami)
|
||||||
icon=" "
|
icon=" "
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,22 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
AUDIO_SINK="@DEFAULT_AUDIO_SINK@"
|
AUDIO_SINK="@DEFAULT_AUDIO_SINK@"
|
||||||
|
AUDIO_LIMIT=1
|
||||||
|
AUDIO_STEP=2
|
||||||
|
|
||||||
|
case "$BLOCK_BUTTON" in
|
||||||
|
1) wpctl set-mute "$AUDIO_SINK" toggle ;;
|
||||||
|
3) setsid -f "$TERMINAL" -e pulsemixer ;;
|
||||||
|
4)
|
||||||
|
wpctl set-mute "$AUDIO_SINK" 0
|
||||||
|
wpctl set-volume -l "$AUDIO_LIMIT" "$AUDIO_SINK" "$AUDIO_STEP"%+
|
||||||
|
;;
|
||||||
|
5)
|
||||||
|
wpctl set-mute "$AUDIO_SINK" 0
|
||||||
|
wpctl set-volume -l "$AUDIO_LIMIT" "$AUDIO_SINK" "$AUDIO_STEP"%-
|
||||||
|
;;
|
||||||
|
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
get_volume_icon() {
|
get_volume_icon() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
|
Loading…
Reference in a new issue