1
0
Fork 0

plenty of statusbar changes

This commit is contained in:
Luca Bilke 2024-07-24 19:16:58 +02:00
parent 7d783df391
commit f69b9957c9
Signed by: luca
GPG Key ID: F6E11C9BAA7C82F5
17 changed files with 404 additions and 1752 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
pkill -RTMIN+8 dwmblocks
pkill -RTMIN+1 dwmblocks
askupgrade() {
[ "$(notify-send -c updates --action=Yes=Yes --action=No=No " Repository Sync" "Updates available. Update now?")" = 'Yes' ] && $TERMCMD upgrades

View File

@ -2,6 +2,6 @@
# battery status file is sent in as an argument from sb-battery
upower --monitor-detail -i "$1" | while read -r _; do
pkill -RTMIN+3 dwmblocks
timeout 5 cat >/dev/null
pkill -RTMIN+4 dwmblocks
sleep 5
done

View File

@ -1,4 +1,5 @@
#!/bin/sh
playerctl status -F | while read -r _; do
# WARN: Not currently used in dwmblocks
pkill -RTMIN+11 dwmblocks
done

View File

@ -11,6 +11,7 @@
updateicon() {
echo "$1" >/tmp/recordingicon
# WARN: Not currently used in dwmblocks
pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}"
}
@ -20,6 +21,7 @@ killrecording() {
kill -15 "$recpid"
rm -f /tmp/recordingpid
updateicon ""
# WARN: Not currently used in dwmblocks
pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}"
# even after SIGTERM, ffmpeg may still run, so SIGKILL it.
sleep 3

View File

@ -1,5 +1,5 @@
#!/bin/sh
. "$HOME/.local/libexec/statusbar/colors"
. "colors"
[ -z "$(ls /sys/class/power_supply)" ] && exit 0
@ -14,7 +14,7 @@ for battery in /sys/class/power_supply/BAT?*; do
;;
"Not charging")
icon="󰁹"
color="$fgwhite"
color="$fggreen"
;;
"Unknown")
icon="󰂑"

View File

@ -1,5 +1,5 @@
#!/bin/sh
. "$HOME/.local/libexec/statusbar/colors"
. "colors"
cache=$XDG_RUNTIME_DIR/cpubarscache

View File

@ -1,4 +1,5 @@
#!/bin/sh
. "colors"
IFS='
'
@ -15,7 +16,7 @@ for mnt in $(findmnt -Py -t "$types"); do
*) icon="" ;;
esac
$first || printf " "
echo "${icon} $(df -h "$TARGET" | awk ' /[0-9]/ {print $3 "/" $2}')"
printf "%b" "${icon} $(df -h "$TARGET" | awk ' /[0-9]/ {print $3 "/" $2}')"
first=false
done
printf "\n"

View File

@ -1,5 +1,5 @@
#!/bin/sh
. "$HOME/.local/libexec/statusbar/colors"
. "colors"
# NOTE: This script takes its dwmblocks update signal as an argument so that it can refresh itself (defaults to 5)
# Options can be found at https://wttr.in/:help
@ -31,6 +31,7 @@ output() {
if fresh; then
output
else
getforecast && pkill "-RTMIN+${1:-5}" dwmblocks &
# WARN: Not currently used in dwmblocks
getforecast && pkill "-RTMIN+5" dwmblocks &
printf "%b" " Getting Weather\n"
fi

View File

@ -1,4 +1,5 @@
#!/bin/sh
. "colors"
shift=""

View File

@ -1,6 +1,16 @@
#!/bin/sh
# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
loc_addr="$(ip route get 9.9.9.9 | head -1 | cut -d ' ' -f7)"
pub_addr="$(curl ipv4.icanhazip.com 2>/dev/null)" || exit
# flag="$(grep "flag: " "${XDG_DATA_HOME:-$HOME/.local/share}/emoji" | grep "$(geoiplookup "$addr" | sed 's/.*, //')" | sed 's/ flag: .*//')"
printf "%s %s\n" "$loc_addr" "$pub_addr"
. "colors"
cache="${XDG_CACHE_HOME:-$HOME/.cache}/geoip"
# loc_addr="$(ip route get 9.9.9.9 | awk 'NR==1 {print $7}')"
pub_addr="$(curl -s ipv4.icanhazip.com 2>/dev/null)"
location="$(awk -F: -v ip="$pub_addr" '$1==ip {print $2}' "$cache")"
[ -z "$location" ] && {
location="$(curl -s "https://reallyfreegeoip.org/json/${pub_addr}" | jq -r '.country_name')"
echo "${pub_addr}:${location}" >>"$cache"
}
flag="$(awk -v loc="$location" '$0 ~ loc {print $1}' "${XDG_DATA_HOME:-$HOME/.local/share}/emoji")"
echo "${flag} ${pub_addr}"

View File

@ -1,3 +1,5 @@
#!/bin/sh
. "colors"
printf "%b" "󰘚 "
free -m | awk 'NR==2 { printf ("%2.2fG/%2.2fG\n", ($3 / 1024), ($2 / 1024)) }'

View File

@ -1,4 +1,6 @@
#!/bin/sh
. "colors"
filter() {
if mpc 1>/dev/null 2>&1 && [ "$(mpc | wc -l)" -eq 3 ]; then
song=$(mpc current -f "%artist% - %title%" | xargs -0)

View File

@ -1,5 +1,5 @@
#!/bin/sh
# . "$HOME/.local/libexec/statusbar/colors"
. "colors"
# TODO: Coloring based on speed
update() {

View File

@ -1,4 +1,5 @@
#!/bin/sh
. "colors"
icon=""

View File

@ -1,4 +1,5 @@
#!/bin/sh
. "colors"
pidof -x sbd-playerctl >/dev/null 2>&1 || "$HOME/.local/libexec/daemons/sbd-playerctl" >/dev/null 2>&1 &
[ "$(playerctl status 2>&1)" = "No players found" ] && printf "%b" "" && exit 1

File diff suppressed because it is too large Load Diff

261
.local/share/emoji Normal file
View File

@ -0,0 +1,261 @@
🇦🇨 Ascension Island
🇦🇩 Andorra
🇦🇪 United Arab Emirates
🇦🇫 Afghanistan
🇦🇬 Antigua & Barbuda
🇦🇮 Anguilla
🇦🇱 Albania
🇦🇲 Armenia
🇦🇴 Angola
🇦🇶 Antarctica
🇦🇷 Argentina
🇦🇸 American Samoa
🇦🇹 Austria
🇦🇺 Australia
🇦🇼 Aruba
🇦🇽 Åland Islands
🇦🇿 Azerbaijan
🇧🇦 Bosnia & Herzegovina
🇧🇧 Barbados
🇧🇩 Bangladesh
🇧🇪 Belgium
🇧🇫 Burkina Faso
🇧🇬 Bulgaria
🇧🇭 Bahrain
🇧🇮 Burundi
🇧🇯 Benin
🇧🇱 St. Barthélemy
🇧🇲 Bermuda
🇧🇳 Brunei
🇧🇴 Bolivia
🇧🇶 Caribbean Netherlands
🇧🇷 Brazil
🇧🇸 Bahamas
🇧🇹 Bhutan
🇧🇻 Bouvet Island
🇧🇼 Botswana
🇧🇾 Belarus
🇧🇿 Belize
🇨🇦 Canada
🇨🇨 Cocos (Keeling) Islands
🇨🇩 Congo - Kinshasa
🇨🇫 Central African Republic
🇨🇬 Congo - Brazzaville
🇨🇭 Switzerland
🇨🇮 Côte dIvoire
🇨🇰 Cook Islands
🇨🇱 Chile
🇨🇲 Cameroon
🇨🇳 China
🇨🇴 Colombia
🇨🇵 Clipperton Island
🇨🇷 Costa Rica
🇨🇺 Cuba
🇨🇻 Cape Verde
🇨🇼 Curaçao
🇨🇽 Christmas Island
🇨🇾 Cyprus
🇨🇿 Czechia
🇩🇪 Germany
🇩🇬 Diego Garcia
🇩🇯 Djibouti
🇩🇰 Denmark
🇩🇲 Dominica
🇩🇴 Dominican Republic
🇩🇿 Algeria
🇪🇦 Ceuta & Melilla
🇪🇨 Ecuador
🇪🇪 Estonia
🇪🇬 Egypt
🇪🇭 Western Sahara
🇪🇷 Eritrea
🇪🇸 Spain
🇪🇹 Ethiopia
🇪🇺 European Union
🇫🇮 Finland
🇫🇯 Fiji
🇫🇰 Falkland Islands
🇫🇲 Micronesia
🇫🇴 Faroe Islands
🇫🇷 France
🇬🇦 Gabon
🇬🇧 United Kingdom
🇬🇩 Grenada
🇬🇪 Georgia
🇬🇫 French Guiana
🇬🇬 Guernsey
🇬🇭 Ghana
🇬🇮 Gibraltar
🇬🇱 Greenland
🇬🇲 Gambia
🇬🇳 Guinea
🇬🇵 Guadeloupe
🇬🇶 Equatorial Guinea
🇬🇷 Greece
🇬🇸 South Georgia & South Sandwich Islands
🇬🇹 Guatemala
🇬🇺 Guam
🇬🇼 Guinea-Bissau
🇬🇾 Guyana
🇭🇰 Hong Kong SAR China
🇭🇲 Heard & McDonald Islands
🇭🇳 Honduras
🇭🇷 Croatia
🇭🇹 Haiti
🇭🇺 Hungary
🇮🇨 Canary Islands
🇮🇩 Indonesia
🇮🇪 Ireland
🇮🇱 Israel
🇮🇲 Isle of Man
🇮🇳 India
🇮🇴 British Indian Ocean Territory
🇮🇶 Iraq
🇮🇷 Iran
🇮🇸 Iceland
🇮🇹 Italy
🇯🇪 Jersey
🇯🇲 Jamaica
🇯🇴 Jordan
🇯🇵 Japan
🇰🇪 Kenya
🇰🇬 Kyrgyzstan
🇰🇭 Cambodia
🇰🇮 Kiribati
🇰🇲 Comoros
🇰🇳 St. Kitts & Nevis
🇰🇵 North Korea
🇰🇷 South Korea
🇰🇼 Kuwait
🇰🇾 Cayman Islands
🇰🇿 Kazakhstan
🇱🇦 Laos
🇱🇧 Lebanon
🇱🇨 St. Lucia
🇱🇮 Liechtenstein
🇱🇰 Sri Lanka
🇱🇷 Liberia
🇱🇸 Lesotho
🇱🇹 Lithuania
🇱🇺 Luxembourg
🇱🇻 Latvia
🇱🇾 Libya
🇲🇦 Morocco
🇲🇨 Monaco
🇲🇩 Moldova
🇲🇪 Montenegro
🇲🇫 St. Martin
🇲🇬 Madagascar
🇲🇭 Marshall Islands
🇲🇰 North Macedonia
🇲🇱 Mali
🇲🇲 Myanmar (Burma)
🇲🇳 Mongolia
🇲🇴 Macao SAR China
🇲🇵 Northern Mariana Islands
🇲🇶 Martinique
🇲🇷 Mauritania
🇲🇸 Montserrat
🇲🇹 Malta
🇲🇺 Mauritius
🇲🇻 Maldives
🇲🇼 Malawi
🇲🇽 Mexico
🇲🇾 Malaysia
🇲🇿 Mozambique
🇳🇦 Namibia
🇳🇨 New Caledonia
🇳🇪 Niger
🇳🇫 Norfolk Island
🇳🇬 Nigeria
🇳🇮 Nicaragua
🇳🇱 Netherlands
🇳🇴 Norway
🇳🇵 Nepal
🇳🇷 Nauru
🇳🇺 Niue
🇳🇿 New Zealand
🇴🇲 Oman
🇵🇦 Panama
🇵🇪 Peru
🇵🇫 French Polynesia
🇵🇬 Papua New Guinea
🇵🇭 Philippines
🇵🇰 Pakistan
🇵🇱 Poland
🇵🇲 St. Pierre & Miquelon
🇵🇳 Pitcairn Islands
🇵🇷 Puerto Rico
🇵🇸 Palestinian Territories
🇵🇹 Portugal
🇵🇼 Palau
🇵🇾 Paraguay
🇶🇦 Qatar
🇷🇪 Réunion
🇷🇴 Romania
🇷🇸 Serbia
🇷🇺 Russia
🇷🇼 Rwanda
🇸🇦 Saudi Arabia
🇸🇧 Solomon Islands
🇸🇨 Seychelles
🇸🇩 Sudan
🇸🇪 Sweden
🇸🇬 Singapore
🇸🇭 St. Helena
🇸🇮 Slovenia
🇸🇯 Svalbard & Jan Mayen
🇸🇰 Slovakia
🇸🇱 Sierra Leone
🇸🇲 San Marino
🇸🇳 Senegal
🇸🇴 Somalia
🇸🇷 Suriname
🇸🇸 South Sudan
🇸🇹 São Tomé & Príncipe
🇸🇻 El Salvador
🇸🇽 Sint Maarten
🇸🇾 Syria
🇸🇿 Eswatini
🇹🇦 Tristan da Cunha
🇹🇨 Turks & Caicos Islands
🇹🇩 Chad
🇹🇫 French Southern Territories
🇹🇬 Togo
🇹🇭 Thailand
🇹🇯 Tajikistan
🇹🇰 Tokelau
🇹🇱 Timor-Leste
🇹🇲 Turkmenistan
🇹🇳 Tunisia
🇹🇴 Tonga
🇹🇷 Turkey
🇹🇹 Trinidad & Tobago
🇹🇻 Tuvalu
🇹🇼 Taiwan
🇹🇿 Tanzania
🇺🇦 Ukraine
🇺🇬 Uganda
🇺🇲 U.S. Outlying Islands
🇺🇳 United Nations
🇺🇸 United States
🇺🇾 Uruguay
🇺🇿 Uzbekistan
🇻🇦 Vatican City
🇻🇨 St. Vincent & Grenadines
🇻🇪 Venezuela
🇻🇬 British Virgin Islands
🇻🇮 U.S. Virgin Islands
🇻🇳 Vietnam
🇻🇺 Vanuatu
🇼🇫 Wallis & Futuna
🇼🇸 Samoa
🇽🇰 Kosovo
🇾🇪 Yemen
🇾🇹 Mayotte
🇿🇦 South Africa
🇿🇲 Zambia
🇿🇼 Zimbabwe
🏴󠁧󠁢󠁥󠁮󠁧󠁿 England
🏴󠁧󠁢󠁳󠁣󠁴󠁿 Scotland
🏴󠁧󠁢󠁷󠁬󠁳󠁿 Wales