Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 30 Apr 2016, 01:38
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
jwm_tools-0.9 (was jwm_menu_create)
Post new topic   Reply to topic View previous topic :: View next topic
Page 9 of 10 [144 Posts]   Goto page: Previous 1, 2, 3, ..., 7, 8, 9, 10 Next
Author Message
disciple

Joined: 20 May 2006
Posts: 6653
Location: Auckland, New Zealand

PostPosted: Thu 05 Jul 2012, 02:37    Post subject:  

Quote:
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).

_________________
Classic Puppy quotes
-
root: n. the superuser or administrator account that has complete control over everything in the machine. Running as root is a taonga of Puppy Linux users.
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6653
Location: Auckland, New Zealand

PostPosted: Thu 05 Jul 2012, 02:51    Post subject:  

Quote:
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/tree/master/linopen

_________________
Classic Puppy quotes
-
root: n. the superuser or administrator account that has complete control over everything in the machine. Running as root is a taonga of Puppy Linux users.
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6653
Location: Auckland, New Zealand

PostPosted: Sun 15 Jul 2012, 08:55    Post subject:  

disciple wrote:
Quote:
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

_________________
Classic Puppy quotes
-
root: n. the superuser or administrator account that has complete control over everything in the machine. Running as root is a taonga of Puppy Linux users.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 3349
Location: www.eussenheim.de/

PostPosted: Thu 18 Oct 2012, 07:45    Post subject: Re: jwm_tools-0.9 (was jwm_menu_create)
Subject description: version 0.9.4
 

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)



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" Laughing
jwm_tools_LANGUAGE.png
 Description   
 Filesize   22.07 KB
 Viewed   1218 Time(s)

jwm_tools_LANGUAGE.png

jwm_tools-0.9.4.pet
Description 
pet

 Download 
Filename  jwm_tools-0.9.4.pet 
Filesize  18.71 KB 
Downloaded  714 Time(s) 
Back to top
View user's profile Send private message 
torios


Joined: 05 Dec 2014
Posts: 28

PostPosted: Fri 05 Dec 2014, 19:39    Post subject: menu fixes  

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/&/&amp;/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...
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4645

PostPosted: Fri 05 Dec 2014, 23:21    Post subject:  

Quote:
Code:
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:
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:
"[Desktop Entry]"*)continue;;
"["*)break;; #handle any other random extra groups

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4645

PostPosted: Fri 05 Dec 2014, 23:48    Post subject:  

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

http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.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:
#!/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

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
torios


Joined: 05 Dec 2014
Posts: 28

PostPosted: Mon 08 Dec 2014, 23:55    Post subject:  

I should add that I look for
Code:
Terminal=*) TERM="${LINE#*=}"''  ;;

and then
Code:
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 Smile

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.
Back to top
View user's profile Send private message 
torios


Joined: 05 Dec 2014
Posts: 28

PostPosted: Tue 09 Dec 2014, 00:01    Post subject:  

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!!
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4645

PostPosted: Tue 09 Dec 2014, 20:48    Post subject:  

torios wrote:
I should add that I look for
Code:
Terminal=*) TERM="${LINE#*=}"''  ;;

and then
Code:
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)

Quote:
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 */*

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4645

PostPosted: Fri 06 Nov 2015, 23:43    Post subject:  

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.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8463
Location: qld

PostPosted: Sat 07 Nov 2015, 00:40    Post subject:  

- 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
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4645

PostPosted: Sat 07 Nov 2015, 01:47    Post subject:  

01micko wrote:
- support for stupid paths like /usr/share/applications/kde4/ (and possibly kde5)

As long as they meet http://standards.freedesktop.org/menu-spec/menu-spec-latest.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
Quote:
- adjustable menu, task bar and title bar heights (touch screen friendly)

This was already available IIRC, but can be easily added if not
Quote:
- adjustable window corners (IIRC it's 0 - 4)

Sure, pretty easy
Quote:
- 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
Quote:
- 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)
Quote:

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=

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 964
Location: Japan

PostPosted: Sat 07 Nov 2015, 05:00    Post subject:  

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.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 3349
Location: www.eussenheim.de/

PostPosted: Sat 07 Nov 2015, 08:25    Post subject: tooltip=Comment  

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.
GenericName.png
 Description   Note: Name(GenericName)
 Filesize   14.64 KB
 Viewed   115 Time(s)

GenericName.png

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 9 of 10 [144 Posts]   Goto page: Previous 1, 2, 3, ..., 7, 8, 9, 10 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0788s ][ Queries: 13 (0.0088s) ][ GZIP on ]