Openbox PipeMenus

Hi
I am starting to educate myself about openbox menus
[Specifically I am trying to find out why conky editor doesnt open anything when I tick my conky, but this is also a general question about how to see what is ‘inside’ pipemenus)

I know I can go further down the menu to edit running Conkys, but would like to know how these pipemenus work.

(Actually, I would prefer ‘edit running conkys’ at a top level in this menu)

I am reading about pipemenus and found this AL post

leigh@archlabs ~ % pacman -Q archlabs-pipemenus
archlabs-pipemenus 2.6.41-1

In my menu.xml I have

<menu execute="al-compton-pipemenu" id="ComptonPipeMenu" label="Compton"/>

<menu execute="al-conky-pipemenu" id="ConkyPipeMenu" label="Conky"/>

<menu execute="al-tint2-pipemenu" id="Tint2PipeMenu" label="Tint2"/>

And the Conky menu opens fine

But how do I see what action the Conky editor should carry out?

I am guessing it is to open the selected Conky file in an editor?

But which editor?

It could be that I dont have that editor installed?

I use Xed

Of course, I could be on completely the wrong track

Any indications most gratefully received

EDIT:
Found these:

https://bbs.archlinux.org/viewtopic.php?id=263210

And
% echo "$EDITOR"
Didnt return anything so I put this in my .xprofile

#Set default editor to xed
export EDITOR="xed"

And now get

leigh@archlabs ~ % echo "$EDITOR"        
xed

but the conky editor still dont do nothing

EDIT 2:
In terminal:

leigh@archlabs ~ % al-conky-pipemenu
error: failed to locate saved-sessions in /home/leigh/.config/conky
<openbox_pipe_menu>
 <item label="Conky Chooser">
   <action name="Execute">
     <command>al-conkyzen</command>
   </action>
 </item>
 <item label="Reload Conkys">
   <action name="Execute">
     <command>al-conky-session</command>
   </action>
 </item>
<menu id="EditConky" label="Edit Conkys">
 <item label="Conky Editor">
   <action name="Execute">
     <command>al-conkyedit</command>
   </action>
 </item>
 <item label="Default conkyrc">
   <action name="Execute">
     <command>exo-open /home/leigh/.config/conky/ArchLabs.conkyrc</command>
   </action>
 </item>
<menu id="RunningConky" label="Running Conkys">
 <item label="conky/ArchLabs.conkyrc">
   <action name="Execute">
     <command>exo-open /home/leigh/.config/conky/ArchLabs.conkyrc</command>
   </action>
 </item>
</menu>
</menu>
<separator/>
 <item label="Pin moveable Conkys">
   <action name="Execute">
     <command>al-conkypin</command>
   </action>
 </item>
<separator/>
 <item label="New Conky Session">
   <action name="Execute">
     <command>al-conkyzen -z</command>
   </action>
 </item>
<menu id="Sessions" label="Saved Sessions">
 <item label="Default">
   <action name="Execute">
     <command>al-conky-session /home/leigh/.config/conky/conky-sessionfile</command>
   </action>
 </item>
</menu>
<separator/>
 <item label="Conky Help">
   <action name="Execute">
     <command>zenity --text-info --title=&apos;ArchLabs Conky Help&apos; --filename=/usr/share/archlabs/docs/helpfile-conkyzen.txt --width=650 --height=700</command>
   </action>
 </item>
</openbox_pipe_menu>
leigh@archlabs ~ % al-conkyedit

(zenity:96987): GLib-GObject-CRITICAL **: 11:14:23.052: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

but the al-conkyedit box in my screenshot above does open - but it doesnt do anything on ticking my conky and then OK

EDIT 3:
‘where’ are al-conky-pipemenu & al-conkyedit?
I tried searching using PCManFM but with no luck
I found them in /usr/bin (it helps if you dont have the only search for images option selected in PCManFM search - DOH!)

al-conkyedit is the below, and echo $EDITOR gives xed, so anyone have any idea why it doesnt open anything?
I dont know that bash language thingy and dont know how to check if $file is correct (e.g. has full path)
I doubt its an error in the script though

xed /home/leigh/.config/conky/ArchLabs.conkyrc
works though


#!/usr/bin/env bash

# conky editor: will find conky files in ~/.config/conky, and allow opening them
# Original concept by damo <damo@bunsenlabs.org> for BunsenLabs Linux, April 2015
# Re Written by Nathaniel Maia For ArchLabs, December 2017

readonly TITLE="ArchLabs Conky Edit"
readonly TEXT="<big>Select Conkys to edit from the list</big>"
readonly ICON="--window-icon=/usr/share/icons/ArchLabs-Light/64x64/places/distributor-logo-archlabs.png"
readonly CHECKLIST="zenity --width=400 --height=500 $ICON --list --checklist --multiple"

if [[ -d $HOME/.config/conky ]]; then
	for file in $(find -L "$HOME/.config/conky" -maxdepth 4 -type f); do
		name="${file##*/}"
		[[ $name = *conkyrc || $name = *conky ]] && LIST+="FALSE $name "
	done
else
	MSG="<big>No conky configs found</big>\n\nConfigs must be located in:\n$HOME/.config/conky"
	zenity --info --width=300 --height=150 $ICON --text="$MSG" &>/dev/null ; exit 0
fi

ANSWER="$($CHECKLIST --title="$TITLE" --text="$TEXT" --separator=" " --column="Select" --column="Conky Name" $LIST)"

if [ $? -ne 0 ]; then
	exit 0
else
	for name in $ANSWER; do
		for file in $FILES; do
			if [[ "${file##*/}" = "$name" ]]; then
				if hash exo-open &>/dev/null; then
					(exo-open "$file" &)
				elif hash termite &>/dev/null; then
					(termite -e "$EDITOR $file" &>/dev/null)
				elif hash st &>/dev/null; then
					(st -e $EDITOR $file &)
				elif hash urxvt &>/dev/null; then
					(urxvt -e "$EDITOR $file" &)
				fi
				break
			fi
		done
	done
fi

exit 0

This part of the script:

		if [[ "${file##*/}" = "$name" ]]; then
				if hash exo-open &>/dev/null; then
					(exo-open "$file" &)
				elif hash termite &>/dev/null; then
					(termite -e "$EDITOR $file" &>/dev/null)
				elif hash st &>/dev/null; then
					(st -e $EDITOR $file &)
				elif hash urxvt &>/dev/null; then
					(urxvt -e "$EDITOR $file" &)
				fi

is going through the commands to open the file. exo-open isn’t recognizing xed so it goes through the rest of the commands. If you do not have one of the terminal applications - termite, st, or urxvt - installed, the script will fail. Change one of those terminal commands to something you have installed, or install one used in the script. Installing the package rxvt-unicode will provide urxvt; a good terminal to have, if only as backup to your favorite terminal application.

3 Likes

Thanks
But I installed rxvt-unicode and checked that urxvt works, but the conky editor still doesnt work

Neither with termite

I previously removed the line I added to my .xprofile

#Set default editor to xed
export EDITOR="xed"

And after reboot now get $EDITOR as nowt

leigh@archlabs ~ % echo "$EDITOR"        

I also tried swapping both instances of exo-open for xed - no luck
I also tried swapping both instances of termite for xed (and took out the -e) no luck

OK, I can sense that I am being a ‘Melga’ (in portuguese its a big mosquito that buzzes around your head, annoyingly and used to describe someone hassling you :slight_smile: )

So, I will drop this

But, I have learnt loads so thanks

My solution was to first use Kickshaw from the AL OB menu to put in a new entry in the menu to open my conkyrc in Xed

Then, now that I know where the pipemenu scripts are, I duplicated then modified the conkyhelpfile entry to make a new entry in the AL OB menu conky pipemenu to directly open my conkyrc in xed

I am still intrigued by why the editor doesnt work (and what the $EDITOR variable does - why is it not in the exo-open entry but is in the terminal ones?, etc) but I dont have time to learn shell scripting (unfortunately, I’d love to) and most of all, I think I need to calm down with all the questions I have and work more on working things out :rofl:

Anyway, thanks for all your help and I am very happy to have worked out how the OB menus work (mais ou menos) which is something that has been bugging me for a long time