diff --git a/dot_config/choose/executable_choose-clip.sh b/dot_config/choose/executable_choose-clip.sh new file mode 100644 index 0000000..e8e8114 --- /dev/null +++ b/dot_config/choose/executable_choose-clip.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Use fuzzel to find a password from password-store and copy it to clipboard. +# inpired by: https://gist.github.com/igemnace/2b8609d280752e8a1b173204c14f6892 + +clip_name=$(cd $HOME/Library/Containers/com.generalarcade.flycut/Data/Library/Preferences && plutil -convert json com.generalarcade.flycut.plist && cat com.generalarcade.flycut.plist | jq '.store.jcList[] | {Contents} | join(" ")' | sed -e 's/[^.]//;s/.$//' | choose) + +[[ $clip_name != "" ]] && echo $clip_name | pbcopy diff --git a/dot_config/choose/executable_choose-pass.sh b/dot_config/choose/executable_choose-pass.sh new file mode 100644 index 0000000..6d88df4 --- /dev/null +++ b/dot_config/choose/executable_choose-pass.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Use fuzzel to find a password from password-store and copy it to clipboard. +# inpired by: https://gist.github.com/igemnace/2b8609d280752e8a1b173204c14f6892 + +pass_name=$(cd $HOME/.password-store && rg --files | sed 's/\.gpg$//' | choose) + +[[ $pass_name != "" ]] && pass show -c $pass_name diff --git a/dot_config/skhd/skhdrc b/dot_config/skhd/skhdrc index 9dda6fc..01db2b9 100644 --- a/dot_config/skhd/skhdrc +++ b/dot_config/skhd/skhdrc @@ -111,7 +111,7 @@ # ] # open terminal, blazingly fast compared to iTerm/Hyper -cmd - return : /Applications/WezTerm.app/Contents/MacOS/wezterm start --always-new-process +cmd - return : /Applications/WezTerm.app/Contents/MacOS/wezterm # open qutebrowser #cmd + shift - return : ~/Scripts/qtb.sh @@ -285,8 +285,14 @@ alt - o : yabai -m window --toggle topmost # toggle picture-in-picture alt - p : yabai -m window --toggle border --toggle pip +# Screenshot +alt + shift - p : screencapture -oWx ~/Pictures/"$(TZ=UTC date '+%F_%H-%M-%S')".png + # change layout of desktop ctrl + alt - a : yabai -m space --layout bsp ctrl + alt - d : yabai -m space --layout float ctrl + alt - s : yabai -m space --layout $(yabai -m query --spaces --space | jq -r 'if .type == "bsp" then "float" else "bsp" end') +cmd + shift - y : ~/.config/choose/choose-pass.sh +cmd - y : ~/.config/choose/choose-clip.sh + diff --git a/dot_config/yabai/executable_yabairc b/dot_config/yabai/executable_yabairc index 14cd3d7..7852366 100644 --- a/dot_config/yabai/executable_yabairc +++ b/dot_config/yabai/executable_yabairc @@ -27,6 +27,17 @@ yabai -m rule --add app="^Steam$" space=games manage=off yabai -m rule --add app="^(Calculator|System Preferences|Archive Utility)$" manage=off yabai -m rule --add app="^mpv$" manage=off border=off sticky=on layer=above opacity=1.0 grid=8:8:6:0:2:2 +# float system preferences +yabai -m rule --add app="^System Preferences$" manage=off +yabai -m rule --add app="^choose$" manage=off + +# show digital colour meter topmost and on all spaces +yabai -m rule --add app="^Digital Colou?r Meter$" sticky=on + +# refresh my Übersicht bar when the space changes +yabai -m signal --add event=space_changed \ + action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"spaces-widget\"'" + # signals yabai -m signal --add event=window_destroyed active=yes action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse &> /dev/null || yabai -m window --focus \$(yabai -m query --windows --space | jq .[0].id) &> /dev/null" yabai -m signal --add event=window_minimized active=yes action="if \$(yabai -m query --windows --window \$YABAI_WINDOW_ID | jq -r '.\"is-floating\"'); then yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse &> /dev/null || yabai -m window --focus \$(yabai -m query --windows --space | jq .[0].id) &> /dev/null; fi"