mukstart - start menu like Cinnamon

Window managers, icon programs, widgets, etc.
Message
Author
User avatar
recobayu
Posts: 387
Joined: Wed 15 Sep 2010, 22:48
Location: indonesia

mukstart - start menu like Cinnamon

#1 Post 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
Attachments
mukstart-4.3.1.pet
I'm sorry about name guimuks and mainw. I change mainw to guimuks.
I add geometry parameter here, so mukstart always show at left top screen.
(2.32 KiB) Downloaded 692 times
mukstart4.3.1.png
(55.31 KiB) Downloaded 1372 times
mukstart4.2.pet
add hover-selection="true"
(2.74 KiB) Downloaded 714 times
mukstart4.1.pet
First version. Simple search menu
(2.67 KiB) Downloaded 644 times
Last edited by recobayu on Fri 15 Jan 2016, 04:06, edited 6 times in total.

User avatar
recobayu
Posts: 387
Joined: Wed 15 Sep 2010, 22:48
Location: indonesia

#2 Post 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
Attachments
mukstart4.3.gz
rename the file to mukstart4.3 (remove the fake gz)
(3.41 KiB) Downloaded 577 times
mukstart4.3.png
(30.55 KiB) Downloaded 1395 times

User avatar
recobayu
Posts: 387
Joined: Wed 15 Sep 2010, 22:48
Location: indonesia

mukstart4.3.1

#3 Post 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.
Attachments
mukstart4.3.1.png
(50.32 KiB) Downloaded 1369 times
mukstart4.3.1.gz
(5 KiB) Downloaded 570 times

User avatar
recobayu
Posts: 387
Joined: Wed 15 Sep 2010, 22:48
Location: indonesia

#4 Post by recobayu »

Version 4.3.1 fixed.

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

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#5 Post 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.

User avatar
recobayu
Posts: 387
Joined: Wed 15 Sep 2010, 22:48
Location: indonesia

#6 Post by recobayu »

I don't know greengeek. I make that pet in puppy tahr 605. :(

User avatar
torm
Posts: 186
Joined: Sat 07 Mar 2015, 19:56

#7 Post 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!

User avatar
recobayu
Posts: 387
Joined: Wed 15 Sep 2010, 22:48
Location: indonesia

#8 Post 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.
Attachments
mukstart-4.3.2.pet
(2.24 KiB) Downloaded 476 times

User avatar
recobayu
Posts: 387
Joined: Wed 15 Sep 2010, 22:48
Location: indonesia

#9 Post 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.
Attachments
mukstart-search.png
Search mode
(28.44 KiB) Downloaded 1148 times
mukstart.png
Not search mode
(58.46 KiB) Downloaded 1170 times
mukstart-4.3.2.1.pet
(2.86 KiB) Downloaded 478 times

User avatar
recobayu
Posts: 387
Joined: Wed 15 Sep 2010, 22:48
Location: indonesia

#10 Post 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.
Attachments
mukstart-4.3.2.2.pet
(3.1 KiB) Downloaded 517 times

User avatar
shadow of viper`
Posts: 113
Joined: Sat 28 Aug 2010, 00:47
Location: Hyderabad, India

Awesome!

#11 Post 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!

User avatar
shadow of viper`
Posts: 113
Joined: Sat 28 Aug 2010, 00:47
Location: Hyderabad, India

#12 Post 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
Attachments
Screenshot.jpg
(51.3 KiB) Downloaded 1022 times

User avatar
recobayu
Posts: 387
Joined: Wed 15 Sep 2010, 22:48
Location: indonesia

#13 Post 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.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#14 Post by MochiMoppel »

recobayu wrote:I know how to left alignment on button, but it just on text.
How?

User avatar
recobayu
Posts: 387
Joined: Wed 15 Sep 2010, 22:48
Location: indonesia

#15 Post 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
Attachments
buttonalignment.png
(6.8 KiB) Downloaded 939 times

User avatar
shadow of viper`
Posts: 113
Joined: Sat 28 Aug 2010, 00:47
Location: Hyderabad, India

#16 Post 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!

User avatar
shadow of viper`
Posts: 113
Joined: Sat 28 Aug 2010, 00:47
Location: Hyderabad, India

#17 Post 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!

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#18 Post by MochiMoppel »

recobayu wrote:Here it is
Terima kasih.

User avatar
nilsonmorales
Posts: 972
Joined: Fri 15 Apr 2011, 14:39
Location: El Salvador

#19 Post 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
[b][url=http://nilsonmorales.blogspot.com/]My blog |[/url][/b][b][url=https://github.com/woofshahenzup]| Github[/url][/b]
[img]https://i.postimg.cc/5tz5vrrX/imag018la6.gif[/img]
[img]http://s5.postimg.org/7h2fid8pz/botones_logos3.png[/img]

tenochslb

#20 Post 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"

Post Reply