#!/bin/bash # # Startup on my Ubuntu 14.04 system works like this: # - lightdm finds /usr/share/xsessions/dwm.desktop # - This desktop file launches dwm.user, which is found in /usr/bin # - /usr/bin/dwm.user is a script that execs $HOME/.dwmrc, if present, else it # execs dwm. # - This is my dwmrc, which installs as ~/.dwmrc # Although the system startup merged ~/.Xresources, it did so with the -nocpp # option (Ubuntu 14.04), which prevents the use of #define, etc. Re-merge here # for correct behavior. xrdb -merge ~/.Xresources # Initial startup volume to sane level pactl set-sink-volume $(pactl info | grep "Default Sink:" | awk '{ print $3}') '30%' # Default LCD panel brightness xbacklight -set 50 # Set the X background xsetroot -solid black # Set up screens dispcfg # Screen saver. DPMS standby -> suspend -> off in seconds # xss-lock calls i3lock on no X activity (DPMS standby) xset dpms 300 600 1200 pgrep -x xss-lock || xss-lock -- i3lock --dpms & # Turn off touchpad (later use a toggle) type synclient 2>/dev/null && synclient TouchpadOff=1 # Applets, etc pgrep -x xbindkeys || xbindkeys & pgrep -x dunst || dunst & pgrep -x nm-applet || nm-applet & pgrep -x xfce4-power-manager || xfce4-power-manager & pgrep -x pidgin || pidgin & pgrep dwm-i3status || dwm-i3status & # Get ssh-add out of the way. The ssh-askpass-fullscreen pkg provides a bit # nicer ssh-askpass than the default X11 version. SSH_ASKPASS=/usr/bin/ssh-askpass ssh-add & # DWM has bindings for screen captures that expects ~/screenshots/ to exist. mkdir -p ~/screenshots exec dwm.custom