os/arch: add rofi scripts
This commit is contained in:
parent
25b871368b
commit
690951c0ea
|
@ -30,6 +30,7 @@ bspc config focused_border_color "#22252c"
|
||||||
i=1
|
i=1
|
||||||
for monitor in $(bspc query -M); do
|
for monitor in $(bspc query -M); do
|
||||||
bspc monitor $monitor -n "$i" -d $i/{desktop,web,code,chat,art,music}
|
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++
|
let i++
|
||||||
done
|
done
|
||||||
NMON=$i
|
NMON=$i
|
||||||
|
|
|
@ -15,6 +15,12 @@ super + grave
|
||||||
# program launcher
|
# program launcher
|
||||||
super + space
|
super + space
|
||||||
rofi -show run
|
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:
|
# make sxhkd reload its configuration files:
|
||||||
super + Escape
|
super + Escape
|
||||||
|
|
10
os/arch/bin/rofi_bspwm.sh
Executable file
10
os/arch/bin/rofi_bspwm.sh
Executable file
|
@ -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
|
25
os/arch/bin/rofi_pass.sh
Executable file
25
os/arch/bin/rofi_pass.sh
Executable file
|
@ -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
|
Loading…
Reference in a new issue