1
0
Fork 0

feat(rofi): add rofi config and scripts

Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
Lucas Sta Maria 2024-01-29 00:14:49 -05:00
parent e9cb27e509
commit 48cd765ce9
No known key found for this signature in database
GPG key ID: F07FB16A826E3B47
4 changed files with 202 additions and 1 deletions

19
.local/bin/rofi-pass Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
get_accounts() {
find ~/.password-store \
| grep "$HOME/.password-store/"\
| sed "s|$HOME/.password-store/||"\
| grep "\gpg$" \
| sed "s/\.gpg$//" \
| grep ".*/" \
| grep -v "^z/"
}
main () {
selected="$(get_accounts 2>/dev/null \
| rofi -dmenu -p 'pass')"
pass -c "$selected"
}
main

24
.local/bin/rofi-vpn Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
print_opts() {
printf "reconnect\nconnect\ndisconnect\n"
}
main() {
selected="$(print_opts 2>/dev/null \
| rofi -dmenu -p 'mullvad')"
case "$selected" in
"reconnect")
mullvad reconnect && sleep 1 && notify-send "Mullvad VPN" "$(mullvad status)"
;;
"connect")
mullvad connect && sleep 1 && notify-send "Mullvad VPN" "$(mullvad status)"
;;
"disconnect")
mullvad disconnect && sleep 1 && notify-send "Mullvad VPN" "$(mullvad status)"
;;
esac
}
main