Pārlūkot izejas kodu

[rofi] Change rofi theme

Colin Powell 4 gadi atpakaļ
vecāks
revīzija
679279a02e
2 mainītis faili ar 63 papildinājumiem un 7 dzēšanām
  1. 5 7
      rofi/.config/rofi/config.rasi
  2. 58 0
      rofi/.config/rofi/pass.sh

+ 5 - 7
rofi/.config/rofi/config.rasi

@@ -1,12 +1,10 @@
 configuration {
 	modi: "window,run,ssh,combi";
 	width: 50;
-	lines: 5;
-	font: "Go Mono 9";
-	location: 2;
-	padding: 15;
-	yoffset: 85;
+	lines: 7;
+	terminal-emulator: "kitty";
+	font: "JetBrains Mono 10";
 	show-icons: true;
-	combi-modi: "window,drun,ssh";
-	theme: "android_notification";
+	combi-modi: "window,ssh,drun";
+	theme: "Monokai";
 }

+ 58 - 0
rofi/.config/rofi/pass.sh

@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+
+# -----------------------------------------------------------------------------
+# Info:
+#   author:    Colin Powell
+#   file:      pass.sh
+#   created:   14.10.2020
+#   revision:  ---
+#   version:   1.0
+# -----------------------------------------------------------------------------
+# Requirements:
+#   rofi
+# Description:
+#   Use rofi to grab password-store passwords
+# Usage:
+#   pass.sh
+# -----------------------------------------------------------------------------
+# Script:
+
+declare -A OPTIONS
+
+OPTIONS=(
+  ["set status"]="slack status edit "
+  ["clear status"]="slack status edit "
+  ["set away"]="slack presence away"
+  ["set available"]="slack presence active"
+)
+
+# List for rofi
+gen_list() {
+    for i in "${!OPTIONS[@]}"
+    do
+      echo "$i"
+    done
+}
+
+main() {
+  # Pass the list to rofi
+  platform=$( (gen_list) | rofi -dmenu -matching fuzzy -no-custom -location 0 -p "Command -> " )
+
+  if [[ -n "$platform" ]]; then
+    query=$( (echo ) | rofi  -dmenu -matching fuzzy -location 0 -p "Input -> " )
+
+    if [[ -n "$query" ]]; then
+      option=${OPTIONS[$platform]}$query
+      eval "$option"
+    else
+      exit
+    fi
+
+  else
+    exit
+  fi
+}
+
+main
+
+exit 0