https://bugs.kde.org/show_bug.cgi?id=360478

--- Comment #43 from Jacob <jacobsea...@gmail.com> ---
(In reply to funkybomber from comment #41)
> Thanks for the submission @Andrii Arendariuk, this is a simple, elegant
> solution. Kudos!
> 
> I took the liberty to run a couple more tests with your code in terminal,
> and realised how easy it is to actually use your code to create multiple
> backup files, in order to preserve icon positions per resolution (if that's
> what we want - and we should).
> For example, I used this command when I was in 1920x1080:
> cp -f ~/.config/plasma-org.kde.plasma.desktop-appletsrc ~/plasma1920x1080.bak
> 
> Then I changed resolution to 800x600, and I rearranged some of the desktop
> icons to new places so that I would feel more comfortable while working in
> this resolution.
> Then I used this command (while still in 800x600) to preserve the icon
> positions for this state as well: 
> cp -f ~/.config/plasma-org.kde.plasma.desktop-appletsrc ~/plasma800x600.bak
> 
> Then I changed resolution back to 1920x1080 and run the command: 
> konsole -e killall plasmashell && cp -f ~/plasma1920x1080.bak
> ~/.config/plasma-org.kde.plasma.desktop-appletsrc && plasmashell &
> 
> which sure enough restored all my icons in the appropriate places.
> 
> Just for the heck of it, I also run the command: 
> konsole -e killall plasmashell && cp -f ~/plasma800x600.bak
> ~/.config/plasma-org.kde.plasma.desktop-appletsrc && plasmashell &
> 
> which just placed the icons in the "800x600" pattern while I was still in
> the 1920x1080 resolution. But that was just me playing at this point.
> 
> The only thing remaining is someone with programming experience to make the
> script run automatically when there is a resolution change. 
> To function properly this script should get as parameters both the "old" and
> "new" resolution and then call "backup" for the "old" resolution and
> "restore" (if a relevant file for this resolution exists) for the "new"
> resolution.
> 
> Obviously I'm biased because I desperately want to see a resolution to this
> issue, but let's discuss:
> 
> What are the downsides to this solution exactly?

I spent several hours trying to make the resolution change idea work only to
eventually give up (at least for now).

What I tested out was to simply detect a "resolution change" from within a .sh
script. 

This can actually be done. However, the problem is that when a program or game
changes the resolution (temporarily?), it does not seem to actually change the
desktop resolution, even though it seems that way visually. 

I tested this with Diablo 2 in Wine. While the game is running, the reported
resolution, when requested from a .sh script, will be unchanged. Hence, we can
not easily detect this. However, we could probably parse the configuration file
and do a simple search and replace whenever it is corrupted.

I also tried simply comparing the md5sums of the configuration and backup
files, but this does not work very well at all. It seems like other things also
change the configuration file, and those changes will be overwritten every time
we restore from a backup automatically. Hence, a search and replace is probably
best.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to