mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Add completions for notify-send
This commit is contained in:
parent
31896534a0
commit
f07e6c6667
9 changed files with 79 additions and 0 deletions
4
po/de.po
4
po/de.po
|
@ -102178,6 +102178,10 @@ msgstr ""
|
||||||
msgid "Footnotes by Docutils"
|
msgid "Footnotes by Docutils"
|
||||||
msgstr ""
|
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
|
#: share/functions/__fish_complete_ftp.fish:1
|
||||||
msgid "Complete ftp, pftp"
|
msgid "Complete ftp, pftp"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
4
po/en.po
4
po/en.po
|
@ -102141,6 +102141,10 @@ msgstr ""
|
||||||
msgid "Footnotes by Docutils"
|
msgid "Footnotes by Docutils"
|
||||||
msgstr ""
|
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
|
#: share/functions/__fish_complete_ftp.fish:1
|
||||||
msgid "Complete ftp, pftp"
|
msgid "Complete ftp, pftp"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
4
po/fr.po
4
po/fr.po
|
@ -103813,6 +103813,10 @@ msgstr ""
|
||||||
msgid "Footnotes by Docutils"
|
msgid "Footnotes by Docutils"
|
||||||
msgstr ""
|
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
|
#: share/functions/__fish_complete_ftp.fish:1
|
||||||
msgid "Complete ftp, pftp"
|
msgid "Complete ftp, pftp"
|
||||||
msgstr "Compléter ftp, pftp"
|
msgstr "Compléter ftp, pftp"
|
||||||
|
|
4
po/pl.po
4
po/pl.po
|
@ -102075,6 +102075,10 @@ msgstr ""
|
||||||
msgid "Footnotes by Docutils"
|
msgid "Footnotes by Docutils"
|
||||||
msgstr ""
|
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
|
#: share/functions/__fish_complete_ftp.fish:1
|
||||||
msgid "Complete ftp, pftp"
|
msgid "Complete ftp, pftp"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -102132,6 +102132,10 @@ msgstr ""
|
||||||
msgid "Footnotes by Docutils"
|
msgid "Footnotes by Docutils"
|
||||||
msgstr ""
|
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
|
#: share/functions/__fish_complete_ftp.fish:1
|
||||||
msgid "Complete ftp, pftp"
|
msgid "Complete ftp, pftp"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
4
po/sv.po
4
po/sv.po
|
@ -102113,6 +102113,10 @@ msgstr ""
|
||||||
msgid "Footnotes by Docutils"
|
msgid "Footnotes by Docutils"
|
||||||
msgstr ""
|
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
|
#: share/functions/__fish_complete_ftp.fish:1
|
||||||
msgid "Complete ftp, pftp"
|
msgid "Complete ftp, pftp"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -102064,6 +102064,10 @@ msgstr ""
|
||||||
msgid "Footnotes by Docutils"
|
msgid "Footnotes by Docutils"
|
||||||
msgstr ""
|
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
|
#: share/functions/__fish_complete_ftp.fish:1
|
||||||
msgid "Complete ftp, pftp"
|
msgid "Complete ftp, pftp"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
23
share/completions/notify-send.fish
Normal file
23
share/completions/notify-send.fish
Normal 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"
|
28
share/functions/__fish_complete_freedesktop_icons.fish
Normal file
28
share/functions/__fish_complete_freedesktop_icons.fish
Normal 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
|
Loading…
Reference in a new issue