PapirusDevelopmentTeam / papirus-folders

a script that lets you change the colors of folders in Papirus icon theme
https://git.io/papirus-folders
MIT License
600 stars 32 forks source link

Does papirus-folders act only system-wide ? #15

Closed Coeur-Noir closed 4 years ago

Coeur-Noir commented 4 years ago

Hi,

using papirus-folders here on a Ubuntu Budgie 18.04.

When using it to change the folders default color - let's say to orange - it's applied system-wide to all the sessions / users making use of papirus icons.

Is this intended ?

Or is there a way to set default color for folders per session / per user ?

SmartFinn commented 4 years ago

That depends on where Papirus icon theme is installed. If the icons installed to the home directory then papirus-folders applied the color to the user, if to root - system-wide.

To solve this issue just install another copy of Papirus icon theme to the user's home directory and change folder color with papirus-folders command. (sudo papirus-folders, in this case, changes colors for system-wide).

Coeur-Noir commented 4 years ago

Mmm… Does not seem to work. I first installed Papirus system-wide. Then change color, papirus-folder asked me for root password. My folders are grey in all sessions.

Now I have also copied Papirus* into ~/.icons of each user. Run papirus-folder no longer asks for root password but change is not applied, folders color is still the one previously set using root password.

Should I delete Papirus* from /usr/share/local/icons to have it installed only per user side ?

SmartFinn commented 4 years ago

I just tested on my system (GNOME Shell 3.32.2) it works as expected. Icons installed to $HOME/.icons have higher priority than the system's icons. Maybe the problem related to Budgie. I have to check this.

papirus-folders -l shows the chosen color or a default? If the chosen one then try to update caches for all themes with papirus-folders -uv.

SmartFinn commented 4 years ago

On Ubuntu Budgie 18.10 works fine. The system folders are gray, the user's folders are cyan:

image

image

Coeur-Noir commented 4 years ago

Sorry… did all that and still not ok. Capture du 2019-12-02 16-53-31 Capture du 2019-12-02 16-54-31 Capture du 2019-12-02 16-57-11 Of course I quit and relaunch nautilus each time. Even did I quit session and log in again…

SmartFinn commented 4 years ago

You didn't mention that you using Unity. So Unity doesn't use icons from ~/.icons. Try to delete the themes from $HOME/.icons and install them to $HOME/.local/share/icons (link).

Coeur-Noir commented 4 years ago

It's another session with Unity on the same system. But I start thinking Unity and Budgie can't live together well… despite being run by different users.

In both sessions, icons are actually installed in ~/.local/share/icons and ~/.icons is a symlink towards it.

SmartFinn commented 4 years ago

@Coeur-Noir

In both sessions, icons are actually installed in ~/.local/share/icons and ~/.icons is a symlink towards it.

That is the problem. ~/.icons cannot be a symlink, it must be a directory.

Coeur-Noir commented 4 years ago

Aaaww… how strange about the symlink ?

Meanwhile here is what I did to « fix » my issue, while keeping the .icons symlink ( I need it for other themes or icon set ) : ⋅ completely uninstall everything regarding papirus icons and papirus-folder everywhere, ⋅ installed system-wide papirus icons and papirus-folder, ⋅ run the install script in each user session to install papirrus icons in ~/.icons ( actually ~/.local/share/icons due to my symlink ), ⋅ tried to change color only on user side → did not work, ⋅ completely uninstall papirus system side ( but keeping papirus-folder ) so papirus icons are only in each user session and no longer in /usr/share/icons, ⋅ change color per session → now it works, my unity session has orange folders with ambiance theme and my budgie session has grey folders with adapta theme, no more mismatch !

If the script can't follow symlink then it was normal changes were only applied system-wide. What remains weird is I was unable to revert my changes system-wide though.

Next step : get back to an installation without symlink just to confirm everything works as expected. My own mess, lol.

SmartFinn commented 4 years ago

Btw, the script works fine with symlinks, but GTK framework totally ignores ~/.icons when it's a symlink.

Coeur-Noir commented 4 years ago

And holly…

I removed my ~/.icons symlinks to replace with real folders.

And as soon as I install papirus icons system-wide, all my folders are blue everywhere… Even if i re-run _papirus-folders -C this_orthat in each session ( without sudo )

Capture du 2019-12-02 18-28-07

Capture du 2019-12-02 18-26-57

SmartFinn commented 4 years ago

It seems like a cache issue. Try rebuild cache for the user with papirus-folders -uv and for the system with sudo papirus-folders -uv. Always set --theme <THEME> option to avoid the cache issue in the future.

But I recommend you completely remove Papirus icon theme from all locations with wget -qO- https://git.io/papirus-icon-theme-uninstall | sh and then install to the system and to the user with our installation scripts (because our scripts work together with papirus-folders).

Coeur-Noir commented 4 years ago

⋅ Uninstalled using wget -qO- https://git.io/papirus-icon-theme-uninstall | sh on each session, each time script asked for sudo password. ⋅ Uninstalled then papirus-folders and papirus icons using synaptic

Installed using scripts from here to system ( sudo ) and to users ( no sudo ). This does not bring papirus-folders. Installed it with synaptic ( therefore from ppa ) which also seems to reinstall icons.

Then changed the color on each user side, grey for Budgie, orange for Unity, did the cache thing. No better result :

Capture du 2019-12-03 16-21-02

Capture du 2019-12-03 16-18-37

Note that in Budgie, desktop settings only shows one Papirus whilst in Unity, unity-tweak shows Papirus icon-set twice. I've tried both, guessing one is for system end the other for user.

Now if I delete papirus icon-set from system I will have different colors in different sessions but administrative applications ( like synaptic, gparted, etc ) won't have papirus icons…

Is there something broken : ⋅ in ppa ? ⋅ in my system ? ⋅ only in 18.04 ?

SmartFinn commented 4 years ago

@Coeur-Noir but why folders color is blue? I guess there is another copy of Papirus icon theme with blue folders. Maybe it's located in /usr/local/share/icons or check Flatpak packages if you used it.

Coeur-Noir commented 4 years ago

but why folders color is blue? Errr… that's precisely my problem since the beginning of that discussion ;-)

As soon as papirus-icons are installed system-side, the chosen color user-side is not applied.

If I delete papirus-icons from /usr/local/share/icons then it's ok user-side but applications in root-mode ( such as synaptic, gparted ) fall back to ( other ) default icons.

Flatpak… damn those new packages. I'll have to check those also, I may have some.

Coeur-Noir commented 4 years ago

I've checked flatpak installed on my system, no package related to papirus-icon there.

Budgie 18.10 ( and up ) have Nemo as file explorer. It is Nautilus in 18.04 : can it be a reason ?

SmartFinn commented 4 years ago

image

Seems I found what the problem was. As you see on the screenshot sudo pass $HOME to root environment. It's never happened in interactive mode (sudo -i), so I didn't know that.

So every time you run sudo papirus-folder it changes colors in ~/.icons/ and breaks permissions on symlinks and on icon-theme.cache file. That is why you got the blue folders.

Unfortunately, that is not all. In Unity ~/.icons directory has lower priority than /usr/share/icons. Even when a different order is specified in the specification.

To fix that you have to:

### In Bugie:
# 1. Delete Papirus icons from ~/.icons and config file (because permissions corrupted)
sudo rm -rf ~/.icons/{Papirus,Papirus-Dark,Papirus-Light,ePapirus}
sudo rm -rf ~/.config/papirus-folders/
# 2. Install it again
wget -qO- https://git.io/papirus-icon-theme-install | DESTDIR="$HOME/.icons" sh
# 3. Change folders color for Budgie session
papirus-folders -v -C grey -t Papirus -u
### In Unity:
# 1. Delete Papirus icons from ~/.icons and config file (because permissions corrupted)
sudo rm -rf ~/.icons/{Papirus,Papirus-Dark,Papirus-Light,ePapirus}
sudo rm -rf ~/.config/papirus-folders/
# 2. Change folders color to orange for system-wide with `sudo -H`
sudo -H papirus-folders -v -C orange -t Papirus -u
Coeur-Noir commented 4 years ago

…and as soon as I did sudo -H papirus-folders -v -C orange -t Papirus -u in my unity session I ended up with orange folders everywhere…

The user preference in Budgie session seems overridden by the one set with sudo. Capture du 2019-12-14 22-55-23

SmartFinn commented 4 years ago

I recommended you remove and install Papirus icons to ~/.icons in Budgie session did you do it?

Check permissions on files:

ls -l ~/.icons/Papirus/icon-theme.cache
ls -l ~/.config/papirus-folders/keep
Coeur-Noir commented 4 years ago

I recommended you remove and install Papirus icons to ~/.icons in Budgie session did you do it? → yes I did.

coeur-noir@asgard:~$ ls -l ~/.icons/Papirus/icon-theme.cache
-rw-r--r-- 1 coeur-noir maison 1961448 déc.  14 23:09 /home/coeur-noir/.icons/Papirus/icon-theme.cache
coeur-noir@asgard:~$ ls -l ~/.config/papirus-folders/keep
-rw-r--r-- 1 coeur-noir maison 25 déc.  14 23:09 /home/coeur-noir/.config/papirus-folders/keep
coeur-noir@asgard:~$ 

Now I have also totally deleted the Unity session and its user, and even reinstalled budgie-core, budgie-desktop and so on but… Capture du 2019-12-14 23-15-06

SmartFinn commented 4 years ago

Interesting, it worked for me https://github.com/PapirusDevelopmentTeam/papirus-folders/issues/15#issuecomment-560454812

Is ~/.icons directory not a symlink?

image

Coeur-Noir commented 4 years ago
total 424
drwxrwsr-x 38 coeur-noir maison   4096 déc.  14 23:12  .
drwxr-xr-x 11 root       root     4096 déc.  14 23:06  ..
(…)
-rw--wS---  1 coeur-noir maison 146714 déc.  14 22:40  .ICEauthority
drwxrwsr-x  6 coeur-noir maison   4096 déc.  14 22:27  .icons
lrwxrwxrwx  1 coeur-noir maison     22 juin   2  2018  Images -> /home/coeurnoir/Images
drwx------  3 coeur-noir maison   4096 juil. 25  2018  .launchpadlib
(…)
-rw--wS---  1 coeur-noir maison     51 déc.  14 22:40  .Xauthority
-rw-rwSr--  1 coeur-noir maison    131 juin   2  2018  .xinputrc
-rw-------  1 coeur-noir maison   4335 déc.  14 22:40  .xsession-errors
-rw-------  1 coeur-noir maison   4335 déc.  14 22:24  .xsession-errors.old
coeur-noir@asgard:~$ 

.icons is not a symlink but a real directory.

Wondering if 18.04 might be different to 18.10 or 19.10 regarding that matter… if I try, I'll let you know.

Or maybe Nautilus vs. Nemo ?

SmartFinn commented 4 years ago

Or maybe Nautilus vs. Nemo ?

No matter what FM/app do you use. It's related to Desktop Environment, more precisely, it is related to a framework on which DE is built.

Wondering if 18.04 might be different to 18.10 or 19.10 regarding that matter… if I try, I'll let you know.

Yeah, it doesn't work on Ubuntu Budgie 18.04. Seems older versions of the GTK framework do not follow the specification.

But this is not the end. There is another way to get what you want:

  1. Remove Papirus icons from /usr/share/icons:
    wget -qO- https://git.io/papirus-icon-theme-install | uninstall=true sh
  2. Install the icons to /root/.icons:
    wget -qO- https://git.io/papirus-icon-theme-install | DESTDIR=/root/.icons sh
  3. Login to Unity session, install the icons and then change folders color to orange:
    wget -qO- https://git.io/papirus-icon-theme-install | DESTDIR=~/.icons sh
    papirus-icons -v -C orange -u

That's it. Unity uses icons from /home/gm-1004/.icons, Budgie uses icons from /home/coeur-noir/.icons, applications running with sudo get icons from /root/.icons

Coeur-Noir commented 4 years ago

Yes, good catch ! Now I can set a color for root user system wide ( grey ) and one different color per user ( teal, blue… ) Capture du 2019-12-15 16-08-05

So everything's fine in 18.04 as long as you DO NOT install Papirus system wide inside /usr/share/icons although it's the normal default place for icons in system, it seems to override any other user place for icons.

So if you install them in /root/.icons beware you won't find Papirus icons theme user side ( ie. in your usual desktop settings ) UNLESS you also install them in each personal user's folder ~/.icons

It's not optimal as it copies / duplicates many files but at least it works.

Many thanks for your patience and perseverance @SmartFinn !

( for reference https://discourse.ubuntubudgie.org/t/folder-color-set-default-color/2751/8?u=coeur-noir )

Coeur-Noir commented 4 years ago

Mmm… upgraded to 20.04 since and I find again same behavior.

If I run folder-color user-side, new color is applied system-wide.

Ok, I will install in each user's personal folder instead…