From 453d2febc2ca6db2ee0ba8d8a19a6ff7dc9876c1 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Wed, 2 Jan 2019 03:55:16 -0500 Subject: [PATCH] Added dmenu pass script --- aliases/zsh_aliases | 2 +- configs/i3/config | 30 +++++++++++++++++------------- configs/i3blocks-scripts/volume | 2 +- dotfiles/.vimrc | 2 ++ scripts/change-sink | 3 ++- scripts/passmenu | 25 +++++++++++++++++++++++++ txt/usbs.md | 2 +- 7 files changed, 49 insertions(+), 17 deletions(-) create mode 100755 scripts/passmenu diff --git a/aliases/zsh_aliases b/aliases/zsh_aliases index 05f694c..e23d5b9 100644 --- a/aliases/zsh_aliases +++ b/aliases/zsh_aliases @@ -262,7 +262,7 @@ function gcm(){ echo git commit -m \""$1"\" ; } function psgi() { git add . - git commit -mS '.' + git commit -m '.' -S git push } alias gps="git push" diff --git a/configs/i3/config b/configs/i3/config index b9680d7..ba2cbaa 100644 --- a/configs/i3/config +++ b/configs/i3/config @@ -32,18 +32,21 @@ bindsym Mod4+a exec studio bindsym $mod+control+Return exec $def_term bindsym Mod4+c exec $browser bindsym Mod4+f exec firefox -bindsym Mod4+o exec okular -bindsym Mod4+m exec okular $sch_dir/calc-textbook.pdf +bindsym Mod4+h exec echo 'kevin.mok@live.ca' | xclip -selection clipboard bindsym Mod4+n exec urxvt -e nvim -bindsym Mod4+p workspace $ws4; exec pgadmin3 +bindsym Mod4+o exec xclip -selection clipboard ~/.password-store/social/gmail +# bindsym Mod4+p workspace $ws4; exec pgadmin3 # bindsym Mod4+p exec pycharm +bindsym Mod4+p exec passmenu bindsym Mod4+q exec qdirstat bindsym Mod4+r exec urxvt -e ranger # bindsym control+$mod+s exec systemctl suspend bindsym control+$mod+s exec systemctl suspend bindsym Mod4+t exec st +bindsym Mod4+u exec echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard # bindsym Mod4+x exec $swex # bindsym Mod4+x exec xmodmap ~/.Xmodmap +bindsym Mod4+z exec cliqz # bindsym Print exec gscreenshot # }}} app shortcuts # @@ -219,11 +222,11 @@ set $ws7 "7 " workspace $ws7 output $samsung bindsym $mod+F7 workspace $ws7; exec $def_term -set $ws8 "8 " +set $ws8 "8 " # set $ws8 "8 📊" # assign [class="jetbrains-"] $ws8 workspace $ws8 output $samsung -bindsym $mod+F8 workspace $ws8; exec urxvt -e htop -s PERCENT_MEM +bindsym $mod+F8 workspace $ws8; exec $def_term set $ws9 "9 " # set $ws9 "9 🔧" @@ -237,13 +240,14 @@ workspace $ws10 output $samsung set $hp 2 # bindsym Mod4+v workspace $ws10; exec urxvt -e alsamixer -c 0 bindsym Mod4+v workspace $ws10; exec urxvt -e cava -bindsym Mod4+h workspace $ws10; exec urxvt -e alsamixer -c $hp +# bindsym Mod4+h workspace $ws10; exec urxvt -e alsamixer -c $hp bindsym Mod4+s workspace $ws10; exec spotify -set $ws11 "11 " +set $ws11 "11 " +# set $ws11 "11 📊" # assign [class="Summoners War Exporter"] $ws11 workspace $ws11 output $samsung -bindsym $mod+F11 workspace $ws11; exec $def_term +bindsym $mod+F11 workspace $ws11; exec urxvt -e htop -s PERCENT_MEM set $ws12 "12 " bindsym $mod+F12 workspace $ws12; exec $def_term @@ -332,11 +336,11 @@ for_window [class="^.*"] border pixel 3 set $inner_gaps 40 set $outer_gaps 0 -gaps inner $inner_gaps -gaps outer $outer_gaps -gaps bottom 0 -# gaps inner 0 -# gaps outer 0 +# gaps inner $inner_gaps +# gaps outer $outer_gaps +# gaps bottom 0 +gaps inner 0 +gaps outer 0 # other gaps {{{ # diff --git a/configs/i3blocks-scripts/volume b/configs/i3blocks-scripts/volume index 7a61490..0a9be6b 100755 --- a/configs/i3blocks-scripts/volume +++ b/configs/i3blocks-scripts/volume @@ -141,7 +141,7 @@ esac function print_format { # echo $NAME case $NAME in - *"FiiO"*) + *"USB"*) SINK_SYMB="" ;; *"hdmi"*) diff --git a/dotfiles/.vimrc b/dotfiles/.vimrc index 48a21a1..937dc4e 100644 --- a/dotfiles/.vimrc +++ b/dotfiles/.vimrc @@ -196,6 +196,8 @@ let mapleader="\" " replace until end of line nnoremap c c$ " delete entire buffer +nnoremap d d$ +" delete entire buffer nnoremap dg ggdG " delete line into system clipboard nnoremap D "+dd diff --git a/scripts/change-sink b/scripts/change-sink index 155d5da..6377e69 100755 --- a/scripts/change-sink +++ b/scripts/change-sink @@ -9,7 +9,8 @@ case $1 in devicename="alsa_output.usb-1852_DigiHug_USB_Audio-01.analog-stereo" ;; line-out ) - devicename="alsa_output.pci-0000_00_14.2.analog-stereo" + # devicename="alsa_output.pci-0000_00_14.2.analog-stereo" + devicename="alsa_output.pci-0000_00_14.2.iec958-stereo" ;; esac # if [ "$1" = "dac" ]; then diff --git a/scripts/passmenu b/scripts/passmenu new file mode 100755 index 0000000..83268bc --- /dev/null +++ b/scripts/passmenu @@ -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[@]}" | dmenu "$@") + +[[ -n $password ]] || exit + +if [[ $typeit -eq 0 ]]; then + pass show -c "$password" 2>/dev/null +else + pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | + xdotool type --clearmodifiers --file - +fi diff --git a/txt/usbs.md b/txt/usbs.md index d926c02..f638b85 100644 --- a/txt/usbs.md +++ b/txt/usbs.md @@ -7,7 +7,7 @@ - HP (1TB) = files/backups # 2.0 -- Adata (16) = Antergos +- Adata (16) = Windows files - Lexar (32) = - Kingston (16) = Ubuntu - Kingston (yellow, 8) = Manjaro