summaryrefslogblamecommitdiff
path: root/toggle-docked.sh
blob: 54551a142a8a38fc24ce2bab3302ecba7a989c6f (plain) (tree)
1
2
3
4
5
6
7
8






                                          
                              










                                  
                           



                                 

                          

















                                  

                         
  
#!/bin/sh
hasVGA=$(xrandr | grep VGA-0 | cut -w -f2)

if [ "$hasVGA" = "connected" ]; then
	xrandr \
		--output VGA-0 \
		--mode 1024x768 \
		--pos 1920x0 \
		--rotate normal \
		--dpi 82 \
		--output DP-0 \
		--off \
		--output DP-1 \
		--off \
		--output DP-2 \
		--off \
		--output DP-3 \
		--primary \
		--mode 1920x1080 \
		--pos 0x0 \
		--rotate normal \
		--dpi 96 \
		--output DP-4 \
		--off
	killall xautolock
	autolocker.sh -d &
else
	xrandr \
		--output VGA-0 \
		--off \
		--output DP-0 \
		--off \
		--output DP-1 \
		--off \
		--output DP-2 \
		--off \
		--output DP-3 \
		--primary \
		--mode 1920x1080 \
		--pos 0x0 \
		--rotate normal \
		--dpi 96 \
		--output DP-4 \
		--off
	killall xautolock
	autolocker.sh &
fi