Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Script to run skype inside a restricted environment.
# Save the current keyboard layout, since we want to configure Xephyr
# to use the same
LAYOUT=$(setxkbmap -query | grep layout | cut -d" " -f6)
Xephyr -screen $RESOLUTION -host-cursor -br :$X_DISPLAY &
# Sleep a second while Xephyr start.
# FIXME: There's probably a more elegant way to know when it has finished
# starting up.
sleep 1
xhost +SI:localuser:_skype
sudo -u _skype setxkbmap -layout $LAYOUT
# Use some lightwight WM because we'll be unable to switch windows otherwise.
sudo -u _skype blackbox &
# Use a tray or we'll loose access to skype when we close the main window.
sudo -u _skype trayer --align right --width 5 &
# Launch Skype
sudo -u _skype /var/skype/skype
# After skype exits, clean everything else
# FIXME: Check which signal to use, because sometimes you kill Xephyr, but it
# doesn't release the DISPLAY
sudo -u _skype pkill -u _skype
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment