An idea… IceWM Dynamic Desktop Menu

Forum Forums New users New Users and General Questions An idea… IceWM Dynamic Desktop Menu

  • This topic has 99 replies, 7 voices, and was last updated Oct 13-5:02 am by BobC.
Viewing 15 posts - 16 through 30 (of 100 total)
  • Author
    Posts
  • #26812
    Member
    AvatarBobC

    I agree, IceWM and Gears looks fine to me. I didn’t see anything like that.

    Thanks 🙂

    #26830
    AvatarAnonymous

    I’m somewhat busy at the moment.
    Will see what I can do.

    Another candidate …

    #26832
    AvatarAnonymous

    @BobC

    When I “look in internet”, I find also such things …

    #26838
    Member
    AvatarBobC

    I think a combo of an icy mountain and gears or tools is going to be in the right direction.

    IMO, The first one you posted was ideal if it would be acceptable with the other icons.

    #26851
    Member
    AvatarBobC

    Ok, so here is a pic of my IceWM Desktop Apps menu on the screen.

    I left spacefm-icewm running but turned conky off. This is on antiX19b3, so I can’t switch desktops without logging out, so I just left it running so you could see that I have generated menu entries for each item in the folder.

    The idea is that on memory limited machines, you could just run min-icewm and be able to open your desktop files from the menu without needing rox-pinboard or spacefm running to save memory. Note that I also made it able to handle folders inside the desktop folder by creating submenu’s for them.

    I haven’t figured out yet how to know what can be run with xdg-open vs not, etc, but the big problem as I saw it was to get the dynamic menu to generate from your Desktop folder.

    Opinions? Offers of help on how to generate the code to run each entry?

    What it opens now:
    .desktop files for x-window apps like PPC’s IceWM Toolbar Editor
    .desktop files for terminal apps
    pictures, movies and other files xdg-open works with
    sub directories within ~/Desktop and the working items within them

    What doesn’t work:
    sub directory names or file names with spaces or special characters
    ???not sure what else???

    Attaching zip file with code for dynamic drives submenu and recursive-dynamic Desktop Apps menu.
    menu file needs to go in ~/.icewm — backup your current file first
    .sh files need to be executable and go in path, I have been putting them into /usr/local/bin

    PS: so far this has only been tested with IceWM 1.6.1 but should also work with IceWM 1.5.5. If running 17.4.1, it will be necessary to install a newer IceWM version. You can find out what version you have installed in a terminal with:
    icewm -V

    PSS: This is NEW code, ONLY tested by me at this point, so best to be CAUTIOUS with it, trying it on a test system, especially if you are running anything I haven’t tried. Be safe, not SORRY!

    • This reply was modified 2 months, 2 weeks ago by BobC.
    • This reply was modified 2 months, 2 weeks ago by BobC.
    • This reply was modified 2 months, 2 weeks ago by BobC.
    #26879
    Forum Admin
    anticapitalistaanticapitalista

    @ BobC – Can’t get the scripts to work.
    Clicking on them or running from a terminal does nothing and no error messages.

    Philosophers have interpreted the world in many ways; the point is to change it.

    #26881
    Member
    AvatarBobC

    Arghhh…

    I will investigate as soon as I get back and upload a new zip file after retesting.

    anti, I downloaded it from the post above
    extracted it with spacefm
    ran the stuff below from a terminal
    restarted icewm from the antiX button Logout menu
    ran PPC’s IceWM Toolbar maint program to show it would run from there
    did a 2nd screenshot

    Maybe you have something it can’t handle in your ~/Desktop folder? If the problem persists, go to where you extracted it and do the same things I did and post the listing like mine, please?

    $ ls -lR ~/Desktop
    /home/bobc/Desktop:
    total 288
    -rwx------ 1 bobc bobc    106 Sep  4 02:22 1440x900-Screen
    -rwx------ 1 bobc bobc    107 Sep  4 02:27 1680x1050-Screen
    -rw-r--r-- 1 bobc bobc    183 Sep  5 03:23 IceWM_Toolbar_Icon_Manager.desktop
    -rw-r--r-- 1 bobc bobc    881 Aug 18 22:29 antiX-docs.desktop
    -rw-r--r-- 1 bobc bobc    238 Aug 16 15:16 arandr.desktop
    -rw-r--r-- 1 bobc bobc   1418 Sep  7 07:37 ddm-nvidia.desktop
    -rw-r--r-- 1 bobc bobc   1562 Aug 18 22:29 file-manager.desktop
    -rw-r--r-- 1 bobc bobc    113 May 23  2018 index.html
    -rw-r--r-- 1 bobc bobc 257101 Aug 21 12:14 mc-screen.jpg
    drwxr-xr-x 2 bobc bobc   4096 Sep  7 02:40 test_stuff
    
    /home/bobc/Desktop/test_stuff:
    total 16
    -rw-rw-r-- 1 bobc bobc  360 Jan  6  2019 ceni.desktop
    -rw-rw-r-- 1 bobc bobc 1418 Jan  6  2019 ddm-nvidia.desktop
    -rw-rw-r-- 1 bobc bobc  222 Jan  6  2019 mps-youtube.desktop
    -rw-rw-r-- 1 bobc bobc  630 Jan  6  2019 pppoeconf.desktop
    bobc@xps15:~/Downloads/icewm-menu/icewm-menu
    $ ls -l
    total 12
    -rwxrwxrwx 1 bobc bobc 3162 Sep  7 10:07 icewm-menu-Desktop.sh
    -rwxrwxrwx 1 bobc bobc  664 Sep  7 08:48 icewm-menu-drives.sh
    -rw-rw-r-- 1 bobc bobc 3251 Sep  7 08:58 menu
    bobc@xps15:~/Downloads/icewm-menu/icewm-menu
    $ ./icewm-menu-Desktop.sh 
    prog "  1440x900-Screen" - xdg-open /home/bobc/Desktop/1440x900-Screen
    prog "  1680x1050-Screen" - xdg-open /home/bobc/Desktop/1680x1050-Screen
    prog "  IceWM_Toolbar_Icon_Manager.desktop" - /usr/local/bin/icewm-toolbar-icon-manager.sh
    prog "  antiX-docs.desktop" - dillo /usr/share/antiX/FAQ/index.html 
    prog "  arandr.desktop" - arandr
    prog "  ddm-nvidia.desktop" - desktop-defaults-run -t su-to-root -c "/usr/local/bin/ddm-mx -i nvidia"
    prog "  file-manager.desktop" - desktop-defaults-run -fm
    prog "  index.html" - xdg-open /home/bobc/Desktop/index.html
    prog "  mc-screen.jpg" - xdg-open /home/bobc/Desktop/mc-screen.jpg
    menu "test_stuff entries" - {
    prog "  ceni.desktop" - desktop-defaults-run -t sudo ceni
    prog "  ddm-nvidia.desktop" - desktop-defaults-run -t su-to-root -c "/usr/local/bin/ddm-mx -i nvidia"
    prog "  mps-youtube.desktop" - desktop-defaults-run -t mpsyt 
    prog "  pppoeconf.desktop" - desktop-defaults-run -t /usr/sbin/pppoeconf
    }
    bobc@xps15:~/Downloads/icewm-menu/icewm-menu
    $ sudo cp icewm-menu-Desktop.sh /usr/local/bin
    [sudo] password for bobc: 
    bobc@xps15:~/Downloads/icewm-menu/icewm-menu
    $ sudo cp icewm-menu-drives.sh  /usr/local/bin
    bobc@xps15:~/Downloads/icewm-menu/icewm-menu
    $ cp menu ~/.icewm
    bobc@xps15:~/Downloads/icewm-menu/icewm-menu
    #26922
    Member
    AvatarBobC

    I installed it on the Pentium III and the response time is not noticeable any more than any other menu.. I added an icon for each menu. I could try to get it top put the correct icons next to the menu entries but not sure how to go about that with the multiple icon schemes. I suppose I could get the ones for .desktop entries for starters, but beyond that, it would get more complex unless there is already a utility to find the correct one that is smart enough to .cache them so it won’t be painfully slow.

    It definitely helped memory and CPU not needing to run the desktop or conky

    #!/bin/bash
    
    ### icewm-menu-Desktop.sh - dynamic menu of ~/Desktop files to open via dynamic menu
    
    ### BobC 09/04/19
    
    ### --- example output ---
    ### prog "  1440x900-Screen" - xdg-open /home/bobc/Desktop/1440x900-Screen
    ### prog "  IceWM_Toolbar_Icon_Manager.desktop" - /usr/local/bin/icewm-toolbar-icon-manager.sh
    ### prog "  antiX-docs.desktop" - dillo /usr/share/antiX/FAQ/index.html 
    ### prog "  arandr.desktop" - arandr
    ### prog "  ddm-nvidia.desktop" - desktop-defaults-run -t su-to-root -c "/usr/local/bin/ddm-mx -i nvidia"
    ### prog "  file-manager.desktop" - desktop-defaults-run -fm
    ### prog "  index.html" - xdg-open /home/bobc/Desktop/index.html
    ### prog "  mc-screen.jpg" - xdg-open /home/bobc/Desktop/mc-screen.jpg
    ### menu "test_stuff entries" - {
    ### prog "  ceni.desktop" - desktop-defaults-run -t sudo ceni
    ### prog "  ddm-nvidia.desktop" - desktop-defaults-run -t su-to-root -c "/usr/local/bin/ddm-mx -i nvidia"
    ### prog "  mps-youtube.desktop" - desktop-defaults-run -t mpsyt 
    ### prog "  pppoeconf.desktop" - desktop-defaults-run -t /usr/sbin/pppoeconf
    ### }
    
    walk_dir () {
    	for pathname in "$1"/*; do
    	    basename="${pathname##*/}"
            # echo "Pathname: ${pathname}   Basename: ${basename}"
            if [ -d "$pathname" ]; then
                basename="${pathname##*/}"
                printf "menu \"${basename} entries\" /usr/share/icons/papirus-antix/48x48/actions/application-menu.png {\n"
                # printf "menu \"${basename} entries\" - {\n" >> $LOGFILE
                walk_dir "$pathname"
                printf "}\n"
                # printf "}\n" >> $LOGFILE
            elif [ -e "$pathname" ]; then
                entry_fileext=${basename##*.}
                # printf "entry_fileext: ${entry_fileext}\n"
                ### if .desktop need to figure out what to run, otherwise use xdg-open
                if [[ "$entry_fileext" != "desktop" ]]; then
                    printf "prog \"  ${basename}\" - xdg-open $pathname\n"
                    # printf "prog \"  ${basename}\" - xdg-open $pathname\n" >> $LOGFILE
                else
                    ### this entry is a .desktop, so get execution string, and whether to run in terminal or not
                    entry_exec=$( grep '^Exec' $pathname | tail -1 | sed 's/^Exec=//' | sed 's/%.//' )
                    #### copied code was wrong, if 1st char of exec string is " then both 1st and last char (matching double quote) need to be removed
                    #### | sed 's/^"//g' | sed 's/" *$//g' )
                    # printf "Entry_exec: ${entry_exec}\n"
                    if grep -q '^Terminal=true' $pathname; then
                        ### use terminal to execute
                        # printf "Termcmd: ${TERMCMD}\n"
                        entry_exec="$TERMCMD $entry_exec"
                        # printf "Terminal based Entry_exec: ${entry_exec}\n"
                    fi
                    printf "prog \"  ${basename}\" - $entry_exec\n"
                    # printf "prog \"  ${basename}\" - $entry_exec\n" >> $LOGFILE
                fi
            fi
        done
    }
    
    TOP_DIR=~/Desktop
    export TERMCMD='desktop-defaults-run -t'
    # printf "Termcmd: ${TERMCMD}\n"
    # export LOGFILE=~/bin/icewm-menu-Desktop.log
    # touch $LOGFILE
    walk_dir "$TOP_DIR"
    
    #26927
    Forum Admin
    anticapitalistaanticapitalista

    @BobC – my mistake – the script is working. (I hadn’t made the change to the menu file)

    I guess it would be nice to have the same for JWM too (and the toolbar icon manager).

    @all – Has anyone noticed any change to the icons in the toolbar since using the latest IceWM?
    The web-browser one is no longer round and is blurred.

    Philosophers have interpreted the world in many ways; the point is to change it.

    #26931
    Member
    AvatarBobC

    Maybe eugen would know on JWM. How to make it do it.

    I could create syntax for generating it if there is a way for it to work.

    Ps, if it can’t, then substitute a link to open the currently selected file manager in the same directory so that they have as similar functionality as possible

    • This reply was modified 2 months, 1 week ago by BobC.
    #26933
    Forum Admin
    DaveDave

    Sorry for the late response.
    I have not looked into this but I do seem to recall allowing an option in the desktop-menu script to specify a xdg menu xml file (I think this is used to make the personal menu) so theoretically you should be able to make a xml menu file in /etx/xdg/menus/ (similar to tcm-menu.menu) that would not have a category condition (and therefore use all categories) with a specification to look at the ~/Desktop folder.
    From there you should be able to specify the xml menu file and an output file to desktop-menu and it should build a menu for whatever desktop (jwm/icewm/fluxbox/openbox?) iirc.

    Then again it has been quite a while since I have looked at that so there is a good chance it may be broke. The intention back then was to have the same scheme for building a recently used menu along with the personal menu.

    Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

    #26934
    Member
    AvatarBobC

    Dave, if there are things I can do to help let me know. I’m not sure what JWM or Fluxbox can do but can adapt the logic if the same general idea will work. Or if you think of some better way, that’s ok too.

    #26936
    Member
    AvatarPPC

    Hi bob & all!
    hijacking a little bit on this thread-I can try, maybe over the week-end, adapt some of your code that refers to the exec from the .desktop file needing to run on the terminal to the Toolbar Icon Manager- that’s really the thing that left me feeling that it’s a unfinished work…

    I tend to swing between Desktops- lately I’ve been on JWM, but, because IceWM now can be themed so nice and has almost the same idle RAM footprint, I’ve been using it again in my antiX19 tests…

    About having a Toolbar Icon Manager on the other desktops:

    JWM:
    I began the TIM project thinking I would make it run on JWM too, with small adaptations. I know it can be done- with some work- the advantage with working with iceWM is that it has a standalone text file to store all the toolbar/tray desktop icons and only that… JWM configuration is more all-in-one, it stores the icons but also all other toolbar/tray info.
    This has a Pro side of easily allowing to place icons anywhere on the tray, even after the clock, but it has the Con side of making a bit harder to use a TIM like script on it’s config file (the syntax is also pretty easy to use, like iceWM’s but)- one can’t simply add the relevant icon information to the end of the config file (and before the “</Tray>” and </JWM>” lines – because the icon would simply appear after the toolbar’s clock…
    The way I would try to do it, if I had to time right now would be something like this:
    1- parse JWM’s tray file, line by line until I reached the “<TaskList maxwidth=” line. I would assume all the “normal” icons (I mean not the Exit icon) are all placed there, sequentially
    2- using’s JWM’s terminalogy, I would create the relevant icon using the exec and icon info from the selected .desktop (that’s the relative easy part)
    3- Save the file- that’s it! It’s a lot more simple said than done…
    4- Problems- the restore from backup function from icewm’s TIM would work but could be a bit dangerous- if the user added a icon to the tray using JWM’s TIM but then manually edited the “tray” file- using Tim’s restore button would also erase those changes… Another situation is that the “delete last icon” button would have to undergo a lot of changes- it can no longer just delete the last line from the toolbar/tray file- it has to parse only the “<TrayButton” lines, count them and delete the last one (before the “<TaskList maxwidth=” line)

    Fluxbox:
    I haven’t tried the script on Fluxbox for a reason: I have, months ago, spent a lot of time altering FB’s appearance and have some idea what problems I would have to deal with on that Desktop…
    I’m assuming I would only need a couple of lines for each new icon (they could be placed anywhere on the FluxBox’s Init file- at the begining would do just fine. That is only the information related to the icon. the icon itself is placed in the position that’s indicated on the “session.screen0.toolbar.tools:” – than can vary greatly from user to user… But that’s not even the main problem!
    There’s no way to present quick launch icons out of the box in antiX default Fluxbox version- using Skidoo’s Fluxbox version the user can create “text” quick launchers- and even indirectly include “icons”- but those “icons” are really glyphs from a special font that I edited to include dozens of common icons- like File Manager, Firefox, Chrome, etc, etc… Using that is not pratical even if antiX came with Skidoo’s FB version out of the box…

    When adapting TIM’s script to allow Bob to quicky edit the personal menu, I noticed that CC’s personal menu editor’s code could easily be adapted to edit IceWM’s “toolbar” file, instead of the “personal” file… But I think that trying to use it to edit JWM’s tray would suffer from the same difficulties I talked about above…

    More on topic:
    Running a19 live, I updated icewm, copy and pasted you menu details, run the scrips, updated the menu and restarted icewm and no new menu entry appears… Could it be because I’m running a live system?

    P.

    #26937
    Member
    AvatarPPC

    It definitely helped memory and CPU not needing to run the desktop or conky

    You can also try another antiX goodie so shave a few Mb from your idle RAM: close Volume-icon and add a “speaker” like icon to your toolbar and set it to run “yad-volume”- it fires up a gui way to change the volume that does not stay resident in memory! I already sent anti a vertical gui for this same functionality- it runs lighter than volume-icon, does not stay resident in memory, but it has a few con’s: it’s slower to start and it’s icon does not indicate the current volume level…

    P.

    #26938
    Member
    AvatarBobC

    I used your Tim to add itself to my toolbar from a desktop entry from my desktop folder from the IceWM menu list my program creates. I didn’t do anything fancy to test all functions but it worked fine adding it.

    On mine, If you don’t see the options for drives and desktop apps then you didn’t get the menu in the right place or need to restart icewm. If you see the options on the menu but it doesn’t actually create a list, then maybe the programs are not in /usr/local/bin or are not executable. Also, my desktop apps menu cannot handle fienames with spaces in them.

    I haven’t tried it live, so not sure there. Lol, the Pentium III can’t handle USB and keyboard and mouse at the same time, so I have no obvious way to run live. I was very happy how quickly it was running with the reduced load

Viewing 15 posts - 16 through 30 (of 100 total)
  • You must be logged in to reply to this topic.