diff options
author | adam <56338480+adastx@users.noreply.github.com> | 2022-10-08 22:53:07 +0200 |
---|---|---|
committer | adam <56338480+adastx@users.noreply.github.com> | 2022-10-08 22:53:17 +0200 |
commit | d9579aee55d4295151b4a76d82975c7171908acc (patch) | |
tree | a1994d4f720ae14850ae3c8232d00eaf652d5b2d | |
parent | b0da3cf5ec6121fc481d5b5315c4dc34ac423bb4 (diff) |
scripts: polished 'dock'
-rwxr-xr-x | .local/bin/dock | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/.local/bin/dock b/.local/bin/dock index 6414c78..ada7b64 100755 --- a/.local/bin/dock +++ b/.local/bin/dock @@ -27,31 +27,32 @@ usage () { help () { usage echo - echo "Toggle laptop between regular and 'docked' modes" + echo "Dock or undock laptop" echo echo "options:" echo " -h, --help show this help message and exit" - echo " -d dock laptop" - echo " -u undock laptop" + echo " -d dock" + echo " -u undock" } dock () { - echo "docking..." - if ! xrandr | grep -q "HDMI-1 connected" ; then echo "error: HDMI not connected"; exit 1 fi - xrandr --output HDMI-1 --mode 2560x1440 --rate 70 --primary --output eDP-1 --off - nitrogen --save --set-centered Pictures/wallpapers/wave-center-docked.png - betterlockscreen -u Pictures/wallpapers/wave-center-docked.png + barpos -b + xrandr --output HDMI-1 --mode 2560x1440 --rate 70 --primary + xrandr --output eDP-1 --off + xwallpaper --center $XDG_CONFIG_HOME/wallpaper/bg + betterlockscreen -u $XDG_CONFIG_HOME/wallpaper/lock &>/dev/null & } undock () { - echo "undocking..." - xrandr --output eDP-1 --mode 1920x1080 --primary --output HDMI-1 --off - nitrogen --save --set-centered Pictures/wallpapers/wave-center.png - betterlockscreen -u Pictures/wallpapers/wave-center.png + barpos -t + xrandr --output eDP-1 --mode 1920x1080 --primary + xrandr --output HDMI-1 --off + xwallpaper --center $XDG_CONFIG_HOME/wallpaper/bg + betterlockscreen -u $XDG_CONFIG_HOME/wallpaper/lock &>/dev/null & } main "$@" |