public
Created

Script to run skype inside a restricted environment.

  • Download Gist
skype-restricted.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
#!/bin/sh
 
RESOLUTION=800x600
X_DISPLAY=7
# 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
 
export DISPLAY=:$X_DISPLAY
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
exit
sudo -u _skype pkill -u _skype

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.