Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-08-27 20:26:11

EdenMar
Member
Registered: 2016-08-27
Posts: 4

How to display icons from existing directory on a Desktop/Workspace

Sorry for a very basic question, but I haven't found anything just by looking and I just searched this subforum for 'display directory icons' and came up with ... no relevant hits. sad

I have several directories that were the source for icons on multiple virtual workspaces in a legacy office suite (StarOffice5.2) installation and I'd like to use them, again, in Xfce.  To give an example of what I mean, I'd like to display, on the desktop, the contents of  a directory holding text files, .pdf files, directories, links/'Bookmarks', image files and so forth.

I'd like to display these over a wallpaper image, that would be different for each individual workspace. 

How do I start?  Do I have to install some sort of an add-on first?

P.S.: If Xfce has some sort of online documentation where this question would have been answered, most appreciated if you could 'point' me to that! cool

Last edited by EdenMar (2016-09-08 21:44:25)

Offline

#2 2016-08-27 20:40:16

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: How to display icons from existing directory on a Desktop/Workspace

Hello and welcome.

EdenMar wrote:

I have several directories that were the source for icons on multiple virtual workspaces in a legacy office suite (StarOffice5.2) and I'd like to use them, again, in Xfce.  To give an example of what I mean, I'd like to display, on the desktop, the contents of  a directory holding text files, .pdf files, directories, links/'Bookmarks', image files and so forth.

Let me see if I've got this straight:
1. You would like to have a different wallpaper for each workspace
2. And on each workspace, you want a different set of icons displayed (that are located in separate directories)

Is this correct?
Btw, what version of Xfce and xfdesktop are you using?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2016-08-27 21:01:49

EdenMar
Member
Registered: 2016-08-27
Posts: 4

Re: How to display icons from existing directory on a Desktop/Workspace

ToZ wrote:

Hello and welcome.
...
Let me see if I've got this straight:
1. You would like to have a different wallpaper for each workspace
2. And on each workspace, you want a different set of icons displayed (that are located in separate directories)

Is this correct?
Yes, you have it exactly correct.

Btw, what version of Xfce and xfdesktop are you using?

The version of Xfce is 4.12.1 and on the version of xfdesktop, not sure.
Would it help if I said I downloaded Linux Mint 18 Xfce earlier today?
Please let me know if you need more information, and by the way, thanks both for the greeting and an unbelievably fast reply! smile

Offline

#4 2016-08-27 21:04:07

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: How to display icons from existing directory on a Desktop/Workspace

Am I correct with my assumptions?

1. You would like to have a different wallpaper for each workspace
2. And on each workspace, you want a different set of icons displayed (that are located in separate directories)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2016-08-27 21:07:04

EdenMar
Member
Registered: 2016-08-27
Posts: 4

Re: How to display icons from existing directory on a Desktop/Workspace

ToZ wrote:

Am I correct with my assumptions?

1. You would like to have a different wallpaper for each workspace
2. And on each workspace, you want a different set of icons displayed (that are located in separate directories)

Yes, that's exactly correct.

Offline

#6 2016-08-27 22:00:12

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: How to display icons from existing directory on a Desktop/Workspace

Xfce doesn't have all of this functionality built in, so you'll have to use a custom script to get part of it to work.

1. You would like to have a different wallpaper for each workspace

You can do this with basic xfdesktop functionality. Go to Settings Manager > Desktop > Background tab, and uncheck "Apply to all workspaces". Then drag this dialog from workspace to workspace and set the wallpaper that you want to display on that workspace.

2. And on each workspace, you want a different set of icons displayed (that are located in separate directories)

This is the tricky part. When xfdesktop starts up, it reads the xdg-user-dir DESKTOP value and uses that folder to display on the desktop. You can change that value on the fly via "xdg-user-dirs-update --set DESKTOP <folder>", and xfdesktop needs to be restarted to re-read that value and display the correct folder. This can be automated. Here is a script that will do this for you:

#!/bin/sh

#Name: 		xfdeskicons
#Description: 	Displays a different set of icons on each workspace's desktop (corresponding to separate folders)
#Requires: 	wmctrl, xdg-user-dirs
#Debug mode:	bash -xv /path/to/xfdeskicons 2>&1 | tee xfdeskicons.log

declare -a WSPACE_ICONS_FOLDERS
### Set these values to the folders containing the icons for each workspace
WSPACE_ICONS_FOLDERS=(  "/home/toz/"
                        "/home/toz/Desktop"
                        "/home/toz/Downloads"
                        "/home/toz/Development"
                        "/home/toz/Music"    )

### Do not change anything below here

# make sure that only one instance of this script is running per user
lockfile=/tmp/.xfdeskicons.$USER.lockfile
if ( set -o noclobber; echo "locked" > "$lockfile") 2> /dev/null; then
  	trap 'rm -f "$lockfile"; exit $?' INT TERM EXIT
  	echo "xfdeskiconsDEBUG: Locking succeeded" >&2

  	# on startup, set the CURRENT_WORKSPACE value & display correct icons
  	CURRENT_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
        xdg-user-dirs-update --set DESKTOP "${WSPACE_ICONS_FOLDERS[$(($CURRENT_WORKSPACE-1))]}"
        pgrep xfdesktop || xfdesktop &
   
  	# every second, query the active workspace number and if different from the previous one, send a notification
	while true
	do
		sleep 1
		NEW_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))	
		if [ $CURRENT_WORKSPACE -ne $NEW_WORKSPACE ]; then
		
		   # using xdg-user-dirs-update, point $XDG_DESKTOP to the proper icon folder
                   xdg-user-dirs-update --set DESKTOP "${WSPACE_ICONS_FOLDERS[$(($NEW_WORKSPACE-1))]}"
		   
		   # reload xfdesktop to re-read values and display correct icon set
		   kill -HUP $(pidof xfdesktop)
		   
		   # Save the new current workspace
		   CURRENT_WORKSPACE=$NEW_WORKSPACE
		fi
		
		# restart xfdesktop if it dies
		pgrep xfdesktop || xfdesktop &
		
	done

# can't create lockfile - notify user and quit
else

  	echo "xfdeskiconsDEBUG: Lock failed, check for existing process and/or lock file and delete - exiting." >&2
  	exit 1
fi			

exit 0

You need to do three things to set up the script:
1. Save the script somewhere on your computer and make it executable.
2. Change the WSPACE_ICONS_FOLDERS array values (lines 10 - 14) to point to the directories whose contents you want displayed on the workspace desktop.
3. Test it. Manually execute the script in a terminal window and switch between workspaces to see if it works.

If everything works fine, add it to your application autostart so that it runs on startup.

How the script works
It checks every second to see if the workspace has changed. If it has, it changes the xdg-user-dir DESKTOP value to the proper folder in the array and restarts xfdesktop. The script also makes sure that only one instance of itself ever runs.

Last edited by ToZ (2017-02-18 14:19:45)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2016-08-27 22:47:17

EdenMar
Member
Registered: 2016-08-27
Posts: 4

Re: How to display icons from existing directory on a Desktop/Workspace

ToZ wrote:

Xfce doesn't have all of this functionality built in, so you'll have to use a custom script to get part of it to work.
...

Wow, Thanks!! big_smile big_smile
Xfce, here I come!

Curious: did you know that KDE made a 'design decision' about two years ago to drop these very features (both #1 and #2, simultaneously) when Plasma went from v4.x to v5.x?  And, because it was unannounced, when the users -- obviously, those who are fans of multiple virtual desktops -- were caught by surprise and discovered it was intentionally 'broken' -- and never to be 'fixed', well ... if you say this is new to you, and want to hear more, I'll continue with the details, in a PM. 

I don't mind one bit, using a script.  Now that KDE has pulled support for this type of desktop, so far as I know using Xfce with your script will be the only way around it, for any current desktop environment.

I like what you've devised better than the other method.  I really don't want running programs to appear and disappear, as I go from one desktop to the next.  I just want the icons and wallpaper to change.  I will let you know after I have it running, but it seems this will give a user experience very similar to that of the legacy StarOffice5.2 --an advantage, in my eyes.  And, without StarOffice's periodic crashes, I might add ...

Last edited by EdenMar (2016-08-28 00:35:23)

Offline

#8 2017-02-18 10:29:02

k-3.14
Member
From: Rhineland
Registered: 2017-02-18
Posts: 153

Re: How to display icons from existing directory on a Desktop/Workspace

Hello.

Do I understand this right? Different icons on different virtual desktops?

Pity, EdenMar did not came back with his experience.

With DEBIAN stretch I get

user@nostromo:~$ ./xfdeskicons.sh
./xfdeskicons.sh: 8: ./xfdeskicons.sh: DECLARE: not found
./xfdeskicons.sh: 10: ./xfdeskicons.sh: Syntax error: "(" unexpected

wmctrl, xdg-user-dirs are installed.

br

Offline

#9 2017-02-18 14:22:37

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: How to display icons from existing directory on a Desktop/Workspace

k-3.14 wrote:

Hello.

Hello and welcome.

Do I understand this right? Different icons on different virtual desktops?

It's a script-based workaround to provide that sort of functionality. Not fully tested though.

With DEBIAN stretch I get

user@nostromo:~$ ./xfdeskicons.sh
./xfdeskicons.sh: 8: ./xfdeskicons.sh: DECLARE: not found

My bad. Shell is case sensitive. "DECLARE" should be "declare". I've edited the code snippet above to reflect the change.

Let me know how it goes.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#10 2017-02-18 16:40:36

k-3.14
Member
From: Rhineland
Registered: 2017-02-18
Posts: 153

Re: How to display icons from existing directory on a Desktop/Workspace

Thank your for answering.

I did a small screen recording to demonstrate the (my) problem.

DEBIAN stretch with xfce 4.12 is in a vbox here.

https://youtu.be/67zk9sL6_ug

1. my two virtual desktops.

2. file structure of home folder

3. your revised script with (lines 10 - 14) changed according to my folder names

4. open a terminal and try to run the script (it is set executable)

PS. I don't get, what you are meaning here?

"### Set these values to the folders containing the icons for each workspace
WSPACE_ICONS_FOLDERS=(  "/home/toz/"
                        "/home/toz/Desktop"
                        "/home/toz/Downloads"
                        "/home/toz/Development"
                        "/home/toz/Music"    )"

Example: Would like to have midnight commander on my desktop #1 and on desktop #2 cutecom

br

Offline

#11 2017-02-18 17:17:52

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: How to display icons from existing directory on a Desktop/Workspace

What this script does, is change the value of XDG_DESKTOP_DIR and force xfdesktop to re-read its settings. xfdesktop, will display as icons, all of the files in XDG_DESKTOP_DIR. In your case, on the first workspace, it should display the contents of /home/kalle on your desktop and for the second workspace, the contents of /home/kalle/Shreibtisch.

Try running the script in a terminal window so you can see the output. It might generate some messages that would indicate why its not changing.

Example: Would like to have midnight commander on my desktop #1 and on desktop #2 cutecom

You should create 2 folders somewhere, call them Desktop1 and Desktop2. Copy the shortcuts to those applications to those folders and in the script and change the first two folder entries to these folders.

Run the script in a terminal window and post back what is displayed.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#12 2017-02-18 17:30:07

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: How to display icons from existing directory on a Desktop/Workspace

Just noticed that at the end of your video, the script still isn't recognizing the "declare" command. What shell are you using?

echo $SHELL

EDIT: Try changing the first line in the script to:

#!/bin/bash

...and see if that helps.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#13 2017-02-18 19:10:34

k-3.14
Member
From: Rhineland
Registered: 2017-02-18
Posts: 153

Re: How to display icons from existing directory on a Desktop/Workspace

Offline

#14 2017-02-18 19:58:47

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: How to display icons from existing directory on a Desktop/Workspace

Yes, but the switch-over effect is really slow in that VM. On my laptop, i5 + 4GB, the switch is instantaneous.

Anyways, thats the concept.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#15 2017-02-19 07:15:22

k-3.14
Member
From: Rhineland
Registered: 2017-02-18
Posts: 153

Re: How to display icons from existing directory on a Desktop/Workspace

Host has a E6750 @2.66GHz and I additionally  slowed the youtube video down.

That should not be an issue. At the moment I am (host) on PCLinuxOS KDE.

As everyone is going to step over to KDE 5, I'll change to XFCE as soon as DEBIAN testing is turning stable ...

br

Offline

#16 2018-05-21 06:18:52

hebrews2124
Member
Registered: 2018-05-21
Posts: 6

Re: How to display icons from existing directory on a Desktop/Workspace

Hello,

I am hoping that ToZ is still around and willing to answer questions here.  I implemented the aforementioned script on my daughter's laptop.  She was looking for a solution like this to help her keep materials for her different school classes straight.  The script works beautifully on Xubuntu 18.04, with one exception: whenever you change workspaces, you lose the placement of the desktop icons.  Is there anyway to retain the placement of the icons?  Thanks in advance for any help on this issue.

Jason

Offline

#17 2018-05-21 12:44:18

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: How to display icons from existing directory on a Desktop/Workspace

hebrews2124 wrote:

Hello,

I am hoping that ToZ is still around and willing to answer questions here.  I implemented the aforementioned script on my daughter's laptop.  She was looking for a solution like this to help her keep materials for her different school classes straight.  The script works beautifully on Xubuntu 18.04, with one exception: whenever you change workspaces, you lose the placement of the desktop icons.  Is there anyway to retain the placement of the icons?  Thanks in advance for any help on this issue.

Jason

Hello and welcome.

Try this version of the script. It seems to work for me, but I haven't tested it extensively. Let me know if you run into any problems.

#!/bin/bash

#Name: 		xfdeskicons
#Description: 	Displays a different set of icons on each workspace's desktop (corresponding to separate folders)
#Requires: 	wmctrl, xdg-user-dirs
#Debug mode:	bash -xv /path/to/xfdeskicons 2>&1 | tee xfdeskicons.log

declare -a WSPACE_ICONS_FOLDERS
### Set these values to the folders containing the icons for each workspace
WSPACE_ICONS_FOLDERS=(  "/home/toz/"
                        "/home/toz/Desktop"
                        "/home/toz/Downloads"
                        "/home/toz/Development"
                        "/home/toz/Music"    )

### Do not change anything below here

# make sure that only one instance of this script is running per user
lockfile=/tmp/.xfdeskicons.$USER.lockfile
if ( set -o noclobber; echo "locked" > "$lockfile") 2> /dev/null; then
  	trap 'rm -f "$lockfile"; exit $?' INT TERM EXIT
  	echo "xfdeskiconsDEBUG: Locking succeeded" >&2

        # on startup, get the latest real xfdesktop icon file
        ICON_FILE=$(ls -t ~/.config/xfce4/desktop | grep screen)

  	# on startup, set the CURRENT_WORKSPACE value & display correct icons
  	CURRENT_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
        xdg-user-dirs-update --set DESKTOP "${WSPACE_ICONS_FOLDERS[$(($CURRENT_WORKSPACE-1))]}"
        cp ~/.config/xfce4/desktop/icon.layout.$(($CURRENT_WORKSPACE-1)) ~/.config/xfce4/desktop/$ICON_FILE
        pgrep xfdesktop || xfdesktop &
           
  	# every second, query the active workspace number and if different from the previous one, send a notification
	while true
	do
		sleep 1
		NEW_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))	
		if [ $CURRENT_WORKSPACE -ne $NEW_WORKSPACE ]; then

		   # save current icon layout
	   	   cp ~/.config/xfce4/desktop/$ICON_FILE ~/.config/xfce4/desktop/icon.layout.$(($CURRENT_WORKSPACE-1))
		   		
		   # using xdg-user-dirs-update, point $XDG_DESKTOP to the proper icon folder
                   xdg-user-dirs-update --set DESKTOP "${WSPACE_ICONS_FOLDERS[$(($NEW_WORKSPACE-1))]}"

		   # restore new icon layout
	           cp ~/.config/xfce4/desktop/icon.layout.$(($NEW_WORKSPACE-1)) ~/.config/xfce4/desktop/$ICON_FILE
		   
		   # reload xfdesktop to re-read values and display correct icon set
		   kill -HUP $(pidof xfdesktop)
		   
		   # Save the new current workspace
		   CURRENT_WORKSPACE=$NEW_WORKSPACE
		fi
		
		# restart xfdesktop if it dies
		pgrep xfdesktop || xfdesktop &
		
	done

# can't create lockfile - notify user and quit
else

  	echo "xfdeskiconsDEBUG: Lock failed, check for existing process and/or lock file and delete - exiting." >&2
  	exit 1
fi			

exit 0

The xfdesktop icon management routines don't respect placement (they are sequentially placed on a grid starting from the top left corner (0,0). There are open enhancement requests to adapt it to a placement-based system. I have added code that saves and restores the file that is updated when you move the icons around. Hopefully this will work for you.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#18 2018-05-21 19:15:41

hebrews2124
Member
Registered: 2018-05-21
Posts: 6

Re: How to display icons from existing directory on a Desktop/Workspace

Hello,

Thank you very much for the prompt response.  I replaced the relevant portions of the script and restarted the computer.  The switching works beautifully, save one little fly in the ointment.  If all of the panels on each work space are in the same place, then the script works as expected.  If I place panels in different places in the various workspaces or size them differently for some reason, the script doesn't work like it's supposed to (I am also using the script you wrote to switch panels between workspaces).

I did a little poking around and, if I understand what the script is doing, it is searching for a file with the word "screen" in the name and then reading that file name into the variable "ICON_FILE".  If a panel is resized or moved, it changes the screen geometry, with regard to available space for desktop icons, of the screen.  xfdesktop then creates a second (or third or fourth, etc) file for saving the icon placement, using the different screen geometries to create unique file names.  Having these additional files here seems to mess the script up, as later on it seems to be only expecting a single file name, whereas multiple file names as stored in the variable for the different workspace configurations.  Does this make sense?  Am I understanding the script correctly?

I apologize here.  I should have thought to make you aware of the fact that I am using different panels on different work spaces.  Is there any way to work around this issue?

Offline

#19 2018-05-21 20:54:34

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: How to display icons from existing directory on a Desktop/Workspace

hebrews2124 wrote:

Hello,

Thank you very much for the prompt response.  I replaced the relevant portions of the script and restarted the computer.  The switching works beautifully, save one little fly in the ointment.  If all of the panels on each work space are in the same place, then the script works as expected.  If I place panels in different places in the various workspaces or size them differently for some reason, the script doesn't work like it's supposed to (I am also using the script you wrote to switch panels between workspaces).

Is this the panel switching program you are using?

I did a little poking around and, if I understand what the script is doing, it is searching for a file with the word "screen" in the name and then reading that file name into the variable "ICON_FILE".  If a panel is resized or moved, it changes the screen geometry, with regard to available space for desktop icons, of the screen.  xfdesktop then creates a second (or third or fourth, etc) file for saving the icon placement, using the different screen geometries to create unique file names.  Having these additional files here seems to mess the script up, as later on it seems to be only expecting a single file name, whereas multiple file names as stored in the variable for the different workspace configurations.  Does this make sense?  Am I understanding the script correctly?

Mostly, yes. I'm saving a copy of the icon layout file for each screen and restoring it when necessary. This only works if xfdesktop generates only one file (the xfdesktop-generated files have the word "screen" in them and I am looking for the latest dated one). In the case of changing panels, you are right in that xfdesktop creates separated "screen" files based on the available grid space.

Now to see if I can account for this in the script. Let me have a see if I can add something to account for this....


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#20 2018-05-21 21:04:48

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: How to display icons from existing directory on a Desktop/Workspace

Okay. First attempt. Seems to work okay once you have successfully switched back and forth from each workspace. Try this:

#!/bin/bash

#Name: 		xfdeskicons
#Description: 	Displays a different set of icons on each workspace's desktop (corresponding to separate folders)
#Requires: 	wmctrl, xdg-user-dirs
#Debug mode:	bash -xv /path/to/xfdeskicons 2>&1 | tee xfdeskicons.log

declare -a WSPACE_ICONS_FOLDERS
### Set these values to the folders containing the icons for each workspace
WSPACE_ICONS_FOLDERS=(  "/home/toz/"
                        "/home/toz/Desktop"
                        "/home/toz/Downloads"
                        "/home/toz/Development"
                        "/home/toz/Music"    )

### Do not change anything below here

# make sure that only one instance of this script is running per user
lockfile=/tmp/.xfdeskicons.$USER.lockfile
if ( set -o noclobber; echo "locked" > "$lockfile") 2> /dev/null; then
  	trap 'rm -f "$lockfile"; exit $?' INT TERM EXIT
  	echo "xfdeskiconsDEBUG: Locking succeeded" >&2

    # on startup, get the latest real xfdesktop icon file
    ICON_FILE=$(ls -t ~/.config/xfce4/desktop | grep screen | head -1)

  	# on startup, set the CURRENT_WORKSPACE value & display correct icons
  	CURRENT_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
        xdg-user-dirs-update --set DESKTOP "${WSPACE_ICONS_FOLDERS[$(($CURRENT_WORKSPACE-1))]}"
        cp ~/.config/xfce4/desktop/icon.layout.$(($CURRENT_WORKSPACE-1)) ~/.config/xfce4/desktop/$ICON_FILE
        pgrep xfdesktop || xfdesktop &
           
  	# every second, query the active workspace number and if different from the previous one, send a notification
	while true
	do
		sleep 1
		NEW_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))	
		if [ $CURRENT_WORKSPACE -ne $NEW_WORKSPACE ]; then

		   # save current icon layout
	   	   cp ~/.config/xfce4/desktop/$ICON_FILE ~/.config/xfce4/desktop/icon.layout.$(($CURRENT_WORKSPACE-1))
		   		
		   # using xdg-user-dirs-update, point $XDG_DESKTOP to the proper icon folder
           xdg-user-dirs-update --set DESKTOP "${WSPACE_ICONS_FOLDERS[$(($NEW_WORKSPACE-1))]}"

		   # restore new icon layout
	       #cp ~/.config/xfce4/desktop/icon.layout.$(($NEW_WORKSPACE-1)) ~/.config/xfce4/desktop/$ICON_FILE
		   
		   # reload xfdesktop to re-read values and display correct icon set
		   kill -HUP $(pidof xfdesktop)
		   ICON_FILE=$(ls -t ~/.config/xfce4/desktop | grep screen | head -1)
		   cp ~/.config/xfce4/desktop/icon.layout.$(($NEW_WORKSPACE-1)) ~/.config/xfce4/desktop/$ICON_FILE
		   kill -HUP $(pidof xfdesktop)
		   
		   # Save the new current workspace
		   CURRENT_WORKSPACE=$NEW_WORKSPACE
		fi
		
		# restart xfdesktop if it dies
		pgrep xfdesktop || xfdesktop &
		
	done

# can't create lockfile - notify user and quit
else

  	echo "xfdeskiconsDEBUG: Lock failed, check for existing process and/or lock file and delete - exiting." >&2
  	exit 1
fi			

exit 0

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#21 2018-05-22 02:11:30

hebrews2124
Member
Registered: 2018-05-21
Posts: 6

Re: How to display icons from existing directory on a Desktop/Workspace

ToZ,

Thank you for your hard work.  As far as I can tell at this point, your modified script works perfectly.  Here is the link to the panel switcher script that I am using: https://forum.xfce.org/viewtopic.php?id=8380.  I tweaked the panel switcher script a little because in the Xubuntu 18.04 release (at least), the script threw the following error:

Property "/panels/panel-/autohide" does not exist on channel "xfce4-panel". If a new property should be created, use the --create option.

After reading a few man pages and issuing the command in pieces, looking at all the various options along the way, I determined that the correct "property" in 18.04 is "autohide-behavior" as opposed to just "autohide".

I also added a line to change the position of each of the unused panels to hide them behind a permanently displayed panel so that they didn't pop up when you hovered over the edge of the screen where a dynamical panel was placed.  I added a line to restore the panel to the "proper" position as well.  Other than that, for my purposes that script was exactly what I needed.

Again, I really appreciate you help.  I have looked around quite a bit on the Internet for some good documentation that explains how all of this stuff works and it seems like it's a little scarce.  Maybe that "lack of good documentation" is just my being so green when it comes to scripting and how these various programs really work under the hood.  At any rate, you saved me a lot of time, headache, and frustration.  Thank you again.

Offline

#22 2018-05-22 02:37:04

MountainDewManiac
Member
From: Where Mr. Bankruptcy is Prez
Registered: 2013-03-24
Posts: 1,115

Re: How to display icons from existing directory on a Desktop/Workspace

hebrews2124 wrote:

I have looked around quite a bit on the Internet for some good documentation that explains how all of this stuff works and it seems like it's a little scarce.  Maybe that "lack of good documentation" is just my being so green when it comes to scripting and how these various programs really work under the hood.

That would account for part of it, perhaps; but it does seem that documentation is... less than it would be in a perfect world. And changes to code, versions, ways of doing things, etc. might occur and not be reflected in some documentation. There might also be a bit of disunity, so to speak.

The vast majority of things linux - including Xfce - are strictly volunteer projects. Developer hours are limited. So it is, I think, understandable and (mostly wink ) forgivable that some documentation is not as extensive and polished as we might wish.

I don't mind typing, but I'm a clueless idiot. Otherwise, I'd volunteer to work on stuff like that.

I'd consider the database of this forum to be the most extensive Xfce documentation in existence, lol.

Regards,
MDM


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

#23 2018-05-23 11:31:21

hebrews2124
Member
Registered: 2018-05-21
Posts: 6

Re: How to display icons from existing directory on a Desktop/Workspace

Good morning MDM,

Yes.  I have a lot of respect for the members of the open source community who dedicate their time and other resources to the creation of various kinds of software.  I also know how you feel when you say "clueless idiot," at least to a certain degree, lol.  The point I was trying to convey and maybe didn't (sometimes I seem to have problems expressing myself wink ) is that I appreciate folks like ToZ, who freely donate their time to helping other folks.  Toward that end, I want to try to understand for myself what is going on in their code and learn from the experience as much as I can so that in the future I can pay it forward (and maybe avoid having to bug someone for minor code fixes/improvements I could do myself).  I was asking and maybe simultaneously and unintentionally kind of "venting" about the "lack of documentation" with that in mind.

BTW, ToZ, the two scripts you wrote have been in operation on my daughter's laptop for a few days now.  Given her natural gift of being able to break things wink and her lack of complaint, I'd say that things are still working quite nicely.

See you guys around the forums,
Jason

Offline

#24 2018-05-23 16:51:35

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: How to display icons from existing directory on a Desktop/Workspace

hebrews2124 wrote:

BTW, ToZ, the two scripts you wrote have been in operation on my daughter's laptop for a few days now.  Given her natural gift of being able to break things wink and her lack of complaint, I'd say that things are still working quite nicely.

Glad to hear.

MountainDewManiac wrote:

I'd consider the database of this forum to be the most extensive Xfce documentation in existence, lol.

If only there was an easy way to move all this information into the wiki to make it easier to find. Maybe when I retire and have all this free time....


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#25 2018-12-30 21:50:56

acme
Member
From: London, England
Registered: 2018-12-30
Posts: 15

Re: How to display icons from existing directory on a Desktop/Workspace

Hello,

I am a relative newbie.  I have been using xfce 4.12 on two machines, one with Mint 17.3 and the other with Mint 18.3.  I have successfully implemented ToZ's xfdeskicons script (#20 above) on both machines.

Now, when I boot the machines I would like the startup workspace to be the same workspace as at the last shutdown.  So I saved the last workspace number in a file and was able to switch to that workspace when I tested it as a standalone bash script just for switching the workspace.  However, I have been unable to get it working by modifying xfdeskicons - on startup the desktop always reverts to workspace 1.  I guess I don't really understand the code.

Any help/suggestions, would be much appreciated - thanks in advance.

Alan

Offline

Board footer

Powered by FluxBB