]> git.phdru.name Git - dotfiles.git/commitdiff
.xinitrc: Add X authorization for all host names
authorOleg Broytman <phd@phdru.name>
Mon, 2 Apr 2018 23:21:31 +0000 (02:21 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 3 Apr 2018 13:41:28 +0000 (16:41 +0300)
My notebook has notebook-eth and notebook-wifi names.
To seamlessly switch between them I need to allow both.

.xinitrc

index dffb5a9b7d9c2564547ef46bcd602ebbd4676ab8..dabbeb0e50615bec5363ee8ec275a9a71f5a28d3 100644 (file)
--- a/.xinitrc
+++ b/.xinitrc
@@ -1,10 +1,26 @@
 #!/bin/sh
 
 #!/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
+else
+   echo "Unknown xauth info" >&2
+   xauth list
+   exit 1
+fi
+
 PATH="$PATH":/usr/games
 
 # Set initial background
 xsetroot -solid DarkCyan
 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
 
 # load .Xdefaults/.Xresources
 if [ -f "$HOME"/lib/X11/.Xdefaults ]; then