[Suggestion] GUI to add application icons to the Rox desktop

Forum Forums General Software [Suggestion] GUI to add application icons to the Rox desktop

  • This topic has 24 replies, 8 voices, and was last updated Dec 14-4:48 pm by PPC.
Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #46514
    Member
    PPC

      howdi

      Following the discussion about making antiX more user friendly (and not bloated), I adapted some scripts and ended up with an easy GUI to add localized application icons to a rox desktop.

      The (beta) script is over at
      https://pastebin.com/raw/RvXm4Esh

      It automatically places the generated icon at the top left corner of the screen. Users just have to drag it to where they want it to be…

      As always, any suggestions, bug reports, are welcomed!

      With not so much work, this can be made to detect the desktop manager being used (rox or spacefm) and work also in spacefm (but app-select seems to already allow adding icons to the desktop) – but I won’t do that- I mean to make life easier for newbies- that start with the default rox-icewm desktop- if anticapitalista does think this idea is too bloated/against antiX’s philosophy, newbies will have GUI’s to add icons to both the toolbar, the desktop and the personal menu- solving once and for all those countless times newbies ask how to add icons to the desktop/toolbar…

      P.

      • This topic was modified 2 years, 5 months ago by PPC.
      #46533
      Anonymous
        Helpful
        Up
        0
        ::

        pb_antiX-icewm
        ^—v
        probably should sniff (or ask) which of the WM -specific pinboards will receive the new icon

        #46535
        Member
        PPC
          Helpful
          Up
          0
          ::

          pb_antiX-icewm
          ^—v
          probably should sniff (or ask) which of the WM -specific pinboards will receive the new icon

          It’s only the first beta… I didn’t even include error correction (in case the user does not select anything…)
          Do you have any idea on how to add the “sniff”, that you can share with me?
          By the way, do you think this little script is needed (for newbies) or it’s pure “bloat”?
          It’s way faster to drag and drop .desktop files from a rox-filler window to the desktop… but this script does rename the icons with the (localizalized) app’s name, which does save some time…

          PS: I don’t use desktop icons myself- I’ve been running min-fluxbox + tint2 for quite some weeks… I wrote the script to collaborate in an effort to have a more newbie friendly OS- I do admit that using .desktop files can be a strange concept for folks coming from other OS…

          P.

          #46542
          Forum Admin
          Dave
            Helpful
            Up
            0
            ::

            Note:
            I have not read the thread, only the subject line.
            Linking a script that I held in the back pocket till I could better incorporate it into an update of add-desktop
            https://gitlab.com/antiX-Dave/add-desktop-antix/-/blob/master/bin/set-grid.sh

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

            #46552
            Member
            manyroads
              Helpful
              Up
              0
              ::

              Not that anyone should care… but I see no reason for Desktop icons at all. Never use them myself. 😉

              Pax vobiscum,
              Mark Rabideau - http://many-roads.com
              "For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
              dwm & i3wm ~Reg. Linux User #449130
              20 Jan 2021 ~ "End of an Error"

              #46553
              Moderator
              BobC
                Helpful
                Up
                0
                ::

                Hmmmm, Thanks for that great idea Manyroads!

                Moral of the story: Techies don’t use desktop icons.

                and the other side is: Newbies do use desktop icons.

                You got me thinking there about how to solve another problem…

                #46556
                Anonymous
                  Helpful
                  Up
                  0
                  ::

                  sniff
                  wmctrl -m | grep 'Name:' | cut -d' ' -f 2

                  #46565
                  Member
                  PPC
                    Helpful
                    Up
                    0
                    ::

                    wmctrl -m | grep ‘Name:’ | cut -d’ ‘ -f 2

                    Thanks, Skiddo, that was almost what I wanted, but you gave me an idea that pointed me to the solution… I took a peek at conkyrc to see how it displays the full desktop name, that way the script can edit the pinboard if the user is on “rox”, copy the desktop file if the user is on “space” or say that it can’t use desktop icons, if the user is not using a rox or a space desktop…

                    desk=$(disp=${DISPLAY#:}; disp=${disp%.[0-9]}; cat $HOME/.desktop-session/desktop-code.$disp 2>/dev/null)
                    echo $desk

                    P.

                    #46566
                    Member
                    PPC
                      Helpful
                      Up
                      0
                      ::

                      Note:
                      I have not read the thread, only the subject line.
                      Linking a script that I held in the back pocket till I could better incorporate it into an update of add-desktop
                      https://gitlab.com/antiX-Dave/add-desktop-antix/-/blob/master/bin/set-grid.sh

                      Hi Dave, thanks for sharing that- I did not study your code in great detail, but it may have some problems working on localized antiX versions – the script returns a “find: ‘/home/[username]/Desktop’: No such file or directory”
                      In portuguese that folder is localized to “/home/[username]/Área de Trabalho”… I tried changing that in your script, but locate refused to work with both a varuiable and spaces, so, in order for it to work on my system I had to do this:

                      function set_new_items() {
                          #echo "${AVAILABLE_CORDS[@]}"
                          cd $HOME
                          cd 'Área de Trabalho'
                          for item in $(find -wholename "*.desktop"); do
                      ...

                      I have no idea how you can make this part work across all localization of the “desktop” folder… Maybe checking for .desktop files on the home folder? Or first checking the system language, and then have an array for each language code and the respective “desktop” translation???

                      P.

                      #46586
                      Forum Admin
                      Dave
                        Helpful
                        Up
                        0
                        ::

                        Hmmmmm. I have not tried but a likely solution is changing the line
                        for item in $(find $HOME/Desktop -wholename "*.desktop"); do
                        to
                        for item in $(find $XDG_DESKTOP_DIR -wholename "*.desktop"); do
                        or
                        for item in $(find ${XDG_DESKTOP_DIR:-$HOME/Desktop} -wholename "*.desktop"); do

                        As the xdg-user-dirs program is supposed to handle translations
                        https://www.freedesktop.org/wiki/Software/xdg-user-dirs/

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

                        #46589
                        Member
                        PPC
                          Helpful
                          Up
                          0
                          ::

                          for item in $(find $XDG_DESKTOP_DIR -wholename “*.desktop”); do

                          Sorry to say- that does not work, because of the spaces in the folder name… I get

                          $ /home/[username]/set_grid.sh
                          find: ‘/home/[username]/Área’: No such file or directory
                          find: ‘de’: No such file or directory
                          find: ‘Trabalho’: No such file or directory

                          solution:

                          desktop_dir=$(echo $XDG_DESKTOP_DIR)
                          cd "$desktop_dir"
                          for item in $(find -wholename "*.desktop"); do
                          ...
                          • This reply was modified 2 years, 5 months ago by PPC.
                          #46591
                          Forum Admin
                          Dave
                            Helpful
                            Up
                            0
                            ::

                            Ah I probably should have quoted the variable…
                            for item in $(find "$XDG_DESKTOP_DIR" -wholename "*.desktop"); do
                            Glad you found a solution though. Hope the script helps with your project in some way

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

                            #46616
                            Member
                            PPC
                              Helpful
                              Up
                              0
                              ::

                              Beta 2 of the script:

                              code is available here:
                              https://pastebin.com/raw/aBTSBm4s

                              Change log:
                              – Check if user is on a rox managed desktop, if not, exit script
                              – Check if user did not select any aplication- if not, then exit without trying to add icon to the desktop
                              – corrected script’s window name

                              To do:
                              – make script also add icons to a spacefm managed desktop
                              – add “antiX” .desktop files folder…

                              enjoy…

                              #46632
                              Member
                              PPC
                                Helpful
                                Up
                                0
                                ::

                                Beta 3- and the last for today:

                                Code at https://pastebin.com/raw/gAUZDnn6

                                Change log:
                                Now the script also adds icons to Spacefm managed desktops
                                It’s close to finished,
                                please, anyone interested, test and provide feeback…

                                P.

                                #46634
                                Anonymous
                                  Helpful
                                  Up
                                  0
                                  ::

                                  ###Create list of availables app
                                  for file in /usr/share/applications/

                                  other directories the script might consult:

                                  /usr/share/applications/antix/
                                  ~/.local/share/applications/

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