Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # newrez-v 0.04
- # marc brumlik, Mon Jan 2 02:09:34 CST 2012
- # set up a "higher-rez" display by starting vncserver on port 5999
- # then viewing that session in scaled mode
- echo -e "\nNOTE 1:\nAt the end of this script, the line which begins \"$server :99\"\ncontains two items you may wish to change:\n\t\"-depth 24\" sets the number of colors. Choose from 8/15/15/24.\n\t\"-geometry=HHHxYYY\" sets the resolution. Higher gives more work space.\n"
- which vinagre >/dev/null 2>&1 || need0="vinagre"
- if uname -a | grep Ubuntu >/dev/null
- then which vnc4server >/dev/null 2>&1 || need1="vnc4server"
- which gdm >/dev/null 2>&1 || need2="gdm"
- which gdm >/dev/null 2>&1 || note="When installing gdm, choose \"lightdm\" as the default manager"
- which gnome-wm >/dev/null 2>&1 || need3="gnome-panel"
- which gconf-editor >/dev/null 2>&1 || need4="gconf-editor"
- [ -n "$need4" ] && echo -e "\nIMPORTANT FOR UBUNTU USERS:\nThere is a problem with one of the default Gnome key-bindings.\nAfter installing gconf-editor, and before running newrez-v again,\nyou must do the following:\n\ttype: gconf-editor\n\tgo to: apps->metacity->global_keybindings\n\troll down to: show_desktop\n\tchange: \"<Super>d\" to \"<Ctrl><Alt>d\"\nTHIS MESSAGE WILL APPEAR ONLY ONCE!"
- server=vnc4server
- if [ -x /etc/X11/xinit/xinitrc ]
- then : already done
- else echo "Setting permissions on /etc/X11/xinit/xinitrc"
- sudo chmod 755 /etc/X11/xinit/xinitrc
- fi
- else which vncserver >/dev/null 2>&1 || need1="tigervnc-server"
- server=vncserver
- fi
- need=`echo -e "$need0\n$need1\n$need2\n$need3\n$need4" | grep -v "^$"`
- case $need in
- '') ;;
- *) echo -e "\nThis script needs the packages:"
- echo -e "\n$need" | sed 's/^/ /'
- echo -e "\nto be installed first!"
- echo -e "$note\n"
- exit 0 ;;
- esac
- if test -f ~/.vnc/xstartup
- then : OK
- else echo -e "\n\tBefore this can be used, VNC server must be set up."
- echo -e "\tThe password you assign can be stored in the VNC client."
- echo -e "\n\tEach time you run this script, the server will be started,"
- echo -e "\tthen the client, and when the client is exited, the server"
- echo -e "\tthe server will be shut down.\n\n"
- echo -e "\tALSO note that when your session starts up, it will"
- echo -e "\ttake about 10 seconds before the panels are ready\n"
- $server :99
- $server -kill :99 >/dev/null 2>&1
- fi
- if uname -a | grep -q Ubuntu
- then if grep -q "marc41.*rev-1" $HOME/.vnc/xstartup
- then createXstartup=y
- fi
- fi
- if [ "createXstartup" = "y" ]
- then cat <<UbuntuXstartup >$HOME/.vnc/xstartup
- #!/bin/sh
- # vnc xstartup file by [email protected] (marc41 on gnome-look.org) rev-1
- unset SESSION_MANAGER
- unset DBUS_SESSION_BUS_ADDRESS
- gnome-session --session=gnome-classic &
- # gnome-session --session=ubuntu-2d &
- [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
- [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
- xsetroot -solid grey
- vncconfig -iconic &
- x-window-manager &
- UbuntuXstartup
- fi
- if [ "createXstartup" = "y" ]
- then echo -e "\n\tThe file $HOME/.vnc/xstartup has been created for you\n\twith some reasonable defaults.\n\tYou may make changes, but retain the line\n\tthat contains \"marc41\" or this script will overwrite it."
- fi
- $server :99 -name marc41:newrez -depth 16 -geometry 1280x800 >/dev/null 2>&1
- vinagre -f --vnc-scale ::5999 >/dev/null 2>&1
- $server -kill :99 >/dev/null 2>&1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement