]> www.git.dmfe.net Git - dotfiles/commitdiff
Add pass dmenu script. Some configuration changes for vi and java.
authorDmitry Fedotov <dm.fe@yandex.ru>
Sun, 24 Jan 2021 09:51:40 +0000 (12:51 +0300)
committerDmitry Fedotov <dm.fe@yandex.ru>
Sun, 24 Jan 2021 10:29:30 +0000 (13:29 +0300)
config/sxhkd/sxhkdrc
scripts/dmenu-pass.sh [new file with mode: 0755]
shell/init_scripts/configs.mrc
shell/init_scripts/java.mrc

index e86cac4371c3dcf503905c2ac42efed7823d0b36..661903a96b9d4ad1a748ce67e3a87751b0e33f23 100644 (file)
@@ -25,6 +25,8 @@ super + shift + m
        ${SCRIPTS}/dmenumount.sh
 super + shift + x
        ${SCRIPTS}/screen-locker.sh
+super + shift + p
+    ${SCRIPTS}/dmenu-pass.sh
 
 super + alt + l
        pkill -SIGUSR1 sxhkd
diff --git a/scripts/dmenu-pass.sh b/scripts/dmenu-pass.sh
new file mode 100755 (executable)
index 0000000..84dc5ee
--- /dev/null
@@ -0,0 +1,30 @@
+#!/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}" )
+
+panel_background=$(xrdb -query | grep '*.panel_background' | awk '{print $NF}')
+selected_background=$(xrdb -query | grep '*.ws_focused' | awk '{print $NF}')
+
+password=$(printf '%s\n' "${password_files[@]}" | dmenu -fn Monospace-18 -nb "${panel_background}" -sb "${selected_background}" "$@")
+
+[[ -n $password ]] || exit
+
+if [[ $typeit -eq 0 ]]; then
+    pass show -c "${password}" 2>/dev/null && \
+        notify-send "${password} copied to clipboard"
+else
+    pass show "${password}" | { IFS= read -r pass; printf %s "$pass"; } |
+        xdotool type --clearmodifiers --file -
+fi
+
index 31b529e19d85cb5b9722331326335f54e0229f85..bf9d1e92833ab1adf046f86fee82787ba2d415a2 100644 (file)
@@ -8,6 +8,7 @@
 export XDG_CONFIG_HOME=${HOME}/.config
 
 alias vi='vi -c "let g:tty='\''$(tty)'\''"'
+alias v='vi'
 alias i3c="vi ${HOME}/.config/i3/config"
 alias bsc="vi ${HOME}/.bashrc"
 alias tmux="tmux -f ${XDG_CONFIG_HOME}/tmux/config"
index dd35bcf2455a9b5003576e380bdba72f1c437d64..2e80e5a4dcea74e938e0c81ca6f9bf5ca200a491 100644 (file)
@@ -1,3 +1,3 @@
 # /etc/skel/.javarc
-export JAVA_HOME="/usr/lib/jvm/icedtea-bin-8"
+export JAVA_HOME="/usr/lib/jvm/jdk-11"
 export GRADLE_HOME="/opt/gradle/gradle-6.4.1"