├── .github └── workflows │ └── codecheck.yml ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── polybar-scripts ├── battery-combined-shell │ ├── README.md │ └── battery-combined-shell.sh ├── battery-combined-tlp │ ├── README.md │ ├── battery-combined-tlp.sh │ └── screenshots │ │ └── 1.png ├── battery-combined-udev │ ├── 95-battery.rules │ ├── README.md │ └── battery-combined-udev.sh ├── battery-cyberpower │ ├── README.md │ └── battery-cyberpower.sh ├── dunst-snooze │ ├── README.md │ ├── dunst-snooze.sh │ └── screenshots │ │ ├── 1.png │ │ └── 2.png ├── easteregg-pornhub │ ├── README.md │ └── screenshots │ │ └── 1.png ├── inbox-imap-pythongpg │ ├── README.md │ ├── inbox-imap-python.py │ └── screenshots │ │ └── 1.png ├── inbox-imap-shellnetrc │ ├── .netrc │ ├── README.md │ └── inbox-imap-shellnetrc.sh ├── inbox-imap-shellpass │ ├── README.md │ └── inbox-imap-shellpass.sh ├── inbox-pop3-shellnetrc │ ├── .netrc │ ├── README.md │ └── inbox-pop3-shellnetrc.sh ├── info-airqualityindex │ ├── README.md │ ├── info-airqualityindex.sh │ └── screenshots │ │ └── 1.png ├── info-camera-mic │ ├── README.md │ ├── info-camera-mic.sh │ └── screenshots │ │ └── 1.png ├── info-cava │ ├── README.md │ ├── info-cava.py │ └── screenshots │ │ └── 1.png ├── info-docker │ ├── README.md │ ├── info-docker.sh │ └── screenshots │ │ └── 1.png ├── info-dualshock4 │ ├── README.md │ ├── info-dualshock4.sh │ └── screenshots │ │ └── 1.png ├── info-ethermine │ ├── README.md │ └── info-ethermine.py ├── info-eyestrain │ ├── README.md │ └── info-eyestrain.sh ├── info-gitlab-pipelines │ ├── README.md │ ├── gitlab-pipelines.sh │ └── screenshots │ │ └── 1.png ├── info-hackspeed │ ├── README.md │ ├── info-hackspeed.sh │ └── screenshots │ │ └── 1.png ├── info-healthchecks.io │ ├── README.md │ ├── info-healthchecks.io.sh │ └── screenshots │ │ └── 1.png ├── info-hexdate │ ├── README.md │ ├── info-hexdate.sh │ └── screenshots │ │ └── 1.png ├── info-hlwm-workspaces │ ├── README.md │ ├── info-hlwm-workspaces.sh │ └── screenshots │ │ └── 1.png ├── info-kernel │ └── README.md ├── info-pingrtt │ ├── README.md │ ├── info-pingrtt.sh │ └── screenshots │ │ ├── 1.png │ │ ├── 2.png │ │ └── 3.png ├── info-podman │ ├── README.md │ ├── info-podman.sh │ └── screenshots │ │ └── 1.png ├── info-projecthamster │ ├── README.md │ ├── info-projecthamster.sh │ └── screenshots │ │ └── 1.png ├── info-redshift-temp │ ├── README.md │ ├── info-redshift-temp.sh │ └── screenshots │ │ └── 1.png ├── info-softwarecounter │ ├── README.md │ ├── info-softwarecounter.py │ └── screenshots │ │ └── 1.png ├── info-ssh-sessions │ ├── README.md │ ├── info-ssh-sessions.sh │ └── screenshots │ │ └── 1.png ├── info-taskspooler │ ├── README.md │ ├── info-taskspooler.sh │ └── screenshots │ │ └── 1.png ├── info-timew │ ├── README.md │ └── info-timew.sh ├── info-timezone │ ├── README.md │ ├── info-timezone.sh │ └── screenshots │ │ └── 1.gif ├── info-tmux-sessions │ ├── README.md │ ├── info-tmux-sessions.sh │ └── screenshots │ │ ├── 1.png │ │ └── 2.png ├── info-todotxt │ ├── README.md │ ├── info-todotxt.sh │ └── screenshots │ │ └── 1.png ├── info-trash │ ├── README.md │ ├── info-trash.sh │ └── screenshots │ │ └── 1.png ├── info-usbtoserial │ ├── 95-usbtoserial.rules │ ├── README.md │ └── info-usbtoserial.sh ├── info-wakatime │ ├── README.md │ ├── info-wakatime.sh │ └── screenshots │ │ └── 1.png ├── info-wifinomadkronoplus │ ├── README.md │ ├── info-wifinomadkronoplus.sh │ └── screenshots │ │ └── 1.png ├── info-wifionice │ ├── README.md │ ├── info-wifionice.sh │ └── screenshots │ │ └── 1.png ├── info-wmname │ ├── README.md │ └── info-wmname.sh ├── info-xampp │ ├── README.md │ ├── info-xampp.sh │ └── screenshots │ │ └── 1.png ├── isrunning-claudius │ ├── README.md │ └── isrunning-claudius.sh ├── isrunning-compton │ ├── README.md │ └── isrunning-compton.sh ├── isrunning-dropbox │ ├── README.md │ └── isrunning-dropbox.sh ├── isrunning-noisetorch │ ├── README.md │ ├── isrunning-noisetorch.sh │ └── screenshots │ │ └── 1.png ├── isrunning-offlineimap │ ├── README.md │ └── isrunning-offlineimap.sh ├── isrunning-service │ ├── README.md │ └── isrunning-service.sh ├── network-huawei-modem │ ├── README.md │ ├── network-huawei-modem.py │ └── screenshots │ │ └── 1.png ├── network-ipinfo.io │ ├── README.md │ ├── network-ipinfo.io.sh │ └── screenshots │ │ └── 1.png ├── network-localip │ ├── README.md │ ├── network-localip.sh │ └── screenshots │ │ └── 1.png ├── network-networkmanager │ ├── README.md │ └── network-networkmanager.sh ├── network-openwrt-status │ ├── README.md │ ├── network-openwrt-status.py │ └── screenshots │ │ └── 1.png ├── network-publicip │ ├── README.md │ ├── network-publicip.sh │ └── screenshots │ │ └── 1.png ├── network-traffic │ ├── README.md │ └── network-traffic.sh ├── news-archlinux │ ├── README.md │ └── news-archlinux.py ├── notification-chess │ ├── README.md │ ├── notification-chess.sh │ └── screenshots │ │ └── 1.png ├── notification-github │ ├── README.md │ └── notification-github.sh ├── notification-mattermost │ ├── README.md │ └── notification-mattermost.sh ├── notification-reddit │ ├── README.md │ ├── notification-reddit.sh │ └── screenshots │ │ └── 1.png ├── notification-spacex │ ├── README.md │ ├── notification-spacex.sh │ └── screenshots │ │ └── 1.png ├── notification-xkcd │ ├── README.md │ ├── notification-xkcd.py │ └── screenshots │ │ ├── 1.png │ │ └── 2.png ├── openweathermap-detailed │ ├── README.md │ ├── openweathermap-detailed.sh │ └── screenshots │ │ └── 1.png ├── openweathermap-forecast │ ├── README.md │ └── openweathermap-forecast.sh ├── openweathermap-fullfeatured │ ├── README.md │ ├── openweathermap-fullfeatured.sh │ └── screenshots │ │ └── 1.png ├── openweathermap-simple │ ├── README.md │ ├── openweathermap-simple.sh │ └── screenshots │ │ └── 1.png ├── pipewire-microphone │ ├── README.md │ └── pipewire-microphone.sh ├── pipewire-simple │ ├── README.md │ ├── pipewire-simple.sh │ └── screenshots │ │ └── 1.png ├── player-cmus │ ├── README.md │ ├── player-cmus.sh │ └── screenshots │ │ └── 1.png ├── player-moc │ ├── README.md │ └── player-moc.sh ├── player-mpris-simple │ ├── README.md │ ├── player-mpris-simple.sh │ └── screenshots │ │ └── 1.png ├── player-mpris-tail │ ├── README.md │ ├── player-mpris-tail.py │ └── screenshots │ │ ├── 1.png │ │ └── 2.png ├── popup-calendar │ ├── README.md │ ├── popup-calendar.sh │ └── screenshots │ │ └── 1.png ├── popup-powermenu │ ├── README.md │ └── popup-powermenu.sh ├── pulseaudio-microphone │ ├── README.md │ └── pulseaudio-microphone.sh ├── pulseaudio-simple │ ├── README.md │ └── pulseaudio-simple.sh ├── pulseaudio-tail │ ├── README.md │ └── pulseaudio-tail.sh ├── system-ati-radeontop │ ├── README.md │ ├── screenshots │ │ └── 1.png │ └── system-ati-radeontop.sh ├── system-bluetooth-bluetoothctl │ ├── README.md │ ├── screenshots │ │ └── 1.png │ └── system-bluetooth-bluetoothctl.sh ├── system-cpu-frequency │ ├── README.md │ └── system-cpu-frequency.sh ├── system-cpu-loadavg │ ├── README.md │ └── system-cpu-loadavg.sh ├── system-cpu-temppercore │ ├── README.md │ ├── screenshots │ │ └── 1.png │ └── system-cpu-temppercore.sh ├── system-eprivacy │ ├── README.md │ ├── screenshots │ │ └── 1.png │ └── system-eprivacy.sh ├── system-fan-speed │ ├── README.md │ └── system-fan-speed.sh ├── system-gpu-intel │ ├── README.md │ └── system-gpu-intel.sh ├── system-gpu-optimus │ ├── README.md │ ├── screenshots │ │ └── 1.png │ └── system-gpu-optimus.sh ├── system-nvidia-bbswitch │ ├── README.md │ └── system-nvidia-bbswitch.sh ├── system-nvidia-smi │ ├── README.md │ └── system-nvidia-smi.sh ├── system-thinklight │ ├── README.md │ ├── info-thinklight.sh │ └── screenshots │ │ └── 1.png ├── system-uptime-pretty │ ├── README.md │ └── system-uptime-pretty.sh ├── system-usb-mount │ ├── README.md │ └── system-usb-mount.sh ├── system-usb-udev │ ├── 95-usb.rules │ ├── README.md │ ├── screenshots │ │ ├── 1.png │ │ └── 2.png │ └── system-usb-udev.sh ├── ticker-crypto │ ├── README.md │ ├── screenshots │ │ └── 1.png │ └── ticker-crypto.sh ├── ticker-forex │ ├── README.md │ └── ticker-forex.sh ├── updates-apt │ ├── README.md │ └── updates-apt.sh ├── updates-aurhelper │ ├── README.md │ └── updates-aurhelper.sh ├── updates-dnf │ ├── README.md │ ├── screenshots │ │ └── 1.png │ └── updates-dnf.sh ├── updates-flatpak │ ├── README.md │ └── updates-flatpak.sh ├── updates-fwupd │ ├── README.md │ └── updates-fwupdmgr.sh ├── updates-pacman-aurhelper │ ├── README.md │ ├── screenshots │ │ └── 1.png │ └── updates-pacman-aurhelper.sh ├── updates-pacman │ ├── README.md │ └── updates-pacman.sh ├── updates-xbps │ ├── README.md │ └── updates-xbps.sh ├── vpn-anyconnect-status │ ├── README.md │ ├── screenshots │ │ ├── 1.png │ │ └── 2.png │ └── vpn-anyconnect-status.sh ├── vpn-expressvpn-status │ ├── README.md │ ├── screenshots │ │ ├── 1.png │ │ └── 2.png │ └── vpn-expressvpn-status.sh ├── vpn-networkmanager-status │ ├── README.md │ ├── screenshots │ │ └── 1.png │ └── vpn-networkmanager-status.sh ├── vpn-nordvpn-status │ ├── README.md │ ├── screenshots │ │ ├── 1.png │ │ └── 2.png │ └── vpn-nordvpn-status.sh ├── vpn-openvpn-isrunning │ ├── README.md │ ├── screenshots │ │ └── 1.png │ └── vpn-openvpn-isrunning.sh ├── vpn-openvpn-status │ ├── README.md │ ├── screenshots │ │ ├── 1.png │ │ └── 2.png │ └── vpn-openvpn-status.sh ├── vpn-tun-status │ ├── README.md │ ├── screenshots │ │ ├── 1.png │ │ └── 2.png │ └── vpn-tun-status.sh └── vpn-wireguard-wg │ ├── README.md │ ├── screenshots │ ├── 1.png │ └── 2.png │ └── vpn-wireguard-wg.sh └── skeleton ├── README.md └── screenshots └── 1.png /.github/workflows/codecheck.yml: -------------------------------------------------------------------------------- 1 | name: Codecheck 2 | on: [push, pull_request] 3 | jobs: 4 | ShellCheck: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: Install ShellCheck 8 | run: | 9 | wget -O /opt/shellcheck-stable.linux.x86_64.tar.xz https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz 10 | tar xf /opt/shellcheck-stable.linux.x86_64.tar.xz -C /opt 11 | 12 | - name: Print installed ShellCheck version 13 | run: /opt/shellcheck-stable/shellcheck --version 14 | 15 | - name: Check out the repository 16 | uses: actions/checkout@v3 17 | 18 | - name: Run ShellCheck on all files 19 | run: find . '(' -name '*.sh' ')' -exec /opt/shellcheck-stable/shellcheck {} + 20 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to polybar-scripts 2 | 3 | Thank you for your interest in improving polybar-scripts. 4 | 5 | Some things that have become standard: 6 | 7 | * The [skeleton](skeleton/). This is an example of how each script is organized to create a common file structure. 8 | * Use `#` or `#1`, `#2` .. as icon replacement in your scripts. Everyone use another icon font. So let the user decide which icon he wants to use. 9 | * Use `#!/bin/sh` as shebang. We don't know which shell is installed and we don't want to add a specific shell as a dependency. 10 | * Remove your colors unless they have a special function. This way scripts remain customizable. 11 | 12 | 13 | ## Check your code 14 | 15 | Use `shellcheck` to check your shell scripts for possible errors. Otherwise, GitHub CI will do it for you. A good start to try [ShellCheck](https://www.shellcheck.net/) is their website. 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /polybar-scripts/battery-combined-shell/README.md: -------------------------------------------------------------------------------- 1 | # Script: battery-combined-shell 2 | 3 | A shell script that shows the battery status. 4 | 5 | It supports two rechargeable batteries and changing icons. It works even if only one battery is used. 6 | 7 | 8 | ## Module 9 | 10 | ```ini 11 | [module/battery-combined-shell] 12 | type = custom/script 13 | exec = ~/polybar-scripts/battery-combined-shell.sh 14 | interval = 10 15 | ``` 16 | -------------------------------------------------------------------------------- /polybar-scripts/battery-combined-shell/battery-combined-shell.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PATH_AC="/sys/class/power_supply/AC" 4 | PATH_BATTERY_0="/sys/class/power_supply/BAT0" 5 | PATH_BATTERY_1="/sys/class/power_supply/BAT1" 6 | 7 | ac=0 8 | battery_level_0=0 9 | battery_level_1=0 10 | battery_max_0=0 11 | battery_max_1=0 12 | 13 | if [ -f "$PATH_AC/online" ]; then 14 | ac=$(cat "$PATH_AC/online") 15 | fi 16 | 17 | if [ -f "$PATH_BATTERY_0/energy_now" ]; then 18 | battery_level_0=$(cat "$PATH_BATTERY_0/energy_now") 19 | fi 20 | 21 | if [ -f "$PATH_BATTERY_0/energy_full" ]; then 22 | battery_max_0=$(cat "$PATH_BATTERY_0/energy_full") 23 | fi 24 | 25 | if [ -f "$PATH_BATTERY_1/energy_now" ]; then 26 | battery_level_1=$(cat "$PATH_BATTERY_1/energy_now") 27 | fi 28 | 29 | if [ -f "$PATH_BATTERY_1/energy_full" ]; then 30 | battery_max_1=$(cat "$PATH_BATTERY_1/energy_full") 31 | fi 32 | 33 | battery_level=$(("$battery_level_0 + $battery_level_1")) 34 | battery_max=$(("$battery_max_0 + $battery_max_1")) 35 | 36 | battery_percent=$(("$battery_level * 100")) 37 | battery_percent=$(("$battery_percent / $battery_max")) 38 | 39 | if [ "$ac" -eq 1 ]; then 40 | icon="#1" 41 | 42 | if [ "$battery_percent" -gt 97 ]; then 43 | echo "$icon" 44 | else 45 | echo "$icon $battery_percent %" 46 | fi 47 | else 48 | if [ "$battery_percent" -gt 85 ]; then 49 | icon="#21" 50 | elif [ "$battery_percent" -gt 60 ]; then 51 | icon="#22" 52 | elif [ "$battery_percent" -gt 35 ]; then 53 | icon="#23" 54 | elif [ "$battery_percent" -gt 10 ]; then 55 | icon="#24" 56 | else 57 | icon="#25" 58 | fi 59 | 60 | echo "$icon $battery_percent %" 61 | fi 62 | -------------------------------------------------------------------------------- /polybar-scripts/battery-combined-tlp/README.md: -------------------------------------------------------------------------------- 1 | # Script: battery-combined-tlp 2 | 3 | A shell script that shows the battery status. 4 | 5 | It uses TLP and requires root privileges. Note that the icon doesn't change. 6 | 7 | ![battery-combined-tlp](screenshots/1.png) 8 | 9 | 10 | ## Dependencies 11 | 12 | * `tlp` 13 | 14 | 15 | ## Configuration 16 | 17 | You have to add the `tlp-stat` command to the `/etc/sudoers` NOPASSWD of your user: 18 | 19 | ```ini 20 | user ALL=(ALL) NOPASSWD: /usr/bin/tlp-stat 21 | ``` 22 | 23 | 24 | ## Module 25 | 26 | ```ini 27 | [module/battery-combined-tlp] 28 | type = custom/script 29 | exec = ~/polybar-scripts/battery-combined-tlp.sh 30 | interval = 10 31 | ``` 32 | -------------------------------------------------------------------------------- /polybar-scripts/battery-combined-tlp/battery-combined-tlp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | battery=$(sudo tlp-stat -b | tac | grep -m 1 "Charge" | tr -d -c "[:digit:],.") 4 | 5 | echo "# $battery %" 6 | -------------------------------------------------------------------------------- /polybar-scripts/battery-combined-tlp/screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybar/polybar-scripts/9722c2b65548ae314b809a2d28b4a70bea0c4d55/polybar-scripts/battery-combined-tlp/screenshots/1.png -------------------------------------------------------------------------------- /polybar-scripts/battery-combined-udev/95-battery.rules: -------------------------------------------------------------------------------- 1 | SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", \ 2 | RUN+="/home/user/.config/polybar/battery-combined-udev.sh --update" 3 | SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", \ 4 | RUN+="/home/user/.config/polybar/battery-combined-udev.sh --update" 5 | -------------------------------------------------------------------------------- /polybar-scripts/battery-combined-udev/README.md: -------------------------------------------------------------------------------- 1 | # Script: battery-combined-udev 2 | 3 | A shell script that shows the battery status. This is an extended version of [battery-combined-shell](../battery-combined-shell). 4 | 5 | It supports two rechargeable batteries and changing icons. It works even if only one battery is used. 6 | 7 | This script is able to display power supply changes in real time. For this udev is being used. 8 | 9 | 10 | ## Configuration 11 | 12 | Copy `95-battery.rules` to `/etc/udev/rules.d/95-battery.rules`. Make sure that the paths in the file have been modified properly. 13 | 14 | 15 | ## Module 16 | 17 | ```ini 18 | [module/battery-combined-udev] 19 | type = custom/script 20 | exec = ~/polybar-scripts/battery-combined-udev.sh 21 | tail = true 22 | ``` 23 | -------------------------------------------------------------------------------- /polybar-scripts/battery-combined-udev/battery-combined-udev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | battery_print() { 4 | PATH_AC="/sys/class/power_supply/AC" 5 | PATH_BATTERY_0="/sys/class/power_supply/BAT0" 6 | PATH_BATTERY_1="/sys/class/power_supply/BAT1" 7 | 8 | ac=0 9 | battery_level_0=0 10 | battery_level_1=0 11 | battery_max_0=0 12 | battery_max_1=0 13 | 14 | if [ -f "$PATH_AC/online" ]; then 15 | ac=$(cat "$PATH_AC/online") 16 | fi 17 | 18 | if [ -f "$PATH_BATTERY_0/energy_now" ]; then 19 | battery_level_0=$(cat "$PATH_BATTERY_0/energy_now") 20 | fi 21 | 22 | if [ -f "$PATH_BATTERY_0/energy_full" ]; then 23 | battery_max_0=$(cat "$PATH_BATTERY_0/energy_full") 24 | fi 25 | 26 | if [ -f "$PATH_BATTERY_1/energy_now" ]; then 27 | battery_level_1=$(cat "$PATH_BATTERY_1/energy_now") 28 | fi 29 | 30 | if [ -f "$PATH_BATTERY_1/energy_full" ]; then 31 | battery_max_1=$(cat "$PATH_BATTERY_1/energy_full") 32 | fi 33 | 34 | battery_level=$(("$battery_level_0 + $battery_level_1")) 35 | battery_max=$(("$battery_max_0 + $battery_max_1")) 36 | 37 | battery_percent=$(("$battery_level * 100")) 38 | battery_percent=$(("$battery_percent / $battery_max")) 39 | 40 | if [ "$ac" -eq 1 ]; then 41 | icon="#1" 42 | 43 | if [ "$battery_percent" -gt 97 ]; then 44 | echo "$icon" 45 | else 46 | echo "$icon $battery_percent %" 47 | fi 48 | else 49 | if [ "$battery_percent" -gt 85 ]; then 50 | icon="#21" 51 | elif [ "$battery_percent" -gt 60 ]; then 52 | icon="#22" 53 | elif [ "$battery_percent" -gt 35 ]; then 54 | icon="#23" 55 | elif [ "$battery_percent" -gt 10 ]; then 56 | icon="#24" 57 | else 58 | icon="#25" 59 | fi 60 | 61 | echo "$icon $battery_percent %" 62 | fi 63 | } 64 | 65 | path_pid="/tmp/polybar-battery-combined-udev.pid" 66 | 67 | case "$1" in 68 | --update) 69 | pid=$(cat $path_pid) 70 | 71 | if [ "$pid" != "" ]; then 72 | kill -10 "$pid" 73 | fi 74 | ;; 75 | *) 76 | echo $$ > $path_pid 77 | 78 | trap exit INT 79 | trap "echo" USR1 80 | 81 | while true; do 82 | battery_print 83 | 84 | sleep 30 & 85 | wait 86 | done 87 | ;; 88 | esac 89 | -------------------------------------------------------------------------------- /polybar-scripts/battery-cyberpower/README.md: -------------------------------------------------------------------------------- 1 | # Script: battery-cyberpower 2 | 3 | A shell script that shows the battery status for CyberPower UPS devices. 4 | 5 | This script is able to display power supply changes in real time. 6 | 7 | 8 | ## Dependencies 9 | 10 | * `pwrstat` from CyberPower's website 11 | 12 | 13 | ## Configuration 14 | 15 | You have to add the `pwrstat` command to the `/etc/sudoers` NOPASSWD of your user: 16 | 17 | ```ini 18 | user ALL=(ALL) NOPASSWD: /usr/bin/pwrstat 19 | ``` 20 | 21 | 22 | ## Module 23 | 24 | ```ini 25 | [module/battery-cyberpower] 26 | type = custom/script 27 | exec = ~/polybar-scripts/battery-cyberpower.sh 28 | tail = true 29 | ``` 30 | -------------------------------------------------------------------------------- /polybar-scripts/battery-cyberpower/battery-cyberpower.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ICON_AC="#1" 4 | ICON_BATTERY_FULL="#21" 5 | ICON_BATTERY_GOOD="#22" 6 | ICON_BATTERY_LOW="#23" 7 | ICON_BATTERY_CAUTION="#24" 8 | ICON_BATTERY_EMPTY="#25" 9 | 10 | SHOW_ESTIMATION=1 11 | 12 | battery_print() { 13 | battery_info="$(sudo pwrstat -status)" 14 | battery_capacity="$(echo "$battery_info" | awk '/Capacity/{print $3}')" 15 | battery_ac="$(echo "$battery_info" | awk '/Power Supply by/{print $4,$5}')" 16 | battery_load="$(echo "$battery_info" | grep "Load" | cut -d \( -f 2 | tr -d ' %)')" 17 | battery_remaining="$(echo "$battery_info" | awk '/Remaining Runtime/{print $3}')" 18 | 19 | output="" 20 | 21 | if [ "$battery_ac" = "Utility Power" ]; then 22 | if [ "$battery_capacity" -gt 97 ]; then 23 | output="$ICON_AC" 24 | else 25 | output="$ICON_AC $battery_capacity %" 26 | fi 27 | else 28 | if [ "$battery_capacity" -gt 85 ]; then 29 | output="$ICON_BATTERY_FULL $battery_capacity %" 30 | elif [ "$battery_capacity" -gt 60 ]; then 31 | output="$ICON_BATTERY_GOOD $battery_capacity %" 32 | elif [ "$battery_capacity" -gt 35 ]; then 33 | output="$ICON_BATTERY_LOW $battery_capacity %" 34 | elif [ "$battery_capacity" -gt 10 ]; then 35 | output="$ICON_BATTERY_CAUTION $battery_capacity %" 36 | else 37 | output="$ICON_BATTERY_EMPTY $battery_capacity %" 38 | fi 39 | fi 40 | 41 | if [ "$SHOW_ESTIMATION" -eq 1 ]; then 42 | output="$output ($battery_load % / $battery_remaining min)" 43 | fi 44 | 45 | echo "$output" 46 | } 47 | 48 | trap exit INT 49 | trap "echo" USR1 50 | 51 | while true; do 52 | battery_print "$@" 53 | 54 | sleep 30 & 55 | wait 56 | done 57 | -------------------------------------------------------------------------------- /polybar-scripts/dunst-snooze/README.md: -------------------------------------------------------------------------------- 1 | # Script: dunst-snooze 2 | 3 | A script to disable/enable Dunst notifications. When disabled, notifications will still be created and saved by dunst until you enable it again. 4 | 5 | ![dunst-pause](screenshots/1.png) 6 | ![dunst-pause](screenshots/2.png) 7 | 8 | 9 | ## Module 10 | ```ini 11 | [module/dunst-snooze] 12 | type = custom/script 13 | exec = ~/polybar-scripts/dunst-snooze.sh 14 | interval = 10 15 | click-left = ~/polybar-scripts/dunst-snooze.sh --toggle & 16 | ``` 17 | -------------------------------------------------------------------------------- /polybar-scripts/dunst-snooze/dunst-snooze.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | case "$1" in 4 | --toggle) 5 | dunstctl set-paused toggle 6 | ;; 7 | *) 8 | if [ "$(dunstctl is-paused)" = "true" ]; then 9 | echo "#1" 10 | else 11 | echo "#2" 12 | fi 13 | ;; 14 | esac 15 | -------------------------------------------------------------------------------- /polybar-scripts/dunst-snooze/screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybar/polybar-scripts/9722c2b65548ae314b809a2d28b4a70bea0c4d55/polybar-scripts/dunst-snooze/screenshots/1.png -------------------------------------------------------------------------------- /polybar-scripts/dunst-snooze/screenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybar/polybar-scripts/9722c2b65548ae314b809a2d28b4a70bea0c4d55/polybar-scripts/dunst-snooze/screenshots/2.png -------------------------------------------------------------------------------- /polybar-scripts/easteregg-pornhub/README.md: -------------------------------------------------------------------------------- 1 | # Script: easteregg-pornhub 2 | 3 | A script that shows a button and opens a random video at a large porn website. 4 | 5 | ![easteregg-pornhub](screenshots/1.png) 6 | 7 | 8 | ## Configuration 9 | 10 | Set your browser at the `click-left` option in your module. 11 | 12 | You should also enable the overline and underline option in your polybar. 13 | 14 | ```ini 15 | [bar/barname] 16 | 17 | overline-size = 5 18 | underline-size = 4 19 | ``` 20 | 21 | 22 | ## Module 23 | 24 | ```ini 25 | [module/easteregg-pornhub] 26 | type = custom/script 27 | exec = echo " hub " 28 | interval = 3600 29 | click-left = "firefox --private-window https://pornhub.com/random" & 30 | 31 | format =