Page 3 of 3

Muksearch

Posted: Sun 01 Sep 2019, 17:06
by recobayu
I was inspired by windows 10 search. Now it is separate with cortana.
I make it simple. The good news is, if we search an app and run it now, it become on the top of search list on the next search.
I also add recent apps button (max 5 apps) and recently used doc (thank you MochiMoppel, I use your code).
We can add shortcut it (i.e: shift+win or win+space). Please rename the fake gz and run it.
I hope you like it. Thank you.

Re: Muksearch

Posted: Mon 02 Sep 2019, 02:06
by MochiMoppel
recobayu wrote:thank you MochiMoppel, I use your code
You're welcome, but that's not exactly my code :wink:
Always make sure that you test your code with file names that contain spaces.

I suggest that in line 217 you change

Code: Select all

<action signal="button-release-event">rox -s $tree_recent</action>
to

Code: Select all

<action signal="button-release-event">rox -s "$tree_recent"</action>

[Edit]
If you like you can try to replace the generic folder icons with each file's ROX mime icon:

1) symlink the ROX icons

Code: Select all

ln -fsn /usr/local/apps/ROX-Filer/ROX/MIME/ ${muksdir}/icons
( Your assignment "export XDG_DATA_DIRS=$XDG_DATA_DIRS:$muksdir" needs no change)

1) Change the function. The sed command now fetches also the mime-type. I omitted the if command as it's most likely not needed.

Code: Select all

recently_used(){
	rm $muksdir/recent
	rm $muksdir/recent_all
	XBEL_PATH=/root/.local/share/recently-used.xbel
	IFS=$'\n'
	MAX_ITEMS=20
	printf -v ALL "$(sed -rn 's/%/\\x/g
	/href=/   {N;N;N;N;s_^.*file://([^ "]*).*modified="([^"]*).*mime-type type="([^"]*).*$_\2@\3|\1_p}
	' "$XBEL_PATH" | sort -r | sed 's/.*@//; s_/_-_')"

	for file in $ALL ;do
	[[ -e ${file#*|} ]] && CNT=$((CNT+1)) && echo "$file" >> $muksdir/recent
	((CNT==MAX_ITEMS)) && break
	done	   
}
3) Change the tree:

Code: Select all

	<tree rules-hint="true" headers-visible="false" hover-selection="true">
	  <height>400</height>
	  <width>600</width>
	  <action signal="button-release-event">rox -s "$tree_recent"</action>
	  <action signal="button-release-event">EXIT:exit</action>
	  <action>rox -s "$tree_recent"</action>
	  <action>EXIT:exit</action>
	  <input file icon-column="0">'$muksdir'/recent</input>
	  <variable>tree_recent</variable>
	</tree>

Posted: Tue 03 Sep 2019, 05:07
by recobayu
Thank you, MochiMoppel.. I like it.
Please download file gz attachment below. rename it manually. it is not real gz file.

Improvement:
-Recent activities icon is based on mime icon the file. Thank you Mochimoppel.. :D
-Colored text recent apps and recent activities
-If we click button on recent apps, it become the first on the next run
-fix the "$tree_recent".
-fix for sudoku.
-file /root/.muksearch/topapps keep small (keep only 5 line)
-notebook also expand vertically when the window resize vertically
-exit by press escape key

Posted: Tue 03 Sep 2019, 11:30
by MochiMoppel
Looks good!
One thing you may want to reconsider is the MAX_ITEMS limitation. This limitation makes sense in a menu, for which this routine was originally written, but you have a scrollbar in your window and speed is not as crucial as in case of a menu. Probably eliminating MAX_ITEMS and CNT would have no negative effects.

Posted: Fri 06 Sep 2019, 08:09
by recobayu
The problem appear after I install a new app. It doesn't appear in mukstart. So I create this update. Now it was fixed. The recent apps still on top of list. and the new app will add in daftarlengkap.

Thank you Mochimoppel, now the recent activities more than 20.
it also can run in terminal where the file has "Terminal=true". Example: python.

Thank you

Posted: Fri 15 Nov 2019, 03:01
by recobayu
Update muksearch:
add two buttons: Clear recent apps and Clear recent activities.

Posted: Wed 04 Dec 2019, 09:59
by recobayu
Hi Everyone,
I make a new mukstart, but it is not complete yet. In this version, I can make the menu and submenu appear like left icon in button. I also make mukstart really like start menu in cinnamon. Any suggestion are welcome.
Thank you.

Posted: Mon 09 Dec 2019, 03:33
by recobayu
My code growing huge.. oh..
I can not write just in one script. the terminal says:

Code: Select all

./191209_0859: line 374: /usr/bin/tail: Argument list too long
./191209_0859: line 375: /usr/sbin/gtkdialog: Argument list too long
So I split my code into two files: the engine that create gui and the run (jalan) script.
Please suggest me an advice.. I still learn programming with bash, gtkdialog.
Thank you.

Posted: Mon 09 Dec 2019, 09:11
by sc0ttman
recobayu wrote:My code growing huge.. oh..
I can not write just in one script. the terminal says:

Code: Select all

./191209_0859: line 374: /usr/bin/tail: Argument list too long
./191209_0859: line 375: /usr/sbin/gtkdialog: Argument list too long
[/quote]

I haven't looked at your code, but it's likely you are trying to hold too many lines in a variable.

Write the variable to a file, and operate on that instead.. Something like:

[code]
cat file1 file 2 | grep 'foo ' > /tmp/some_file
...

something="$(grep 'bar /tmp/some_file | sed "s/old_value/new_value/g" )"

etc....


Or, it could be that you haven't wrapped something in quotes..

Like

Code: Select all

grep $some_value_with_spaces  /tmp/somefile
or

Code: Select all

grep 'foo' $some_file_list

(of course this is a guess, based on the error you got...)

Posted: Mon 09 Dec 2019, 10:27
by recobayu
Thank You, Scottman.
I split my code into two separate files. I call my make_gui_script from another file. And it's work.. :D

Code: Select all

#!/bin/sh
export mukstartdir=/root/.mukstart

/usr/local/mukstart/./mukstart_make_gui

tail -n +2 "$mukstartdir"/gui_mukstart > "$mukstartdir"/guifix
gtkdialog -f "$mukstartdir"/guifix --geometry +"0"+"0"
Now we can change display profile.
run from terminal:

Code: Select all

mukstart

Posted: Mon 16 Dec 2019, 14:27
by sfs

Posted: Sat 21 Dec 2019, 20:15
by recobayu
Thank you, Sfs for your feedback.
I upload the new mukstart that be able to find an app.
sc0ttman wrote:Write the variable to a file, and operate on that instead..
Thank you, Sc0ttman.
I found my problem. That is, I export my gui. The previous code is like this:

Code: Select all

export gui='<?xml version="1.0"?>
<window decorated="true" resizable="false" title="Mukstart" icon-name="limuks-logo">
...
</window>' > "$mukstartdir"/gui_mukstart
Now I write in a file, so I just do like this:

Code: Select all

echo '<?xml version="1.0"?>
<window decorated="true" resizable="false" title="Mukstart" icon-name="limuks-logo">
...
</window>' > "$mukstartdir"/gui_mukstart
Then I call my gui by tailing it.

Code: Select all

tail -n +2 "$mukstartdir"/gui_mukstart | gtkdialog -s
Okay.

What new:
we can move from tree (search apps) using left and right arrow. Left go to search box (entry) and right go to display picture.
Run it by command "mukstart" from terminal.
At first walk, it is eat long time. But at second and later, it run faster.

Questions:
1. How to make fileselect can show preview of display picture?
2. This mukstart still long to wake up from I run it. Anyone know how to faster it?
Thank you.

Posted: Wed 05 Feb 2020, 14:41
by sfs
recobayu wrote:2. This mukstart still long to wake up from I run it. Anyone know how to faster it?
I redid your script for non puppy linux and replaced :
for -> awk
gtkdialog : <input file> -> <input file icon=

"Recent Apps" does not work ?

Сan add checkbox "Edit *.desktop" ?