Page 1 of 2 12 LastLast
Results 1 to 10 of 27

Thread: Locking icons position

Hybrid View

  1. #1
    Join Date
    Jul 2011
    Beans
    9

    Locking icons position

    Hi guys,

    I'm wondering if we can kind of "lock icons" on the desktop so they will not change positions when I play a 800*600 game.

    You know, when you have icons near the left side of your screen and after playing a game your icons are all smashed to the right side of the screen.

    Any clues? Thank's

  2. #2
    Join Date
    Jul 2011
    Beans
    6

    Re: Locking icons position

    Oh my god. I had this too when I used XFCE. I couldn't find the answer though. I sort of "solved" it by moving all the desktop icons into a second folder called "Desktop", which is on the actual desktop. I placed it in the top left corner of the screen. That's not the best solution though if you want desktop icons on the actual desktop... Hm. Did you try filing a bug report?

  3. #3
    Join Date
    Feb 2010
    Location
    Obscurial Springs
    Beans
    15,209
    Distro
    Ubuntu Budgie Development Release

    Re: Locking icons position

    Hello and Welcome

    I don't see anything in the configuration editor or advanced settings that allows what you want . I am curious what allows the icons to move when the game is used . Neither the configuration editor nor Ubuntu Tweak include a right or left placement option for desktop icons in 11.10 . I am on Ubuntu .so that may not be case for you .
    "Our intention creates our reality. "

    Ubuntu Documentation Search: Popular Pages
    Ubuntu: Security Basics
    Ubuntu: Flavors

  4. #4
    Join Date
    Jul 2011
    Beans
    9

    Re: Locking icons position

    Hi,

    thank's for your answers it's appreciated. For more precision I'll add that I run on Xubuntu 11.10

    @PD808
    your solution is pretty original . I didn't tried to filled a bug report because I didn't think this problem can be considered like a bug. Thank's for this suggestion, maybe it's the way to go.

    @Frogs Hair
    Well, the thing is when the game resize the screen in a lower resolution all icons change position to be visible for that newer resolution. And after when the desktop regain the normal resolution (when closing a game) it seems that nothing is replacing the icons at their initial position .

  5. #5
    Join Date
    Oct 2008
    Location
    Ottawa, Canada
    Beans
    813
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: Locking icons position

    Here's another solution for you.
    Run
    Code:
    sudo chattr +i ~/.config/xfce4/desktop/icons*
    This in effect renders your icon placement config file immutable.
    When you change resolution your icons will be shuffled around and will be out of place when your get back.
    However, the changes will not have been written to disk.
    To reload the desktop and the right placement, simply run 'xfdesktop --reload'. This can be conveniently made into a launcher.

    To unlock the config, replace +i for -i in the first command.

    Cheers!
    husband@wife$ make sandwich
    Permission denied
    husband@wife$ sudo make sandwich

  6. #6
    Join Date
    Jul 2011
    Beans
    9

    Re: Locking icons position

    @LewisTM
    Big thank's, that's a useful trick to know. I just need to remember to unlock the file when adding icons to the desktop .

  7. #7
    Join Date
    Nov 2009
    Beans
    11
    Distro
    Ubuntu

    Re: Locking icons position

    Quote Originally Posted by underkz View Post
    Hi guys,

    I'm wondering if we can kind of "lock icons" on the desktop so they will not change positions when I play a 800*600 game.

    You know, when you have icons near the left side of your screen and after playing a game your icons are all smashed to the right side of the screen.

    Any clues? Thank's

    Finally I came up with decent solution for this.

    1. Create following script, save it to your home folder as "RunPreservingIconPos" and make it runnable.

    Code:
    #!/bin/bash
    cd ~/.config/xfce4/desktop/
    cp -f ./icons.screen0-1280x1024.rc ./icons.screen0-1280x1024.rc_bak
    
    # This will launch application given as argument (as background process).
    $1 &
    sleep 1
    
    # This will get PID of the application (if it launches multiple processes this script might not work).
    PID=`jobs -p`
    echo "Looking for process which has pid of $PID."
    
    # Let's wait until ps doesn't see the process anymore.
    while [ ! -z `ps -p $PID -o pid=` ]; do
    sleep 1
    done
    
    echo "Execution of the process ended."
    
    cd ~/.config/xfce4/desktop/
    
    # These lines forces new configs to be read (apparently by flushing some config cache).
    rm ./icons.screen0-1280x1024.rc
    xfdesktop --reload
    
    # Wait and restore backed up configs.
    sleep 1
    cp -f ./icons.screen0-1280x1024.rc_bak ./icons.screen0-1280x1024.rc
    xfdesktop --reload
    NOTE! Rename all of these "icons.screen0-1280x1024.rc" filenames in the script to correspond to your resolution in use!


    2. Modify all problem application launchers to start with the script, example:

    /usr/games/sauerbraten
    --->
    /home/<yourusername>/RunPreservingIconPos sauerbraten


    3. Done. After one second you exit the application, all your icons will be just where you wanted.


    If you find it useful, please share it.
    Last edited by Jussl; April 24th, 2013 at 12:51 AM. Reason: Correction from underkz. Thanks!

  8. #8
    Join Date
    Jul 2011
    Beans
    9

    Re: Locking icons position

    Thank's for sharing your solution, that's a nice script! But I guess all lines with "icons.screen0-1280x1024" needs to change depending of the resolution adopted.

    I really hope that XFCE or xubuntu will do something about it one day .

  9. #9
    Join Date
    Nov 2009
    Beans
    11
    Distro
    Ubuntu

    Re: Locking icons position

    Oh yes, you are right. Correct file names are dependent of resolution.

    Do you know whether there is bug report filed for this?

  10. #10
    Join Date
    Jul 2011
    Beans
    9

    Re: Locking icons position

    If I remember right, I think there was a report filed for this, but sadly I do not find it. It seems not to bother many people, so I doubt it will be quickly resolved .

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •