Xfce Forum

Sub domains
 

You are not logged in.

#26 2015-06-03 12:12:33

rijnsma
Member
From: NL
Registered: 2011-09-05
Posts: 36

Re: Desktop icons rearrange on reboot

I had this icon-problem in Linux Lite.
So I experimented as a test with Xubuntu 14.04 (and Xfce 4.10)
With Xfce 4.12 (via PPA) the iconproblem is gone here. big_smile

Last edited by rijnsma (2015-06-03 12:15:56)

Offline

#27 2015-06-07 16:39:55

nl_simon
Member
Registered: 2015-06-07
Posts: 2

Re: Desktop icons rearrange on reboot

Hi all,
I am running an Ubuntu 14.04.2 LTS. That provides me with XFCE 4.10. I have been using this setup for a year now and it has been working for me. I like the "old fashioned" look and feel and all has been working well.

Recently I got some updates, at least I thought to have seen XFCE when system update was active. And since that time the icons do not stick to their position when rebooting. It is a bit disappointing. Maybe a bit moor than a bit.... It is stupid.

I noticed that when I log out, not shutting down the system, and re-log in all icons are there where I left them.

However, when I shut the system and boot it later, most of the icons have moved.
Most (!) icons are moved to the left hand edge of the desktop. A few JPEGs remain at their position every time and a removable device (thumb drive) is somewhere to the centre right of the screen to my surprise.

Sorry to say but how can it be so hard to simply put icons back where they were? Windows 3.11 did this right. Please note the huge number of "views" on this item; something is not working right for many people.

Last edited by nl_simon (2015-06-07 16:43:44)

Offline

#28 2015-06-07 19:24:15

rijnsma
Member
From: NL
Registered: 2011-09-05
Posts: 36

Re: Desktop icons rearrange on reboot

Maybe this? ->
http://www.webupd8.org/2015/03/install- … 04-or.html

I did it that way. It is right now like I wrote.

Last edited by rijnsma (2015-06-07 19:24:47)

Offline

#29 2015-06-07 20:10:43

nl_simon
Member
Registered: 2015-06-07
Posts: 2

Re: Desktop icons rearrange on reboot

rijnsma wrote:

Maybe this? ->
http://www.webupd8.org/2015/03/install- … 04-or.html

I did it that way. It is right now like I wrote.

Hi Rijnsma, Yeah it does work, I will admit. But is this a reasonable solution? Why does it become a mess? I has been working for some time and then someone decides to "update" my system and my desktop gets messed up. So I am still running a 3 year old version of XFCE (4.10 was from 2012) but now, since the update, WITH an annoying error.

Maybe I was a bit grumpy; why does the Linux community not seem able to sort these trivial things? You don't expect a freshly installed system not to boot (as I had with this one). Neither do you expect not to be able to play Youtube video's. Yes, I know the reasons, but still. And at that same level I would expect my desktop to remain as I set it. You would not like your maid to re-arrange the things in the kitchen every day. You expect the salt to be in a particular cabinet, like you expect to find the dishes and the other utensils where you put them.

Anyway, thank you for the pointer! Although I find it avoidance rather than solving. Thanks.

Regards,  Simon.

PS: Nice example on Linux support: Solved within 4 hours on a Sunday evening! No company is going to beat this.

Last edited by nl_simon (2015-06-07 20:12:33)

Offline

#30 2015-06-07 20:31:51

rijnsma
Member
From: NL
Registered: 2011-09-05
Posts: 36

Re: Desktop icons rearrange on reboot

I don't know the reason of 'the mess', but I know a lot has happened and in a very fast pace in softwareland.
KDE, Gnome, Qt, other filesystems (ext4, btrfs), grub2, 64 bits after 32, mobiles, system-d  and it looks like it will continue.
The Linux community is most of the time a little slow in these things.
I agree: better no updates of things when it can 'break' like the icons on the desktop...!

Anyway, thank you for the pointer! Although I find it avoidance rather than solving. Thanks.

Regards,  Simon.

PS: Nice example on Linux support: Solved within 4 hours on a Sunday evening! No company is going to beat this.

You're welcome nl_Simon. :wink:

Offline

#31 2015-09-10 09:19:36

panamabob
Member
Registered: 2015-09-10
Posts: 2

Re: Desktop icons rearrange on reboot

Wow this sure works great!   I followed sixwingsfire instructions but changed the "iconlockset.sh" file.
I had to add " exec chmod +x IconLockSet.desktop " (without quotes) in the "iconlockset.sh" file in both the locked and unlocked scripts to keep the file executeable. My new file with changes is below.

#!/bin/bash

if grep -q "LockStatus=Locked" "/home/xxx/Desktop/IconLockSet.desktop"; then
   echo "It is Locked...we will Unlock it"
   sudo chattr -i ~/.config/xfce4/desktop/icons*
   sed '/Icon=/ c\Icon=\/home\/xxx\/Linux_stuff\/Icons\/icon-unlock.png' < /home/xxx/Desktop/IconLockSet.desktop > /home/xxx/Desktop/tmp.desktop
   rm /home/xxx/Desktop/IconLockSet.desktop
   sed '/LockStatus=/ c\LockStatus=Unlocked' < /home/xxx/Desktop/tmp.desktop > /home/xxx/Desktop/IconLockSet.desktop
   rm /home/xxx/Desktop/tmp.desktop
   exec chmod +x IconLockSet.desktop
else
if grep -q "LockStatus=Unlocked" "/home/xxx/Desktop/IconLockSet.desktop"; then
    echo "It is UnLocked...we will Lock it"
    sed '/Icon=/ c\Icon=\/home\/xxx\/Linux_stuff\/Icons\/icon-lock.png' < /home/xxx/Desktop/IconLockSet.desktop > /home/xxx/Desktop/tmp.desktop
    rm /home/xxx/Desktop/IconLockSet.desktop
    sed '/LockStatus=/ c\LockStatus=Locked' < /home/xxx/Desktop/tmp.desktop > /home/xxx/Desktop/IconLockSet.desktop
    rm /home/xxx/Desktop/tmp.desktop
    sudo chattr +i ~/.config/xfce4/desktop/icons*
    exec chmod +x IconLockSet.desktop
fi

fi

exit

Offline

#32 2015-09-14 08:52:23

seth
Member
Registered: 2014-10-25
Posts: 3

Re: Desktop icons rearrange on reboot

Hi!

You can omit the annoying password query for sudo, if you just make the directory read-only. So a more comfortable solution could be something like

#!/bin/bash

IconLockSet="$HOME/Desktop/IconLockSet.desktop"
if grep -q "LockStatus=Locked" $IconLockSet; then
  chmod 750 $HOME/.config/xfce4/desktop
  perl -i -pe 's/^Icon=.*\Kicon-lock\.png/icon-unlock.png/' $IconLockSet
  perl -i -pe 's/^LockStatus=\K.*/Unlocked/' $IconLockSet
else if grep -q "LockStatus=Unlocked" $IconLockSet; then
  perl -i -pe 's/^Icon=.*\Kicon-unlock\.png/icon-lock.png/' $IconLockSet
  perl -i -pe 's/^LockStatus=\K.*/Locked/' $IconLockSet
  chmod 550 $HOME/.config/xfce4/desktop
fi
fi
exit

Advantages:
* no password query
* no exchange of "xxx" by username needed, because theres a environment variable $HOME which always contains your home path
* no "exec chmod +x IconLockSet.desktop" needed every time. It's enough to do that once.

Anyway: This does not really fix the bug, but is just a work-around.

bye
seth

Offline

#33 2015-09-15 04:31:27

panamabob
Member
Registered: 2015-09-10
Posts: 2

Re: Desktop icons rearrange on reboot

Thanks Seth. Your script works great. I did have to add -R on the two chmod lines because it was locking the files in the folder.

#!/bin/bash

IconLockSet="$HOME/Desktop/IconLockSet.desktop"
if grep -q "LockStatus=Locked" $IconLockSet; then
  chmod 750 $HOME/.config/xfce4/desktop -R
  perl -i -pe 's/^Icon=.*\Kicon-lock\.png/icon-unlock.png/' $IconLockSet
  perl -i -pe 's/^LockStatus=\K.*/Unlocked/' $IconLockSet
else if grep -q "LockStatus=Unlocked" $IconLockSet; then
  perl -i -pe 's/^Icon=.*\Kicon-unlock\.png/icon-lock.png/' $IconLockSet
  perl -i -pe 's/^LockStatus=\K.*/Locked/' $IconLockSet
  chmod 550 $HOME/.config/xfce4/desktop -R
fi
fi
exit

Offline

#34 2015-09-16 00:27:47

seth
Member
Registered: 2014-10-25
Posts: 3

Re: Desktop icons rearrange on reboot

Hi panamabob!

I guess, the files inside $HOME/.config/xfce4/desktop/ won't be modified but simply overwritten by the xfce-desktop. So in my opinion, a 'chmod -w' on the files will be useless. But if the directory is read-only, then the files can't be rewritten.

Apart from that 'chmod 550 $HOME/.config/xfce4/desktop -R' does not make sense, because the files in that directory are not executable.

bye
seth

Offline

#35 2016-02-11 10:04:48

dga
Member
Registered: 2016-02-11
Posts: 1

Re: Desktop icons rearrange on reboot

Wow... way too complicated. A better way is...

Create this script:

#! /bin/sh
chattr +i ~/.config/xfce4/desktop/icons*
sleep 40
chattr -i ~/.config/xfce4/desktop/icons*

Give exec permissions to the script, add the script to the sudoers and run it as root in autostart

Regards

Last edited by dga (2016-02-11 14:35:39)

Offline

#36 2016-03-05 22:02:42

passer-domesticus
Member
Registered: 2015-11-20
Posts: 2

Re: Desktop icons rearrange on reboot

shakebake wrote:

Here is a kludge that I did.
...
Put this script in your scripts folder:
It should be named "IconLockSet.sh"


#!/bin/bash

if grep -q "LockStatus=Locked" "/home/xxx/Desktop/IconLockSet.desktop"; then
   echo "It is Locked...we will Unlock it"
   sudo chattr -i ~/.config/xfce4/desktop/icons*
   sed '/Icon=/ c\Icon=\/home\/xxx\/Linux_stuff\/Icons\/icon-unlock.png' < /home/xxx/Desktop/IconLockSet.desktop > /home/xxx/Desktop/tmp.desktop
   rm /home/xxx/Desktop/IconLockSet.desktop
   sed '/LockStatus=/ c\LockStatus=Unlocked' < /home/xxx/Desktop/tmp.desktop > /home/xxx/Desktop/IconLockSet.desktop
   rm /home/xxx/Desktop/tmp.desktop
else
 if grep -q "LockStatus=Unlocked" "/home/xxx/Desktop/IconLockSet.desktop"; then
    echo "It is UnLocked...we will Lock it"
    sed '/Icon=/ c\Icon=\/home\/xxx\/Linux_stuff\/Icons\/icon-lock.png' < /home/xxx/Desktop/IconLockSet.desktop > /home/xxx/Desktop/tmp.desktop
    rm /home/xxx/Desktop/IconLockSet.desktop
    sed '/LockStatus=/ c\LockStatus=Locked' < /home/xxx/Desktop/tmp.desktop > /home/xxx/Desktop/IconLockSet.desktop
    rm /home/xxx/Desktop/tmp.desktop
    sudo chattr +i ~/.config/xfce4/desktop/icons*
 fi

fi

exit

...

The disadvantage of this approach is that chattr requires sudo. So this recipe fails for a user who is not in the sudoers list.

P.S.: I just realized that according to http://www.xfce.org/about/news/?post=1425081600 xfce4 version 4.12 has been released. I scanned this announcement for the keyword "icon", but the two hits did not claim that this error is corrected but rather that new features have been added. Is someone out there who might tell me if the root cause of the error has been recognized and fixed? (Perhaps it was not considered worth telling about the fixed error in the announcement which I mentioned.)

Last edited by passer-domesticus (2016-03-06 09:25:02)

Offline

#37 2016-03-05 22:08:03

passer-domesticus
Member
Registered: 2015-11-20
Posts: 2

Re: Desktop icons rearrange on reboot

seth wrote:

Hi!

You can omit the annoying password query for sudo, if you just make the directory read-only. So a more comfortable solution could be something like

#!/bin/bash

IconLockSet="$HOME/Desktop/IconLockSet.desktop"
if grep -q "LockStatus=Locked" $IconLockSet; then
  chmod 750 $HOME/.config/xfce4/desktop
  perl -i -pe 's/^Icon=.*\Kicon-lock\.png/icon-unlock.png/' $IconLockSet
  perl -i -pe 's/^LockStatus=\K.*/Unlocked/' $IconLockSet
else if grep -q "LockStatus=Unlocked" $IconLockSet; then
  perl -i -pe 's/^Icon=.*\Kicon-unlock\.png/icon-lock.png/' $IconLockSet
  perl -i -pe 's/^LockStatus=\K.*/Locked/' $IconLockSet
  chmod 550 $HOME/.config/xfce4/desktop
fi
fi
exit

...

seth,
I was glad to find a recipe which does not require to be a sudoer like the approach discussed above using sudo chattr...
So I implemented this one but I get a message

-i used with no filenames on the command line, reading from STDIN. 

Unfortunately I can not program in perl. What's wrong here?

Offline

Board footer

Powered by FluxBB