Giter VIP home page Giter VIP logo

polybar-scripts's Introduction

polybar-scripts

Codecheck GitHub contributors license

This is a community project. We write and collect scripts for Polybar!

To find out how to write and use your own scripts, read Polybars wiki.

This repository is not an exact blueprint. I guess every script has to be customized to make your Polybar unique. We cannot guarantee that all scripts will work because many scripts are written for very specific purposes. But we're trying.

Your script isn't here yet? You have ideas to extend the scripts or descriptions? Send us your pull request or join us on freenode's #polybar.

Hall of Fame

Is this your first time here? You should definitely take a look at these scripts:

Setup

  • Save the script of your choice somewhere at ~/.config/polybar/.
  • Don't forget to make the script executable: chmod +x ~/.config/polybar/script.sh.
  • Copy the module settings into your configuration file.
  • Replace the appropriate icon strings in the script (e.g. replace #1 with ๐ŸŽ‰).

all colors are beautiful

updates-pacman-aurhelper system-cpu-temppercore notification-chess notification-reddit vpn-openvpn-isrunning inbox-imap-pythongpg openweathermap-fullfeatured ticker-crypto info-docker easteregg-pornhub info-airqualityindex player-mpris-simple battery-combined-tlp info-projecthamster system-usb-udev system-usb-udev openweathermap-simple info-pingrtt info-ssh-sessions openweathermap-detailed info-hackspeed info-xampp info-taskspooler network-publicip system-thinklight player-mpris-tail info-redshift-temp info-trash vpn-wireguard-wg vpn-wireguard-wg info-softwarecounter vpn-anyconnect-status dunst-snooze dunst-snooze player-cmus info-todotxt vpn-networkmanager-status info-wifinomadkronoplus info-wifionice network-localip updates-dnf system-eprivacy network-ipinfo.io system-gpu-optimus info-cava info-wakatime info-tmux-sessions info-hlwm-workspaces info-hexdate notification-spacex info-podman isrunning-noisetorch info-camera-mic info-healthchecks.io network-huawei-modem info-timezone

See also these other user repositories:

Email

Media/Spotify

Tasks/Timers

News/Feeds

Blue light filter

WM/System

Finance

VPN

Other

polybar-scripts's People

Contributors

132ikl avatar alexozer avatar avalonv avatar chenxu2048 avatar cybolic avatar dkasak avatar drumfreakk avatar druskus20 avatar falcosuessgott avatar haideralipunjabi avatar jfernandz avatar jnmcfly avatar jtambasco avatar krzys-h avatar m1dgard avatar maxdswain avatar mbugert avatar mntzrr avatar oscarablinger avatar patrick96 avatar realstickman avatar rockyprabowo avatar sad-soul-eater avatar seraphybr avatar skaiinyght avatar skoetting avatar tdfacer avatar victortrac avatar x70b1 avatar zemmsoares avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polybar-scripts's Issues

IMAP Shell + .netrc and POP3 Shell + .netrc

There are two nearly identical scripts for IMAP and POP3, one using .netrc rather than user/pass in command. What case scenario would the first one be used over the second. Unless there is some specific purpose I'm missing, it seems redundant to offer two nearly functionally identical scripts.

Idea: info-pingspeed

The user lajade posted a script on freenode/#polybar:
Maybe we can do something with it.

[module/eth]
type = custom/script
interval = 1
label = %{A1:termite --exec=ping 8.8.8.8 | sed -rn 's/.*time=([0-9]{1,}\.?[0-9]{0,}) ms.*/\1/p' & disown:}%output%%{A} %{A}
tail = true
;; Ping server and show the ping in polybar

player-mpris-tail does not correctly get artist

Using spotifyd, playerctl metadata returns something like

'xesam:album': <'Soundtracks For The Blind'>, 'xesam:title': <'Red Velvet Corridor'>, 'mpris:length': <int64 185120>, 'xesam:artists': <('Swans',)>}

Somehow it always returns xesam:artists instead of xesam:artist as the script is expecting.

I tried changing line 227 to artist = _getProperty(self._metadata, 'xesam:artists', ['']) but I'm getting TypeError: object of type 'NoneType' has no len(). I don't know where to go from here since I don't know the internals of the libraries it uses, but figured one should know.

Player-mpris-tail: no output when playing some things in vlc

If the media being played by vlc doesn't have an artist or a title (like some movies or tv shows), the only output is the 'stopped icon'.

I think it would be better if it would display the name of the file being played when the title is empty.

Question about openweather scripts

I'm just wondering why the weather icons in Symbols Nerd Font don't work, and I have to add the Weather Iconsfont declaration to my polybar config file. Are the codes different?

Thanks. And thanks for all the scripts :)

check battery-cyberpower

@Cybolic

In the beginning I just wanted to fix the shellcheck errors. But then I rewrote some lines in battery-cyberpower. Could you check if that script still works?

popup-calendar.sh position

Hi,
Awesome script by the way. I'm using i3-gap and I'm having a hard time trying to position the calendar under the bar where you clicked on. Can you give me some tips or info on how to go about setting it up? Thank you.

test info-xampp

@TetrisIQ

I updated info-xampp. Could you test it?

Why do we need the Troubleshooting section? We read the informations from the status command. Is this not availiable if we don't patch MySQL?

system-nvidia-smi

โฏ nvidia-smi --loop=1 --query-gpu=temperature.gpu,utilization.gpu,utilization.memory --format=csv,noheader,nounits                                       
41, 6, 13
41, 6, 13
41, 5, 13
41, 7, 13
41, 12, 15
41, 8, 13
41, 4, 12
41, 6, 13
41, 5, 13
[module/nvidia_info]
type = custom/script
tail = true
exec-if = nvidia-smi
exec = nvidia-smi --loop=1 --query-gpu=temperature.gpu,utilization.gpu,utilization.memory --format=csv,noheader,nounits | sed -ur 's|([[:digit:]]+)[^[:digit:]]*([[:digit:]]+)[^[:digit:]]*([[:digit:]]+)|GPU \2% \3% \1ยฐ|g'

https://pastebin.com/raw/G92EW4Vr

Add documentation on changing icons

The README currently states:

Use # or #1, #2 .. as icon replacement in your scripts. Everyone use anoter icon font. So let the user decide which icon he wants to use.

but doesn't provide information on how the user should replace these strings with their desired icons (and as far as I can tell, neither does the polybar documentation).

Adding this information would be helpful to new users.

improve player-cmus

Some work is to do here. The Script uses not the skeleton template at this moment. The reason for this is simply that it was copied from the Polybar wiki and was never touched since then.

  • use skeleton
  • rewrite if neccessary

Polybar player-mpris-tail has some issues with spotify

Hey,
It seems that your module has trouble with spotify because the dbus response is slightly different that other ones:

  • first, xesam:length is renamed by mpris:length and this is the same thing for artUrl.
  • there are netheir xesam:contentCreated, a date or xesam:genre in the dbus response.
    I've fixed the first point but not the second.

And also, do you know what is the mpris:length? because it doesn't seems to be a duration or something. This the duration in microseconds (?) my bad.

Thanks for the pretty module

Specify City ID required or switch to `?q=$CITY`

I found it unclear that the openweathermap-fullfeatured.sh and openweathermap-detailed.sh scripts need a city ID as the CITY parameter. I'd prefer to see this indicated in the README or in a comment. Alternatively, we could use q=$CITY instead of id=$CITY.

Using icon examples instead of #

I would like to discuss about using icons by default instead of #. We should look for the most used font to display icons (for example FontAwesome) and use them by default.

As they are the most used ones, most of the times the user won't even have to customize the script, which can be a bit tedious if the used icons aren't stored in a variable at the top of the script, meaning that you have to dig through it to find the command that prints the icons and change them. Looking for icons can be a bit tedious too, since some fonts have over 1500.

Maybe we could add a disclaimer saying that the icons used by default are from FontAwesome, but that they can be changed inside the script.

What do you think?

player-cmus - position some times breaks the script

#99

Some times

cmus-remote -Q 2 "$info" | grep position | awk -F\  '{print $2}'

returns something similar to

23
comment

(23 being an example duration, followed by the word comment), which breaks the script outputting the name of the file. For what I understand, it happens when the archive has a comment beginning with \n, but without a tag comment.

When there is a tag comment, the script does not break and outputs a partial result (only artist, no title).

Some other times (with the tag comment or without it), the output is the expected.

system-nvidia-bbswitch click action stopped working properly

I remember it used to work properly when I tested this a while ago. I came back wanting to add this to my config, but it no longer works.

The click action is optirun -b none nvidia-settings -c :8 and now, it opens the nvidia settings dialog. It seems to switch on the gpu as long as the dialog stays open. I tried adding -l to load the nvidia config only, but it just toggles the gpu on and off since the settings dialog exits.

This means this module is pretty useless since I can't toggle the gpu with it and I can see the gpu status on my power button anyway.

improve player-mpv

Some work is to do here. The Script uses not the skeleton template at this moment. The reason for this is simply that it was copied from the Polybar wiki and was never touched since then.

  • use skeleton
  • rewrite if neccessary

improve hint-pomodoro

Some work is to do here. The Script uses not the skeleton template at this moment. The reason for this is simply that it was copied from the Polybar wiki and was never touched since then.

  • rename to info-pomodoro
  • use skeleton
  • rewrite if neccessary

inbox-reddit

./inbox-reddit.sh: 4: ./inbox-reddit.sh: jq: not found
#2

player-mpris-tail no longer working with spotify on one machine

Both my desktop and my laptop are running Arch, and for the most part, have the same config files (i'm using dotbot.

On my desktop, the script works fine with spotify. On my laptop, if i run the script while VLC is playing something, it is able to play/pause/get metadata etc, but still nothing shows in my polybar.

I've noticed I do have a different version of the script on each machine. Here is the diff. Unfortunately I don't know Python and can only guess as to what the difference would be.

But regardless, replacing the file on my laptop with the one on my desktop still does not solve the issue. I'm stumped.

weather fullfeatured

hi , i use your script weather full, it's very good, easy to use , but i get wrong information about the next sunrise or sunset , i don't know way, weather information is good .

pulseaudio-tail speed improvement (?)

Hey, it might be my imagination and bias but I think restructuring the loop in pulseautio-tail can have noticeable effects on performance. I built it like this:

listen() {
    volume_print

    pactl subscribe | grep --line-buffered "sink" | while read -r e; do
        volume_print;
    done
}

This reduces the amount of data that is processed, at least as long as there is no non-default sink going crazy.

updates-arch-combined: a way to refresh the module

For the updates-arch-combined module, I'd like to find a way to refresh the module after it has updated. Now, after updating, the module still reads the amount of updates BEFORE it has updated, because it hasn't reloaded yet (obviously).

I'd like to find a way to force it to reload after it has completed an update. Is there a way?

change weather text font/size

How can I change the size of the text associated with each weather icon?
Ideally, I would like to use ohsnap font...

info-redshift-temp illegal number

I am trying to get this script to work but it complains of an illegal number...

[mrneilypops@void polybar-scripts]$ ./info-redshift-temp.sh
./info-redshift-temp.sh: 8: [: Illegal number: :
./info-redshift-temp.sh: 10: [: Illegal number: :
%{F#D08770} #

player-mpris-tail script not exiting along with polybar

The player-mpris-tail.py process doesn't seem to exit along with polybar. It's not that big a deal as restarting polybar is pretty rare, but it seems like something that should be fixed if possible. I tried looking into it myself, but wasn't able to make much progress.

openweathermap: Add details about which icons to use

It's said in the main README to replace icons strings by the appropriated ones, but there is no way to tell which ones are appropriate. All over the scripts (I'm guessing) placeholder icons are used but there is no instructions on what they are supposed to represent.

Anyway I really like this ๐Ÿ‘

EDIT: I have installed the required font already, I just don't know what to replace the boilerplate icons with.

improve player-qmmp

Some work is to do here. The Script uses not the skeleton template at this moment. The reason for this is simply that it was copied from the Polybar wiki and was never touched since then.

  • use skeleton
  • rewrite if neccessary

battery-combined-udev - Line 38 Division by 0 Error

Hello, I am trying to get this to work but I am having issues with the script. When I try to run it, I get the following error:

./battery-combined-udev.sh: line 38: 0 / 0: division by 0 (error token is "0")

I have changed the relevant location in line 67 as per the readme file. I have very limited knowledge in programing, so don't know where to start to troubleshoot. FYI, I have the same error with the verison batter-combined-shell.

Thanks a lot for your time!

Merge similar versions

I understand it might be tedious, has merging similar versions of scripts together been considered? For example, if all openweathermap scripts were merged into a single script (with differences in functionality toggleable with options), it would deduplicate a lot.

Help with system-usb-udev.sh script

Hello all,

I'm struggling to get this script/module to work as expected: https://github.com/x70b1/polybar-scripts/tree/master/polybar-scripts/system-usb-udev
I installed the required dependancies. I have created the udev rule, modified it for my user, copied the script to my polybar scripts folder and modified my polybar config to include the new module. At first I was getting a 'permission denied' inside polybar, but that was because I forgot to 'chmod +x' the script. Since doing that, I get nothing at all in polybar, and I can't seem to find any errors anywhere to help troubleshoot. When I run lsblk, I do see my usb in there, same thing for dmesg... but I still don't see anything in polybar. I'm sorry if this is something silly, I'm a little new to all this. Any help would be very much appreciated!

Unbuffered output needed?

System-nvidia-smi script
At first I tried your version and it literally printed $1 each iteration, like the piped awk didn't handle well quotes and doublequotes on output variables:

# $1 %
# $1 %
...

If I only kept "$1" without the labels it would work, but I still needed custom labelling, and multiple print parameters brought buffer problems (the output didn't even show up on polybar).
The only way I made this work was by emulating python -u with fflush() (not so efficient):

nvidia-smi --loop=10 --query-gpu=utilization.gpu --format=csv,noheader,nounits | awk '{ print "GPU",""$1"","%"; fflush() }'

Now I'm interested, what is wrong with my setup? Something having to do with python maybe?

[Need help] TOTP / 2 factors auth countdown

Hi,

I just dreamt of a module which show a thirty seconds countdown to easily show the validity of TOTP code for the 2 factors authentification protocol.
Who never be frustrated by finishing to enter the code while the 30 seconds just expired ? Who ??
I'm using several scripts like this, which give me the code for a website :

#!/bin/bash

key_complete=$(oathtool --base32 --totp "U4FGXWKTUHjAU42DMQH")
key_part1=$(echo $key_complete | cut -c 1-3)
key_separator="โ€ข"
key_part2=$(echo $key_complete | cut -c 4-6)
key=$key_part1$key_separator$key_part2

echo $key

For now, I have to check the clock on my bottom right corner when my TOTP codes are on the top of my screen, that is not very efficient, recognized it !
I obviously could change the clock's position (or the codes position!!) but it is not so fun...

On my dream, I saw a graphical radar counter, but a 2-digits countdown could be very very usefull !
Didn't it ?

Do you thing a module like this could be usefull on 2019 ?
Is it the right place to post my help request ?
Someone here is OK to help me to realize my dream ?

improve hint-trash

Some work is to do here. The Script uses not the skeleton template at this moment. The reason for this is simply that it was copied from the Polybar wiki and was never touched since then.

  • rename to info-trash
  • use skeleton
  • rewrite if neccessary

improve player-moc

Some work is to do here. The Script uses not the skeleton template at this moment. The reason for this is simply that it was copied from the Polybar wiki and was never touched since then.

  • use skeleton
  • rewrite if neccessary

player-mpris-tail no output

Hey, when trying to use player-mpris-tail I simply get no output in my bar. Playerctl itself correctly shows my players and the current status, but even running the script manually does nothing. I am on arch linux with python up to date.

Merging the openweathermap-* modules into a single configurable module

I just made some improvements to the openweathermap-* modules and it was more tedious than necessary because they are four separate modules. As it is now, the modules share most of the functionality, with the primary difference being in what gets output in the end.

Perhaps it would make sense to merge all of these into a single module and add one or two additional configuration variables so they can share the code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.