summaryrefslogtreecommitdiff
path: root/.local/bin/dock
blob: 5f8ec04ee0765d1df9fa3744d1294eb2304876af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh

main () {
    case "$1" in
        -d) 
            dock ;; 
        -u) 
            undock ;;
        *) 
            echo "usage: dock [-du]";; 
    esac
}

dock () { 
    if ! xrandr | grep -q "HDMI-1 connected" ; 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
}

undock () {
    # barpos top
    ~/.local/bin/barlaunch
    xrandr --output eDP-1 --mode 1920x1080 --primary
    xrandr --output HDMI-1 --off
    xwallpaper --center ~/.local/share/bg
}

main "$@"