aboutsummaryrefslogtreecommitdiff
path: root/config/x11/xinitrc
blob: d883219000e984526c495b3f798f6ff5a1036929 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh

keynav daemonize               # moving the cursor around without the mouse
redshift &                     # filter blue light
dunst &                        # notification daemon
unclutter --timeout 10 --fork  # hide mouse after 10s
clout push-watch &             # could with rsync
xrdb "$XDG_CONFIG_HOME/x11/Xresources"
syncthing --no-browser > ~/.cache/syncthing.log 2>&1 &
hsetroot -add '#111' -add '#222' -gradient 180

case "$(cat /etc/hostname)" in
    charles-main)
        if xrandr | grep -q 'DisplayPort-0 connected'
        then
            xrandr --output DisplayPort-0 --mode 3840x1080 --rate 68
        elif xrandr | grep 'HDMI-0 connected'
        then
            xrandr --output DVI-0  --auto                     --left-of DVI-1  \
                   --output DVI-1  --mode 1920x1080 --primary --left-of HDMI-0 \
                   --output HDMI-0 --mode 1920x1080
        else
            xrandr --output DVI-0  --auto                     --left-of DVI-1  \
                   --output DVI-1  --mode 1920x1080 --primary
        fi
        ;;
    charles-laptop)
        xrandr | grep -q 'VGA1.*connected' &&
        xrandr --output LVDS1 --primary --left-of VGA1 \
               --output VGA1 --mode 1280x1024
        ;;
    charles-fractal)
        if xrandr | grep -q 'HTMI-1 connected'
        then
            xrandr --output DP-2 --mode 3840x1080 --primary --left-of HDMI-1 \
                   --output HDMI-1 --mode 1920x1080
        fi
        # fix screen tearing
        nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
        ;;
    charles-cleveron)
        if xrandr | grep -q 'HDMI1 connected'
        then
            # Generated by arandr
            xrandr --output eDP1 --primary --mode 1600x900 --pos 0x0 --rotate normal --output DP1 --off --output DP2 --off --output DP2-1 --off --output DP2-2 --mode 1920x1080 --pos 3520x0 --rotate normal --output DP2-3 --off --output HDMI1 --mode 1920x1080 --pos 1600x0 --rotate normal --output HDMI2 --off --output VIRTUAL1 --off
        fi
esac

# awesome
xmonad || { xmonad --recompile; xmonad; }