2023-01-04 01:28:50 +00:00
|
|
|
#!/usr/bin/env fish
|
2023-01-05 16:33:27 +00:00
|
|
|
import config
|
2023-01-04 01:28:50 +00:00
|
|
|
|
|
|
|
function notify
|
2023-01-05 16:33:27 +00:00
|
|
|
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
|
2023-01-04 01:28:50 +00:00
|
|
|
set_default _flag_secs 1
|
|
|
|
|
2023-01-05 16:33:27 +00:00
|
|
|
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) \
|
2023-01-04 01:28:50 +00:00
|
|
|
-h 16
|
|
|
|
end
|