]> git.phdru.name Git - dotfiles.git/blobdiff - .xinitrc
.xinitrc: calculate geometry for `xclock`
[dotfiles.git] / .xinitrc
index dabbeb0e50615bec5363ee8ec275a9a71f5a28d3..664442e430c3cfa9d70965faaa3df9fe5a8c02ba 100644 (file)
--- a/.xinitrc
+++ b/.xinitrc
@@ -10,10 +10,6 @@ if xauth list | grep -Fq -- -eth; then
    fi
 elif xauth list | grep -Fq -- -wifi; then
    xauth list | sed -e 's/^/add /' -e 's/-wifi/-eth/' | xauth
-else
-   echo "Unknown xauth info" >&2
-   xauth list
-   exit 1
 fi
 
 PATH="$PATH":/usr/games
@@ -44,9 +40,12 @@ fi
 #    "$OPENWINHOME"/lib/openwin-init    # Default OpenWindows tools
 #fi
 
-# EN/RU, switch on RightAlt, Compose: RightControl, Level3:RightMenu
+# EN/RU, switch on RightAlt and both Shifts,
+# Compose: RightControl, Level3:RightMenu.
 setxkbmap -layout '' -variant '' -option ''
-setxkbmap -layout 'us,ru' -variant ',common' -option 'grp:toggle,compose:rctrl,lv3:menu_switch'
+setxkbmap -layout 'us,ru' -variant ',common' -option 'grp:toggle,grp:shifts_toggle,compose:rctrl,lv3:menu_switch'
+# Terminate X session on Ctrl+Alt+Backspace
+#setxkbmap -option terminate:ctrl_alt_bksp
 
 # adjust key bindings (if any)
 #[ -f "$HOME"/lib/X11/.Xmodmap ] && xmodmap "$HOME"/lib/X11/.Xmodmap
@@ -77,10 +76,16 @@ synclient AccelFactor=0.1 MaxDoubleTapTime=80 MaxSpeed=1 RightEdge=5000 \
 # start a small console shell
 #xterm -C -geometry 80x8-0+0 -n Console -T Consle -ls +ut -fn 6x10 &
 
-#WIDTH=1024: 85x85+400+1
-#WIDTH=1600: 100x100+600+1
-#WIDTH=1920: 150x150+880+1
-xclock -geometry 100x100+600+1 -bg white -update 1 &
+screen_width=`xrandr --current | head -1 | awk '{print $8}'`
+if [ $screen_width = 1024 ]; then
+   xclcok_geom=85x85+400+1
+elif [ $screen_width = 1600 ]; then
+   xclcok_geom=100x100+600+1
+elif [ $screen_width = 1920 ]; then
+   xclcok_geom=150x150+880+1
+fi
+test -n "$xclcok_geom" && xclock -geometry $xclcok_geom -bg white -update 1 &
+unset screen_width xclcok_geom
 
 # multi-biff
 #xbuffy -fn '-*-helvetica-bold-r-*-*-*-100-*-*-*-*-koi8-r' -geometry +0+125 -boxfile mail/misc/.xbuffyrc &