style(rofi): update theme and add new launcher category
This commit is contained in:
1 parent
596cec1e99
commit
7180a46e7d
4 files changed
+89
-108
No files matched your search
+19
-21
@@ -1,11 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -uo pipefail
|
||||
tmp_dir="/tmp/cliphist"
|
||||
mkdir -p "$tmp_dir"
|
||||
mode="${1:-}"
|
||||
selection="${2:-}"
|
||||
|
||||
if [[ -n "$selection" ]]; then
|
||||
if [[ "$mode" == "clipboard" ]]; then
|
||||
id="${selection%% *}"
|
||||
@@ -15,11 +13,11 @@ if [[ -n "$selection" ]]; then
|
||||
printf '%s' "$body" | wl-copy
|
||||
elif [[ "$mode" == "powermenu" ]]; then
|
||||
case "$ROFI_INFO" in
|
||||
lock) swaylock ;;
|
||||
suspend) systemctl suspend ;;
|
||||
reboot) systemctl reboot ;;
|
||||
shutdown) systemctl poweroff ;;
|
||||
logout) loginctl terminate-session "${XDG_SESSION_ID-}" ;;
|
||||
lock) swaylock ;;
|
||||
suspend) systemctl suspend ;;
|
||||
reboot) systemctl reboot ;;
|
||||
shutdown) systemctl poweroff ;;
|
||||
logout) loginctl terminate-session "${XDG_SESSION_ID-}" ;;
|
||||
esac
|
||||
else
|
||||
target_app=$(grep -rl "^Name=${selection}\$" /usr/share/applications/*.desktop 2>/dev/null | head -n1)
|
||||
@@ -31,7 +29,6 @@ if [[ -n "$selection" ]]; then
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$mode" in
|
||||
clipboard)
|
||||
find "$tmp_dir" -type f -mmin +30 -delete 2>/dev/null
|
||||
@@ -42,9 +39,9 @@ case "$mode" in
|
||||
ext=""
|
||||
case "$rest" in
|
||||
*jpeg*|*jpg*) ext="jpg" ;;
|
||||
*png*) ext="png" ;;
|
||||
*bmp*) ext="bmp" ;;
|
||||
*) continue ;;
|
||||
*png*) ext="png" ;;
|
||||
*bmp*) ext="bmp" ;;
|
||||
*) continue ;;
|
||||
esac
|
||||
img="$tmp_dir/$id.$ext"
|
||||
[[ -s "$img" ]] || printf '%s\n' "$id" | clipvault get > "$img" 2>/dev/null
|
||||
@@ -60,13 +57,14 @@ case "$mode" in
|
||||
"\(.appname.data): \(.summary.data) — \(.body.data)"
|
||||
'
|
||||
;;
|
||||
internet|dev|media|games|system)
|
||||
internet|dev|media|office|games|system)
|
||||
case "$mode" in
|
||||
internet) category="Network" ;;
|
||||
dev) category="Development" ;;
|
||||
media) category="AudioVideo" ;;
|
||||
games) category="Game" ;;
|
||||
system) category="System" ;;
|
||||
dev) category="Development" ;;
|
||||
media) category="AudioVideo" ;;
|
||||
office) category="Office" ;;
|
||||
games) category="Game" ;;
|
||||
system) category="System" ;;
|
||||
esac
|
||||
awk -v cat="$category" '
|
||||
BEGINFILE { name=""; icon=""; match_cat=0 }
|
||||
@@ -83,10 +81,10 @@ case "$mode" in
|
||||
;;
|
||||
powermenu)
|
||||
echo -e "\0markup-rows\x1ftrue"
|
||||
printf '%s\0info\x1flock\n' "<span foreground=\"#88c0d0\"></span> lock"
|
||||
printf '%s\0info\x1fsuspend\n' "<span foreground=\"#5e81ac\"></span> suspend"
|
||||
printf '%s\0info\x1freboot\n' "<span foreground=\"#ebcb8b\"></span> reboot"
|
||||
printf '%s\0info\x1fshutdown\n' "<span foreground=\"#bf616a\">⏻</span> shutdown"
|
||||
printf '%s\0info\x1flogout\n' "<span foreground=\"#b48ead\"></span> logout"
|
||||
printf '%s\0info\x1flock\n' "<span foreground=\"#88c0d0\"></span> lock"
|
||||
printf '%s\0info\x1fsuspend\n' "<span foreground=\"#5e81ac\"></span> suspend"
|
||||
printf '%s\0info\x1freboot\n' "<span foreground=\"#ebcb8b\"></span> reboot"
|
||||
printf '%s\0info\x1fshutdown\n' "<span foreground=\"#bf616a\"></span> shutdown"
|
||||
printf '%s\0info\x1flogout\n' "<span foreground=\"#b48ead\"></span> logout"
|
||||
;;
|
||||
esac
|
||||
Reference in new issue
Block a user