How to show my custom Menu on all desktops?SOLVED

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

How to show my custom Menu on all desktops?SOLVED

#1 Post by oldyeller »

Hello Everyone,

I have made a menu and would like to have it show up on all the desktops when switching from one to the other.

I have no idea on how to do this. This is the code for the menu.

Code: Select all

#! /bin/bash

if [ "`which gtkdialog4`" ]; then
 GTKDIALOG=gtkdialog4
elif [ "`which gtkdialog3`" ]; then
 GTKDIALOG=gtkdialog3
else
 GTKDIALOG=gtkdialog
fi


export WORKDIR="/usr/local/MannaMenu"
export ICONSDIR="/usr/local/MannaMenu/icons"

if [ "`which ParallelBible`" ]; then
PARALLELBIBLE='
<button tooltip-text="Parallel Bible"  height-request="0" width-request="0">
  <input file>'$ICONSDIR'/Bible.png</input><height>30</height><width>60</width>
  <action>ParallelBible &</action>
</button>'
else
PARALLELBIBLE=''
fi

if [ "`which ISBE`" ]; then
ISBE='
<button tooltip-text="THE INTERNATIONAL STANDARD BIBLE ENCYCLOPEDIA"  height-request="0" width-request="0">
  <input file>'$ICONSDIR'/Book2.png</input><height>30</height><width>60</width>
  <action>ISBE &</action>
</button>'
else
ISBE=''
fi

if [ "`which STRONGS`" ]; then
STRONGS='
<button tooltip-text="Strongs"  height-request="0" width-request="0">
  <input file>'$ICONSDIR'/Book2.png</input><height>30</height><width>60</width>
  <action>STRONGS &</action>
</button>'
else
STRONGS=''
fi

if [ "`which /usr/local/Kiyut/Alkitab-2_9_1/bin/alkitab`" ]; then
ALKITAB='
<button tooltip-text="Alkitab Bible Study"  height-request="0" width-request="0">
  <input file>'$ICONSDIR'/alkitab48.png</input><height>30</height><width>60</width>
  <action>/usr/local/Kiyut/Alkitab-2_9_1/bin/alkitab &</action>
</button>'
else
ALKITAB=''
fi

if [ "`which /root/bibledesktop-1.6/BibleDesktop.sh`" ]; then
BIBLEDESKTOP='
<button tooltip-text="Bible Desktop"  height-request="0" width-request="0">
  <input file>'$ICONSDIR'/BibleDesktop128.png</input><height>30</height><width>60</width>
  <action>/root/bibledesktop-1.6/BibleDesktop.sh &</action>
</button>'
else
BIBLEDESKTOP=''
fi

if [ "`which bibleanalyzer4.sh`" ]; then
	BibleAnalyzer4='
<button tooltip-text="BibleAnalyzer"  height-request="0" width-request="0">
  <input file>'$ICONSDIR'/75DE_BibleAnalyzer4.0.png</input><height>30</height><width>60</width>
  <action>bibleanalyzer4.sh &</action>
</button>'
else
	BibleAnalyzer4=''
fi

if [ "`which bibletime`" ]; then
	bibletime='
<button tooltip-text="bibletime"  height-request="0" width-request="0">
  <input file>'$ICONSDIR'/bibletime.xpm</input><height>30</height><width>60</width>
  <action>bibletime &</action>
</button>'

else
	bibletime=''
fi

if [ "`which e-Sword.sh`" ]; then
	eSword='
<button tooltip-text="esword"  height-request="0" width-request="0">
  <input file>'$ICONSDIR'/esword.png</input><height>30</height><width>60</width>
  <action>e-Sword.sh &</action>
</button>'

else
	eSword=''
fi

if [ "`which theword.sh`" ]; then
	theWord='
<button tooltip-text="theWord"  height-request="0" width-request="0">
  <input file>'$ICONSDIR'/CB2C_theword.0.png</input><height>30</height><width>60</width>
  <action>theword.sh &</action>
</button>'

 else
	theWord=''
fi

if [ "`which xiphos`" ]; then
	xiphos='
<button tooltip-text="xiphos"  height-request="0" width-request="0">
  <input file>'$ICONSDIR'/xiphos.svg</input><height>30</height><width>60</width>
  <action>xiphos &</action>
</button>'

else
	xiphos=''
fi

RIGHT=10 DOWN=200= WIDTH=0 HEIGHT=0

export MAIN_DIALOG='
<window title="MannaMenu" icon-name="Com" decorated="false" skip_taskbar_hint="true" >
<vbox>

<button tooltip-text="Bible Reader" height-request="0" width-request="0">
  <input file>'$ICONSDIR'/KJV.png</input><height>30</height><width>60</width>
  <action>Manna &</action>
</button>

'$PARALLELBIBLE'

<button tooltip-text="Teachings"  height-request="0" width-request="0">
  <input file>'$ICONSDIR'/Com.png</input><height>30</height><width>60</width>
  <action>studies &</action>
</button>

'$ISBE'

'$STRONGS'

'$ALKITAB'

'$BibleAnalyzer4'

'$BIBLEDESKTOP'

'$bibletime'

'$eSword'

'$theWord'

'$xiphos'

<button tooltip-text="Editor"  height-request="0" width-request="0">
  <input file>'$ICONSDIR'/typewriter.png</input><height>30</height><width>60</width>
  <action>Editor &</action>
</button>

<hbox homogeneous="true">
<button tooltip-text="Refesh">
  <input file>'$ICONSDIR'/refresh.png</input><height>15</height><width>30</width>
  <action>'$WORKDIR'/Manna-Menu &</action>
		<action type="exit">quit_now</action>
  </button>
  </hbox>
</vbox>
</window>
'

gtkdialog --program=MAIN_DIALOG -G ${1-${WIDTH}x${HEIGHT}+${RIGHT}+${DOWN}}
Any help with this would be great.
Last edited by oldyeller on Sat 14 Jun 2014, 22:58, edited 1 time in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Code: Select all

#!/bin/sh
# oy-menu-wrapper.sh
####
oy-menu.sh & 
# Your MannaMenu dialog (above)
sleep 0.5s
wmctrl -r MannaMenu -b toggle,sticky
More below.
Last edited by musher0 on Sat 14 Jun 2014, 04:29, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#3 Post by musher0 »

Hi, oldyeller.

If your window manager is jwm, there are explanations about making
programs and menus sticky here:
http://joewing.net/projects/jwm/config.shtml
The reference is out of charity :?, since I thoroughly dislike jwm.

You may be able to add a <Group> called "MannaMenu" with the "sticky"
option in file /root/.jwm/jwmrc-personal.
Someone with thorough experience of jwm (meaning: not me!) should be
advising you if you choose that route.

That said, wmctrl does a fine job of displaying it on all desktops. Of
course, I do not have your underlying programs, but do you see the little
white vertical bar in the dark grey pager in the picture? That's your Manna
Menu with the sticky attribute set up by wmctrl, displayed on all desktops.

wmctrl is available from http://tomas.styblo.name/wmctrl/

Taking "all desktops" in another sense, you could of course add an icon
to the ROX backdrop for your menu.

Best regards.

musher0
Attachments
stickyMannaMenu-with-wmctrl.jpg
(Magnification: 200 %)
(26.44 KiB) Downloaded 182 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#4 Post by musher0 »

An improvement! :)

Code: Select all

#!/bin/sh
# MannaMenu-wrapper.sh # As an on/off switch.
# musher0, Sat. June 14, 2014
####
if [ "`wmctrl -l | awk '$4=="MannaMenu"'`" ];then
# If MannaMenu is open,
	wmctrl -c MannaMenu
# close it.
	else # Otherwise, open it.
	MannaMenu.sh & 
	# Your MannaMenu dialog script
	sleep 0.5s
	wmctrl -r MannaMenu -b toggle,sticky
fi
This way, wmctrl's on-and-off switch feature ( -c ) can be used as well.
Let's say that you have this MannaMenu wrapper as the icon for Manna
Menu on the desktop. Click once, you open the MannaMenu. Click a 2nd
time, and you close it.

Enjoy!

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#5 Post by oldyeller »

musher0,
Do you have a ./configure for this?

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#6 Post by musher0 »

oldyeller wrote:musher0,
Do you have a ./configure for this?
Not really! :)
Attachments
wmctrl-1.07.pet
(19.3 KiB) Downloaded 188 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#7 Post by oldyeller »

Thanks for the pet. Will give all a try see.

Cheers

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#8 Post by oldyeller »

musher0 wrote:

Code: Select all

#!/bin/sh
# oy-menu-wrapper.sh
####
oy-menu.sh & 
# Your MannaMenu dialog (above)
sleep 0.5s
wmctrl -r MannaMenu -b toggle,sticky
More below.
I did give it a try but no joy,
Would you be willy to code this and put it up as a .gz file for me

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#9 Post by musher0 »

Hello, old yeller.

I'm surprised at such a request coming from an experienced Pupy-ist
such as yourself.

Surely you know how to do a copy-and-paste, from an insert in a post on
the forum to a window in an opened editor? Surely you know how to
save a script from your text editor? Surely you know how to make
executable the resulting saved bash script?

Sorry for being so blunt, but I do not wish to encourage laziness, and I
certainly don't like to feel I'm being taken advantage of. I am quite willing
to help a user, but I do need to feel there has been some sort of effort on
his(her) side.

Please do the steps above (in the 2nd paragraph) before proceeding to
anything else. We'll take it from there if some more help is necessary.

Those steps are really simple and basic. If you are not successful, a step-
by-step account of what you did would be most helpful in pinpointing what
step you missed or did wrong.

Respectfully.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#10 Post by oldyeller »

musher0 wrote:Hello, old yeller.

I'm surprised at such a request coming from an experienced Pupy-ist
such as yourself.

Surely you know how to do a copy-and-paste, from an insert in a post on
the forum to a window in an opened editor? Surely you know how to
save a script from your text editor? Surely you know how to make
executable the resulting saved bash script?

Sorry for being so blunt, but I do not wish to encourage laziness, and I
certainly don't like to feel I'm being taken advantage of. I am quite willing
to help a user, but I do need to feel there has been some sort of effort on
his(her) side.

Please do the steps above (in the 2nd paragraph) before proceeding to
anything else. We'll take it from there if some more help is necessary.

Those steps are really simple and basic. If you are not successful, a step-
by-step account of what you did would be most helpful in pinpointing what
step you missed or did wrong.

Respectfully.

musher0
You are right of course :D Just tired from doing a lot of coding these past few weeks. Will work it out, thanks for all of your input. Will get it going with this or checking into jwmrc.

Cheers

Post Reply