Add completions for notify-send

This commit is contained in:
kpbaks 2024-08-10 18:52:46 +02:00 committed by Fabian Boehm
parent 31896534a0
commit f07e6c6667
9 changed files with 79 additions and 0 deletions

View file

@ -102178,6 +102178,10 @@ msgstr ""
msgid "Footnotes by Docutils"
msgstr ""
#: share/functions/__fish_complete_freedesktop_icons.fish:1
msgid "List installed icon names according to `https://specifications.freedesktop.org/icon-theme-spec/0.13/`"
msgstr ""
#: share/functions/__fish_complete_ftp.fish:1
msgid "Complete ftp, pftp"
msgstr ""

View file

@ -102141,6 +102141,10 @@ msgstr ""
msgid "Footnotes by Docutils"
msgstr ""
#: share/functions/__fish_complete_freedesktop_icons.fish:1
msgid "List installed icon names according to `https://specifications.freedesktop.org/icon-theme-spec/0.13/`"
msgstr ""
#: share/functions/__fish_complete_ftp.fish:1
msgid "Complete ftp, pftp"
msgstr ""

View file

@ -103813,6 +103813,10 @@ msgstr ""
msgid "Footnotes by Docutils"
msgstr ""
#: share/functions/__fish_complete_freedesktop_icons.fish:1
msgid "List installed icon names according to `https://specifications.freedesktop.org/icon-theme-spec/0.13/`"
msgstr ""
#: share/functions/__fish_complete_ftp.fish:1
msgid "Complete ftp, pftp"
msgstr "Compléter ftp, pftp"

View file

@ -102075,6 +102075,10 @@ msgstr ""
msgid "Footnotes by Docutils"
msgstr ""
#: share/functions/__fish_complete_freedesktop_icons.fish:1
msgid "List installed icon names according to `https://specifications.freedesktop.org/icon-theme-spec/0.13/`"
msgstr ""
#: share/functions/__fish_complete_ftp.fish:1
msgid "Complete ftp, pftp"
msgstr ""

View file

@ -102132,6 +102132,10 @@ msgstr ""
msgid "Footnotes by Docutils"
msgstr ""
#: share/functions/__fish_complete_freedesktop_icons.fish:1
msgid "List installed icon names according to `https://specifications.freedesktop.org/icon-theme-spec/0.13/`"
msgstr ""
#: share/functions/__fish_complete_ftp.fish:1
msgid "Complete ftp, pftp"
msgstr ""

View file

@ -102113,6 +102113,10 @@ msgstr ""
msgid "Footnotes by Docutils"
msgstr ""
#: share/functions/__fish_complete_freedesktop_icons.fish:1
msgid "List installed icon names according to `https://specifications.freedesktop.org/icon-theme-spec/0.13/`"
msgstr ""
#: share/functions/__fish_complete_ftp.fish:1
msgid "Complete ftp, pftp"
msgstr ""

View file

@ -102064,6 +102064,10 @@ msgstr ""
msgid "Footnotes by Docutils"
msgstr ""
#: share/functions/__fish_complete_freedesktop_icons.fish:1
msgid "List installed icon names according to `https://specifications.freedesktop.org/icon-theme-spec/0.13/`"
msgstr ""
#: share/functions/__fish_complete_ftp.fish:1
msgid "Complete ftp, pftp"
msgstr ""

View file

@ -0,0 +1,23 @@
set -l c complete -c notify-send
$c -f # Disable file completion
# notify-send [OPTION…] <SUMMARY> [BODY] - create a notification
set -l urgency_levels
$c -s u -l urgency -d "urgency level" -x -a 'low normal critical'
$c -s t -l expire-time -x -d "timeout in milliseconds at which to expire the notification"
$c -s a -l app-name -x -d "app name for the icon"
$c -s i -l icon -x -d "icon filename or stock icon to display"
$c -s i -l icon -x -a "(__fish_complete_freedesktop_icons)"
$c -s c -l category -x -d "notification category"
$c -s e -l transient -d "create a transient notification"
$c -s h -l hint -x -d "extra data to pass, format: `TYPE:NAME:VALUE`, valid types: boolean, int, double, string, byte and variant"
$c -s p -l print-id -d "print the notification ID"
$c -s r -l replace-id -x -d "ID of the notification to replace"
$c -s w -l wait -d "wait for the notification to be closed before exciting"
$c -s A -l action -x -d "clickable actions to display to the user. implies --wait, can be set multiple times, example: --action=save='Save Screenshot?'"
$c -s '?' -l help -d "print help information"
$c -s v -l version -d "print program version"

View file

@ -0,0 +1,28 @@
function __fish_complete_freedesktop_icons -d 'List installed icon names according to `https://specifications.freedesktop.org/icon-theme-spec/0.13/`'
# The latest `icon-theme-spec` as of 2024-08-10 is 0.13
# https://specifications.freedesktop.org/icon-theme-spec/latest/
# https://specifications.freedesktop.org/icon-theme-spec/0.13/
# https://specifications.freedesktop.org/icon-theme-spec/0.13/#directory_layout
# 1. $HOME/.icons
# 2. $XDG_DATA_DIRS/icons
# 3. /usr/share/pixmaps
set -l dirs
test -d $HOME/.icons; and set -a dirs $HOME/.icons
if set -q XDG_DATA_DIRS
# Can be a list of directories so we append each
for d in $XDG_DATA_DIRS
test -d $d/icons; and set -a dirs $d/icons
end
end
test -d /usr/share/pixmaps; and set -a dirs /usr/share/pixmaps
for d in $dirs
# https://specifications.freedesktop.org/icon-theme-spec/0.13/#definitions
# .png, .svg and .xpm are valid icon file formats
printf '%s\n' $d/**/*.{png,svg,xpm}
end \
| path basename \
| path change-extension '' \
| command sort --unique
end