diff --git a/os/arch/.config/bspwm/bspwmrc b/os/arch/.config/bspwm/bspwmrc index 9e566677..99d115a1 100755 --- a/os/arch/.config/bspwm/bspwmrc +++ b/os/arch/.config/bspwm/bspwmrc @@ -30,6 +30,7 @@ bspc config focused_border_color "#22252c" i=1 for monitor in $(bspc query -M); do bspc monitor $monitor -n "$i" -d $i/{desktop,web,code,chat,art,music} + echo $i/{desktop,web,code,chat,art,music} > /tmp/bspwm-monitor-$i let i++ done NMON=$i diff --git a/os/arch/.config/sxhkd/sxhkdrc b/os/arch/.config/sxhkd/sxhkdrc index 0a0ce1ef..e62cc99c 100644 --- a/os/arch/.config/sxhkd/sxhkdrc +++ b/os/arch/.config/sxhkd/sxhkdrc @@ -15,6 +15,12 @@ super + grave # program launcher super + space rofi -show run +# switch to desktop +super + shift + space + rofi_bspwm.sh +# password manager +super + alt + space + rofi_pass.sh # make sxhkd reload its configuration files: super + Escape diff --git a/os/arch/bin/rofi_bspwm.sh b/os/arch/bin/rofi_bspwm.sh new file mode 100755 index 00000000..c8e23ed2 --- /dev/null +++ b/os/arch/bin/rofi_bspwm.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +shopt -s nullglob globstar + +desktops=($(cat /tmp/bspwm-monitor-*)) +desktop=$(printf '%s\n' "${desktops[@]}" | rofi -dmenu -p bspwm: "$@") + +[[ -n $desktop ]] || exit + +bspc desktop -f $desktop diff --git a/os/arch/bin/rofi_pass.sh b/os/arch/bin/rofi_pass.sh new file mode 100755 index 00000000..44a7ff00 --- /dev/null +++ b/os/arch/bin/rofi_pass.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +shopt -s nullglob globstar + +typeit=0 +if [[ $1 == "--type" ]]; then + typeit=1 + shift +fi + +prefix=${PASSWORD_STORE_DIR-~/.password-store} +password_files=( "$prefix"/**/*.gpg ) +password_files=( "${password_files[@]#"$prefix"/}" ) +password_files=( "${password_files[@]%.gpg}" ) + +password=$(printf '%s\n' "${password_files[@]}" | rofi -dmenu -p pass: "$@") + +[[ -n $password ]] || exit + +if [[ $typeit -eq 0 ]]; then + pass show -c "$password" 2>/dev/null +else + pass show "$password" | { read -r pass; printf %s "$pass"; } | + xdotool type --clearmodifiers --file - +fi