29 lines
1.0 KiB
Fish
Executable File
29 lines
1.0 KiB
Fish
Executable File
#!/usr/bin/env fish
|
|
import config
|
|
|
|
function notify
|
|
argparse -i 'fg=' \
|
|
'bg=' \
|
|
'f/font=' \
|
|
'p/padding=' \
|
|
'secs=!_validate_int --min 1' \
|
|
-- $argv
|
|
set_default _flag_fg (get_config NotifyTextColor)
|
|
set_default _flag_bg (get_config NotifyBgColor)
|
|
set_default _flag_font (get_config Font)
|
|
set_default _flag_padding 30
|
|
set_default _flag_secs 1
|
|
|
|
log "using font '$_flag_font'"
|
|
set -f text_width (textwidth "$_flag_font" "$argv")
|
|
|
|
echo "$argv" | \
|
|
dzen2 \
|
|
-p $_flag_secs \
|
|
-fg $_flag_fg \
|
|
-bg $_flag_bg \
|
|
-fn $_flag_font \
|
|
-ta 'c' \
|
|
-w (math $text_width + $_flag_padding) \
|
|
-h 16
|
|
end |