dotfiles

Mahdi's dotfiles
git clone git://mahdi.pw/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

xinitrc (1079B)


      1 #!/bin/sh
      2 
      3 # Disable [Energy Star/Screensaver] features
      4 xset -dpms
      5 xset s off
      6 
      7 # Reload Xresources/Xmodmap
      8 UXR=${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources
      9 UMM=${XDG_CONFIG_HOME:-$HOME/.config}/x11/xmodmap
     10 [ -f "$UXR" ] && xrdb -merge "$UXR"
     11 [ -f "$UMM" ] && xmodmap "$UMM"
     12 
     13 # Autostart:
     14 theme-sel -x
     15 bg-gen &
     16 dwm-bar &
     17 pipewire &
     18 pipewire-pulse &
     19 pipewire-media-session &
     20 
     21 # Monitors:
     22 i=0
     23 for MONITOR in $(xrandr | awk '$2 == "connected"{print $1}'); do
     24 	if [ "$i" -eq 0 ]; then
     25 		xrandr --output "$MONITOR" --auto --primary
     26 		LAST_MONITOR="$MONITOR"
     27 	else
     28 		xrandr --output "$MONITOR" --auto
     29 		xrandr --output "$LAST_MONITOR" --above "$MONITOR"
     30 		LAST_MONITOR="$MONITOR"
     31 	fi
     32 	i=$((i+1))
     33 done
     34 
     35 # Keyboard - Fix for my layouts:
     36 setxkbmap -layout us,ir
     37 setxkbmap -option 'grp:caps_toggle'
     38 
     39 # Keyboard - Bind `Alt_L` to `p` for my laptop's broken keyboard:
     40 xmodmap -e "clear mod1"
     41 xmodmap -e "keycode 108 = p P Arabic_hah bracketleft"
     42 xmodmap -e "add mod1 = Alt_L Meta_L"
     43 
     44 # Add -f after startx to experience dwm in floating mode.
     45 exec dbus-launch dwm "$@"
     46 #ssh-agent dwm "$@"