diff --git a/.config/aerc/binds.conf b/.config/aerc/binds.conf index 25a5ce1..7f261c1 100644 --- a/.config/aerc/binds.conf +++ b/.config/aerc/binds.conf @@ -11,7 +11,7 @@ = :prompt 'Quit?' quit [messages] -q = quit +q = :quit j = :next = :next diff --git a/.config/lf/lfrc b/.config/lf/lfrc new file mode 100644 index 0000000..98c6d15 --- /dev/null +++ b/.config/lf/lfrc @@ -0,0 +1 @@ +map D delete diff --git a/.config/nvim/lua/pack-lspconfig.lua b/.config/nvim/lua/pack-lspconfig.lua index 83ac35a..4d3dd1f 100644 --- a/.config/nvim/lua/pack-lspconfig.lua +++ b/.config/nvim/lua/pack-lspconfig.lua @@ -1,6 +1,7 @@ local lspconfig = require"lspconfig" local servers = { + "bashls", "pyright", } diff --git a/.config/nvim/pack/plugins/opt/telescope b/.config/nvim/pack/plugins/opt/telescope index 7472420..e9e01d6 160000 --- a/.config/nvim/pack/plugins/opt/telescope +++ b/.config/nvim/pack/plugins/opt/telescope @@ -1 +1 @@ -Subproject commit 7472420f8734c710bd7009081cef9b97f08a3821 +Subproject commit e9e01d699843af530ef4ad2c8679a7e273bb3dd1 diff --git a/.config/nvim/pack/plugins/opt/treesitter b/.config/nvim/pack/plugins/opt/treesitter index 8d3176c..bb3dd60 160000 --- a/.config/nvim/pack/plugins/opt/treesitter +++ b/.config/nvim/pack/plugins/opt/treesitter @@ -1 +1 @@ -Subproject commit 8d3176cfbc0e3c5b8eadf4dfc20681878529c3af +Subproject commit bb3dd60ebcf6f75f73f39c44724b4a426ece6b7b diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/.gitignore b/.config/suckless/dmenu-5.3/.gitignore similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/.gitignore rename to .config/suckless/dmenu-5.3/.gitignore diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/LICENSE b/.config/suckless/dmenu-5.3/LICENSE similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/LICENSE rename to .config/suckless/dmenu-5.3/LICENSE diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/Makefile b/.config/suckless/dmenu-5.3/Makefile similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/Makefile rename to .config/suckless/dmenu-5.3/Makefile diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/README b/.config/suckless/dmenu-5.3/README similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/README rename to .config/suckless/dmenu-5.3/README diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/arg.h b/.config/suckless/dmenu-5.3/arg.h similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/arg.h rename to .config/suckless/dmenu-5.3/arg.h diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/config.def.h b/.config/suckless/dmenu-5.3/config.def.h similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/config.def.h rename to .config/suckless/dmenu-5.3/config.def.h diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/config.h b/.config/suckless/dmenu-5.3/config.h similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/config.h rename to .config/suckless/dmenu-5.3/config.h diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/config.mk b/.config/suckless/dmenu-5.3/config.mk similarity index 98% rename from .config/suckless/dmenu-5.2-8-g8df553e/config.mk rename to .config/suckless/dmenu-5.3/config.mk index 566348b..137f7c8 100644 --- a/.config/suckless/dmenu-5.2-8-g8df553e/config.mk +++ b/.config/suckless/dmenu-5.3/config.mk @@ -1,5 +1,5 @@ # dmenu version -VERSION = 5.2 +VERSION = 5.3 # paths PREFIX = /usr/local diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/dmenu.1 b/.config/suckless/dmenu-5.3/dmenu.1 similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/dmenu.1 rename to .config/suckless/dmenu-5.3/dmenu.1 diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/dmenu.c b/.config/suckless/dmenu-5.3/dmenu.c similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/dmenu.c rename to .config/suckless/dmenu-5.3/dmenu.c diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/dmenu_path b/.config/suckless/dmenu-5.3/dmenu_path similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/dmenu_path rename to .config/suckless/dmenu-5.3/dmenu_path diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/dmenu_run b/.config/suckless/dmenu-5.3/dmenu_run similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/dmenu_run rename to .config/suckless/dmenu-5.3/dmenu_run diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/drw.c b/.config/suckless/dmenu-5.3/drw.c similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/drw.c rename to .config/suckless/dmenu-5.3/drw.c diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/drw.h b/.config/suckless/dmenu-5.3/drw.h similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/drw.h rename to .config/suckless/dmenu-5.3/drw.h diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/stest.1 b/.config/suckless/dmenu-5.3/stest.1 similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/stest.1 rename to .config/suckless/dmenu-5.3/stest.1 diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/stest.c b/.config/suckless/dmenu-5.3/stest.c similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/stest.c rename to .config/suckless/dmenu-5.3/stest.c diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/util.c b/.config/suckless/dmenu-5.3/util.c similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/util.c rename to .config/suckless/dmenu-5.3/util.c diff --git a/.config/suckless/dmenu-5.2-8-g8df553e/util.h b/.config/suckless/dmenu-5.3/util.h similarity index 100% rename from .config/suckless/dmenu-5.2-8-g8df553e/util.h rename to .config/suckless/dmenu-5.3/util.h diff --git a/.config/suckless/dwm-6.4-6-g9f88553/.gitignore b/.config/suckless/dwm-6.5/.gitignore similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/.gitignore rename to .config/suckless/dwm-6.5/.gitignore diff --git a/.config/suckless/dwm-6.4-6-g9f88553/LICENSE b/.config/suckless/dwm-6.5/LICENSE similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/LICENSE rename to .config/suckless/dwm-6.5/LICENSE diff --git a/.config/suckless/dwm-6.4-6-g9f88553/Makefile b/.config/suckless/dwm-6.5/Makefile similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/Makefile rename to .config/suckless/dwm-6.5/Makefile diff --git a/.config/suckless/dwm-6.4-6-g9f88553/README b/.config/suckless/dwm-6.5/README similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/README rename to .config/suckless/dwm-6.5/README diff --git a/.config/suckless/dwm-6.4-6-g9f88553/config.def.h b/.config/suckless/dwm-6.5/config.def.h similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/config.def.h rename to .config/suckless/dwm-6.5/config.def.h diff --git a/.config/suckless/dwm-6.4-6-g9f88553/config.h b/.config/suckless/dwm-6.5/config.h similarity index 98% rename from .config/suckless/dwm-6.4-6-g9f88553/config.h rename to .config/suckless/dwm-6.5/config.h index 4f589fe..916d0f2 100644 --- a/.config/suckless/dwm-6.4-6-g9f88553/config.h +++ b/.config/suckless/dwm-6.5/config.h @@ -55,7 +55,7 @@ static const Layout layouts[] = { /* commands */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; +static const char *dmenucmd[] = { "dmenu_run", "-i", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; static const char *termcmd[] = { "alacritty", NULL }; static const char *lockcmd[] = { "lock", NULL }; static const char *wwwcmd[] = { "firefox", NULL }; diff --git a/.config/suckless/dwm-6.4-6-g9f88553/config.mk b/.config/suckless/dwm-6.5/config.mk similarity index 98% rename from .config/suckless/dwm-6.4-6-g9f88553/config.mk rename to .config/suckless/dwm-6.5/config.mk index ba64d3d..8efca9a 100644 --- a/.config/suckless/dwm-6.4-6-g9f88553/config.mk +++ b/.config/suckless/dwm-6.5/config.mk @@ -1,5 +1,5 @@ # dwm version -VERSION = 6.4 +VERSION = 6.5 # Customize below to fit your system diff --git a/.config/suckless/dwm-6.4-6-g9f88553/drw.c b/.config/suckless/dwm-6.5/drw.c similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/drw.c rename to .config/suckless/dwm-6.5/drw.c diff --git a/.config/suckless/dwm-6.4-6-g9f88553/drw.h b/.config/suckless/dwm-6.5/drw.h similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/drw.h rename to .config/suckless/dwm-6.5/drw.h diff --git a/.config/suckless/dwm-6.4-6-g9f88553/dwm.1 b/.config/suckless/dwm-6.5/dwm.1 similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/dwm.1 rename to .config/suckless/dwm-6.5/dwm.1 diff --git a/.config/suckless/dwm-6.4-6-g9f88553/dwm.c b/.config/suckless/dwm-6.5/dwm.c similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/dwm.c rename to .config/suckless/dwm-6.5/dwm.c diff --git a/.config/suckless/dwm-6.4-6-g9f88553/dwm.png b/.config/suckless/dwm-6.5/dwm.png similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/dwm.png rename to .config/suckless/dwm-6.5/dwm.png diff --git a/.config/suckless/dwm-6.4-6-g9f88553/patches/allmonbar.diff b/.config/suckless/dwm-6.5/patches/allmonbar.diff similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/patches/allmonbar.diff rename to .config/suckless/dwm-6.5/patches/allmonbar.diff diff --git a/.config/suckless/dwm-6.4-6-g9f88553/patches/fullscreen.diff b/.config/suckless/dwm-6.5/patches/fullscreen.diff similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/patches/fullscreen.diff rename to .config/suckless/dwm-6.5/patches/fullscreen.diff diff --git a/.config/suckless/dwm-6.4-6-g9f88553/patches/ltsymbol.diff b/.config/suckless/dwm-6.5/patches/ltsymbol.diff similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/patches/ltsymbol.diff rename to .config/suckless/dwm-6.5/patches/ltsymbol.diff diff --git a/.config/suckless/dwm-6.4-6-g9f88553/patches/restorefloat.diff b/.config/suckless/dwm-6.5/patches/restorefloat.diff similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/patches/restorefloat.diff rename to .config/suckless/dwm-6.5/patches/restorefloat.diff diff --git a/.config/suckless/dwm-6.4-6-g9f88553/patches/transparentborder.diff b/.config/suckless/dwm-6.5/patches/transparentborder.diff similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/patches/transparentborder.diff rename to .config/suckless/dwm-6.5/patches/transparentborder.diff diff --git a/.config/suckless/dwm-6.4-6-g9f88553/patches/warpcursor.diff b/.config/suckless/dwm-6.5/patches/warpcursor.diff similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/patches/warpcursor.diff rename to .config/suckless/dwm-6.5/patches/warpcursor.diff diff --git a/.config/suckless/dwm-6.4-6-g9f88553/transient.c b/.config/suckless/dwm-6.5/transient.c similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/transient.c rename to .config/suckless/dwm-6.5/transient.c diff --git a/.config/suckless/dwm-6.4-6-g9f88553/util.c b/.config/suckless/dwm-6.5/util.c similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/util.c rename to .config/suckless/dwm-6.5/util.c diff --git a/.config/suckless/dwm-6.4-6-g9f88553/util.h b/.config/suckless/dwm-6.5/util.h similarity index 100% rename from .config/suckless/dwm-6.4-6-g9f88553/util.h rename to .config/suckless/dwm-6.5/util.h diff --git a/.config/zsh/powerlevel10k b/.config/zsh/powerlevel10k index d39e426..6836bfe 160000 --- a/.config/zsh/powerlevel10k +++ b/.config/zsh/powerlevel10k @@ -1 +1 @@ -Subproject commit d39e4268355f7a10f7758982db2a59e485d2659a +Subproject commit 6836bfe2da51bf32472b67df062347cfc4b1952e diff --git a/.config/zsh/prompt.zsh b/.config/zsh/prompt.zsh new file mode 100644 index 0000000..93567b6 --- /dev/null +++ b/.config/zsh/prompt.zsh @@ -0,0 +1,47 @@ +# LEFT +# dir vcs command_execution_time status +# RIGHT +# background_jobs virtualenv kubecontext + +autoload -Uz vcs_info + +zstyle ':vcs_info:*' enable git +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:git*' formats '%b (%a) %m%u%c' + +function preexec() { + _timer_start="$SECONDS" +} + +function _get_time() { + local d="$((SECONDS - _timer_start))" + local text + + text="$((d % 60))s" + if [ "$d" -gt 60 ]; then + text="$((d % 60))m$text" + (( d /= 60 )) + fi + if [ "$d" -gt 60 ]; then + text="${d}h$text" + fi + echo "$text" +} + +function precmd() { + local err + + IFS='|' err="${pipestatus[*]}" + timer="$((SECONDS - _timer_start))" + + vcs_info + + PROMPT='%~ ' + [ -n "$vcs_info_msg_0_" ] && PROMPT="$PROMPT$vcs_info_msg_0_ " + [ "$timer" -ge 2 ] && PROMPT="$PROMPT$(_get_time) " + [ "$err" != 0 ] && PROMPT="$PROMPT$err " + + RPROMPT='%(1j.%j.)' + false && RPROMPT="$RPROMPT virtualenv" + false && RPROMPT="$RPROMPT kubecontext" +} diff --git a/.var/app/org.mozilla.firefox/.mozilla/firefox/ange/chrome/userChrome.css b/.var/app/org.mozilla.firefox/.mozilla/firefox/ange/chrome/userChrome.css new file mode 100644 index 0000000..3027253 --- /dev/null +++ b/.var/app/org.mozilla.firefox/.mozilla/firefox/ange/chrome/userChrome.css @@ -0,0 +1,4 @@ +#unified-extensions-button, #unified-extensions-button > .toolbarbutton-icon{ + width: 0px !important; + padding: 0px !important; +} diff --git a/.var/app/org.mozilla.firefox/.mozilla/firefox/ange/user.js b/.var/app/org.mozilla.firefox/.mozilla/firefox/ange/user.js new file mode 100644 index 0000000..6a2a663 --- /dev/null +++ b/.var/app/org.mozilla.firefox/.mozilla/firefox/ange/user.js @@ -0,0 +1,40 @@ +user_pref("app.shield.optoutstudies.enabled", false); +user_pref("browser.aboutConfig.showWarning", false); +user_pref("browser.contentblocking.category", "strict"); +user_pref("browser.download.useDownloadDir", false); +user_pref("browser.formfill.enable", false); +user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false); +user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false); +user_pref("browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.searchEngines", ""); +user_pref("browser.newtabpage.enabled", false); +user_pref("browser.preferences.moreFromMozilla", false); +user_pref("browser.privatebrowsing.vpnpromourl", ""); +user_pref("browser.startup.homepage", "chrome://browser/content/blanktab.html"); +user_pref("browser.tabs.tabmanager.enabled", false); +user_pref("browser.topsites.contile.cachedTiles", ""); +user_pref("browser.urlbar.update2.engineAliasRefresh", true); +user_pref("datareporting.healthreport.uploadEnabled", false); +user_pref("datareporting.policy.dataSubmissionEnabled", false); +user_pref("dom.security.https_only_mode", true); +user_pref("extensions.formautofill.addresses.enabled", false); +user_pref("extensions.formautofill.creditCards.enabled", false); +user_pref("extensions.pocket.enabled", false); +user_pref("findbar.highlightAll", true); +user_pref("identity.fxaccounts.enabled", false); +user_pref("media.videocontrols.picture-in-picture.video-toggle.enabled", false); +user_pref("network.proxy.socks_remote_dns", true); +user_pref("signon.rememberSignons", false); +user_pref("startup.homepage_override_url", ""); +user_pref("startup.homepage_welcome_url", ""); +user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); +user_pref("toolkit.telemetry.archive.enabled", false); +user_pref("toolkit.telemetry.pioneer-new-studies-available", false); + +// user preferences +user_pref("browser.startup.page", 3); +user_pref("browser.tabs.inTitlebar", 0); +user_pref("browser.toolbars.bookmarks.visibility", "newtab"); +user_pref("browser.translations.enable", false); +user_pref("browser.uiCustomization.state", "{\"placements\":{\"widget-overflow-fixed-list\":[],\"unified-extensions-area\":[],\"nav-bar\":[\"back-button\",\"forward-button\",\"stop-reload-button\",\"urlbar-container\",\"downloads-button\",\"fxa-toolbar-menu-button\",\"unified-extensions-button\",\"ublock0_raymondhill_net-browser-action\"],\"toolbar-menubar\":[\"menubar-items\"],\"TabsToolbar\":[\"tabbrowser-tabs\",\"alltabs-button\"],\"PersonalToolbar\":[\"personal-bookmarks\"]},\"currentVersion\":20,\"newElementCount\":3}"); +user_pref("browser.zoom.siteSpecific", false); +user_pref("media.autoplay.default", 5); diff --git a/.var/app/org.mozilla.firefox/.mozilla/firefox/profiles.ini b/.var/app/org.mozilla.firefox/.mozilla/firefox/profiles.ini new file mode 100644 index 0000000..d8e0051 --- /dev/null +++ b/.var/app/org.mozilla.firefox/.mozilla/firefox/profiles.ini @@ -0,0 +1,11 @@ +[General] +Version=2 + +[InstallCF146F38BCAB2D21] +Default=ange +Locked=1 + +[Profile0] +Name=ange +IsRelative=1 +Path=ange diff --git a/.xinitrc b/.xinitrc index b5ace80..3abba57 100644 --- a/.xinitrc +++ b/.xinitrc @@ -4,7 +4,7 @@ dbus-update-activation-environment --systemd DISPLAY XAUTHORITY # startup autorandr -c & -xss-lock -n feh --fullscreen "$XDG_CONFIG_HOME/wallpapers/lock.png" -- lock & +xss-lock -n "feh --fullscreen '$XDG_CONFIG_HOME/wallpapers/lock.png'" -- lock & /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 || # arch /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 || # debian /usr/libexec/polkit-gnome-authentication-agent-1 & # fedora diff --git a/bin/crypto b/bin/crypto index ba3f1a3..39d6ece 100755 --- a/bin/crypto +++ b/bin/crypto @@ -6,6 +6,7 @@ import json # curl -sS https://api.coingecko.com/api/v3/coins/list COINS = [ # [id, symbol] + ["monero", "XMR"], ["bitcoin", "BTC"], ["ordinals", "ORDI"], ] diff --git a/bin/sbar b/bin/sbar index fb09a4c..e9cb1a4 100755 --- a/bin/sbar +++ b/bin/sbar @@ -1,8 +1,9 @@ #!/bin/bash -# MODULES function update_crypto() { - local c; c="$(crypto)" && crypto="$c" + local c + + c="$(crypto 2> /dev/null)" && crypto="$c" } function update_cpu() { @@ -10,13 +11,14 @@ function update_cpu() { } function update_memory() { - memory=" $(free -h | awk '$1 == "Mem:" {print $3}')" + memory=" $(free -h | awk '/^Mem:/ {print $3}')" } function update_bat() { - local dir; dir="$(find /sys/class/power_supply/ -mindepth 1 -name 'BAT*' -print -quit)" - local cap; cap="$(cat "$dir/capacity")" + local dir cap + dir='/sys/class/power_supply/BAT0' + cap="$(cat "$dir/capacity")" { grep -qv Discharging "$dir/status" && bat=" $cap%"; } || { [ "$cap" -gt 80 ] && bat=" $cap%"; } || { [ "$cap" -gt 60 ] && bat=" $cap%"; } || @@ -26,39 +28,39 @@ function update_bat() { } function update_sink_vol() { - local sink; sink="$(wpctl get-volume '@DEFAULT_AUDIO_SINK@')" - local vol; + local sink vol - if grep -q 'MUTED' <<< "$sink"; then + sink="$(wpctl get-volume '@DEFAULT_AUDIO_SINK@')" + if grep -q MUTED <<< "$sink"; then sink_vol='🔇' - else - vol="$(awk '{print int($2 * 100)}' <<< "$sink")" - { [ "$vol" -gt 67 ] && sink_vol=" $vol"; } || - { [ "$vol" -gt 33 ] && sink_vol=" $vol"; } || - { sink_vol=" $vol"; } + return fi + vol="$(awk '{print int($2 * 100)}' <<< "$sink")" + { [ "$vol" -gt 67 ] && sink_vol=" $vol"; } || + { [ "$vol" -gt 33 ] && sink_vol=" $vol"; } || + { sink_vol=" $vol"; } } function update_source_vol() { - local source; source="$(wpctl get-volume '@DEFAULT_AUDIO_SOURCE@')" - local vol; + local source vol - if grep -q 'MUTED' <<< "$source"; then - source_vol="" - else - vol="$(awk '{print int($2 * 100)}' <<< "$sink")" - source_vol=" $(awk '{print int($2 * 100)}' <<< "$source")" + source="$(wpctl get-volume '@DEFAULT_AUDIO_SOURCE@')" + if grep -q MUTED <<< "$source"; then + source_vol='' + return fi + source_vol=" $(awk '{print int($2 * 100)}' <<< "$source")" } function update_wlp() { - local sig; sig="$(awk '$1 ~ "wlp" {print int($3)}' /proc/net/wireless)" - local ssid; ssid="$(nmcli device wifi show-password | sed -n 's/SSID:\s*//p')" + local sig ssid - [ -z "$ssid" ] && wlp='⚠' && return - [ -z "$sig" ] && sig=0 - - # https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/d9b06a95/src/libnmc-base/nm-client-utils.c#L628 + sig="$(awk '/^wlp/ {print int($3)}' /proc/net/wireless)" + if [ -z "$sig" ]; then + wlp='⚠' + return + fi + ssid="$(nmcli device wifi show-password | sed -n 's/^SSID:\s*//p')" { [ "$sig" -gt 56 ] && wlp="▂▄▆█ $ssid"; } || { [ "$sig" -gt 38 ] && wlp="▂▄▆_ $ssid"; } || { [ "$sig" -gt 21 ] && wlp="▂▄__ $ssid"; } || @@ -67,7 +69,7 @@ function update_wlp() { } function update_time() { - time="$(date "+%a %m/%d %R")" + time="$(date "+%a %m-%d %R")" } function display() { @@ -81,8 +83,8 @@ else fi # SIGNALING -# trap ';display' 'RTMIN+n' -trap 'update_sink_vol;display' 'RTMIN' +# trap ';display' 'RTMIN+n' +trap 'update_sink_vol;display' 'RTMIN' # to update it from external commands ## kill -m "$(cat ~/.cache/pidofbar)" # where m = 34 + n @@ -102,7 +104,6 @@ while true; do update_time display } - sleep "$(awk "BEGIN {s=$(date '+%S.%N'); print 10 - s % 10}")" & wait sec="$((sec + 10))" done