jwm_tools-0.9 (was jwm_menu_create)

Window managers, icon programs, widgets, etc.
Message
Author
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#121 Post by disciple »

instead implement autostart
Yes.
For when your window manager doesn't provide the functionality, I thought there was a shell script somewhere like github or gitorious produced by some Arch person... but if there was, I can't find it now. Maybe I was thinking of http://gitorious.org/xdg-autostart/ (not a shell script).
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#122 Post by disciple »

implement a better default handler (that does not depend on ROX-Filer) using mime info from desktop file entries including Trash and thumbnail support if possible (basically xdg-open lite)
I think the "new generation" pcmanfm actually handles this (file associations, not opening files from the command line like xdg-open), quite well, and I've been wondering what the chances would be of linking something like Rox or the old GTK searchmonkey against libfm to get this functionality... but I'm sure it's a lot too difficult for me.

This thing looks fun:
https://bbs.archlinux.org/viewtopic.php?pid=1124843https://github.com/Cloudef/PKGBUILDS/tr ... er/linopen
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#123 Post by disciple »

disciple wrote:
instead implement autostart
Yes.
For when your window manager doesn't provide the functionality, I thought there was a shell script somewhere like github or gitorious produced by some Arch person... but if there was, I can't find it now. Maybe I was thinking of http://gitorious.org/xdg-autostart/ (not a shell script).
Another one (also not a shell script): https://bitbucket.org/jjacky/dapper
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: jwm_tools-0.9 (was jwm_menu_create)

#124 Post by L18L »

Once upon a time...
L18L wrote:Please delete config file /root/.jwm/JWMRC
then install 0.9.3.pet

What´s new?

jwm_param_gui can be launched from JWM configuration

known bugs are fixed

menu has an alternative for translations now
no more inside /usr/share/applications/*.desktop
but simply in 1 file, ex: /usr/share/locales/de/names
/usr/share/locales/de/names wrote:s%"Abiword word processor"%"Abiword Textverarbeitung"%
s%"FFConvert multimedia converter"%"FFConvert Multimedia-Konverter"%
s%"Mixer generic sound mixer"%"Mixer Sound-Mischpult"%
s%"Pmount mount/unmount drives"%"Pmount Laufwerke ein-/aushängen"%
Copy this file (170 program names from racy, extendable) into your locales and you can translate everything very quick (momanager needed more than 1 minute for each word and I think this is much better)

Image
Please delete config file /root/.jwm/JWMRC
then install 0.9.4.pet

What´s new?

- You can switch (back) to English now

Does it not look nice in in of the "sinister languages" :lol:
Attachments
jwm_tools_LANGUAGE.png
(22.07 KiB) Downloaded 1487 times
jwm_tools-0.9.4.pet
(18.71 KiB) Downloaded 1094 times

User avatar
torios
Posts: 28
Joined: Fri 05 Dec 2014, 23:21

menu fixes

#125 Post by torios »

I have been modifying the script for use on Ubuntu, and I handle a few things slightly different.

First... Icons and Exec=
if [[ "${ICON##*.}" == "xpm" ]] || [[ "${ICON##*.}" == "svg" ]] || [[ "${ICON##*.}" == "png" ]] || [[ "${ICON}" == "/*" ]]
then
MenuEntry='
<Program label="'${NAME}'" icon="'${ICON}'">'${EXEC%\ \%?}'</Program>'
else
MenuEntry='
<Program label="'${NAME}'" icon="'${ICON}'.svg">'${EXEC%\ \%?}'</Program>'
fi


And secondly for the case statement to get the info I added two items
case $LINE in
Name?${myLANG%_*}?=*|Name=*) NAME="${LINE#*=}"'' ;; # sc0ttman... should use "Name[$myLANG]=" if found
TryExec=*|Exec=*) EXEC="${LINE#*=}"'' ;;
Categories=*) CATS="${LINE#*=}"'' ;;
Icon=*) ICON="${LINE#*=}"'' ;;
Terminal=*) TERM="${LINE#*=}"'' ;;
'[Desktop Action'*) break ;;
"["*" Shortcut Group]") break ;;
the last two things check for Ubuntu specific (?) Desktop Actions and Shortcut Group for apps like Chrome...

I also include an xdg desktop directories folder, and parse that for localization for the category names... Which are structured like the Lubuntu menu
case "$CAT" in
AudioVideo)AV=${AV}${MenuEntry};;
Development)DEV=${DEV}${MenuEntry};;
Education)ED=${ED}${MenuEntry};;
Game)GAME=${GAME}${MenuEntry};;
Graphics)ART=${ART}${MenuEntry};;
Network)NET=${NET}${MenuEntry};;
Office)OFF=${OFF}${MenuEntry};;
Science)SCI=${SCI}${MenuEntry};;
Settings)SET=${SET}${MenuEntry};;
System)SYS=${SYS}${MenuEntry};;
Utility)ACC=${ACC}${MenuEntry};;
*)Misc=${MISC}${MenuEntry};; #add Miscellaneous category?
esac
If anyone is interested in this menu script let me know... it generates a Root menu, so it looks and behaves much like the old Gnome2 menu or the LXDE/XFCE etc... menus
I put my menu generation script in
/etc/menu-methods
and install menu && menu-xdg so this script is run everytime a program is installed...
The end of the script also does
sed -i 's/&/&/g' ${MENUFILE}
RESULT=$(jwm -reload)
to replace & with the xml &amp
and reloads the menu

I use svg icons but feel free to change svg to whatever you like best
Basically it checks to see if it starts with '/' which would mean it is full path
and it looks to see if it has a . extention to keep that the same as well...

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#126 Post by technosaurus »

Code: Select all

if [[ "${ICON##*.}" == "xpm" ]] || [[ "${ICON##*.}" == "svg" ]] || [[ "${ICON##*.}" == "png" ]] || [[ "${ICON}" == "/*" ]]
then
MenuEntry='
<Program label="'${NAME}'" icon="'${ICON}'">'${EXEC%\ \%?}'</Program>'
else
MenuEntry='
<Program label="'${NAME}'" icon="'${ICON}'.svg">'${EXEC%\ \%?}'</Program>'
fi 
could be

Code: Select all

case "${ICON##*.}" in
  *.xpm|*.png|*.svg|/*):;;
  *)ICON="${ICON}.${DEFAULTICONTYPE:-svg}"
     #allows default icon type to be set in config
esac
MenuEntry='
<Program label="'${NAME}'" icon="'${ICON}'">'${EXEC%\ \%?}'</Program>
'

and also

Code: Select all

"[Desktop Entry]"*)continue;;
"["*)break;; #handle any other random extra groups
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#127 Post by technosaurus »

I just threw an xdg_autostart script together to use as a jwm <StartupCommand>

http://standards.freedesktop.org/autost ... atest.html

just place .desktop files that you want to autorun in /etc/xdg/autostart/ or $HOME/.config/autorun/

It assumes that $XDG_CURRENT_DESKTOP is set appropirately; for puppy using mostly gtk2 apps, to get a full desktop environment, set it to XFCE and/or GNOME ... in /etc/profile or your bashrc just set:
XDG_CURRENT_DESKTOP=GNOME:XFCE
and it will run all apps with OnlyShowIn=GNOME;XFCE
but not run any apps with NotShowIn=GNOME;XFCE
or set it to XDG_CURRENT_DESKTOP to JWM and add it to the OnlyShowIn= or NotShowIn= parameter of the .desktop files as necessary

Code: Select all

#!/bin/ash

matchDeskEnv(){
	ret=1; IFS=";"
	for Env in ${1}; do
		case ":${XDG_CURRENT_DESKTOP}:" in
			*":${Env}:"*)ret=0;break;;
		esac
	done
	return $ret
}

doDesktopFile(){
	EXEC="";EXECPATH="";BACK=$PWD
	while read LINE; do
		case "$LINE" in
			Exec=*)EXEC=${LINE#*=};;
			Path=*)EXECPATH=${LINE#*=};;
			Hidden=true*)return;;
			OnlyShowIn=*)matchDeskEnv ${LINE#*=} || return;;
			NotShowIn=*)matchDeskEnv ${LINE#*=} && return;;
		esac
	done < $1
	[ "$EXECPATH" ] && cd $EXECPATH
	[ "$EXEC" ] && $EXEC &
	[ "$EXECPATH" ] && cd $BACK
}

AUTOSTARTDIR=${XDG_CONFIG_HOME:-${HOME}/.config/}/autostart
for Entry in ${AUTOSTARTDIR}/*.desktop; do
	doDesktopFile $Entry
done

IFS=":"
for DIR in ${XDG_CONFIG_DIRS:-/etc/xdg}; do
	for Entry in ${DIR}/autostart/*.desktop; do
		#allow users to block/override system settings
		[ -f "${AUTOSTARTDIR}/${Entry##*/}" ] && continue
		[ -f "${Entry}" ] && doDesktopFile $Entry
	done
done
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
torios
Posts: 28
Joined: Fri 05 Dec 2014, 23:21

#128 Post by torios »

I should add that I look for

Code: Select all

Terminal=*) TERM="${LINE#*=}"''  ;;
and then

Code: Select all

if [ "${TERM}" == "true" ]
then
EXEC="x-terminal-emulator -e ${EXEC}"
fi
So things like htop will work correctly.
I will look at your autostart scripts soon (still looking at sdesk)
That may be an easier way to handle autostarting all together.
Much more intuitive for new users :)

Thanks for the input.. the icon code doesn't work exactly as I want (adds svg to files with a path....) but it looks cleaner.. so I will look more at it.

User avatar
torios
Posts: 28
Joined: Fri 05 Dec 2014, 23:21

#129 Post by torios »

Another question... do you know of anyone who has already made a way to parse icon themes (like the theme files or whatever) to add the appropriate directories for jwmrc?

This could then be checked and the extension added in the menu script.

Thanks for your help by the way! It is wonderful to have a usable JWM on Ubuntu!!

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#130 Post by technosaurus »

torios wrote:I should add that I look for

Code: Select all

Terminal=*) TERM="${LINE#*=}"''  ;;
and then

Code: Select all

if [ "${TERM}" == "true" ]
then
EXEC="x-terminal-emulator -e ${EXEC}"
fi
Don't use TERM that way, it is a reserved variable used to set the terminal. It is actually helpful... That case should probably be
Terminal=*)["${LINE#*=}" == "true" ] && EXEC="$TERM -e $EXEC";;
(btw if you want x-terminal-emulator to be your default $TERM, add an export for it in /etc/profile or $HOME/.bashrc)
Thanks for the input.. the icon code doesn't work exactly as I want (adds svg to files with a path....) but it looks cleaner.. so I will look more at it.
I thought that shells didn't do fallthrough cases, so I just used ):;; instead of )break;; ... normally that code would only add the svg (or default if set) when the icon doesn't have a supported extension or start with a '/'.... I don't recall if its allowed to have relative paths or with variables, but if so that could be changed to */*
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#131 Post by technosaurus »

Now that jwm supports menu tooltips, I will be starting back to work on jwm tools. I have to go out of town for the weekend.
While I am away please feel free to request any features you'd like to see.

Since jwm now supports separate mouse bindings (including scroll wheel) I'll probably do a few "tray applets" (volume control seems to be the lowest low lying fruit).

Let me know if you are a dev that already has some fixes to work with the latest jwm, so I don't miss something.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#132 Post by 01micko »

- support for stupid paths like /usr/share/applications/kde4/ (and possibly kde5)
- adjustable menu, task bar and title bar heights (touch screen friendly)
- adjustable window corners (IIRC it's 0 - 4)
- icon choice for window buttons (assuming you are supporting stock as well as your fork)
- top or bottom main tray (old one had that?)

Thanks

PS: what are you defaulting to in the tooltip? 'Comment=' ?
And, what is the main menu entry; 'Name=' or 'GenericName=' ?

Thanks again.
Puppy Linux Blog - contact me for access

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#133 Post by technosaurus »

01micko wrote:- support for stupid paths like /usr/share/applications/kde4/ (and possibly kde5)
As long as they meet http://standards.freedesktop.org/menu-s ... atest.html
$XDG_DATA_DIRS/applications/.
so if you had XDG_DATA_DIRS=/usr/share:/usr/share/kde/xdg, it would look in /usr/share/kde/xdg/applications/*.desktop as well
it will look in all "applications" sub-directories in XDG_DATA_DIRS
beyond that
- adjustable menu, task bar and title bar heights (touch screen friendly)
This was already available IIRC, but can be easily added if not
- adjustable window corners (IIRC it's 0 - 4)
Sure, pretty easy
- icon choice for window buttons (assuming you are supporting stock as well as your fork)
yep, I just submitted a patch so that xbm icons that we did in this thread work again
- top or bottom main tray (old one had that?)
If its is configurable in jwm, there will be an interface. The big difference this time around is that them menus, themes, keybindings, icon paths etc, will be in separate include files and the jwmrc will just be a series of include tags
(we don't need to regenerate keybindings and trays every time we update the menu)
Thanks

PS: what are you defaulting to in the tooltip? 'Comment=' ?
And, what is the main menu entry; 'Name=' or 'GenericName=' ?

Thanks again.
tooltip = Comment
label = Name (for localization support, some .desktop files have Name[lang], but not GenericName[])
Hopefully this will keep us from having to keep puppy-specific desktop files in woof-ce with the Comment= section added to the end of Name=
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

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

#134 Post by MochiMoppel »

technosaurus wrote:we don't need to regenerate keybindings and trays every time we update the menu
I never understood why we do now. Though fixmenus should only update the menu, in reality it updates the whole configuration file .jwmrc. This leads to the necessity of include files as safe havens for customized settings. JWM needs only 1 configuration file, and splitting this file into many include files certainly may have advantages, but I'm not sure if they outweigh the disadvantages. I tried this once and found that the small content for each include file doesn't justify the separation.

Did you consider to let fixmenus generate the menu only? In other words: Reduce the content of /etc/xdg/templates/_root_.jwmrc to <RootMenu> and rename the template to something like _root_.jwmrc-menu? The generated menu can then be included in .jwmrc - as the one and only include file.
I moved all the stuff from jwmrc-tray / personal / themes into my .jwmrc , thereby removing many duplicate and unneeded settings. I was surprised how small and neat a full featured and now editable .jwmrc can be. After all having only 1 configuration file (+ 1 include) is less confusing for novices and closer to what the JWM manual describes.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

tooltip=Comment

#135 Post by L18L »

01micko wrote:what are you defaulting to in the tooltip? 'Comment=' ?
And, what is the main menu entry; 'Name=' or 'GenericName=' ?
technosaurus wrote:tooltip = Comment
label = Name (for localization support, some .desktop files have Name[lang], but not GenericName[])
Hopefully this will keep us from having to keep puppy-specific desktop files in woof-ce with the Comment= section added to the end of

Comment at the end of Name was really a quick and dirty work around.
Comment or its translation if available is much better of course.
[pseudo code]tooltip from Comment[LANG%.*] or Comment[LANG%_*] or Comment.[/pseudocode]

There is a patch of Rox-Filer made by mikeb that renders Comment[lang] as tooltip. http://murga-linux.com/puppy/viewtopic.php?t=98535

GenericName (and its translations) are being used in razor menu of Fatdog64 like Name (GenericName) e.g. Geany (Integrierte Entwicklungsumgebung) but that's another story.
Attachments
GenericName.png
Note: Name(GenericName)
(14.64 KiB) Downloaded 360 times

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#136 Post by technosaurus »

MochiMoppel wrote:
technosaurus wrote:we don't need to regenerate keybindings and trays every time we update the menu
I never understood why we do now. Though fixmenus should only update the menu, in reality it updates the whole configuration file .jwmrc. This leads to the necessity of include files as safe havens for customized settings. JWM needs only 1 configuration file, and splitting this file into many include files certainly may have advantages, but I'm not sure if they outweigh the disadvantages. I tried this once and found that the small content for each include file doesn't justify the separation.

Did you consider to let fixmenus generate the menu only? In other words: Reduce the content of /etc/xdg/templates/_root_.jwmrc to <RootMenu> and rename the template to something like _root_.jwmrc-menu? The generated menu can then be included in .jwmrc - as the one and only include file.
I moved all the stuff from jwmrc-tray / personal / themes into my .jwmrc , thereby removing many duplicate and unneeded settings. I was surprised how small and neat a full featured and now editable .jwmrc can be. After all having only 1 configuration file (+ 1 include) is less confusing for novices and closer to what the JWM manual describes.
I use a flat file with inline comments that is much easier to edit than XML, but it is still all in one file. The individual config tools just read / replace the appropriate lines. On the plus side it can be included in a shell script directly where XML would need to be parsed.

Yes menus will only generate their own xml, but now support an additional dynamic tag so technically it could be generated when the menu is hovered over. I did that with my 9menu version.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

Re: tooltip=Comment

#137 Post by technosaurus »

L18L wrote:
01micko wrote:what are you defaulting to in the tooltip? 'Comment=' ?
And, what is the main menu entry; 'Name=' or 'GenericName=' ?
technosaurus wrote:tooltip = Comment
label = Name (for localization support, some .desktop files have Name[lang], but not GenericName[])
Hopefully this will keep us from having to keep puppy-specific desktop files in woof-ce with the Comment= section added to the end of

Comment at the end of Name was really a quick and dirty work around.
Comment or its translation if available is much better of course.
[pseudo code]tooltip from Comment[LANG%.*] or Comment[LANG%_*] or Comment.[/pseudocode]

There is a patch of Rox-Filer made by mikeb that renders Comment[lang] as tooltip. http://murga-linux.com/puppy/viewtopic.php?t=98535

GenericName (and its translations) are being used in razor menu of Fatdog64 like Name (GenericName) e.g. Geany (Integrierte Entwicklungsumgebung) but that's another story.
How about label=Name[lang] and tooltip=GenericName[lang] + Comment[lang] (unless they are the same exact text) .... In other words , no tooltip would say "word processor - word processor"
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: tooltip=GenericName[lang] + Comment[lang]

#138 Post by L18L »

technosaurus wrote:How about label=Name[lang] and tooltip=GenericName[lang] + Comment[lang] (unless they are the same exact text) .... In other words , no tooltip would say "word processor - word processor"
appears simply perfect! :D

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

back to work on jwm tools

#139 Post by L18L »

technosaurus wrote:While I am away please feel free to request any features you'd like to see.
Just to let you know I am working on momanager to be used for translation of jwm_menu_create.

translation file is /usr/share/locale/myLANG/LC_MESSAGES/jwm_menu_create.

Code: Select all

<Menu label="'${_M_6:-Graphic}'" icon="paint48.png" height="16">
	'${GraphicGraphics}'
<Separator/>
German "translation":
my tmp/momanager/jwm_menu_create wrote:# created Son Nov 8 18:42:53 CET 2015 by /usr/sbin/t12s_msgfmt
# from only temporarily existing jwm_menu_create.po

_M_6="Grafik"
#Graphic

_M_7="Dokument"
#Document
works 8)

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

Re: back to work on jwm tools

#140 Post by technosaurus »

L18L wrote:
technosaurus wrote:While I am away please feel free to request any features you'd like to see.
Just to let you know I am working on momanager to be used for translation of jwm_menu_create.

translation file is /usr/share/locale/myLANG/LC_MESSAGES/jwm_menu_create.

Code: Select all

<Menu label="'${_M_6:-Graphic}'" icon="paint48.png" height="16">
	'${GraphicGraphics}'
<Separator/>
German "translation":
my tmp/momanager/jwm_menu_create wrote:# created Son Nov 8 18:42:53 CET 2015 by /usr/sbin/t12s_msgfmt
# from only temporarily existing jwm_menu_create.po

_M_6="Grafik"
#Graphic

_M_7="Dokument"
#Document
works 8)
Leave me a link to your current work and I will try to keep it compatible or send a patch. I am going to be replacing some puppy terminology with appropriate standards from standards.freedesktop.org.

One new thing will be KDE, Enlightenment and Gnome categories with the option to integrate or separate them by user options and/or environment variables while respecting corresponding applicable OnlyShowIn= NotShowIn= settings.

The named files are going to be split out into functional categories menus, toolbars, theme, keybindings, iconpaths, program groups.

I am going to be designing an svg creator for the sole purpose of demonstrating themes on the fly so we don't have to jwm -restart to see if we like the changes.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply