X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=blobdiff_plain;f=.xinitrc;h=7018cf418327d868e5a0226797cd5d33fe09305c;hp=dffb5a9b7d9c2564547ef46bcd602ebbd4676ab8;hb=81d03156ffa4b89fcf0c194cf52ae54d097d7e14;hpb=6fd72eb67de65b4ce4c3cf46e3390e7b9cc4a83e diff --git a/.xinitrc b/.xinitrc index dffb5a9..7018cf4 100644 --- a/.xinitrc +++ b/.xinitrc @@ -1,10 +1,22 @@ #!/bin/sh +# Add X authorization for all host names +if xauth list | grep -Fq -- -eth; then + if xauth list | grep -Fq -- -wifi; then + # Nothing to do + : + else + xauth list | sed -e 's/^/add /' -e 's/-eth/-wifi/' | xauth + fi +elif xauth list | grep -Fq -- -wifi; then + xauth list | sed -e 's/^/add /' -e 's/-wifi/-eth/' | xauth +fi + PATH="$PATH":/usr/games # Set initial background xsetroot -solid DarkCyan -xli -border darkcyan -center -onroot -quiet -zoom auto "`$HOME/current/projects/xsetbg/print-filename.py`" +xli -border darkcyan -center -onroot -quiet -zoom auto "`$HOME/current/projects/xsetbg/print-filename.py -e koi8-r`" # load .Xdefaults/.Xresources if [ -f "$HOME"/lib/X11/.Xdefaults ]; then @@ -28,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 @@ -48,6 +63,7 @@ xset s 300 300 # DPMS on notebook: standby - 10 minutes, suspend - 15 minutes, off - 20 minutes xset dpms 600 900 1200 +pulseaudio --start xscreensaver & xbindkeys xxkb & @@ -61,10 +77,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 & @@ -77,6 +99,6 @@ fi dbus-launch --exit-with-session gpg-agent --daemon "$WINDOW_MANAGER" # Stop pulseaudio, xscreensaver and xsetbg.py -pulseaudio -k +pulseaudio --kill xscreensaver-command -exit & "$HOME"/current/projects/xsetbg/xsetbg-http-stop &