Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #testing for the word fujitsu because we are only concerned if the scansnap scanner profile is active
- LocalDisplay=':0'
- # Get the username of whoever is at the local X11 display.
- # If we don't find one, then exit.
- X11User=`who | grep $LocalDisplay | cut -f 1 -d ' '`
- if [ -z "$X11User" ] ; then
- exit
- fi
- if [ -e "/home/$X11User/.bashrc" ] ; then
- source /home/$X11User/.bashrc
- fi
- export DISPLAY=$LocalDisplay
- export HOME=/home/$X11User
- export XAUTHORITY=/home/$X11User/.Xauthority
- TEST=`pgrep -f fujitsu`
- if [ "${TEST:-null}" = null ]; then
- su $X11User -c "`gscan2pdf --device='fujitsu:ScanSnap S1500:373683'`" &
- else
- echo "running, nothing to do"
- exit 0
- fi
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement