On 5/8/2015 6:46 PM, John Hupp wrote:
> I'm casting around for ideas on how to best detect that the current 
> environment is on a fat client (not on a thin client or on the server 
> itself), and then run a startup script to modify pcmanfm's volume 
> management preferences.  The script should run whether the user is 
> logging into the server, a thin client or a fat client, so I would 
> probably not want to run it via an RCFILE entry in lts.conf. Maybe an 
> upstart job (I'm on Lubuntu 14.04).
>
> (I'm tweaking the behavior of what happens when a USB flash drive, 
> audio CD or data disc is inserted.  My first approach was to turn off 
> pcmanfm's "Mount removable media automatically when they are inserted" 
> setting for all users except user1.  I arrived at an acceptable 
> solution in a thin-only environment that involved ltspfs 
> notifications, but the same thing doesn't work for fat clients.)
>
> I know that pcmanfm's preferences are in 
> ~/.config/pcmanfm/lubuntu/pcmanfm.conf, but don't have any slick ideas 
> beyond that.  My first idea is to make a script that looks at whether 
> the output of hostname contains "ltsp" or not.
>
> Other ideas?

Here is the script code from an upstart job I'm trying to get working 
(but which doesn't work yet):

     # test for a fat client:
     if [[ $(hostname | grep 'ltsp') == ltsp* ]]; then
         sed 's/mount_removable=0/mount_removable=1/' 
<~/.config/pcmanfm/lubuntu/pcmanfm.conf 
 >~/.config/pcmanfm/lubuntu/pcmanfm.conf
     # test for a thin client:
     elif [ -n "$LTSP_CLIENT" ]; then
         sed 's/mount_removable=1/mount_removable=0/' 
<~/.config/pcmanfm/lubuntu/pcmanfm.conf 
 >~/.config/pcmanfm/lubuntu/pcmanfm.conf
     # machine must be the server
     else
         sed 's/mount_removable=0/mount_removable=1/' 
<~/.config/pcmanfm/lubuntu/pcmanfm.conf 
 >~/.config/pcmanfm/lubuntu/pcmanfm.conf
     fi

Assuming that it was tripping on ~, I also tried:

     # test for a fat client:
     if [[ $(hostname | grep 'ltsp') == ltsp* ]]; then
         sed 's/mount_removable=0/mount_removable=1/' 
<$HOME/.config/pcmanfm/lubuntu/pcmanfm.conf 
 >$HOME/.config/pcmanfm/lubuntu/pcmanfm.conf
     # test for a thin client:
     elif [ -n "$LTSP_CLIENT" ]; then
         sed 's/mount_removable=1/mount_removable=0/' 
<$HOME/.config/pcmanfm/lubuntu/pcmanfm.conf 
 >$HOME/.config/pcmanfm/lubuntu/pcmanfm.conf
     # machine must be the server
     else
         sed 's/mount_removable=0/mount_removable=1/' 
<$HOME/.config/pcmanfm/lubuntu/pcmanfm.conf 
 >$HOME/.config/pcmanfm/lubuntu/pcmanfm.conf
     fi

I'm guessing that my file identification strings need fixing up, but I'm 
such a poor scripter that this could only be one of several mistakes.

Check my homework?

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to