diff options
author | lonkaars <loek@pipeframe.xyz> | 2024-03-12 19:44:04 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2024-03-12 19:44:04 +0100 |
commit | a1bae69d54bfebbdb99c4beb644ebc755a75da24 (patch) | |
tree | 48507d6e3c092ce018e8e1b39887c38d2b296052 /plugins/polybar | |
parent | 8b0ecac59c4fa1d87167f4c1358c2662be3a63aa (diff) |
Diffstat (limited to 'plugins/polybar')
-rwxr-xr-x | plugins/polybar | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/plugins/polybar b/plugins/polybar new file mode 100755 index 0000000..430b814 --- /dev/null +++ b/plugins/polybar @@ -0,0 +1,43 @@ +#!/bin/sh +[ "$1" = "info" ] && echo "plugin for script module in polybar" && exit 2 + +. "$core_path/lib" + +usage() { + cat << EOF +usage: + $subcmd [options] + +options: + -h, --help display this help text + +this plugin is intended to be used in combination with polybar. add the +following to your config.ini file to use this plugin: + + [module/$progname] + type = custom/script + exec = $subcmd + tail = true + click-left = $progname toggle + click-middle = $progname reset +EOF +} + +while [ $# -gt 0 ] ; do + case "$1" in + -h|--help) usage && exit 0 ;; + --) shift ; break ;; + *) err "unknown parameter: $1" ;; + esac +done + +# launch notify daemon if it is not already active +("$prog" notify 1> /dev/null 2> /dev/null &) +sleep 0.1 # warm up a little + +"$prog" display +while inotifywait -qq -e attrib "$XDG_RUNTIME_DIR/$progname/notify" ; do + unset remaining lap time running + "$prog" display +done + |