Merge branch 'master' of gitlab.com:chriscochrun/dotfiles
This commit is contained in:
		
						commit
						0f2d413d57
					
				
					 4 changed files with 74 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -318,7 +318,7 @@ colors:
 | 
			
		|||
#
 | 
			
		||||
# Window opacity as a floating point number from `0.0` to `1.0`.
 | 
			
		||||
# The value `0.0` is completely transparent and `1.0` is opaque.
 | 
			
		||||
background_opacity: 0.75
 | 
			
		||||
background_opacity: 1
 | 
			
		||||
 | 
			
		||||
#selection:
 | 
			
		||||
  #semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -119,6 +119,8 @@
 | 
			
		|||
                     ;; Prompt
 | 
			
		||||
                     (awful.key [ modkey ] "Menu" (fn [] (awful.spawn "/home/chris/.config/rofi/launchers-git/run.sh"))
 | 
			
		||||
                                {:description "run prompt" :group "launcher"})
 | 
			
		||||
                     (awful.key [ modkey ] "r" (fn [] (awful.spawn "/home/chris/.config/rofi/launchers-git/run.sh"))
 | 
			
		||||
                                {:description "run prompt" :group "launcher"})
 | 
			
		||||
 | 
			
		||||
                     (awful.key [ modkey shift ctrl ] "x" (fn []
 | 
			
		||||
                                                              (let [fscr (awful.screen.focused)]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -240,7 +240,7 @@ blur: {
 | 
			
		|||
  # requires: https://github.com/ibhagwan/picom
 | 
			
		||||
  method = "dual_kawase";
 | 
			
		||||
  #method = "kernel";
 | 
			
		||||
  strength = 17;
 | 
			
		||||
  strength = 14;
 | 
			
		||||
  deviation = 4.0;
 | 
			
		||||
  # kernel = "11x11gaussian";
 | 
			
		||||
  background = false;
 | 
			
		||||
| 
						 | 
				
			
			@ -266,7 +266,7 @@ blur-background-exclude = [
 | 
			
		|||
  "name = 'Video'",
 | 
			
		||||
  "name = 'Projection Window'",
 | 
			
		||||
  # "window_type = '_NET_WM_WINDOW_TYPE_NOTIFICATION'"
 | 
			
		||||
  "window_type = 'notification'"
 | 
			
		||||
  # "window_type = 'notification'"
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										69
									
								
								scripts/kderofi-rbw
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										69
									
								
								scripts/kderofi-rbw
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,69 @@
 | 
			
		|||
#!/usr/bin/env bash
 | 
			
		||||
# Very basic interface for rbw using rofi
 | 
			
		||||
if [ $(hostname) = "syl" ]; then
 | 
			
		||||
    style="laptop-rbw"
 | 
			
		||||
    #echo "this is hidpi"
 | 
			
		||||
else 
 | 
			
		||||
    style="desktop-rbw"
 | 
			
		||||
    #echo "this is not hidpi"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# Get all password files and create an array
 | 
			
		||||
root=~/.password-store
 | 
			
		||||
CACHE=~/.local/tmp/pass_rofi
 | 
			
		||||
seat=seat0
 | 
			
		||||
 | 
			
		||||
rbw sync
 | 
			
		||||
rbw list
 | 
			
		||||
 | 
			
		||||
list_passwords() {
 | 
			
		||||
    rbw list
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
passwords=$(rbw list)
 | 
			
		||||
 | 
			
		||||
prompt='search for passwords...'
 | 
			
		||||
SECRET=$(list_passwords | rofi -i -p="${prompt}" -dmenu -theme ~/.config/rofi/launchers-git/$style.rasi)
 | 
			
		||||
 | 
			
		||||
# Ask whether pass, user or both are required
 | 
			
		||||
options=("Password" \
 | 
			
		||||
             "User" \
 | 
			
		||||
             "User and password" \
 | 
			
		||||
             "QR-Code" \
 | 
			
		||||
	     "OTP")
 | 
			
		||||
 | 
			
		||||
option=$(printf '%s\n' "${options[@]%}" | rofi -i -dmenu -p="..." -theme ~/.config/rofi/launchers-git/$style.rasi)
 | 
			
		||||
 | 
			
		||||
# echo $option
 | 
			
		||||
 | 
			
		||||
case ${option} in
 | 
			
		||||
    Password )
 | 
			
		||||
	# echo "${SECRET}"
 | 
			
		||||
	ydotool type --next-delay 500 $(rbw get "${SECRET}")
 | 
			
		||||
	;;
 | 
			
		||||
    User )
 | 
			
		||||
	ydotool type --next-delay 500 "$(rbw get --full "${SECRET}" | rg Username: | awk '{print $2}')"
 | 
			
		||||
	;;
 | 
			
		||||
    "User and password" )
 | 
			
		||||
	ydotool type --next-delay 500 $(rbw get --full "${SECRET}" | rg Username: | awk '{print $2}')
 | 
			
		||||
	ydotool key TAB
 | 
			
		||||
	ydotool type --next-delay 500 $(rbw get "${SECRET}")
 | 
			
		||||
	;;
 | 
			
		||||
    "QR-Code" )
 | 
			
		||||
	if [[ $SECRET =~ wifi$ ]]; then
 | 
			
		||||
	    # Produce a valid wifi QR-code
 | 
			
		||||
	    WIFISSID=$(pass get_user ${SECRET})
 | 
			
		||||
	    WIFIPASS=$(pass get_pass ${SECRET})
 | 
			
		||||
	    WIFIQR="WIFI:T:WPA;S:${WIFISSID};P:${WIFIPASS};;"
 | 
			
		||||
	    qrencode -s 8 -o - $WIFIQR | feh --title "pass: QR-WIFI" -
 | 
			
		||||
	else
 | 
			
		||||
	    # Only password
 | 
			
		||||
	    pass show -q1 ${SECRET}
 | 
			
		||||
	fi
 | 
			
		||||
	;;
 | 
			
		||||
    "OTP" )
 | 
			
		||||
	ydotool type --next-delay 300 $(rbw code ${SECRET})
 | 
			
		||||
	;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
# wl-copy -o -s ${seat} ${PASSWD_PASS}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue