Move rofi/bspwm scripts into config/{rofi,bspwm}

This commit is contained in:
Henrik Lissner 2019-12-08 17:02:41 -05:00
parent 712e2ac58d
commit d923c8c079
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
11 changed files with 28 additions and 15 deletions

View file

@ -19,7 +19,20 @@ done
if [[ $1 == -r ]]; then
resume=1; shift
fi
url=$@
url=
# Get qutebrowser's current url
win=$(xdotool getactivewindow)
if [[ -n $win ]]; then
winname=$(xdotool getwindowname $win)
if [[ $winname =~ " - Mozilla Firefox$" ]]; then
url=${winname% - Mozilla*}
url=${url##* - }
while (( ${#url//[^.]/} > 1 )); do
url=${url#*.}
done
fi
fi
LAST_ENTRY_FILE=/tmp/_upm
if [[ -n $resume && -f $LAST_ENTRY_FILE ]]; then
@ -29,7 +42,7 @@ else
password_files=( "$prefix"/**/*.gpg )
password_files=( "${password_files[@]#"$prefix"/}" )
password_files=( "${password_files[@]%.gpg}" )
entry=$(printf "%s\n" "${password_files[@]}" | $ROFI_CMD -p "pass > " -filter "$url")
entry=$(printf "%s\n" "${password_files[@]}" | $ROFI_CMD -p pass -filter "$url")
fi
if [[ -z $entry ]]; then
@ -47,7 +60,7 @@ if [[ -n $secrets ]]; then
otp) printf "%s" "$(pass otp -c "$entry")" ;;
*) printf "%s" "$(awk -v "key=$field:" '$1 == key {print $2}' <<<"$secrets")" | xclip -selection clipboard -in ;;
esac
notify-send --urgency=low "<b>$entry -> $field</b>" "Copied to clipboard for 45s"
notify-send --urgency=low "<b>$entry/$field</b>" "Copied to clipboard for 45s"
else
notify-send --urgency=critical "Failed to retrieve $entry"
exit 2

View file

@ -1,3 +0,0 @@
#!/usr/bin/env zsh
export PATH="$XDG_CONFIG_HOME/rofi/bin:$PATH"

View file

@ -12,10 +12,10 @@ super + apostrophe
# focus/swap the node in the given direction
super + {_,ctrl +}{h,j,k,l}
~/.dotfiles/bin/bspc/focus {_,-m }{west,south,north,east}
bspc-focus {_,-m }{west,south,north,east}
super + shift + {_,ctrl +}{h,j,k,l}
~/.dotfiles/bin/bspc/swap {_,-m }{west,south,north,east}
bspc-swap {_,-m }{west,south,north,east}
super + {_,shift +}{1-9,0}
bspc {desktop -f,node -d} {1-9,10}
@ -30,13 +30,13 @@ super + shift + grave
emacsclient -e '(open-scratch-frame)'
super + space
~/.config/rofi/bin/appmenu
rofi-appmenu
super + Tab
~/.config/rofi/bin/windowmenu
rofi-windowmenu
super + backslash
~/.config/rofi/bin/passmenu
rofi-passmenu
super + Escape
pkill -USR1 -x sxhkd

View file

@ -1,3 +1,7 @@
for dir in $XDG_CONFIG_HOME/*/bin(N); do
export PATH="$dir:$PATH"
done
for file in $XDG_CONFIG_HOME/zsh/rc.d/env.*.zsh(N); do
source $file
done

View file

@ -13,7 +13,7 @@
name = "browsermenu";
desktopName = "Open Bookmark in Firefox";
icon = "firefox";
exec = "/home/hlissner/.config/rofi/bin/browsermenu";
exec = "rofi-browsermenu";
categories = "Network";
})
];
@ -24,6 +24,5 @@
home-manager.users.hlissner.xdg.configFile = {
# link recursively so other modules can link files in its folder
"rofi" = { source = <config/rofi>; recursive = true; };
"zsh/rc.d/env.rofi.zsh".source = <config/rofi/env.zsh>;
};
}

View file

@ -11,6 +11,6 @@
}
#element.selected {
text-color: #c678dd;
border-color: #c678dd;
text-color: #c678dd;
border-color: #c678dd;
}