diff options
Diffstat (limited to '.local/bin')
-rwxr-xr-x | .local/bin/barlaunch | 3 | ||||
-rwxr-xr-x | .local/bin/clipclear | 3 | ||||
-rwxr-xr-x | .local/bin/dmenu/dm-pass | 24 | ||||
-rwxr-xr-x | .local/bin/dmenu/dm-power | 11 | ||||
-rwxr-xr-x | .local/bin/dock | 17 | ||||
-rwxr-xr-x | .local/bin/menu/pass | 24 | ||||
-rwxr-xr-x | .local/bin/menu/power | 9 | ||||
-rwxr-xr-x | .local/bin/rate | 6 |
8 files changed, 40 insertions, 57 deletions
diff --git a/.local/bin/barlaunch b/.local/bin/barlaunch index 5a8fec0..99a37cd 100755 --- a/.local/bin/barlaunch +++ b/.local/bin/barlaunch @@ -3,4 +3,5 @@ polybar-msg cmd quit >/dev/null echo "---" >> /tmp/polybar.log -nohup polybar bar1 --reload >> /tmp/polybar.log 2>&1 & +MONITOR=eDP-1 nohup polybar primary --reload >> /tmp/polybar.log 2>&1 & +# MONITOR=HDMI-1 nohup polybar primary --reload >> /tmp/polybar.log 2>&1 & diff --git a/.local/bin/clipclear b/.local/bin/clipclear deleted file mode 100755 index 2395cc3..0000000 --- a/.local/bin/clipclear +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -clipdel -d ".*" diff --git a/.local/bin/dmenu/dm-pass b/.local/bin/dmenu/dm-pass deleted file mode 100755 index 2432822..0000000 --- a/.local/bin/dmenu/dm-pass +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -DMENU_CMD="dmenu -p 'pass:' -l 8 -b -i -fn 'JetBrainsMono Nerd Font:size=11'" - -entry=$(find "$PASSWORD_STORE_DIR" -name '*.gpg' |\ - sed "s|$PASSWORD_STORE_DIR/||" |\ - sed "s|.gpg||" |\ - sort -n |\ - eval "$DMENU_CMD") || exit 1 - -details=$(pass "$entry") || exit 1 -user=$(echo "$details" | sed -n '2p' | sed 's|user: ||') -pass=$(echo "$details" | head -n1) - -case "$(printf "autotype\npass\nuser" | eval "$DMENU_CMD")" in - autotype) - xdotool type "$user" - xdotool key Tab - xdotool type "$pass" ;; - pass) - xdotool type "$pass" ;; - user) - xdotool type "$user" ;; -esac diff --git a/.local/bin/dmenu/dm-power b/.local/bin/dmenu/dm-power deleted file mode 100755 index fb856bb..0000000 --- a/.local/bin/dmenu/dm-power +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -DMENU_CMD="dmenu -p 'sys:' -l 8 -b -i -fn 'JetBrainsMono Nerd Font:size=11'" - -case "$(printf "Shutdown\nRestart\nLogout\nSuspend\nLock" | eval "$DMENU_CMD")" in - Shutdown) exec systemctl poweroff;; - Restart) exec systemctl reboot;; - Logout) exec loginctl terminate-session ${XDG_SESSION_ID-};; - Suspend) exec systemctl suspend;; - Lock) exec systemctl --user start lock.target;; -esac diff --git a/.local/bin/dock b/.local/bin/dock index 5f8ec04..da9a1b2 100755 --- a/.local/bin/dock +++ b/.local/bin/dock @@ -12,23 +12,16 @@ main () { } dock () { - if ! xrandr | grep -q "HDMI-1 connected" ; then + if ! swaymsg -t get_outputs | grep -q "HDMI-A-1" ; then echo "error: HDMI not connected"; exit 1 fi - - # barpos bottom - ~/.local/bin/barlaunch - xrandr --output HDMI-1 --mode 2560x1440 --rate 70 --primary - xrandr --output eDP-1 --off - xwallpaper --center ~/.local/share/bg + swaymsg output HDMI-A-1 enable res 2560x1440@70Hz + swaymsg output eDP-1 disable } undock () { - # barpos top - ~/.local/bin/barlaunch - xrandr --output eDP-1 --mode 1920x1080 --primary - xrandr --output HDMI-1 --off - xwallpaper --center ~/.local/share/bg + swaymsg output eDP-1 enable res 1920x1080 + swaymsg output HDMI-A-1 disable } main "$@" diff --git a/.local/bin/menu/pass b/.local/bin/menu/pass new file mode 100755 index 0000000..86fd1ee --- /dev/null +++ b/.local/bin/menu/pass @@ -0,0 +1,24 @@ +#!/bin/sh + +MENU_CMD="bemenu -p 'pass'" + +entry=$(find "$PASSWORD_STORE_DIR" -name '*.gpg' |\ + sed "s|$PASSWORD_STORE_DIR/||" |\ + sed "s|.gpg||" |\ + sort -n |\ + eval "$MENU_CMD") || exit 1 + +details=$(pass "$entry") || exit 1 +user=$(echo "$details" | sed -n '2p' | sed 's|user: ||') +pass=$(echo "$details" | head -n1) + +case "$(printf "autotype\npass\nuser" | eval "$MENU_CMD")" in + autotype) + wtype "$user" + wtype -k Tab + wtype "$pass" ;; + pass) + wtype "$pass" ;; + user) + wtype "$user" ;; +esac diff --git a/.local/bin/menu/power b/.local/bin/menu/power new file mode 100755 index 0000000..4962580 --- /dev/null +++ b/.local/bin/menu/power @@ -0,0 +1,9 @@ +#!/bin/sh + +case "$(printf "shutdown\nreboot\nlogout\nsuspend\nlock" | eval bemenu -p 'power')" in + shutdown) exec systemctl poweroff;; + reboot) exec systemctl reboot;; + logout) exec loginctl terminate-session "${XDG_SESSION_ID-}";; + suspend) exec systemctl suspend;; + lock) exec swaylock -f -c 000000;; +esac diff --git a/.local/bin/rate b/.local/bin/rate deleted file mode 100755 index f8be848..0000000 --- a/.local/bin/rate +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -xset r rate 300 25 -setxkbmap -option grp:win_space_toggle us,dk - -xset -dpms && xset s off |