Initial commit

This commit is contained in:
Mahesh Asolkar 2018-09-01 10:17:03 -07:00
commit 6912c81d81
3 changed files with 34 additions and 0 deletions

3 Normal file
View File

@ -0,0 +1,3 @@
# My VNC setup
Runs [DWM](

dwm_status Executable file
View File

@ -0,0 +1,6 @@
DESKTOPNAME=$(perl -e '$ARGV[0] =~ m/([a-zA-Z0-9]+)(_([a-zA-Z0-9]+))?/; print "$1"' $VNCDESKTOP)
sts=$(date +"%a %D %I:%M%p")
ipa=$(hostname -I | cut -f1 -d" ")
xsetroot -name " $sts [$DESKTOPNAME:$ipa]"

xstartup Executable file
View File

@ -0,0 +1,25 @@
xrdb $HOME/.Xresources
xsetroot -solid grey
# I call vncserver with the -name argument. The name is of format
# <DestopName>_<COLOR>. E.g.: Tenor_007722. I send the color to a patched DWM,
# which sets the selection color to the one in VNC name.
# The dwm_status command below also recognizes this name format, and displays
# only the desktop name part in the status
COLOR=$(perl -e '$ARGV[0] =~ m/([a-zA-Z0-9]+)(_([a-zA-Z0-9]+))?/; print "$3"' $VNCDESKTOP)
while true; do
# If we don't explicitly kill the dwm_status thread, it keeps running even
# after vncserver -kill kills the VNC. So if the display dies, exit xstartup
if xhost > /dev/null 2>&1 ; then
sleep 10
echo Display for ${VNCDESKTOP} on ${DISPLAY} died. Exiting...
exit 0
done &
/home/mahesh/apps/bin/dwm "#${COLOR}"