LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   Help with script to move panel (Red Hat) (http://www.linuxquestions.org/questions/red-hat-31/help-with-script-to-move-panel-red-hat-4175445309/)

kesi 01-12-2013 04:11 PM

Help with script to move panel (Red Hat)
 
I'm using 'disper' to auto-detect and extend my monitor but I'd like the bottom panel to be moved too. I found a script that is supposed to do this and is below but it's not working. It seems the variable is set correctly but it's not happening. I can drag with a mouse but it would be nice if it was auto in some way since I'm constantly connecting and disconnecting from monitors.

Script:
Code:

# disper command will detect and configure monitors
disper --displays=auto -e

# parse output from disper tool how many displays we have attached
# disper prints 2 lines per displer
lines=`disper -l|wc -l`

display_count=$((lines / 2))

echo $display_count

echo "Detected display count:" $display_count

# Make sure that we move panels to the correct display based
# on the display count
if [ $display_count = 1 ] ; then
  echo "Moving panels to the internal LCD display"
  gconftool-2 \
        --set "/apps/panel/toplevels/bottom_panel_screen0/monitor" \
        --type integer "0"       
  gconftool-2 \
        --set "/apps/panel/toplevels/top_panel_screen0/monitor" \
        --type integer "0"       
else
  echo "Moving panels to the external display"
  gconftool-2 \
        --set "/apps/panel/toplevels/bottom_panel_screen0/monitor" \
        --type integer "1"       
  gconftool-2 \
        --set "/apps/panel/toplevels/top_panel_screen0/monitor" \
        --type integer "1"       
fi

The echo text prints out but nothing happens. Currently, the file /home/rmasher/.gconf/apps/panel/toplevels/bottom_panel_screen0/%gconf.xml reads as such but the panel is on the non-external monitor anyways:

Code:

<?xml version="1.0"?>
<gconf>
        <entry name="monitor" mtime="1358027324" type="int" value="1"/>
</gconf>

What can I do?


All times are GMT -5. The time now is 03:56 AM.