Rofi/Waybar aufräumen: tote Scripts entfernen, Themes konsolidieren
- GTK-Style-Script und Template-System entfernt (Catppuccin fest) - 15 tote/inkompatible Scripts gelöscht (Hyprland, X11, Duplikate) - Rasi-Themes von Einzelordnern in themes/ konsolidiert - Waybar: Timezone fix, BAT0, JSON-Struktur, Icons restored - Waybar: GTK-Menu durch wlogout on-click ersetzt - Alle Script-Pfade auf /etc/xdg/rofi/themes/ aktualisiert - moonarch-session als Rofi-basierte Übergangslösung hinzugefügt - moonarch-dnd: broken pipe bei Waybar-Restart behoben - Style.css vom System übernommen
This commit is contained in:
@@ -1,142 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# ABOUTME: Rofi-based tool launcher that provides a searchable menu of system utilities.
|
||||
# ABOUTME: Includes VPN, sound, bluetooth, shortcuts, and other system management tools.
|
||||
|
||||
declare -A LABELS
|
||||
declare -A COMMANDS
|
||||
|
||||
###
|
||||
# List of defined 'bangs'
|
||||
|
||||
# launch programs
|
||||
# COMMANDS["apps"]="rofi -combi-modi window,drun -show combi"
|
||||
# LABELS["apps"]=""
|
||||
|
||||
# open bookmarks
|
||||
# COMMANDS["bookmarks"]="~/.scripts/rofi-scripts-collection/rofi-surfraw-bookmarks.sh"
|
||||
# LABELS["bookmarks"]=""
|
||||
|
||||
# search local files
|
||||
COMMANDS[""]="moonarch-locate"
|
||||
LABELS[""]="Locate"
|
||||
|
||||
COMMANDS[""]="wlogout -P 1 -s -r 10 -c 10"
|
||||
LABELS[""]="Session Menu"
|
||||
|
||||
# open custom web searches
|
||||
# COMMANDS["websearch"]="~/.scripts/rofi-scripts-collection/rofi-surfraw-websearch.sh"
|
||||
# LABELS["websearch"]=""
|
||||
|
||||
# show clipboard history
|
||||
# source: https://bitbucket.org/pandozer/rofi-clipboard-manager/overview
|
||||
# COMMANDS["clipboard"]='rofi -modi "clipboard:~/.bin/rofi-clipboard-manager/mclip.py menu" -show clipboard && ~/.bin/rofi-clipboard-manager/mclip.py paste'
|
||||
# LABELS["clipboard"]=""
|
||||
|
||||
# references --------------------------
|
||||
# COMMANDS[";sr2"]="chromium 'wikipedia.org/search-redirect.php?search=\" \${input}\""
|
||||
# LABELS[";sr2"]=""
|
||||
|
||||
# COMMANDS[";piratebay"]="chromium --disk-cache-dir=/tmp/cache http://thepiratebay.org/search/\" \${input}\""
|
||||
# LABELS[";piratebay"]=""
|
||||
|
||||
# COMMANDS[".bin"]="spacefm -r '/home/dka/bin'"
|
||||
# LABELS[".bin"]=".bin"
|
||||
|
||||
# COMMANDS["#screenshot"]='/home/dka/bin/screenshot-scripts/myscreenshot.sh'
|
||||
# LABELS["#screenshot"]="screenshot"
|
||||
|
||||
# greenclip clipboard history
|
||||
# source: https://github.com/erebe/greenclip
|
||||
COMMANDS[""]='rofi -modi "clipboard:greenclip print" -show Clipboard'
|
||||
LABELS[""]="Clipboard"
|
||||
|
||||
COMMANDS[""]='moonarch-vpn'
|
||||
LABELS[""]='VPN Connection Manager'
|
||||
|
||||
COMMANDS[""]='moonarch-volume'
|
||||
LABELS[""]='Sound Manager'
|
||||
|
||||
#COMMANDS[""]='shortcuts module was removed'
|
||||
#LABELS[""]='Hotkey List'
|
||||
|
||||
COMMANDS[""]='wdisplays'
|
||||
LABELS[""]='Display Setup'
|
||||
|
||||
COMMANDS[""]='nwg-look'
|
||||
LABELS[""]='Appearance Settings'
|
||||
|
||||
COMMANDS[""]='noisetorch'
|
||||
LABELS[""]='Audio Noise Reduction'
|
||||
|
||||
COMMANDS[""]='$HOME/.local/share/headset-charge-indicator/headset-charge-indicator.py &'
|
||||
LABELS[""]='Headset Control'
|
||||
|
||||
COMMANDS[""]='moonarch-bluetooth'
|
||||
LABELS[""]='Bluetooth Control'
|
||||
|
||||
COMMANDS[""]='nm-applet --indicator &'
|
||||
LABELS[""]='Networker Manager'
|
||||
|
||||
COMMANDS[""]='wl-color-picker'
|
||||
LABELS[""]='Color Picker'
|
||||
|
||||
COMMANDS[""]='font-manager'
|
||||
LABELS[""]='Font Manager'
|
||||
|
||||
COMMANDS[""]='gufw'
|
||||
LABELS[""]='Firewall Settings'
|
||||
|
||||
COMMANDS[""]='stacer'
|
||||
LABELS[" "]='System Maintenance'
|
||||
|
||||
|
||||
################################################################################
|
||||
# do not edit below
|
||||
################################################################################
|
||||
##
|
||||
# Generate menu
|
||||
##
|
||||
function print_menu()
|
||||
{
|
||||
for key in ${!LABELS[@]}
|
||||
do
|
||||
# echo "$key ${LABELS}"
|
||||
echo "$key ${LABELS[$key]}"
|
||||
# my top version just shows the first field in labels row, not two words side by side
|
||||
done
|
||||
}
|
||||
##
|
||||
# Show rofi.
|
||||
##
|
||||
function start()
|
||||
{
|
||||
# print_menu | rofi -dmenu -p "?=>"
|
||||
print_menu | sort | rofi -show "Tools" -dmenu -mesg " Tools" -i -p "rofi-bangs: "
|
||||
}
|
||||
|
||||
|
||||
# Run it
|
||||
value="$(start)"
|
||||
|
||||
# Split input.
|
||||
# grab upto first space.
|
||||
choice=${value%%\ *}
|
||||
# graph remainder, minus space.
|
||||
input=${value:$((${#choice}+1))}
|
||||
|
||||
##
|
||||
# Cancelled? bail out
|
||||
##
|
||||
if test -z ${choice}
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
# check if choice exists
|
||||
if test ${COMMANDS[$choice]+isset}
|
||||
then
|
||||
# Execute the choice
|
||||
${COMMANDS[$choice]}
|
||||
else
|
||||
echo "Unknown command: ${choice}" | rofi -dmenu -p "error"
|
||||
fi
|
||||
@@ -302,7 +302,7 @@ show_menu() {
|
||||
}
|
||||
|
||||
# Rofi command to pipe into, can add any options here
|
||||
rofi_command="rofi -dmenu $* -p -theme /etc/xdg/rofi/bluetooth/bluetooth.rasi -mesg -Bluetooth-Control"
|
||||
rofi_command="rofi -dmenu $* -p -theme /etc/xdg/rofi/themes/bluetooth.rasi -mesg -Bluetooth-Control"
|
||||
|
||||
case "$1" in
|
||||
--status)
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# ABOUTME: Rofi-based calendar widget with month navigation.
|
||||
# ABOUTME: Displays a calendar grid and highlights the current day.
|
||||
|
||||
DIR=$(dirname $PWD)
|
||||
|
||||
current_day=$(date +"%e")
|
||||
current_month=$(date +"%m")
|
||||
current_year=$(date +"%Y")
|
||||
|
||||
month=$(date +"%-m")
|
||||
year=$(date +"%Y")
|
||||
previous_month="◀"
|
||||
next_month="▶"
|
||||
last_selected_option=""
|
||||
|
||||
format_calendar () {
|
||||
echo "$1" \
|
||||
| sed -E 's/([[:alpha:]])__/\1\n/g' \
|
||||
| sed -E 's/___([[:digit:]])/.\n\1/g' \
|
||||
| sed -e 's/___/\n./g' \
|
||||
| sed -e 's/__/\n/g' \
|
||||
| sed -e 's/_/\n/g'
|
||||
}
|
||||
|
||||
print_month() {
|
||||
calendar="$(cal -v -- $1 $2 | tail -n +2 | sed -e 's/ /_/g')"
|
||||
echo "$(format_calendar "$calendar")"
|
||||
}
|
||||
|
||||
find_day_index() {
|
||||
index=0
|
||||
while IFS=' ' read -ra arr; do
|
||||
for i in "${arr[@]}"; do
|
||||
if [[ "$i" == "$2" ]]; then
|
||||
echo "$index"
|
||||
break
|
||||
fi
|
||||
((index++))
|
||||
done
|
||||
done <<< "$1"
|
||||
}
|
||||
|
||||
calendar_menu() {
|
||||
calendar_header=$(cal -v -- $month $year | head -n 1)
|
||||
|
||||
month_page="$(print_month $month $year)"
|
||||
calendar_body="\n\n\n$previous_month\n\n\n\n$month_page\n\n\n\n$next_month\n\n\n"
|
||||
|
||||
previous_month_index="3"
|
||||
next_month_index="59"
|
||||
calendar_body_column="7"
|
||||
urgent="-u $previous_month_index,$next_month_index"
|
||||
active=""
|
||||
selected_row=""
|
||||
|
||||
if [[ "$(echo $current_month | bc) $current_year" == "$(echo $month | bc) $year" ]]; then
|
||||
current_day_index=$(($(find_day_index "$month_page" $current_day) + $calendar_body_column))
|
||||
active="-a $current_day_index"
|
||||
selected_row="-selected-row $current_day_index"
|
||||
fi
|
||||
|
||||
if [[ $last_selected_option == $previous_month ]]; then
|
||||
selected_row="-selected-row $previous_month_index"
|
||||
fi
|
||||
|
||||
if [[ $last_selected_option == $next_month ]]; then
|
||||
selected_row="-selected-row $next_month_index"
|
||||
fi
|
||||
|
||||
echo -e "$calendar_body" | rofi -dmenu \
|
||||
-theme /etc/xdg/rofi/calendar/rofi-calendar.rasi \
|
||||
-p "$calendar_header" $urgent $active $selected_row
|
||||
}
|
||||
|
||||
while [[ true ]]; do
|
||||
selected=$(calendar_menu)
|
||||
last_selected_option="$selected"
|
||||
case $selected in
|
||||
$previous_month)
|
||||
((month--))
|
||||
if [[ $month -lt 1 ]]; then
|
||||
month=12
|
||||
((year--))
|
||||
fi
|
||||
;;
|
||||
$next_month)
|
||||
((month++))
|
||||
if [[ $month -gt 12 ]]; then
|
||||
month=1
|
||||
((year++))
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
@@ -39,7 +39,7 @@ function print_menu()
|
||||
function start()
|
||||
{
|
||||
# print_menu | rofi -dmenu -p "?=>"
|
||||
print_menu | sort | rofi -theme /etc/xdg/rofi/cpugov/rofi-cpugov.rasi -show "CPU Modes" -dmenu -mesg " CPU Modes" -i -p "rofi-bangs: "
|
||||
print_menu | sort | rofi -theme /etc/xdg/rofi/themes/cpugov.rasi -show "CPU Modes" -dmenu -mesg " CPU Modes" -i -p "rofi-bangs: "
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# ABOUTME: Waybar-Modul das den DND-Status von dunst als JSON ausgibt.
|
||||
# ABOUTME: Wird von der Waybar custom/dnd Config referenziert.
|
||||
set -euo pipefail
|
||||
trap '' PIPE
|
||||
|
||||
readonly ENABLED=''
|
||||
readonly DISABLED=''
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
# ABOUTME: Rofi emoji picker that copies selected emoji to clipboard.
|
||||
# ABOUTME: Reads emoji list from /etc/xdg/rofi/emojis/emojis.txt.
|
||||
|
||||
FILE="/etc/xdg/rofi/emojis/emojis.txt"
|
||||
|
||||
if [ "$@" ]
|
||||
then
|
||||
smiley=$(echo $@ | cut -d' ' -f1)
|
||||
echo -n "$smiley" | xsel -bi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cat $FILE
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# ABOUTME: Converts GTK theme colors to rofi-compatible CSS color values.
|
||||
# ABOUTME: Reads a template file and replaces {@theme_*_color} placeholders with hex values.
|
||||
|
||||
# https://github.com/Git-Fal7/gtk-rofi/
|
||||
# Taken from MATE-HUD github.com/ubuntu-mate/mate-hud
|
||||
# Used for rofi css
|
||||
|
||||
# Usage
|
||||
# ./moonarch-gtk-style [input file] > [output file]
|
||||
|
||||
# examples
|
||||
# background-color: {@theme_bg_color}
|
||||
|
||||
# see the array below for list of style context to use
|
||||
|
||||
import sys
|
||||
|
||||
if len(sys.argv)<2:
|
||||
sys.exit(1)
|
||||
|
||||
import gi
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gio, GLib, Gtk
|
||||
|
||||
#Converts from rgba <GTK R, G, B> to hex #RRGGBB
|
||||
def rgba_to_hex(color):
|
||||
return "#{0:02x}{1:02x}{2:02x}".format( int(color.red * 255), int(color.green * 255), int(color.blue * 255))
|
||||
|
||||
window = Gtk.Window()
|
||||
style_context = window.get_style_context()
|
||||
|
||||
#List of style contexts
|
||||
lists = [
|
||||
#Foreground
|
||||
'theme_fg_color', 'theme_selected_fg_color', 'theme_fg_color',
|
||||
'warning_fg_color', 'info_fg_color',
|
||||
#Background
|
||||
'theme_bg_color', 'theme_selected_bg_color', 'error_bg_color',
|
||||
'warning_bg_color', 'info_bg_color',
|
||||
#Others
|
||||
'theme_unfocused_fg_color', 'theme_text_color',
|
||||
'theme_unfocused_text_color',
|
||||
'theme_base_color',
|
||||
'theme_unfocused_fg_color',
|
||||
'theme_unfocused_text_color',
|
||||
'theme_unfocused_bg_color',
|
||||
'theme_unfocused_base_color',
|
||||
'theme_unfocused_selected_bg_color',
|
||||
'theme_unfocused_selected_fg_color',
|
||||
'unfocused_insensitive_color',
|
||||
'borders',
|
||||
'unfocused_borders',
|
||||
'warning_color',
|
||||
'error_color',
|
||||
'success_color'
|
||||
]
|
||||
|
||||
with open(sys.argv[1]) as f:
|
||||
file=f.read()
|
||||
for style in lists:
|
||||
file=file.replace("{@" + style + "}", rgba_to_hex(style_context.lookup_color(style)[1]))
|
||||
print(file)
|
||||
@@ -1,52 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ABOUTME: Rofi helper that reads a JSON config file to build a dynamic menu.
|
||||
# ABOUTME: Parses name/command/icon fields from JSON and launches selected entries.
|
||||
|
||||
#https://github.com/luiscrjunior/rofi-json
|
||||
|
||||
user_file="${1/#\~/$HOME}"
|
||||
|
||||
if [[ "$user_file" = /* ]]
|
||||
then
|
||||
config_file="$user_file"
|
||||
else
|
||||
cwd=$(dirname $0)
|
||||
config_file="${cwd}/${user_file}"
|
||||
fi
|
||||
|
||||
json=$(cat ${config_file})
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
echo $json | jq -cr '.[] | "\(.name)|\(.command)|\(.icon)"' |
|
||||
while IFS="|" read -r name command icon
|
||||
do
|
||||
if [[ $name == "null" ]]; then
|
||||
continue
|
||||
fi
|
||||
if [[ $icon == "null" ]]; then
|
||||
icon="system-run"
|
||||
fi
|
||||
echo -en "${name}\0icon\x1f${icon}\n"
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -eq 2 ]; then
|
||||
|
||||
selected=$2
|
||||
task=$(echo $json | jq ".[] | select(.name == \"$selected\")")
|
||||
|
||||
if [[ $task == "" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
command=$(echo $task | jq -j ".command")
|
||||
|
||||
if [[ $command == "null" ]]; then
|
||||
command=$(echo $task | jq -j ".name")
|
||||
fi
|
||||
|
||||
coproc bash -c "$command"
|
||||
exit
|
||||
|
||||
fi
|
||||
@@ -1,24 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# ABOUTME: Application launcher using rofi with GTK theme integration.
|
||||
# ABOUTME: Application launcher using rofi with Catppuccin Mocha theme.
|
||||
# ABOUTME: Supports window, files, run, and drun modes.
|
||||
|
||||
SETTINGS=/etc/xdg/rofi/gtk-theme.ini
|
||||
|
||||
#Gets the current gtk using gsettings and removes the quotes
|
||||
CURRENT_GTK_THEME=$(gsettings get org.gnome.desktop.interface gtk-theme)
|
||||
CURRENT_GTK_THEME="${CURRENT_GTK_THEME#?}"
|
||||
CURRENT_GTK_THEME="${CURRENT_GTK_THEME%?}"
|
||||
|
||||
#Gets the gtk theme that is in the settings.ini file
|
||||
SETTINGS_GTK_THEME=$(grep "GTK_THEME" "${SETTINGS}" | cut -b 11-)
|
||||
|
||||
#create new colors.rasi from template
|
||||
if [ "${SETTINGS_GTK_THEME}" != "${CURRENT_GTK_THEME}" ]; then
|
||||
sed -i "s:GTK_THEME=${SETTINGS_GTK_THEME}:GTK_THEME=${CURRENT_GTK_THEME}:g" "${SETTINGS}"
|
||||
|
||||
python3 moonarch-gtk-style /etc/xdg/rofi/_template/colors.rasi > /etc/xdg/rofi/colors.rasi
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
window)
|
||||
showmode="window"
|
||||
@@ -38,4 +21,4 @@ esac
|
||||
rofi \
|
||||
-show $showmode \
|
||||
-click-to-exit \
|
||||
-theme /etc/xdg/rofi/launcher/launcher.rasi
|
||||
-theme /etc/xdg/rofi/themes/launcher.rasi
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ABOUTME: Rofi-based file search using the locate/mlocate database.
|
||||
# ABOUTME: Opens selected files with xdg-open.
|
||||
|
||||
# info: rofi-locate is a script to search local files and folders on your computer using the locate command and the updatedb database
|
||||
# requirements: rofi mlocate
|
||||
# playlist: rofi https://www.youtube.com/playlist?list=PLqv94xWU9zZ0LVP1SEFQsLEYjZC_SUB3m
|
||||
|
||||
xdg-open "$(locate home media | rofi -threads 0 -width 100 -dmenu -i -p "locate:")"
|
||||
@@ -1,84 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# ABOUTME: Rofi-basiertes Power-Menü für Moonarch (Niri).
|
||||
# ABOUTME: Bietet Shutdown, Reboot, Lock, Suspend und Logout.
|
||||
|
||||
# CMDs
|
||||
uptime="`uptime -p | sed -e 's/up //g'`"
|
||||
host="$USER@"`hostname`
|
||||
|
||||
# Options
|
||||
shutdown=''
|
||||
reboot=''
|
||||
lock=''
|
||||
suspend=''
|
||||
logout=''
|
||||
yes=''
|
||||
no=''
|
||||
|
||||
# Rofi CMD
|
||||
rofi_cmd() {
|
||||
rofi -dmenu \
|
||||
-p "$host uptime: $uptime" \
|
||||
-mesg "$host uptime: $uptime" \
|
||||
-theme /etc/xdg/rofi/powermenu/powermenu.rasi
|
||||
}
|
||||
|
||||
# Confirmation CMD
|
||||
confirm_cmd() {
|
||||
rofi -dmenu \
|
||||
-p 'Confirmation' \
|
||||
-normal-window \
|
||||
-mesg 'Confirm '${chosen} \
|
||||
-theme /etc/xdg/rofi/powermenu/confirm.rasi
|
||||
}
|
||||
|
||||
# Ask for confirmation
|
||||
confirm_exit() {
|
||||
echo -e "$yes\n$no" | confirm_cmd ${chosen}
|
||||
}
|
||||
|
||||
# Pass variables to rofi dmenu
|
||||
run_rofi() {
|
||||
echo -e "$lock\n$suspend\n$logout\n$reboot\n$shutdown" | rofi_cmd
|
||||
}
|
||||
|
||||
# Execute Command
|
||||
run_cmd() {
|
||||
selected="$(confirm_exit)"
|
||||
if [[ "$selected" == "$yes" ]]; then
|
||||
if [[ $1 == '--shutdown' ]]; then
|
||||
systemctl poweroff
|
||||
elif [[ $1 == '--reboot' ]]; then
|
||||
systemctl reboot
|
||||
elif [[ $1 == '--suspend' ]]; then
|
||||
mpc -q pause
|
||||
amixer set Master mute
|
||||
systemctl suspend
|
||||
elif [[ $1 == '--logout' ]]; then
|
||||
niri msg action quit
|
||||
fi
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Actions
|
||||
chosen="$(run_rofi)"
|
||||
case ${chosen} in
|
||||
$shutdown)
|
||||
run_cmd --shutdown
|
||||
;;
|
||||
$reboot)
|
||||
run_cmd --reboot
|
||||
;;
|
||||
$lock)
|
||||
killall rofi
|
||||
wlogout -P 1 -s -r 10 -c 10
|
||||
;;
|
||||
$suspend)
|
||||
run_cmd --suspend
|
||||
;;
|
||||
$logout)
|
||||
run_cmd --logout
|
||||
;;
|
||||
esac
|
||||
Executable
+43
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
# ABOUTME: Rofi-based session menu with horizontal icon layout.
|
||||
# ABOUTME: Replaces wlogout — provides lock, logout, suspend, hibernate, reboot, shutdown.
|
||||
|
||||
declare -A actions
|
||||
declare -a order
|
||||
|
||||
order=("lock" "logout" "suspend" "hibernate" "reboot" "shutdown")
|
||||
|
||||
actions[lock]="gtklock"
|
||||
actions[logout]="niri msg action quit"
|
||||
actions[suspend]="systemctl suspend"
|
||||
actions[hibernate]="systemctl hibernate"
|
||||
actions[reboot]="systemctl reboot"
|
||||
actions[shutdown]="systemctl poweroff"
|
||||
|
||||
# GTK icon theme names
|
||||
declare -A icons
|
||||
icons[lock]="system-lock-screen"
|
||||
icons[logout]="system-log-out"
|
||||
icons[suspend]="system-suspend"
|
||||
icons[hibernate]="system-suspend-hibernate"
|
||||
icons[reboot]="system-reboot"
|
||||
icons[shutdown]="system-shutdown"
|
||||
|
||||
# Build menu — use rofi icon protocol
|
||||
menu=""
|
||||
for key in "${order[@]}"; do
|
||||
[[ -n "$menu" ]] && menu+="\n"
|
||||
menu+="${key}\x00icon\x1f${icons[$key]}"
|
||||
done
|
||||
|
||||
selected=$(echo -e "$menu" | rofi -dmenu \
|
||||
-theme /etc/xdg/rofi/themes/session.rasi \
|
||||
-show-icons \
|
||||
-p "")
|
||||
|
||||
[[ -z "$selected" ]] && exit 0
|
||||
|
||||
# Execute the selected action
|
||||
if [[ -n "${actions[$selected]+x}" ]]; then
|
||||
eval "${actions[$selected]}"
|
||||
fi
|
||||
@@ -6,7 +6,7 @@
|
||||
# @author moonarch.de (nevaforget)
|
||||
# script used with rofi to list desktop files of specific dir
|
||||
# dir: /usr/share/settings-menu/
|
||||
# @example rofi -show fb -modes "fb:moonarch-setmen" -theme /etc/xdg/rofi/settings-menu/settings-menu.rasi
|
||||
# @example rofi -show fb -modes "fb:moonarch-setmen" -theme /etc/xdg/rofi/themes/settings-menu.rasi
|
||||
# @dependencies glib >= 2.67.2
|
||||
####
|
||||
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# ABOUTME: Rofi-based settings menu that launches various system tools and scripts.
|
||||
# ABOUTME: Provides a searchable list of system utilities like VPN, sound, bluetooth, etc.
|
||||
|
||||
declare -A LABELS
|
||||
declare -A COMMANDS
|
||||
|
||||
###
|
||||
# List of defined 'bangs'
|
||||
|
||||
# launch programs
|
||||
# COMMANDS["apps"]="rofi -combi-modi window,drun -show combi"
|
||||
# LABELS["apps"]=""
|
||||
|
||||
# open bookmarks
|
||||
# COMMANDS["bookmarks"]="~/.scripts/rofi-scripts-collection/rofi-surfraw-bookmarks.sh"
|
||||
# LABELS["bookmarks"]=""
|
||||
|
||||
# search local files
|
||||
# COMMANDS[""]="moonarch-locate"
|
||||
# LABELS[""]="Locate"
|
||||
|
||||
COMMANDS[""]="wlogout -P 1 -s -r 10 -c 10"
|
||||
LABELS[""]="Session Menu"
|
||||
|
||||
# greenclip clipboard history
|
||||
# source: https://github.com/erebe/greenclip
|
||||
COMMANDS[""]='cliphist -db-path /run/user/1000/cliphist/db list | rofi -dmenu | cliphist -db-path /run/user/1000/cliphist/db decode | wl-copy'
|
||||
LABELS[""]="Clipboard"
|
||||
|
||||
COMMANDS[""]='moonarch-vpn'
|
||||
LABELS[""]='VPN Connection Manager'
|
||||
|
||||
COMMANDS[""]='waypaper'
|
||||
LABELS[""]='Wallpaper Settings'
|
||||
|
||||
COMMANDS[""]='moonarch-volume'
|
||||
LABELS[""]='Sound Manager'
|
||||
|
||||
#COMMANDS[""]='shortcuts module was removed'
|
||||
#LABELS[""]='Hotkey List'
|
||||
|
||||
COMMANDS[""]='wdisplays'
|
||||
LABELS[""]='Display Setup'
|
||||
|
||||
COMMANDS[""]='nwg-look'
|
||||
LABELS[""]='Appearance Settings'
|
||||
|
||||
COMMANDS[""]='noisetorch'
|
||||
LABELS[""]='Audio Noise Reduction'
|
||||
|
||||
COMMANDS[""]='$HOME/.local/share/headset-charge-indicator/headset-charge-indicator.py &'
|
||||
LABELS[""]='Headset Control'
|
||||
|
||||
COMMANDS[""]='moonarch-bluetooth'
|
||||
LABELS[""]='Bluetooth Control'
|
||||
|
||||
COMMANDS[""]='nm-applet --indicator &'
|
||||
LABELS[""]='Networker Manager'
|
||||
|
||||
COMMANDS[""]='wl-color-picker'
|
||||
LABELS[""]='Color Picker'
|
||||
|
||||
COMMANDS[""]='font-manager'
|
||||
LABELS[""]='Font Manager'
|
||||
|
||||
COMMANDS[""]='gufw'
|
||||
LABELS[""]='Firewall Settings'
|
||||
|
||||
COMMANDS[""]='env GTK_THEME=Adwaita:dark resources'
|
||||
LABELS[""]='System Resources'
|
||||
|
||||
COMMANDS[""]='moonarch-cpugov'
|
||||
LABELS[""]='CPU Modes'
|
||||
|
||||
COMMANDS[""]='hardinfo'
|
||||
LABELS[""]='System Profiler and Benchmark'
|
||||
|
||||
COMMANDS[""]='alarm-clock-applet'
|
||||
LABELS[""]='Alarm & Timer'
|
||||
|
||||
COMMANDS[""]='moonarch-launcher'
|
||||
LABELS[""]='App Launcher'
|
||||
|
||||
################################################################################
|
||||
# do not edit below
|
||||
################################################################################
|
||||
##
|
||||
# Generate menu
|
||||
##
|
||||
function print_menu()
|
||||
{
|
||||
for key in ${!LABELS[@]}
|
||||
do
|
||||
# echo "$key ${LABELS}"
|
||||
echo "$key ${LABELS[$key]}"
|
||||
# my top version just shows the first field in labels row, not two words side by side
|
||||
done
|
||||
}
|
||||
##
|
||||
# Show rofi.
|
||||
##
|
||||
function start()
|
||||
{
|
||||
# print_menu | rofi -dmenu -p "?=>"
|
||||
title="MoonArch \ $USER \ $(date +"%H:%M") \ $(uptime -p | sed 's/up //')"
|
||||
print_menu | sort | rofi -theme /etc/xdg/rofi/settings-menu/settings-menu.rasi -show $title -dmenu -markup-rows -mesg " $title" -i -p "rofi-bangs: "
|
||||
}
|
||||
|
||||
|
||||
# Run it
|
||||
value="$(start)"
|
||||
|
||||
# Split input.
|
||||
# grab upto first space.
|
||||
choice=${value%%\ *}
|
||||
# graph remainder, minus space.
|
||||
input=${value:$((${#choice}+1))}
|
||||
|
||||
##
|
||||
# Cancelled? bail out
|
||||
##
|
||||
if test -z ${choice}
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
# check if choice exists
|
||||
if test ${COMMANDS[$choice]+isset}
|
||||
then
|
||||
# Execute the choice
|
||||
${COMMANDS[$choice]}
|
||||
else
|
||||
echo "Unknown command: ${choice}" | rofi -dmenu -p "error"
|
||||
fi
|
||||
@@ -6,7 +6,7 @@
|
||||
# changes default sink and moves all streams to that sink
|
||||
#https://gist.github.com/Nervengift/844a597104631c36513c?permalink_comment_id=1826282
|
||||
|
||||
sink=$(ponymix -t sink list|awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}'|rofi -dmenu -theme '/etc/xdg/rofi/volume/volume.rasi' -mesg ' Sink Switcher' -p 'pulseaudio sink:' -location 6 -width 100|grep -Po '[0-9]+(?=:)') &&
|
||||
sink=$(ponymix -t sink list|awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}'|rofi -dmenu -theme '/etc/xdg/rofi/themes/volume.rasi' -mesg ' Sink Switcher' -p 'pulseaudio sink:' -location 6 -width 100|grep -Po '[0-9]+(?=:)') &&
|
||||
|
||||
|
||||
ponymix set-default -d $sink &&
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# ABOUTME: Rofi-based tool launcher with SSH and system utility shortcuts.
|
||||
# ABOUTME: Provides a searchable menu of tools including VPN, sound, bluetooth, etc.
|
||||
|
||||
declare -A LABELS
|
||||
declare -A COMMANDS
|
||||
|
||||
###
|
||||
# List of defined 'bangs'
|
||||
|
||||
# launch programs
|
||||
# COMMANDS["apps"]="rofi -combi-modi window,drun -show combi"
|
||||
# LABELS["apps"]=""
|
||||
|
||||
# open bookmarks
|
||||
# COMMANDS["bookmarks"]="~/.scripts/rofi-scripts-collection/rofi-surfraw-bookmarks.sh"
|
||||
# LABELS["bookmarks"]=""
|
||||
|
||||
# search local files
|
||||
COMMANDS[""]="moonarch-locate"
|
||||
LABELS[""]="Locate"
|
||||
|
||||
# open custom web searches
|
||||
# COMMANDS["websearch"]="~/.scripts/rofi-scripts-collection/rofi-surfraw-websearch.sh"
|
||||
# LABELS["websearch"]=""
|
||||
|
||||
# show clipboard history
|
||||
# source: https://bitbucket.org/pandozer/rofi-clipboard-manager/overview
|
||||
# COMMANDS["clipboard"]='rofi -modi "clipboard:~/.bin/rofi-clipboard-manager/mclip.py menu" -show clipboard && ~/.bin/rofi-clipboard-manager/mclip.py paste'
|
||||
# LABELS["clipboard"]=""
|
||||
|
||||
# references --------------------------
|
||||
# COMMANDS[";sr2"]="chromium 'wikipedia.org/search-redirect.php?search=\" \${input}\""
|
||||
# LABELS[";sr2"]=""
|
||||
|
||||
# COMMANDS[";piratebay"]="chromium --disk-cache-dir=/tmp/cache http://thepiratebay.org/search/\" \${input}\""
|
||||
# LABELS[";piratebay"]=""
|
||||
|
||||
# COMMANDS[".bin"]="spacefm -r '/home/dka/bin'"
|
||||
# LABELS[".bin"]=".bin"
|
||||
|
||||
# COMMANDS["#screenshot"]='/home/dka/bin/screenshot-scripts/myscreenshot.sh'
|
||||
# LABELS["#screenshot"]="screenshot"
|
||||
|
||||
# greenclip clipboard history
|
||||
# source: https://github.com/erebe/greenclip
|
||||
COMMANDS[""]='rofi -modi "clipboard:greenclip print" -show Clipboard'
|
||||
LABELS[""]="Clipboard"
|
||||
|
||||
COMMANDS[""]='moonarch-vpn'
|
||||
LABELS[""]='VPN Connection Manager'
|
||||
|
||||
COMMANDS[""]='moonarch-volume'
|
||||
LABELS[""]='Sound Manager'
|
||||
|
||||
#COMMANDS[""]='shortcuts module was removed'
|
||||
#LABELS[""]='Hotkey List'
|
||||
|
||||
COMMANDS[""]='wlogout'
|
||||
LABELS[""]='Session Menu'
|
||||
|
||||
COMMANDS[""]='wdisplays'
|
||||
LABELS[""]='Display Setup'
|
||||
|
||||
COMMANDS[""]='nwg-look'
|
||||
LABELS[""]='Appearance Settings'
|
||||
|
||||
COMMANDS[""]='noisetorch'
|
||||
LABELS[""]='Audio Noise Reduction'
|
||||
|
||||
COMMANDS[""]='$HOME/.local/share/headset-charge-indicator/headset-charge-indicator.py &'
|
||||
LABELS[""]='Headset Control'
|
||||
|
||||
COMMANDS[""]='moonarch-bluetooth'
|
||||
LABELS[""]='Bluetooth Control'
|
||||
|
||||
COMMANDS[""]='nm-applet --indicator &'
|
||||
LABELS[""]='Networker Manager'
|
||||
|
||||
COMMANDS[""]='wl-color-picker'
|
||||
LABELS[""]='Color Picker'
|
||||
|
||||
COMMANDS[""]='font-manager'
|
||||
LABELS[""]='Font Manager'
|
||||
|
||||
COMMANDS[""]='gufw'
|
||||
LABELS[""]='Firewall Settings'
|
||||
|
||||
COMMANDS[""]='stacer'
|
||||
LABELS[" "]='System Maintenance'
|
||||
|
||||
|
||||
################################################################################
|
||||
# do not edit below
|
||||
################################################################################
|
||||
##
|
||||
# Generate menu
|
||||
##
|
||||
function print_menu()
|
||||
{
|
||||
for key in ${!LABELS[@]}
|
||||
do
|
||||
# echo "$key ${LABELS}"
|
||||
echo "$key ${LABELS[$key]}"
|
||||
# my top version just shows the first field in labels row, not two words side by side
|
||||
done
|
||||
}
|
||||
##
|
||||
# Show rofi.
|
||||
##
|
||||
function start()
|
||||
{
|
||||
# print_menu | rofi -dmenu -p "?=>"
|
||||
print_menu | sort | rofi -show "Tools" -dmenu -mesg " Tools" -i -p "rofi-bangs: "
|
||||
}
|
||||
|
||||
|
||||
# Run it
|
||||
value="$(start)"
|
||||
|
||||
# Split input.
|
||||
# grab upto first space.
|
||||
choice=${value%%\ *}
|
||||
# graph remainder, minus space.
|
||||
input=${value:$((${#choice}+1))}
|
||||
|
||||
##
|
||||
# Cancelled? bail out
|
||||
##
|
||||
if test -z ${choice}
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
# check if choice exists
|
||||
if test ${COMMANDS[$choice]+isset}
|
||||
then
|
||||
# Execute the choice
|
||||
${COMMANDS[$choice]}
|
||||
else
|
||||
echo "Unknown command: ${choice}" | rofi -dmenu -p "error"
|
||||
fi
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
## Applets : Volume
|
||||
|
||||
theme="/etc/xdg/rofi/volume/volume.rasi"
|
||||
theme="/etc/xdg/rofi/themes/volume.rasi"
|
||||
|
||||
# Volume Info
|
||||
mixer="`amixer info Master | grep 'Mixer name' | cut -d':' -f2 | tr -d \',' '`"
|
||||
|
||||
@@ -80,7 +80,7 @@ function extract_connection_name_from_result() {
|
||||
# used as lines to select from.
|
||||
function start_rofi() {
|
||||
local content="$1"
|
||||
echo -e "$content" | rofi -dmenu -theme /etc/xdg/rofi/nm-vpn/nm-vpn.rasi -mesg " VPN Connection Manager" -icon ""
|
||||
echo -e "$content" | rofi -dmenu -theme /etc/xdg/rofi/themes/vpn.rasi -mesg " VPN Connection Manager" -icon ""
|
||||
}
|
||||
|
||||
# List the VPN connections and let the user toggle one using rofi.
|
||||
|
||||
Reference in New Issue
Block a user