add script to detect if docked and change stuff then, fixes #2

auto-flake-update
Yorick van Pelt 2013-08-23 15:58:36 +02:00
parent db218badeb
commit b7c1e0d4f0
2 changed files with 17 additions and 3 deletions

16
bin/docked.sh Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/sh
# this script checks if the system is docked with the lid closed
# and if so, sets the correct DPI, disables the laptop screen, sets the DP-3 monitor as primary
# and loads the nvidia config for vsync options and sets the dithering depth to 8
if [ `cat /sys/devices/platform/hp-wmi/dock` -eq 1 ] && [[ `cat /proc/acpi/button/lid/LID/state` == *closed* ]]
then
echo "Using docked configuration with 27\" IPS screen and VGA-screen"
xrandr --output LVDS-0 --off --output DP-3 --primary --output VGA-0 --left-of DP-3 --dpi 108.79/DP-3
nvidia-settings -l -a "[dpy:DP-3]/DitheringDepth=2" -a "0/XVideoSyncToDisplay=1048576"
echo "Xft.dpi: 108.79" | xrdb -merge
else
echo "Using laptop-only configuration"
xrandr --output LVDS-0 --mode 1920x1080 --primary --rotate normal --pos 0x0 --output VGA-0 --off --output DP-3 --off --dpi 146.86/LVDS-0
nvidia-settings -l
echo "Xft.dpi: 146.86" | xrdb -merge
fi

View File

@ -6,13 +6,11 @@ export GTK2_RC_FILES="$HOME/dotfiles/gtk/gtkrc.mine"
export GDK_CORE_DEVICE_EVENTS=1
xrdb ~/dotfiles/x/Xresources
source /etc/profile.d/infinality-settings.sh
#.screenlayout/display_pluggedin.sh
#/usr/bin/xscreensaver -no-splash &
~/dotfiles/bin/docked.sh
pulseaudio --start
volnoti
dropbox start &
syndaemon -t -k -i 1 -d &
synclient HorizScrollDelta=-107 VertScrollDelta=-107
urxvtd -f -o
(sleep 2s; compton --config ~/dotfiles/x/compton.conf -b) &
exec awesome -c ~/dotfiles/awesome/rc.lua