Switch to GNU stow
This commit is contained in:
parent
a2605c4254
commit
d34cecb27e
137 changed files with 39244 additions and 141 deletions
160
rofi/.config/rofi/config.rasi
Normal file
160
rofi/.config/rofi/config.rasi
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
configuration {
|
||||
show-icons: true;
|
||||
icon-theme: "Paper";
|
||||
theme: "themes/settings.rasi";
|
||||
cycle: true;
|
||||
hide-scrollbar: true;
|
||||
disable-history: false;
|
||||
modi: "drun";
|
||||
display-drun: "apps";
|
||||
columns: 2;
|
||||
pid: "/run/user/1000/rofi.pid";
|
||||
}
|
||||
|
||||
/* ALL OPTIONS */
|
||||
/* configuration { */
|
||||
/* modi: "window,run,ssh,drun,combi,keys,calc"; */
|
||||
/* width: 50;*/
|
||||
/* lines: 15;*/
|
||||
/* columns: 1;*/
|
||||
/* font: "mono 12";*/
|
||||
/* bw: 1;*/
|
||||
/* location: 0;*/
|
||||
/* padding: 5;*/
|
||||
/* yoffset: 0;*/
|
||||
/* xoffset: 0;*/
|
||||
/* fixed-num-lines: true;*/
|
||||
/* show-icons: false;*/
|
||||
/* terminal: "rofi-sensible-terminal";*/
|
||||
/* ssh-client: "ssh";*/
|
||||
/* ssh-command: "{terminal} -e {ssh-client} {host} [-p {port}]";*/
|
||||
/* run-command: "{cmd}";*/
|
||||
/* run-list-command: "";*/
|
||||
/* run-shell-command: "{terminal} -e {cmd}";*/
|
||||
/* window-command: "wmctrl -i -R {window}";*/
|
||||
/* window-match-fields: "all";*/
|
||||
/* icon-theme: ;*/
|
||||
/* drun-match-fields: "name,generic,exec,categories";*/
|
||||
/* drun-show-actions: false;*/
|
||||
/* drun-display-format: "{name} [<span weight='light' size='small'><i>({generic})</i></span>]";*/
|
||||
/* disable-history: false;*/
|
||||
/* ignored-prefixes: "";*/
|
||||
/* sort: false;*/
|
||||
/* sorting-method: ;*/
|
||||
/* case-sensitive: false;*/
|
||||
/* cycle: true;*/
|
||||
/* sidebar-mode: false;*/
|
||||
/* eh: 1;*/
|
||||
/* auto-select: false;*/
|
||||
/* parse-hosts: false;*/
|
||||
/* parse-known-hosts: true;*/
|
||||
/* combi-modi: "window,run";*/
|
||||
/* matching: "normal";*/
|
||||
/* tokenize: true;*/
|
||||
/* m: "-5";*/
|
||||
/* line-margin: 2;*/
|
||||
/* line-padding: 1;*/
|
||||
/* filter: ;*/
|
||||
/* separator-style: "dash";*/
|
||||
/* hide-scrollbar: false;*/
|
||||
/* fullscreen: false; */
|
||||
/* fake-transparency: false;*/
|
||||
/* dpi: -1;*/
|
||||
/* threads: 0;*/
|
||||
/* scrollbar-width: 8;*/
|
||||
/* scroll-method: 0;*/
|
||||
/* fake-background: "screenshot";*/
|
||||
/* window-format: "{w} {c} {t}";*/
|
||||
/* click-to-exit: true;*/
|
||||
/* show-match: true;*/
|
||||
/* theme: "dmenu"; */
|
||||
/* color-normal: ;*/
|
||||
/* color-urgent: ;*/
|
||||
/* color-active: ;*/
|
||||
/* color-window: ;*/
|
||||
/* max-history-size: 25;*/
|
||||
/* combi-hide-mode-prefix: false;*/
|
||||
/* matching-negate-char: '-' /* unsupported */;*/
|
||||
/* cache-dir: ;*/
|
||||
/* pid: "/run/user/1000/rofi.pid"; */
|
||||
/* display-window: ;*/
|
||||
/* display-windowcd: ;*/
|
||||
/* display-run: ;*/
|
||||
/* display-ssh: ;*/
|
||||
/* display-drun: ;*/
|
||||
/* display-combi: ;*/
|
||||
/* display-keys: ;*/
|
||||
/* display-calc: ;*/
|
||||
/* kb-primary-paste: "Control+V,Shift+Insert";*/
|
||||
/* kb-secondary-paste: "Control+v,Insert";*/
|
||||
/* kb-clear-line: "Control+w";*/
|
||||
/* kb-move-front: "Control+a";*/
|
||||
/* kb-move-end: "Control+e";*/
|
||||
/* kb-move-word-back: "Alt+b,Control+Left";*/
|
||||
/* kb-move-word-forward: "Alt+f,Control+Right";*/
|
||||
/* kb-move-char-back: "Left,Control+b";*/
|
||||
/* kb-move-char-forward: "Right,Control+f";*/
|
||||
/* kb-remove-word-back: "Control+Alt+h,Control+BackSpace";*/
|
||||
/* kb-remove-word-forward: "Control+Alt+d";*/
|
||||
/* kb-remove-char-forward: "Delete,Control+d";*/
|
||||
/* kb-remove-char-back: "BackSpace,Shift+BackSpace,Control+h";*/
|
||||
/* kb-remove-to-eol: "Control+k";*/
|
||||
/* kb-remove-to-sol: "Control+u";*/
|
||||
/* kb-accept-entry: "Control+j,Control+m,Return,KP_Enter";*/
|
||||
/* kb-accept-custom: "Control+Return";*/
|
||||
/* kb-accept-alt: "Shift+Return";*/
|
||||
/* kb-delete-entry: "Shift+Delete";*/
|
||||
/* kb-mode-next: "Shift+Right,Control+Tab";*/
|
||||
/* kb-mode-previous: "Shift+Left,Control+ISO_Left_Tab";*/
|
||||
/* kb-row-left: "Control+Page_Up";*/
|
||||
/* kb-row-right: "Control+Page_Down";*/
|
||||
/* kb-row-up: "Up,Control+p,ISO_Left_Tab";*/
|
||||
/* kb-row-down: "Down,Control+n";*/
|
||||
/* kb-row-tab: "Tab";*/
|
||||
/* kb-page-prev: "Page_Up";*/
|
||||
/* kb-page-next: "Page_Down";*/
|
||||
/* kb-row-first: "Home,KP_Home";*/
|
||||
/* kb-row-last: "End,KP_End";*/
|
||||
/* kb-row-select: "Control+space";*/
|
||||
/* kb-screenshot: "Alt+S";*/
|
||||
/* kb-ellipsize: "Alt+period";*/
|
||||
/* kb-toggle-case-sensitivity: "grave,dead_grave";*/
|
||||
/* kb-toggle-sort: "Alt+grave";*/
|
||||
/* kb-cancel: "Escape,Control+g,Control+bracketleft";*/
|
||||
/* kb-custom-1: "Alt+1";*/
|
||||
/* kb-custom-2: "Alt+2";*/
|
||||
/* kb-custom-3: "Alt+3";*/
|
||||
/* kb-custom-4: "Alt+4";*/
|
||||
/* kb-custom-5: "Alt+5";*/
|
||||
/* kb-custom-6: "Alt+6";*/
|
||||
/* kb-custom-7: "Alt+7";*/
|
||||
/* kb-custom-8: "Alt+8";*/
|
||||
/* kb-custom-9: "Alt+9";*/
|
||||
/* kb-custom-10: "Alt+0";*/
|
||||
/* kb-custom-11: "Alt+exclam";*/
|
||||
/* kb-custom-12: "Alt+at";*/
|
||||
/* kb-custom-13: "Alt+numbersign";*/
|
||||
/* kb-custom-14: "Alt+dollar";*/
|
||||
/* kb-custom-15: "Alt+percent";*/
|
||||
/* kb-custom-16: "Alt+dead_circumflex";*/
|
||||
/* kb-custom-17: "Alt+ampersand";*/
|
||||
/* kb-custom-18: "Alt+asterisk";*/
|
||||
/* kb-custom-19: "Alt+parenleft";*/
|
||||
/* kb-select-1: "Super+1";*/
|
||||
/* kb-select-2: "Super+2";*/
|
||||
/* kb-select-3: "Super+3";*/
|
||||
/* kb-select-4: "Super+4";*/
|
||||
/* kb-select-5: "Super+5";*/
|
||||
/* kb-select-6: "Super+6";*/
|
||||
/* kb-select-7: "Super+7";*/
|
||||
/* kb-select-8: "Super+8";*/
|
||||
/* kb-select-9: "Super+9";*/
|
||||
/* kb-select-10: "Super+0";*/
|
||||
/* ml-row-left: "ScrollLeft";*/
|
||||
/* ml-row-right: "ScrollRight";*/
|
||||
/* ml-row-up: "ScrollUp";*/
|
||||
/* ml-row-down: "ScrollDown";*/
|
||||
/* me-select-entry: "MousePrimary";*/
|
||||
/* me-accept-entry: "MouseDPrimary";*/
|
||||
/* me-accept-custom: "Control+MouseDPrimary";*/
|
||||
/* } */
|
||||
47
rofi/.config/rofi/modes/fontawesome
Executable file
47
rofi/.config/rofi/modes/fontawesome
Executable file
|
|
@ -0,0 +1,47 @@
|
|||
#!/usr/bin/env sh
|
||||
# Original wrapper script from: https://github.com/wstam88/rofi-fontawesome
|
||||
# more fa icon lists can be obtained there as well
|
||||
|
||||
# a file to read from, will be preferred over url
|
||||
# ROFI_FONTAWESOME_LIST_FILE="some-fa5-icon-list.txt"
|
||||
# a url to pull list from
|
||||
# ROFI_FONTAWESOME_LIST_URL="https://point-me-to/a/fa-icon-list.txt"
|
||||
# icon|name|unicode, icon is default
|
||||
# ROFI_FONTAWESOME_OUTPUT="icon"
|
||||
|
||||
if [ -n "$*" ]; then
|
||||
output="${ROFI_FONTAWESOME_OUTPUT}"
|
||||
case "$output" in
|
||||
unicode)
|
||||
printf "%s" "$*" |
|
||||
grep -o -e '...;' |
|
||||
sed 's/^&#x//' |
|
||||
sed 's/;$//' |
|
||||
xclip -selection clipboard >/dev/null 2>/dev/null &
|
||||
;;
|
||||
name)
|
||||
printf "%s" "$*" |
|
||||
cut -d\' -f2 |
|
||||
xclip -selection clipboard >/dev/null 2>/dev/null &
|
||||
;;
|
||||
icon | *)
|
||||
printf "%s" "$*" |
|
||||
grep -o -e '...;' |
|
||||
sed 's/^&#x/\\u/' |
|
||||
sed 's/;$//' |
|
||||
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_FONTAWESOME_LIST_URL:-"https://raw.githubusercontent.com/wstam88/rofi-fontawesome/master/fa5-icon-list.txt"}
|
||||
if [ -n "${ROFI_FONTAWESOME_LIST_FILE}" ]; then
|
||||
cat "$ROFI_FONTAWESOME_LIST_FILE"
|
||||
elif [ -n "${url}" ]; then
|
||||
curl -s "${url}"
|
||||
fi
|
||||
fi
|
||||
73
rofi/.config/rofi/modes/gopass
Executable file
73
rofi/.config/rofi/modes/gopass
Executable file
|
|
@ -0,0 +1,73 @@
|
|||
#!/usr/bin/env sh
|
||||
# Custom key bindings do not work in script-mode, use a wrapper instead
|
||||
# Script at .local/bin/rofi-gopass
|
||||
OLD_GOPASS_GPG_OPTS="$GOPASS_GPG_OPTS"
|
||||
|
||||
break_out() {
|
||||
if [ "$1" -eq 1 ]; then
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
has_xclip() {
|
||||
if (type xclip >/dev/null 2>&1); then
|
||||
printf "Your system does not appear to support pasting to clipboard via xclip."
|
||||
exit 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
to_clipboard() {
|
||||
has_xclip
|
||||
value="$(gopass show "$1" "$2")"
|
||||
printf "%s" "$value" | xclip -selection clipboard
|
||||
notify-send "Password" "Copied pass for $2 to clipboard.\n"
|
||||
exit
|
||||
}
|
||||
|
||||
show_secrets() {
|
||||
printf "%s" "$(gopass ls -fo)"
|
||||
}
|
||||
|
||||
# get_key() {
|
||||
# return echo "$*" | gpg --passphrase-fd 0 --pinentry-mode loopback --batch --export-secret-keys 2>&1
|
||||
# }
|
||||
|
||||
# check_gpg_key() {
|
||||
# check_keyphrase=$(echo "$*" | gpg --passphrase-fd 0 --pinentry-mode loopback --batch --export-secret-keys 2>&1)
|
||||
# if echo "$check_keyphrase" | grep -q -e '.*<.*@.*>'; then
|
||||
# printf "\x00prompt\x1fLogin> \n"
|
||||
# show_secrets
|
||||
# elif echo "$check_keyphrase" | grep -q -e "can't get input" - || echo "$check_keyphrase" | grep -q -e "error receiving key" -; then
|
||||
# printf "\x00prompt\x1fMaster Passphrase> \n"
|
||||
# printf "%s" "$check_keyphrase"
|
||||
# else
|
||||
# echo "passphrase successfully input, $check_keyphrase"
|
||||
# fi
|
||||
# }
|
||||
|
||||
# has_selected_login() {
|
||||
# echo "this is passed to ls: $*"
|
||||
# echo "grep reveals: $(gopass ls -f | grep -e "$*" -)"
|
||||
# if grep "$(gopass ls -f | grep -q -e "$*" -)"; then
|
||||
# echo "ls found something"
|
||||
# true
|
||||
# else
|
||||
# false
|
||||
# fi
|
||||
# }
|
||||
|
||||
# if [ -z "$*" ]; then
|
||||
# check_gpg_key "$*"
|
||||
# elif has_selected_login "$*"; then
|
||||
# echo "has selected login $*"
|
||||
# else
|
||||
# check_gpg_key "$*"
|
||||
# fi
|
||||
|
||||
main() {
|
||||
show_secrets
|
||||
}
|
||||
|
||||
main
|
||||
37
rofi/.config/rofi/modes/nerdfont
Executable file
37
rofi/.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
|
||||
76
rofi/.config/rofi/modes/powermenu
Executable file
76
rofi/.config/rofi/modes/powermenu
Executable file
|
|
@ -0,0 +1,76 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
#### Environment Variable Options ###
|
||||
# Interface options
|
||||
# ROFI_POWERMENU_SHOW_ICONS=1
|
||||
# ROFI_POWERMENU_SHOW_TEXT=0
|
||||
# Command options
|
||||
# ROFI_POWERMENU_SHUTDOWN_CMD=""
|
||||
# ROFI_POWERMENU_REBOOT_CMD=""
|
||||
# ROFI_POWERMENU_LOCKSCREEN_CMD=""
|
||||
# ROFI_POWERMENU_LOGOUT_CMD=""
|
||||
# ROFI_POWERMENU_SUSPEND_CMD=""
|
||||
|
||||
#### Menu Options ###
|
||||
if [ "${ROFI_POWERMENU_SHOW_TEXT:-0}" -eq 0 ] && [ "${ROFI_POWERMENU_SHOW_ICONS:-1}" -eq 0 ]; then
|
||||
echo "You disabled both text and icons for rofi-powermenu, nothing can be shown."
|
||||
exit 1
|
||||
elif [ "${ROFI_POWERMENU_SHOW_ICONS:-1}" -eq 1 ]; then
|
||||
power_off_btn=""
|
||||
reboot_btn=""
|
||||
lock_btn=""
|
||||
suspend_btn="鈴"
|
||||
logout_btn=""
|
||||
fi
|
||||
if [ "${ROFI_POWERMENU_SHOW_TEXT:-0}" -eq 1 ]; then
|
||||
power_off_btn="${power_off_btn} Shut Down"
|
||||
reboot_btn="${reboot_btn} Restart"
|
||||
lock_btn="${lock_btn} Lock Screen"
|
||||
suspend_btn="${suspend_btn} Suspend"
|
||||
logout_btn="${logout_btn} Log Out"
|
||||
fi
|
||||
|
||||
# grep -a since it assumes with our nullcodes etc that this is a binary file
|
||||
# grep -o to only leave the things we grep for
|
||||
case $(echo "$*" | grep -a -o -e "Shutdown" -e "Reboot" -e "Lockscreen" -e "Logout" -e "Suspend") in
|
||||
"Shutdown")
|
||||
if [ -n "$ROFI_POWERMENU_SHUTDOWN_CMD" ]; then eval "$ROFI_POWERMENU_SHUTDOWN_CMD"; else
|
||||
systemctl poweroff
|
||||
fi
|
||||
;;
|
||||
"Reboot")
|
||||
if [ -n "$ROFI_POWERMENU_REBOOT_CMD" ]; then eval "$ROFI_POWERMENU_REBOOT_CMD"; else
|
||||
systemctl reboot
|
||||
fi
|
||||
;;
|
||||
"Lockscreen")
|
||||
# Completely detach from the parent script
|
||||
# If in/outputs are not redirected, rofi will wait for the forked process as well.
|
||||
if [ -n "$ROFI_POWERMENU_LOCKSCREEN_CMD" ]; then eval "$ROFI_POWERMENU_LOCKSCREEN_CMD"; else
|
||||
lockscreen rofi </dev/null >/dev/null 2>/dev/null &
|
||||
fi
|
||||
;;
|
||||
"Logout")
|
||||
if [ -n "$ROFI_POWERMENU_LOGOUT_CMD" ]; then eval "$ROFI_POWERMENU_LOGOUT_CMD"; else
|
||||
i3-msg exit
|
||||
fi
|
||||
;;
|
||||
"Suspend")
|
||||
if [ -n "$ROFI_POWERMENU_SUSPEND_CMD" ]; then eval "$ROFI_POWERMENU_SUSPEND_CMD"; else
|
||||
lockscreen rofi </dev/null >/dev/null 2>/dev/null &
|
||||
systemctl suspend
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$*" ]; then
|
||||
printf "\x00prompt\x1fPower> \n"
|
||||
# we can use pango markup to hide text which we can then search. Neat!
|
||||
printf "\0markup-rows\x1ftrue\n"
|
||||
|
||||
printf "<!-- Shutdown Poweroff --> %s\n" "$power_off_btn"
|
||||
printf "<!-- Reboot Restart --> %s\n" "$reboot_btn"
|
||||
printf "<!-- Lockscreen --> %s\n" "$lock_btn"
|
||||
printf "<!-- Suspend Sleep --> %s\n" "$suspend_btn"
|
||||
printf "<!-- Exit X Logout --> %s\n" "$logout_btn"
|
||||
fi
|
||||
28
rofi/.config/rofi/modes/rofi-colors
Executable file
28
rofi/.config/rofi/modes/rofi-colors
Executable file
|
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
rofi_command="rofi"
|
||||
|
||||
original_args=("$@")
|
||||
for ((i = 0; i <= "${#original_args[@]}"; i++)); do
|
||||
if [ "${original_args[i]}" == "-color" ]; then
|
||||
for ((j = 0; j <= "${#original_args[@]}"; j++)); do
|
||||
if [ "${original_args[j]}" == "-theme" ]; then
|
||||
echo "with theme: $i : ${original_args[i]} ${original_args[i + 1]}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
# for ((index = 0; index <= ${#lines_ary[@]}; index++)); do
|
||||
# if [ "${lines_ary[index]}" == "Release:" ]; then
|
||||
# echo "${lines_ary[index + 1]}"
|
||||
# fi
|
||||
# done
|
||||
|
||||
$rofi_command "${original_args[@]}"
|
||||
|
||||
# if [ -z "${color}" ]; then
|
||||
# command rofi "${original_args[@]}"
|
||||
# fi
|
||||
|
||||
# echo "color = ${color}"
|
||||
209
rofi/.config/rofi/modes/scratch
Normal file
209
rofi/.config/rofi/modes/scratch
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
#!/bin/bash
|
||||
|
||||
# rofi wrapper. Add custom settings here.
|
||||
_rofi () {
|
||||
rofi -dmenu -no-auto-select -i "$@"
|
||||
}
|
||||
|
||||
# default settings
|
||||
backend=ydotool
|
||||
dotool_delay=200
|
||||
daemon_wait=2
|
||||
autotype_delay=2
|
||||
key_autotype="Return"
|
||||
key_usertype="Alt+2"
|
||||
key_passtype="Alt+3"
|
||||
key_actions="Alt+a"
|
||||
key_clipboard="Alt+1"
|
||||
key_fieldtype="Return"
|
||||
|
||||
# read config file
|
||||
get_config_file () {
|
||||
configs=("$ROFI_PASS_CONFIG"
|
||||
"$HOME/.config/rofi-pass/rofi-gopass.conf"
|
||||
"/etc/rofi-gopass.conf")
|
||||
|
||||
# return the first config file with a valid path
|
||||
for config in "${configs[@]}"; do
|
||||
# '! -z' is needed in case ROFI_PASS_CONFIG is not set
|
||||
if [[ ! -z "${config}" && -f "${config}" ]]; then
|
||||
printf "%s" "$config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Make sure ESC will always end the programm.
|
||||
# Call this function with "exit_check $?" after each rofi call.
|
||||
exit_check () {
|
||||
exit_value=$1
|
||||
if [[ "${exit_value}" == "1" ]]; then
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
clipboard () {
|
||||
local entry
|
||||
local key
|
||||
local value
|
||||
entry="${1}"
|
||||
key="${2}"
|
||||
value="$(gopass show "${entry}" "${key}")"
|
||||
printf '%s' "${value}" | xclip -sel clip
|
||||
notify-send "rofi-gopass" "Copied ${key} to clipboard\nClearing in 45 seconds."
|
||||
(sleep 45; printf '%s' "" | xclip; printf '%s' "" | xclip -selection clipboard | notify-send "rofi-gopass" "Clipboard cleared") &
|
||||
exit
|
||||
}
|
||||
|
||||
_ydotoold () {
|
||||
if ! pgrep -x "ydotoold" >/dev/null; then
|
||||
# ydotoold blocks the terminal, so we need to background it.
|
||||
# Sadly this way we never know when the process finished starting up.
|
||||
# Until ydotoold receives proper daemonizing we add a sleep value here.
|
||||
ydotoold&
|
||||
sleep "${daemon_wait}"
|
||||
fi
|
||||
}
|
||||
|
||||
_dotool () {
|
||||
local mode
|
||||
local key
|
||||
mode="${1}"
|
||||
key="${2:-null}"
|
||||
case "${mode}" in
|
||||
"type")
|
||||
case "${backend}" in
|
||||
"xdotool") xdotool type --delay "${dotool_delay}" --file - ;;
|
||||
"ydotool") _ydotoold; ydotool type --delay "${dotool_delay}" --file - ;;
|
||||
esac ;;
|
||||
"key")
|
||||
case "${backend}" in
|
||||
"xdotool") xdotool key "${key}" ;;
|
||||
"ydotool") _ydotoold; ydotool key "${key}" ;;
|
||||
esac ;;
|
||||
esac
|
||||
}
|
||||
|
||||
list_passwords () {
|
||||
gopass list --flat
|
||||
}
|
||||
|
||||
|
||||
autopass () {
|
||||
local entry
|
||||
local autotype
|
||||
entry="${1}"
|
||||
autotype="$(gopass show "${entry}" autotype)"
|
||||
autotype="${autotype:-user :tab pass}"
|
||||
|
||||
for word in ${autotype}; do
|
||||
case "$word" in
|
||||
":tab") _dotool key Tab;;
|
||||
":space") _dotool key " ";;
|
||||
":delay") sleep "${autotype_delay}";;
|
||||
":enter") _dotool key enter;;
|
||||
"pass") printf '%s' "$(gopass show --password "${entry}")" | _dotool type ;;
|
||||
*) printf '%s' "$(gopass show "${entry}" "${word}")" | _dotool type ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
list_keys () {
|
||||
# gopass has no option to only list keys, so we need to build the list ourselves.
|
||||
local entry
|
||||
local keys
|
||||
entry="${1}"
|
||||
keys="$(gopass show "${entry}")"
|
||||
printf '%s\n' "${keys}" | while read -r line; do
|
||||
if [[ "${line}" == *": "* ]]; then
|
||||
printf '%s\n' "${line%: *}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
edit_key () {
|
||||
local entry
|
||||
local keys
|
||||
entry="${1}"
|
||||
keys="$(list_keys "${entry}")"
|
||||
key_name=$(printf '%s\n' "${keys}" | _rofi -mesg "Enter new key or chose existing one")
|
||||
exit_check $?
|
||||
value_name=$(printf '%s' "" | _rofi -mesg "Enter Value for key \"${key_name}\"")
|
||||
exit_check $?
|
||||
if [[ -z "${key_name}" ]]; then
|
||||
printf '%s' "${value_name}" | gopass insert -a "${entry}" "${key_name}"
|
||||
else
|
||||
printf '%s' "${value_name}" | gopass insert "${entry}" "${key_name}"
|
||||
fi
|
||||
}
|
||||
|
||||
# For dangerous operations call this function first. You can provide a message as argument.
|
||||
# Example: confirm "Are you sure you want to delete entry?"
|
||||
confirm () {
|
||||
local message
|
||||
message="${1}"
|
||||
confirm_content=(
|
||||
"Yes"
|
||||
"No")
|
||||
|
||||
confirm_menu=$(printf '%s\n' "${confirm_content[@]}" | _rofi -mesg "${message}")
|
||||
exit_check $?
|
||||
case "${confirm_menu}" in
|
||||
"Yes") : ;;
|
||||
"No") exit ;;
|
||||
esac
|
||||
}
|
||||
|
||||
custom_type () {
|
||||
local entry
|
||||
local keys
|
||||
entry="${1}"
|
||||
keys="$(list_keys "${entry}")"
|
||||
key_name=$(printf '%s\n' "${keys}" | _rofi -kb-accept-entry "" -no-custom -kb-custom-1 "${key_clipboard}" -kb-custom-2 "${key_fieldtype}" -mesg "${key_clipboard}: Copy to Clipboard | ${key_fieldtype}: Type Field")
|
||||
local exit_value=$?
|
||||
exit_check "${exit_value}"
|
||||
case "${exit_value}" in
|
||||
"10") clipboard "${entry}" "${key_name}" ;;
|
||||
"11") printf '%s' "$(gopass show "${entry}" "${key_name}")" | _dotool type; exit ;;
|
||||
esac
|
||||
}
|
||||
|
||||
do_menu () {
|
||||
local entry
|
||||
entry="${1}"
|
||||
action_menu_content=(
|
||||
"< Go Back"
|
||||
"---"
|
||||
"Show Fields"
|
||||
"Add/Edit Keys"
|
||||
"Generate New Password"
|
||||
"Delete Entry"
|
||||
)
|
||||
|
||||
action_menu="$(printf '%s\n' "${action_menu_content[@]}" | _rofi -no-custom -mesg "Selected Entry: ${entry}" -p '> ')"
|
||||
exit_value=$?
|
||||
exit_check "${exit_value}"
|
||||
|
||||
case "${action_menu}" in
|
||||
"< Go Back") main ;;
|
||||
"Show Fields") custom_type "${entry}" ;;
|
||||
"Add/Edit Keys") edit_key "${entry}" ;;
|
||||
"Delete Entry") confirm "Delete ${entry}?"; gopass rm -f "${entry}" ;;
|
||||
"Generate New Password") confirm "Generate a new password for ${entry}?"; gopass generate -f "${entry}" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
main () {
|
||||
entry="$(list_passwords | _rofi -kb-accept-entry "" -kb-custom-1 "${key_autotype}" -kb-custom-2 "${key_usertype}" -kb-custom-3 "${key_passtype}" -kb-custom-4 "${key_actions}" -mesg "${key_autotype}: Autotype | ${key_usertype}: Type User | ${key_passtype}: Type Pass | ${key_actions}: More Actions")"
|
||||
exit_value=$?
|
||||
exit_check "${exit_value}"
|
||||
case "${exit_value}" in
|
||||
"10") autopass "${entry}"; exit ;;
|
||||
"11") printf '%s' "$(gopass show "${entry}" user)" | _dotool type; exit ;;
|
||||
"12") printf '%s' "$(gopass show --password "${entry}")" | _dotool type; exit ;
|
||||
esac
|
||||
do_menu "${entry}"
|
||||
}
|
||||
|
||||
main
|
||||
99
rofi/.config/rofi/modes/test
Executable file
99
rofi/.config/rofi/modes/test
Executable file
|
|
@ -0,0 +1,99 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
# POSIX COMPLIANT EXAMPLE ROFI MODE SCRIPT
|
||||
|
||||
#### Options ###
|
||||
power_off_btn=""
|
||||
reboot_btn=""
|
||||
lock_btn=""
|
||||
suspend_btn="鈴"
|
||||
logout_btn=""
|
||||
|
||||
# find out what the user has input
|
||||
# pad both values with a simple p in front
|
||||
# if query is empty it tries to compare nothing with quit otherwise
|
||||
# i.e. the [ operator, which will error out
|
||||
if [ p"$*" = p"quit" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ x"$*" = x"noot" ]; then
|
||||
rofi-powermenu
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# another way to see what the user has input
|
||||
# grep -a since it assumes with our nullcodes etc that this is a binary file
|
||||
# grep -o to only leave the things we grep for
|
||||
case $(echo "$*" | grep -a -o -e "Shutdown" -e "Reboot" -e "Lockscreen" -e "Logout" -e "Suspend") in
|
||||
"Shutdown")
|
||||
# do shutdown
|
||||
;;
|
||||
"Reboot")
|
||||
# do shutdown
|
||||
;;
|
||||
"Lockscreen")
|
||||
# do shutdown
|
||||
;;
|
||||
"Logout")
|
||||
# do shutdown
|
||||
;;
|
||||
"Suspend")
|
||||
# do shutdown
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$@" ]; then
|
||||
# Override the previously set prompt.
|
||||
printf "\x00prompt\x1fChange prompt\n"
|
||||
for a in 1 2 3 4 5 6 7 8 9 10; do
|
||||
echo "$a"
|
||||
done
|
||||
echo "quit"
|
||||
else
|
||||
|
||||
printf "\x00prompt\x1fPower> \n"
|
||||
# we can use pango markup to hide text which we can then search. Neat!
|
||||
printf "\0markup-rows\x1ftrue\n"
|
||||
# echo -en "\0urgent\x1f0,2\n"
|
||||
# echo -en "\0active\x1f1\n"
|
||||
# echo -en "\0message\x1fSpecial <b>bold</b>message\n"
|
||||
|
||||
printf "aap\0icon\x1ffolder\n"
|
||||
printf "<!-- Shutdown Poweroff --> %s\0icon\x1fstart-here\n" "$power_off_btn"
|
||||
printf "<!-- Reboot Restart --> %s\n" "$reboot_btn"
|
||||
printf "<!-- Lockscreen --> %s\n" "$lock_btn"
|
||||
printf "<!-- Suspend Sleep --> %s\n" "$suspend_btn"
|
||||
printf "<!-- Exit X Logout --> %s\n" "$logout_btn"
|
||||
echo "<b>Bold</b>"
|
||||
echo "quit"
|
||||
fi
|
||||
|
||||
##!/usr/bin/env sh
|
||||
|
||||
#### Options ###
|
||||
#power_off=""
|
||||
#reboot=""
|
||||
#lock=""
|
||||
#suspend_btn="鈴"
|
||||
#logout_btn=""
|
||||
## Variable passed to rofi
|
||||
|
||||
#chosen="$(printf "%s\n%s\n%s\n%s\n%s" "$power_off" "$reboot" "$lock" "$suspend_btn" "$logout_btn" | $rofi_command -dmenu -selected-row 2)"
|
||||
#case $chosen in
|
||||
#$power_off)
|
||||
# systemctl poweroff
|
||||
# ;;
|
||||
#$reboot)
|
||||
# systemctl reboot
|
||||
# ;;
|
||||
#$lock)
|
||||
# lockscreen
|
||||
# ;;
|
||||
#$suspend_btn)
|
||||
# systemctl suspend
|
||||
# ;;
|
||||
#$logout_btn)
|
||||
# i3-msg exit
|
||||
# ;;
|
||||
#esac
|
||||
6
rofi/.config/rofi/rofi-bang-commands.csv
Normal file
6
rofi/.config/rofi/rofi-bang-commands.csv
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
Calculator,!c,source,"rofi -show calc -modi calc -no-show-match -no-sort -theme Arc-Dark"
|
||||
Clipboard,!y,source,"rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}' -theme Arc-Dark"
|
||||
Emojis,!e,source,"rofimoji --rofi-args '-theme sidebar'"
|
||||
Youtube,!yt,source,"someroficommand"
|
||||
Wikipedia,!w,source,"someroficommand"
|
||||
DuckDuckGo,!ddg,source,"someroficommand"
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 33.
|
11
rofi/.config/rofi/themes/colorschemes/dmenu.rasi
Normal file
11
rofi/.config/rofi/themes/colorschemes/dmenu.rasi
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
* {
|
||||
accent: #ffffff; // anything which should be accented
|
||||
background: #000000; // rofi background color
|
||||
background-nofocus: #000000;// bg of items not focused
|
||||
background-focus: #4682b4; // bg of item focused
|
||||
foreground: #ffffff; // rofi foreground color
|
||||
foreground-nofocus: #ffffff;// fg of items not focused
|
||||
foreground-focus: #000000; // fg of items focused
|
||||
on: #6B9BC3; // color to signify something is turned on
|
||||
off: #1D354A; // color to signify something is turned off
|
||||
}
|
||||
11
rofi/.config/rofi/themes/colorschemes/gruvbox-dark.rasi
Normal file
11
rofi/.config/rofi/themes/colorschemes/gruvbox-dark.rasi
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
* {
|
||||
accent: #83a598; // anything which should be accented
|
||||
background: #282828; // rofi background color
|
||||
background-nofocus: #282828;// bg of items not focused
|
||||
background-focus: #1d2021; // bg of item focused
|
||||
foreground: #ebdbb2; // rofi foreground color
|
||||
foreground-nofocus: #ebdbb2;// fg of items not focused
|
||||
foreground-focus: #83a598; // fg of items focused
|
||||
on: #83a598; // color to signify something is turned on
|
||||
off: #fb4934; // color to signify something is turned off
|
||||
}
|
||||
34
rofi/.config/rofi/themes/dmenu.rasi
Normal file
34
rofi/.config/rofi/themes/dmenu.rasi
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/**
|
||||
* Layout for the horizontal top bar
|
||||
* dmenu we all know and love
|
||||
*
|
||||
*/
|
||||
|
||||
@import "layouts/list-horizontal.rasi"
|
||||
* {
|
||||
background-color: @background;
|
||||
border-color: @accent;
|
||||
text-color: @foreground;
|
||||
font: @text-font;
|
||||
}
|
||||
|
||||
#window {
|
||||
anchor: north;
|
||||
location: north;
|
||||
width: 100%;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
#listview {
|
||||
spacing: 5px;
|
||||
lines: 100;
|
||||
}
|
||||
|
||||
#entry {
|
||||
expand: false;
|
||||
width: 10em;
|
||||
}
|
||||
|
||||
#element {
|
||||
padding: 0px 2px;
|
||||
}
|
||||
28
rofi/.config/rofi/themes/layouts/list-horizontal.rasi
Normal file
28
rofi/.config/rofi/themes/layouts/list-horizontal.rasi
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* Settings for a general purpose
|
||||
* horizontal options list menu:
|
||||
*/
|
||||
@import "../settings.rasi"
|
||||
* {
|
||||
background-color: @background;
|
||||
text-color: @foreground;
|
||||
font: @text-font;
|
||||
}
|
||||
#window {
|
||||
children: [ horizbox ];
|
||||
}
|
||||
#horizbox {
|
||||
orientation: horizontal;
|
||||
children: [ prompt, entry, listview ];
|
||||
}
|
||||
#listview {
|
||||
layout: horizontal;
|
||||
}
|
||||
#element {
|
||||
background-color: @background-nofocus;
|
||||
text-color: @foreground-nofocus;
|
||||
}
|
||||
#element.selected {
|
||||
background-color: @background-focus;
|
||||
text-color: @foreground-focus;
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
/**
|
||||
* Settings for a general purpose full screen
|
||||
* horizontal options screen. The options will
|
||||
* make use of icons.
|
||||
* Px values for 1920x1080 screens.
|
||||
*
|
||||
* Depending on how many options your list
|
||||
* should display, choose the corresponding padding and spacing
|
||||
* for window and listview from below and add it to your
|
||||
* specific theme.
|
||||
*/
|
||||
|
||||
@import "list-horizontal.rasi"
|
||||
* {
|
||||
/* General */
|
||||
icon-font: "Iosevka 40";
|
||||
font: @icon-font;
|
||||
inputbar-margin: 4px 4px;
|
||||
prompt-padding: 16px 20px;
|
||||
entry-padding: 18px 16px 16px 0px;
|
||||
list-element-padding: 20px;
|
||||
list-element-margin: @inputbar-margin;
|
||||
list-element-border: 0px 0px 0px 8px;
|
||||
list-8-window-padding: 219px 360px;
|
||||
/**
|
||||
* Values bellow are 'no-padding' ones for Iosevka icons in this size.
|
||||
* If you use a different sized font, you will have to find your own
|
||||
* padding and spacing values.
|
||||
* -12px 0px -19px -96px */
|
||||
option-element-padding: 88px 100px 81px 4px;
|
||||
option-3-window-padding: 415px 446px;
|
||||
option-3-listview-spacing: 140px;
|
||||
option-5-window-padding: 415px 183px;
|
||||
option-5-listview-spacing: 77px;
|
||||
option-6-listview-spacing: 50px;
|
||||
}
|
||||
|
||||
#window {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: @option-5-window-padding;
|
||||
}
|
||||
|
||||
#horizbox {
|
||||
children: [ listview ];
|
||||
}
|
||||
|
||||
#listview {
|
||||
spacing: @option-5-listview-spacing;
|
||||
}
|
||||
|
||||
#element {
|
||||
padding: @option-element-padding;
|
||||
border: @list-element-border;
|
||||
}
|
||||
14
rofi/.config/rofi/themes/powermenu.rasi
Normal file
14
rofi/.config/rofi/themes/powermenu.rasi
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* This theme is intended for a 5 items wide menu on a 1920x1080 pixels resolution.
|
||||
* You may have to tweak values such as the window padding if you have a different resolution.
|
||||
*/
|
||||
|
||||
@import "layouts/options-horizontal-fullscreen.rasi"
|
||||
|
||||
#window {
|
||||
padding: @option-5-window-padding;
|
||||
}
|
||||
#listview {
|
||||
spacing: @option-5-listview-spacing;
|
||||
lines: 5;
|
||||
}
|
||||
40
rofi/.config/rofi/themes/settings.rasi
Normal file
40
rofi/.config/rofi/themes/settings.rasi
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/**
|
||||
* Changing this file allows all other theme files to be affected since
|
||||
* they all get their default settings from here.
|
||||
* Idea cribbed from: https://gitlab.com/vahnrr/rofi-menus
|
||||
*
|
||||
* Structure (what goes where) should be set in specific theme files, which pull from more general layouts/ files
|
||||
* Color (what has which accent) can be added with colorschemes/ files, and then set globally from here
|
||||
*
|
||||
* if a layout needs a *very* specific colorscheme it can also be set in the layouts/theme files
|
||||
* but try to keep the two separated as much as possible, so we can adjust global options easily from here
|
||||
*/
|
||||
|
||||
@import "colorschemes/gruvbox-dark.rasi"
|
||||
|
||||
* {
|
||||
/* General */
|
||||
text-font: "Iosevka Nerd Font";
|
||||
text-font-mono: "Iosevka Nerd Font";
|
||||
icon-font: "Iosevka Nerd Font";
|
||||
icon-font-small: "Iosevka Nerd Font";
|
||||
}
|
||||
|
||||
/**
|
||||
* In case rofi gets started without a specific theme
|
||||
* try to match the imported theme colors as best we
|
||||
* can to any general purpose.
|
||||
*/
|
||||
* {
|
||||
background-color: @background;
|
||||
text-color: @foreground;
|
||||
font: @text-font;
|
||||
}
|
||||
#element {
|
||||
background-color: @background-nofocus;
|
||||
text-color: @foreground-nofocus;
|
||||
}
|
||||
#element.selected {
|
||||
background-color: @background-focus;
|
||||
text-color: @foreground-focus;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue