Add rofi-nerdfont icon picker mode
This commit is contained in:
parent
c6c4161d77
commit
b28a98c4e4
1 changed files with 37 additions and 0 deletions
37
.config/rofi/modes/nerdfont
Executable file
37
.config/rofi/modes/nerdfont
Executable file
|
@ -0,0 +1,37 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
# Nerdfont csv from: https://github.com/shanedabes/rofi-nerdfonts
|
||||||
|
|
||||||
|
# a file to read from, will be preferred over url
|
||||||
|
# ROFI_NERDFONT_LIST_FILE="point/to/nerdfont-chars.csv"
|
||||||
|
# a url to pull list from
|
||||||
|
# ROFI_NERDFONT_LIST_URL="https://point-me-to/a/nerd-icon-list.csv"
|
||||||
|
# icon|name, icon is default
|
||||||
|
# ROFI_NERDFONT_OUTPUT="icon"
|
||||||
|
|
||||||
|
if [ -n "$*" ]; then
|
||||||
|
output="${ROFI_NERDFONT_OUTPUT}"
|
||||||
|
case "$output" in
|
||||||
|
name)
|
||||||
|
printf "%s" "$*" |
|
||||||
|
cut -d',' -f2 |
|
||||||
|
xclip -selection clipboard >/dev/null 2>/dev/null &
|
||||||
|
;;
|
||||||
|
icon | *)
|
||||||
|
printf "%s" "$*" |
|
||||||
|
cut -d',' -f1 |
|
||||||
|
xclip -selection clipboard >/dev/null 2>/dev/null &
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
elif [ -z "$*" ]; then
|
||||||
|
printf "\x00prompt\x1fIcon> \n"
|
||||||
|
printf "\x00markup-rows\x1ftrue\n"
|
||||||
|
|
||||||
|
url=${ROFI_NERDFONT_LIST_URL:-"https://raw.githubusercontent.com/shanedabes/rofi-nerdfonts/master/chars.csv"}
|
||||||
|
if [ -n "${ROFI_NERDFONT_LIST_FILE}" ]; then
|
||||||
|
cat "$ROFI_NERDFONT_LIST_FILE"
|
||||||
|
elif [ -n "${url}" ]; then
|
||||||
|
curl -s "${url}"
|
||||||
|
fi
|
||||||
|
fi
|
Loading…
Reference in a new issue