Last active
February 26, 2024 11:24
-
-
Save thingsiplay/eaafca24f43ec1cf98fa72d9015f71cf to your computer and use it in GitHub Desktop.
qforceupdate - update a widget on your bar through shell command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
# Usage: | |
# qforceupdate | |
# qforceupdate checkupdates | |
if [ "${#}" == 0 ] | |
then | |
# requires ln -s ~/.cache/qtile/qtilesocket.\:0 ~/.cache/qtile/qtilesocket.\:0.0 | |
qtile cmd-obj -o cmd -f list_widgets \ | |
| sed "s/^\[//" \ | |
| sed "s/\]$//" \ | |
| sed "s/^ *'//" \ | |
| sed "s/',*$//" | |
else | |
for widget_name in "${@}" | |
do | |
qtile cmd-obj -o widget "${widget_name}" -f force_update | |
done | |
fi |
Hi @poslat-pismo , good to see alternatives! Unfortunately I stopped using Qtile (shame on me, but plan on returning) and cannot test your commands at the moment. Your first command which simplifies it into a single sed makes sense. The second script is probably useful to test right away if a certain widget name is the correct one, before using the widget name in an automation script.
But its too specific for my taste. The listing command was added for exactly that, to be able to make menu scripts if someone wants to. I would probably use the widget listing command and combine it with a fuzzy finder, something like qforceupdate "$(qforceupdate | fzf)"
(untested command!).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add some interaction