power menu, redshift, polybar
This commit is contained in:
28
.config/polybar/scripts/info-taskspooler/README.md
Normal file
28
.config/polybar/scripts/info-taskspooler/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# Script: info-taskspooler
|
||||
|
||||
A small script that displays the number of queues/runtimes for one or more task spooler servers.
|
||||
|
||||

|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
* `task-spooler`
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
By default the script will output the count of the default task-spooler server.
|
||||
|
||||
Arguments can be passed to show custom task-spooler servers by using the `TS_SOCKET variable`. These custom servers will need to use a socket filename format like /tmp/ts-socket.SOCK_NAME or the script will be unable to find the server. Arguments are passed as `name,sock_name` with sock_name being optional, e.g. `default yt,youtube p,podcast`.
|
||||
|
||||
|
||||
## Module
|
||||
|
||||
```ini
|
||||
[module/info-taskspooler]
|
||||
type = custom/script
|
||||
exec = ~/polybar-scripts/info-task-spooler/info-taskspooler.sh
|
||||
# exec = ~/polybar-scripts/info-taskspooler/info-taskspooler.sh default yt,youtube p,podcast
|
||||
interval = 5
|
||||
```
|
||||
27
.config/polybar/scripts/info-taskspooler/info-taskspooler.sh
Normal file
27
.config/polybar/scripts/info-taskspooler/info-taskspooler.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
# USAGE:
|
||||
# No arguments: prints the job running/queued job count of the default tsp server
|
||||
# Arguments: name,sock_name - one or more arguments, e.g. tsp yt,youtube p,podcasts
|
||||
# sock_name is optional, will default to default tsp socket
|
||||
# custom socket names will be generated as /tmp/ts-socket.SOCK_NAME, your TS_SOCKET will need to match
|
||||
|
||||
get_tsp_count() {
|
||||
sock=/tmp/socket-ts.${1:-$(id -u)}
|
||||
|
||||
tsp_count=$(TS_SOCKET=$sock tsp|grep -E -c 'running|queued')
|
||||
echo "${tsp_count:-0}"
|
||||
}
|
||||
|
||||
# without argument, just show count of default socket
|
||||
if [ $# -lt 1 ]; then
|
||||
get_tsp_count
|
||||
else
|
||||
for t in "$@"; do
|
||||
IFS=, read -r name sock_name <<- EOF
|
||||
${t}
|
||||
EOF
|
||||
|
||||
echo "${name} $(get_tsp_count "${sock_name}")"
|
||||
done|sed 'N;s/\n/ /'
|
||||
fi
|
||||
BIN
.config/polybar/scripts/info-taskspooler/screenshots/1.png
Normal file
BIN
.config/polybar/scripts/info-taskspooler/screenshots/1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
Reference in New Issue
Block a user