- This topic has 24 replies, 8 voices, and was last updated Dec 14-4:48 pm by PPC.
-
AuthorPosts
-
December 4, 2020 at 5:52 pm #46514Member
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/RvXm4EshIt 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.
December 4, 2020 at 7:38 pm #46533Anonymous
::pb_antiX-icewm
^—v
probably should sniff (or ask) which of the WM -specific pinboards will receive the new iconDecember 4, 2020 at 7:50 pm #46535MemberPPC
::pb_antiX-icewm
^—v
probably should sniff (or ask) which of the WM -specific pinboards will receive the new iconIt’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.
December 4, 2020 at 10:27 pm #46542Forum Admin
Dave
::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.shComputers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
December 5, 2020 at 2:51 am #46552Member
manyroads
::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"December 5, 2020 at 3:30 am #46553ModeratorBobC
::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…
December 5, 2020 at 5:32 am #46556Anonymous
December 5, 2020 at 10:47 am #46565MemberPPC
::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 $deskP.
December 5, 2020 at 11:10 am #46566MemberPPC
::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.shHi 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.
December 5, 2020 at 2:53 pm #46586Forum Admin
Dave
::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"); doAs 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
December 5, 2020 at 3:06 pm #46589MemberPPC
::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 directorysolution:
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.
December 5, 2020 at 3:19 pm #46591Forum Admin
Dave
::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 wayComputers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
December 5, 2020 at 8:04 pm #46616MemberPPC
::Beta 2 of the script:
code is available here:
https://pastebin.com/raw/aBTSBm4sChange 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 nameTo do:
– make script also add icons to a spacefm managed desktop
– add “antiX” .desktop files folder…enjoy…
December 5, 2020 at 11:24 pm #46632MemberPPC
::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.
December 6, 2020 at 12:17 am #46634Anonymous
::###Create list of availables app
for file in /usr/share/applications/other directories the script might consult:
/usr/share/applications/antix/
~/.local/share/applications/ -
AuthorPosts
- You must be logged in to reply to this topic.