Page 1 of 3

mukstart - start menu like Cinnamon

Posted: Mon 03 Aug 2015, 01:56
by recobayu
Mukstart
This is my little pet that like start menu in newer O.S.
I adapted from start menu in cinnamon, and now, it has icon :D.

press winkey + space, and we can see mukstart run.
press winkey + space again, and mukstart dissappear.

After install mukstart.pet, there are two script in /usr/bin, that is mukstart and startmukstart.
Please comment and advice.
Feel free to upgrade my simple script.
Thank you.

v4.3.1
I do a lot of change here.
Button with icon,
Search by tree
And logout_gui on the top of window.
At the first time, mukstart will walk very slow because he build a gui and save it to /tmp/mukstart. After that, mukstart will run very fast.
I edit the startmukstart's script



v4.2
add hover-selection="true"

Recobayu

Posted: Wed 13 Jan 2016, 07:17
by recobayu
This is another mukstart's code:

Code: Select all

#!/bin/sh
mkdir -p /tmp/mukstart
grep "<Menu label" /root/.jwmrc|cut -d'"' -f2 > main
#~ grep "<Program label" /root/.jwmrc|cut -d'"' -f2>/tmp/mukstart/submain
m=(`grep "<Menu label" /root/.jwmrc|cut -d\" -f2`)
icon=(`grep "<Menu label" /root/.jwmrc|cut -d\" -f4`)

#~ echo ${a[*]}
#indeks
for i in ${!m[*]};do
   #~ sed -e '/"'${a[$i]}'"/,/"'${a[$((i+1))]}'"/!d' /root/.jwmrc|grep "Program label"|cut -d '"' -f2>"/tmp/mukstart/$i${a[$i]}.txt"
   sed -e '/"'${m[$i]}'"/,/"'${m[$((i+1))]}'"/!d' /root/.jwmrc|grep "Program label"|cut -d '"' -f2>"/tmp/mukstart/$i"
done

buatmenu(){
	for i in ${!m[*]};do
	echo '<button relief="2">
		<label>'${m[$i]}'</label>
		<input file>/root/puppy-reference/midi-icons/'${icon[$i]}'</input>
		<action signal="enter-notify-event">echo "'$i'">/tmp/mukstart/sub</action>
		<action signal="focus-in-event">echo "'$i'">/tmp/mukstart/sub</action>
		<action signal="enter-notify-event">refresh:notesub</action>
		<action signal="focus-in-event">refresh:notesub</action>
		<width>16</width>
	</button>'
	done
}

buatsub(){
	for i in ${!m[*]};do
		echo '<vbox scrollable="true">'
		cat /tmp/mukstart/$i|while read line;do
			exe=`grep "$line" /root/.jwmrc|cut -d '>' -f2|cut -d '<' -f1`
			echo '<button>
				<label>'$line'</label>
				<action>'$exe'&</action>
				<action>EXIT:exit</action>
			</button>'
		done
		echo '</vbox>'
	done
}

#~ cek(){
	#~ if [[ $E == "" ]];then echo 0 > /tmp/mukstart/ganti; else echo 1 > /tmp/mukstart/ganti;fi
#~ }
#~ export -f cek

luru(){
	locApps='/usr/share/applications/'

	grep -r Comment= $locApps| sed 's/.*hare\/applications\///g'|sed 's/.desktop:Comment=/ /g'|grep -i $E|cut -d' ' -f1> /tmp/mukstart/cari
	grep -r Name= $locApps|grep -v GenericName|sed 's/.*are\/applications\///g'|sed 's/.desktop:Name=/ /g'|grep -i $E|cut -d' ' -f1 >> /tmp/mukstart/cari
	grep -r Exec= $locApps|sed 's/.*are\/applications\///g'|sed 's/.desktop:Exec=/ /g'|grep -i $E|cut -d' ' -f1 >> /tmp/mukstart/cari
	sort -u /tmp/mukstart/cari -o /tmp/mukstart/cari
}
export -f luru

mlaku(){
	locApps='/usr/share/applications/'
	read a < /tmp/mukstart/cari
	$(grep Exec= $locApps$a.desktop|cut -d'=' -f2)&
}
export -f mlaku

mlayu2(){
	locApps='/usr/share/applications/'
	$(grep Exec= $locApps$tri.desktop|cut -d'=' -f2)&
}
export -f mlayu2


export mainw='
<window title="/tmp/mukstart4.3" width-request="300">
  <vbox>
	<entry activates-default="true" has-focus="true"> 
		<variable>E</variable> 
		<action>if [[ $E == "" ]];then echo 0 > /tmp/mukstart/ganti; else echo 1 > /tmp/mukstart/ganti;fi</action>
		<action>refresh:note2tree</action>
		<action signal="changed">luru</action>
		<action signal="changed">refresh:tri</action>
		<action signal="activate">mlaku&</action>
	</entry>
	<notebook show-tabs="false" show-border="false">
		<hbox>
			<vbox>
				 '"`buatmenu`"'
			</vbox>
			<notebook show-tabs="false" show-border="false">
				'"`buatsub`"'
				<variable>notesub</variable>
				<input file>/tmp/mukstart/sub</input>
			</notebook>
		</hbox>
		<hbox>
			<tree rules-hint="true" headers-visible="false">
				<action signal="button-release-event">mlayu2&</action>
				<action signal="button-release-event">EXIT:exit</action>
				<action>mlayu2&</action>
				<action>EXIT:exit</action>
				<variable>tri</variable>
				<input file>/tmp/mukstart/cari</input>
			</tree>
		</hbox>
		<variable>note2tree</variable>
		<input file>/tmp/mukstart/ganti</input>
	</notebook>
  </vbox>
</window>'
echo $mainw>/tmp/mukstart/gui
gtkdialog -p mainw

mukstart4.3.1

Posted: Thu 14 Jan 2016, 05:20
by recobayu
I use this code:

Code: Select all

#!/bin/sh
#/tmp/mukstart4.3
#use button and refine gui
mkdir -p /tmp/mukstart
grep "<Menu label" /root/.jwmrc|cut -d'"' -f2 > main
#~ grep "<Program label" /root/.jwmrc|cut -d'"' -f2>/tmp/mukstart/submain
m=(`grep "<Menu label" /root/.jwmrc|cut -d\" -f2`)
icon=(`grep "<Menu label" /root/.jwmrc|cut -d\" -f4`)

#~ echo ${a[*]}
#indeks
for i in ${!m[*]};do
   #~ sed -e '/"'${a[$i]}'"/,/"'${a[$((i+1))]}'"/!d' /root/.jwmrc|grep "Program label"|cut -d '"' -f2>"/tmp/mukstart/$i${a[$i]}.txt"
   sed -e '/"'${m[$i]}'"/,/"'${m[$((i+1))]}'"/!d' /root/.jwmrc|grep "Program label"|cut -d '"' -f2>"/tmp/mukstart/$i"
done

buatmenu(){
	for i in ${!m[*]};do
	echo '<button relief="2">
		<label>'${m[$i]}'</label>
		<input file>/root/puppy-reference/midi-icons/'${icon[$i]}'</input>
		<action signal="enter-notify-event">echo "'$i'">/tmp/mukstart/sub</action>
		<action signal="focus-in-event">echo "'$i'">/tmp/mukstart/sub</action>
		<action signal="enter-notify-event">refresh:notesub</action>
		<action signal="focus-in-event">refresh:notesub</action>
		<width>16</width>
	</button>'
	done
}

buatsub(){
	for i in ${!m[*]};do
		echo '<vbox scrollable="true" width="300">'
		cat /tmp/mukstart/$i|while read line;do
			exe=`grep "$line" /root/.jwmrc|cut -d '>' -f2|cut -d '<' -f1`
			ic=`grep "$line" /root/.jwmrc|cut -d \" -f4`
			if [[ $ic == *\/* ]];then
				ico=$ic;
			else
				for i in mini-icons pixmaps;do
					b=`ls /root/puppy-reference/$i|grep $ic`
					if [[ $b != "" ]];then 
						ico=/root/puppy-reference/$i/$ic
					fi
				done
			fi
			echo '<button>
				<label>'$line'</label>
				<input file>'$ico'</input>
				<action>'$exe'&</action>
				<action>EXIT:exit</action>
				<width>16</width>
			</button>'
		done
		echo '</vbox>'
	done
}

#~ cek(){
	#~ if [[ $E == "" ]];then echo 0 > /tmp/mukstart/ganti; else echo 1 > /tmp/mukstart/ganti;fi
#~ }
#~ export -f cek

luru(){
	locApps='/usr/share/applications/'

	grep -r Comment= $locApps| sed 's/.*hare\/applications\///g'|sed 's/.desktop:Comment=/ /g'|grep -i $E|cut -d' ' -f1> /tmp/mukstart/cari
	grep -r Name= $locApps|grep -v GenericName|sed 's/.*are\/applications\///g'|sed 's/.desktop:Name=/ /g'|grep -i $E|cut -d' ' -f1 >> /tmp/mukstart/cari
	grep -r Exec= $locApps|sed 's/.*are\/applications\///g'|sed 's/.desktop:Exec=/ /g'|grep -i $E|cut -d' ' -f1 >> /tmp/mukstart/cari
	sort -u /tmp/mukstart/cari -o /tmp/mukstart/cari
}
export -f luru

mlaku(){
	locApps='/usr/share/applications/'
	read a < /tmp/mukstart/cari
	$(grep Exec= $locApps$a.desktop|cut -d'=' -f2)&
}
export -f mlaku

mlayu2(){
	locApps='/usr/share/applications/'
	$(grep Exec= $locApps$tri.desktop|cut -d'=' -f2)&
}
export -f mlayu2


export mainw='
<window title="mukstart4.3.1" width-request="400" icon-name="go-home">

  <vbox>
	<hbox>
	  
	  <button image-position="2" tooltip-text="Poweroff">
	   <input file>/root/puppy-reference/pixmaps/puppy/shutdown.svg</input>
	   <width>32</width>
	   <action>exec wmpoweroff&</action>
	   <action>EXIT:exit</action>
	  </button>
	  <button image-position="2" tooltip-text="Reboot">
	   <input file>/root/puppy-reference/pixmaps/puppy/reboot.svg</input>
	   <width>32</width>
	   <action>exec wmreboot&</action>
	   <action>EXIT:exit</action>
	  </button>
	  <button image-position="2" tooltip-text="Restart X">
	   <input file>/root/puppy-reference/pixmaps/puppy/graphics_restart.svg</input>
	   <width>32</width>
	   <action>restartx&</action>
	   <action>EXIT:exit</action>
	  </button>
	  <button image-position="2" tooltip-text="Exit to prompt">
	   <input file>/root/puppy-reference/pixmaps/puppy/terminal.svg</input>
	   <width>32</width>
	   <action>exec wmexit&</action>
	   <action>EXIT:exit</action>
	  </button>
	  <button image-position="2" tooltip-text="Restart JWM">
	   <input file>/root/puppy-reference/pixmaps/puppy/wm_restart.svg</input>
	   <width>32</width>
	   <action>jwm -restart&</action>
	   <action>EXIT:exit</action>
	  </button> 
	</hbox>
  
	<entry activates-default="true" has-focus="true"> 
		<variable>E</variable> 
		<action>if [[ $E == "" ]];then echo 0 > /tmp/mukstart/ganti; else echo 1 > /tmp/mukstart/ganti;fi</action>
		<action>refresh:note2tree</action>
		<action signal="changed">luru</action>
		<action signal="changed">refresh:tri</action>
		<action signal="activate">mlaku&</action>
		<action signal="activate">EXIT:exit</action>
	</entry>
	<notebook show-tabs="false" show-border="false">
		<hbox>
			<vbox>
				 '"`buatmenu`"'
			</vbox>
			<notebook show-tabs="false" show-border="false">
				'"`buatsub`"'
				<variable>notesub</variable>
				<input file>/tmp/mukstart/sub</input>
			</notebook>
		</hbox>
		<hbox>
			<tree rules-hint="true" headers-visible="false">
				<action signal="button-release-event">mlayu2&</action>
				<action signal="button-release-event">EXIT:exit</action>
				<action>mlayu2&</action>
				<action>EXIT:exit</action>
				<variable>tri</variable>
				<input file>/tmp/mukstart/cari</input>
			</tree>
		</hbox>
		<variable>note2tree</variable>
		<input file>/tmp/mukstart/ganti</input>
	</notebook>
  </vbox>
</window>'
echo $mainw>/tmp/mukstart/gui
gtkdialog -p mainw
And now, the gui is better. But my problem is it is very slow on start.
I actually save the gui's script in /tmp/mukstart/gui.

Posted: Fri 15 Jan 2016, 04:23
by recobayu
Version 4.3.1 fixed.

Add --geometry +"0"+"0" so mukstart always show on left top screen.

Posted: Fri 15 Jan 2016, 07:16
by greengeek
Hi, I just tried this on a Slacko 5.6 derivative but it said "failed to install". Don't know why this happened. No other messages.

Posted: Fri 15 Jan 2016, 09:30
by recobayu
I don't know greengeek. I make that pet in puppy tahr 605. :(

Posted: Wed 18 May 2016, 18:16
by torm
Hello!
About the initial startup-time..
maybe it could use some cache-files
and a folder of it's own (like /usr/local/mukstart or something)
to hold configuration files, themes, whatnot.. and then a starter in the binary
path?

There is PupMenu that does:
http://murga-linux.com/puppy/viewtopic. ... 3&start=60
..and it uses GtkDialog, so probably there may be some more
interesting reading in the scripts :wink:


xerrs.log shows:
widget_tree_input_by_command(): Couldn't open '/tmp/mukstart/cari' for reading.
widget_notebook_input_by_file(): Couldn't open '/tmp/mukstart/ganti' for reading.
..and this "ganti" appears to be commented out in the code?

Good luck!

Posted: Sat 02 Jul 2016, 14:25
by recobayu
torm wrote:Hello!
About the initial startup-time..
maybe it could use some cache-files
and a folder of it's own (like /usr/local/mukstart or something)
to hold configuration files, themes, whatnot.. and then a starter in the binary
path?
Thank You Torm,
.now i use /usr/local/mukstart as your suggest.
.very long at first startup now just once, that is after install this pet.
.Better search, we can use whitespace in search, ex: 'ext edi'
.esc to close, win + space to launch it.

Posted: Mon 11 Jul 2016, 23:05
by recobayu
The new mukstart-4.3.2.1.
Start menu like cinnamon.
We can search and run application based on Name, Exec, or Comment. Just type it.
Add user icon profile and info on the bottom of window.
Very fast searching apps.

Posted: Wed 13 Jul 2016, 23:51
by recobayu
Mukstart-4.3.2.2
Now, we can see icon in tree when we search.
Thank you to mochi, sfr, and step about pointing XDG_DATA_DIRS from here:
http://murga-linux.com/puppy/viewtopic.php?t=107461
Very fast searching apps.

Awesome!

Posted: Tue 02 Aug 2016, 00:32
by shadow of viper`
Hi recobayu

I stumbled across this thread while looking for something else

This is exactly what puppy needs, lightweight and fast - yet modern looking menu

Thank you!

I installed the pet package last night and gave it a quick go

Unfortunately, there were a few errors
It was past midnight so i did not want to spend time troubleshooting

Info:
1. I tested this on LXPup, with LXPanel and OpenBox
2. Had to run mukstart from commandline because i did not configure the hotkey
3. When i ran mukstart in terminal, it threw errors about malformed tags
4. I nailed down the errors to the file manager tags - ROX and PCManFM (tags were empty?)
5. I edited the mukstart menu file in root directory (i think, dont remember it now) and placed a /root into the tags
6. mukstart menu worked after that
7. Obviously, my edited menu was gone when i ran the mukstart update. It threw errors again

Note:
I understand bash scripts a little but never worked with gtkdialog before
I am not on my puppy machine at the moment, will retest tonight again

Suggestions:
1. Is it possible to somehow remove the window decorations - close, minimise, maximise buttons
2. Is it possible to make the text left-aligned? (Looks like it is center-aligned now)
3. Is it possible to set the geometry of the window to a user configurable area? For example, i have my LXPanel at the bottom of my screen. I think it looks perfect if the menu started just above the panel but without any gap


Thanks again for this wonderful work
I will retest it some more

Cheers!

Posted: Tue 02 Aug 2016, 14:48
by shadow of viper`
Hello again!

Tested a little more today on CompizPup

#1 The errors were for LXTerminal, PCManFM
on <input file> tags

I guess the icons for these applications were not found, will investigate later

I edited the /usr/local/mukstart/gui file and copied the icon path for an existing application (gexec)

Mukstart finally opened and looked pretty

#2 Could not figure out how to change the text alignment to left
Found a tutorial for gtkdialog on this forum, will try and learn

#3 Could not figure out how to remove window decoration, will go through the tutorial again

#4 Experimented with the button relief on the right pane and also figured out the geometry to suit my LXPanel

Here is the screenshot

Posted: Wed 03 Aug 2016, 05:01
by recobayu
Wow..
That is very great, Shadow!
I only make this for jwm, but You can upgrade my code. I'm very happy..
:D

I know how to left alignment on button, but it just on text. But when i add image, it is center automatically. :(

for making decoration window gone, please add

Code: Select all

decorated="false"
after window. So the complete line is like this:

Code: Select all

<window title="mukstart-4.3.3" width-request="410" icon-name="go-home" decorated="false">
Please, if you found any new upgrade script, please put it here so mukstart will be better.
Thank you.

Posted: Wed 03 Aug 2016, 08:17
by MochiMoppel
recobayu wrote:I know how to left alignment on button, but it just on text.
How?

Posted: Wed 03 Aug 2016, 10:20
by recobayu
MochiMoppel wrote:How?
Here it is:

Code: Select all

#!/bin/sh
export leftbut='
<window width-request="200">
 <vbox>
	 <button xalign="0">
	  <label>left</label>
	 </button>
	 <button xalign="0">
	  <label>left?</label>
	  <input file>/root/puppy-reference/midi-icons/edit48.png</input>
	 </button>
	 <button xalign="0.5">
	  <label>center</label>
	 </button>
	 <button>
	  <label>center too (default)</label>
	 </button>
	 <button xalign="1">
	  <label>right</label>
	 </button>
 </vbox>
</window>'

gtkdialog -p leftbut

Posted: Wed 03 Aug 2016, 12:33
by shadow of viper`
recobayu wrote:I know how to left alignment on button, but it just on text. But when i add image, it is center automatically. Sad
Thanks for providing the code snippet too showing this behaviour

Now, i wish someone can come up with a way to align the entire image+text to left

The menu itself is working, the logout options did not seem to work

I will test again when i get a chance

Cheers!

Posted: Wed 03 Aug 2016, 12:44
by shadow of viper`
Also, i did try PupMenu, but an older version
http://murga-linux.com/puppy/viewtopic.php?t=76713

Back the, it only had radio buttons for selection
Mukstart attracted my attention with the hover select feature

PupMenu has all the text left aligned
i did not check the source code, so i am not sure if it calls gtkdialog

You may want to check it out when you can spare some time

Cheers!

Posted: Wed 03 Aug 2016, 12:48
by MochiMoppel
recobayu wrote:Here it is
Terima kasih.

Posted: Wed 10 Aug 2016, 15:50
by nilsonmorales
Hi a couple of questions
What requirements need this software?
It works with lxpanel and openbox?
the terminal shows me this error with version 4.3.1
** (gtkdialog:24169): ERROR **: gtkdialog: Error in line 265, near token '</vbox>': syntax error

./mukstart: línea 180: 24169 Trace/breakpoint trap gtkdialog -p guimuks --geometry +"0"+"0"
btw. im using retro precise+openbox+lxpanel
gtkdialog --version
gtkdialog version 0.8.4 r514M (C) 2003-2007 Laszlo Pere, 2011-2012 Thunor
Built with support for: GTK+ 2, Glade

Posted: Wed 10 Aug 2016, 22:21
by tenochslb
On puppy tarh 6.0.5

mukstart version 4.3.2.2

Code: Select all

 mukstart
rm: cannot remove ‘/usr/local/mukstart/pixmaps/*’: No such file or directory

** (gtkdialog:11320): ERROR **: gtkdialog: Error in line 1126, near token '</input>': syntax error

/usr/bin/mukstart: line 286: 11320 Trace/breakpoint trap   gtkdialog -f /usr/local/mukstart/gui --geometry +"0"+"0"