diff options
author | adam <56338480+adastx@users.noreply.github.com> | 2022-10-10 01:20:33 +0200 |
---|---|---|
committer | adam <56338480+adastx@users.noreply.github.com> | 2022-10-10 01:20:33 +0200 |
commit | 0375f1c658571190d1b26ac8c12dac1b3ff8821e (patch) | |
tree | b83f1fcc7f49b2d1a1a6d37988400b6b437c00e6 /.local/bin/dock | |
parent | 9d1ef47d9757260631f96c879b02c0221e188648 (diff) |
scripts: cleanup
Diffstat (limited to '.local/bin/dock')
-rwxr-xr-x | .local/bin/dock | 44 |
1 files changed, 10 insertions, 34 deletions
diff --git a/.local/bin/dock b/.local/bin/dock index ada7b64..3d0c06f 100755 --- a/.local/bin/dock +++ b/.local/bin/dock @@ -1,38 +1,14 @@ #!/bin/bash main () { - if [ ! -n "$1" ]; then - help - fi - - while [ -n "$1" ]; do # while loop starts - case "$1" in - -d) - dock; break ;; - -u) - undock; break ;; - -h|--help) - help ;; - *) - usage; echo "error: unrecognized arguments: $1" ; exit 1 ;; - esac - shift - done -} - -usage () { - echo "usage: dock [options]" -} - -help () { - usage - echo - echo "Dock or undock laptop" - echo - echo "options:" - echo " -h, --help show this help message and exit" - echo " -d dock" - echo " -u undock" + case "$1" in + -d) + dock ;; + -u) + undock ;; + *) + echo "usage: dock [-du]";; + esac } dock () { @@ -40,7 +16,7 @@ dock () { echo "error: HDMI not connected"; exit 1 fi - barpos -b + barpos bottom xrandr --output HDMI-1 --mode 2560x1440 --rate 70 --primary xrandr --output eDP-1 --off xwallpaper --center $XDG_CONFIG_HOME/wallpaper/bg @@ -48,7 +24,7 @@ dock () { } undock () { - barpos -t + barpos top xrandr --output eDP-1 --mode 1920x1080 --primary xrandr --output HDMI-1 --off xwallpaper --center $XDG_CONFIG_HOME/wallpaper/bg |