Ver Fonte

Add readme and start of rofi slack plugin

Colin Powell há 5 anos atrás
pai
commit
e37d7133ed
2 ficheiros alterados com 81 adições e 0 exclusões
  1. 23 0
      README.org
  2. 58 0
      rofi/.config/rofi/slack.sh

+ 23 - 0
README.org

@@ -0,0 +1,23 @@
+#+TITLE: Dotfiles
+
+I use:
+
++-----+--------------------+
+| OS | FreeBSD 12.1        |
++-----+--------------------+
+| WM | i3-gaps             |
++-----+--------------------+
+| Compositor | compton     |
++-----+--------------------+
+| Editor | DOOM Emacs      |
++-----+--------------------+
+| Terminal | Alacritty     |
++-----+--------------------+
+| Shell | fish             |
++-----+--------------------+
+| PDF-viewer | Zathura     |
++-----+--------------------+
+| Mail | notmuch + Emacs   |
++-----+--------------------+
+| Browser | Firefox / surf |
++-----+--------------------+

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

@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+
+# -----------------------------------------------------------------------------
+# Info:
+#   author:    Colin Powell
+#   file:      slack.sh
+#   created:   20.03.2020
+#   revision:  ---
+#   version:   1.0
+# -----------------------------------------------------------------------------
+# Requirements:
+#   rofi
+# Description:
+#   Use rofi to update slack
+# Usage:
+#   slack.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