[SOLVED]Open the native window manager...

Post here if you are a new Porteus member and you're looking for some help.
xtudiux
Black ninja
Black ninja
Posts: 72
Joined: 07 Mar 2011, 06:01
Location: Philippines

[SOLVED]Open the native window manager...

Post#1 by xtudiux » 09 May 2013, 05:59

Good pm,

Can someone post their own system-desktop-icon...

Here's Mine but it doest work in xfce

Code: Select all


# Find the desktop we are running and run certain file manager
startx=`ps x | grep -c /usr/bin/startx`
if [ $startx -eq 2 ]; then
    lxde=`ps x | grep -v grep | grep -c /usr/bin/lxsession`
    trinity=`ps x | grep -v grep | grep tdeinit`
    kde4=`ps x | grep -v grep | grep -c /usr/bin/startkde`
    razor=`ps x | grep -v grep | grep -c razor`
else
    lxde=`ps aux | sed '/X '$(echo $DISPLAY|cut -d. -f1)'/,$ !d' | sed '1,/X / !d' | grep -c /usr/bin/lxsession`
    trinity=`ps aux | sed '/ '$DISPLAY' /,$ !d' | sed '1,/X / !d' | grep tdeinit`
    kde4=`ps aux | sed '/ '$DISPLAY' /,$ !d' | sed '1,/X / !d' | grep -c /usr/bin/startkde`
    razor=`ps aux | sed '/ '$DISPLAY' /,$ !d' | sed '1,/X / !d' | grep -c razor`
fi

if [ "$lxde" -eq 1 ]; then
    pcmanfm menu://applications/System || pcmanfm
elif [ "$trinity" ]; then
    konqueror system:/
elif [ "$kde4" -eq 1 -a -z "$trinity" ]; then
    dolphin settings:/
elif [ "$razor" -gt 0 ]; then
    razor-config
else
    echo
fi

There is a corruption on the upper part though
Last edited by xtudiux on 15 May 2013, 03:27, edited 1 time in total.

xtudiux
Black ninja
Black ninja
Posts: 72
Joined: 07 Mar 2011, 06:01
Location: Philippines

Re: Open the native window manager using when clicking deskt

Post#2 by xtudiux » 09 May 2013, 06:00

the script is found on the

Code: Select all

/opt/porteus-scripts/

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Open the native window manager using when clicking deskt

Post#3 by Ahau » 09 May 2013, 19:19

What command do you want your script to execute when you run it inside Xfce?

It's not running inside Xfce because it doesn't have a section at the top of it that identifies xfce at all when it's the current desktop, and further, it provides no command to execute if xfce is found. If you give me some more information on what you want it to do, I should be able to put it together for you.

Thanks!
Please take a look at our online documentation, here. Suggestions are welcome!

xtudiux
Black ninja
Black ninja
Posts: 72
Joined: 07 Mar 2011, 06:01
Location: Philippines

Re: Open the native window manager using when clicking deskt

Post#4 by xtudiux » 10 May 2013, 06:50

Good pm Ahau,

Its an icon found on my desktop., Its says system.desktop. In the razor-qt, it works there. From what I can say, when it is click, It will ask for execution, once executd, it opens the system menu...

In My xfce, it doesnt because, on the script it doesnt have an info about xfce. on how to handle it. I believe the script is done by brokenman, - I assumed since nearly all scripts in the folder he have a signature there...hehehe

I nearly forgot, thx for the help last time. :D
:)

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Open the native window manager using when clicking deskt

Post#5 by Ahau » 10 May 2013, 14:25

Ok, I think I understand now. In some desktops, that script will open the settings menu, on others, it opens up a file manager with the icons from the 'system' submenu inside the panel. Assuming you want to open the settings manager for xfce (similar to the behavior in razor), try this script:

Code: Select all

#!/bin/bash
# Author: Brokenman
############################################################
# Open the native window manager using when clicking desktop system icon.


# Find the desktop we are running and run certain file manager
startx=`ps x | grep -c /usr/bin/startx`
if [ $startx -eq 2 ]; then
    lxde=`ps x | grep -v grep | grep -c /usr/bin/lxsession`
    trinity=`ps x | grep -v grep | grep tdeinit`
    kde4=`ps x | grep -v grep | grep -c /usr/bin/startkde`
    xfce=`ps x | grep -v grep | grep -c xfdesktop`
    razor=`ps x | grep -v grep | grep -c azor`
else
    lxde=`ps aux | sed '/X '$(echo $DISPLAY|cut -d. -f1)'/,$ !d' | sed '1,/X / !d' | grep -c /usr/bin/lxsession`
    trinity=`ps aux | sed '/ '$DISPLAY' /,$ !d' | sed '1,/X / !d' | grep tdeinit`
    kde4=`ps aux | sed '/ '$DISPLAY' /,$ !d' | sed '1,/X / !d' | grep -c /usr/bin/startkde`
    xfce=`ps aux | sed '/ '$(echo $DISPLAY|cut -d. -f1)' /,$ !d' | sed '1,/X / !d' | grep -c xfdesktop`
    razor=`ps aux | sed '/ '$DISPLAY' /,$ !d' | sed '1,/X / !d' | grep -c razor`
fi

if [ "$lxde" -eq 1 ]; then
    pcmanfm menu://applications/System || pcmanfm
elif [ "$trinity" ]; then
    konqueror system:/
elif [ "$kde4" -eq 1 -a -z "$trinelif [ "$xfce" -eq 1 ]; then
    thunar $*ity" ]; then
    dolphin settings:/
elif [ "$xfce" -eq 1 ]; then
    xfce4-settings-manager
elif [ "$razor" -gt 0 ]; then
    razor-config
else
    echo
fi
However, you can open this same program through the menu -- just click the Porteus ("Start") button on the panel, hover over "Settings", then click on "Settings Manager".

Thanks!
Please take a look at our online documentation, here. Suggestions are welcome!

xtudiux
Black ninja
Black ninja
Posts: 72
Joined: 07 Mar 2011, 06:01
Location: Philippines

Re: Open the native window manager using when clicking deskt

Post#6 by xtudiux » 11 May 2013, 02:54

Good am ahau,

The scripts opens the system menu on the porteus menu...in the xfce, the system.desktop...doesnt do anything but its there.
The script has a missing entry. I tried the x86-64 one, they have thesame script.

I'll try the script later. Thx Ahau.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Open the native window manager using when clicking deskt

Post#7 by brokenman » 11 May 2013, 19:02

Please post output of:

Code: Select all

ps aux | sed '/ '$(echo $DISPLAY|cut -d. -f1)' /,$ !d' | sed '1,/X / !d' | grep -c xfdesktop
How do i become super user?
Wear your underpants on the outside and put on a cape.

xtudiux
Black ninja
Black ninja
Posts: 72
Joined: 07 Mar 2011, 06:01
Location: Philippines

Re: Open the native window manager using when clicking deskt

Post#8 by xtudiux » 14 May 2013, 02:26

Good am,

Sorry to kep you waiting..Been a long weekend with the election held this monday...

The out of

Code: Select all

ps aux | sed '/ '$(echo $DISPLAY|cut -d. -f1)' /,$ !d' | sed '1,/X / !d' | grep -c xfdesktop
is 1..

xtudiux
Black ninja
Black ninja
Posts: 72
Joined: 07 Mar 2011, 06:01
Location: Philippines

Re: Open the native window manager using when clicking deskt

Post#9 by xtudiux » 14 May 2013, 02:27

As for the code that was done by Ahau,

I edited it by geany, it works now but it goes to settings not on system...it goes to settings...hmmm...its ok... :D

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Open the native window manager using when clicking deskt

Post#10 by brokenman » 15 May 2013, 01:22

If the answer is 1 then the next part of the script should fire.

Code: Select all

elif [ "$xfce" -eq 1 ]; then xfce4-settings-manager
This should be the same result as if you open a terminal and type: xfce4-settings-manager

Is this not happening?
How do i become super user?
Wear your underpants on the outside and put on a cape.

xtudiux
Black ninja
Black ninja
Posts: 72
Joined: 07 Mar 2011, 06:01
Location: Philippines

Re: Open the native window manager using when clicking deskt

Post#11 by xtudiux » 15 May 2013, 02:17

good am,

Its now opening in the xfce4-settings-manager now...
In the razor-qt, it opens on the system menu...

I like it on the xfce4-settings-manager...

chow..

thx for the help...
\

\

Post Reply