numix-folders icon indicating copy to clipboard operation
numix-folders copied to clipboard

numix-folders setting changes with upgrade.

Open Himanshu-Mishr opened this issue 8 years ago • 35 comments

Every time I upgrade numix icons via package manager, settings that I have set for numix-folder gets changed to its default values and colors. How to make my settings permanent ?

Himanshu-Mishr avatar Jul 23 '15 02:07 Himanshu-Mishr

@Foggalong I thought about this, and I guess there is a way to do this:

  1. Save the current configuration (colour, style, custom etc.) in a config file somewhere in ~/.config (or somewhere else) by writing it in the end of the script.
  2. Add another flag to the script that reads this config file and applies these values without asking the user on the command line
  3. On numix-base and circle there is somewhere a postinstall method (that's where the gtk-update-icon-cache is done). Add the numix-folder script (using for example which numix-folders) with this new flag.

All that's necessary to do this is that numix-folders is somewhere in $PATH (doesn't matter where exactly)

andia89 avatar Jul 23 '15 07:07 andia89

While this issue is a duplicate of https://github.com/numixproject/numix-folders/issues/45, https://github.com/numixproject/numix-folders/issues/47#issuecomment-113933833, https://github.com/numixproject/numix-folders/issues/64 and https://github.com/numixproject/numix-folders/issues/99, we might just address this here. It is apparent that there is a demand for this kind of feature.

I am still not sure whether the method that @wa4557 proposed will work on all distros, or whether this would be specific to updating e.g. via PPA/AUR/copr. How about cloning from GitHub?

An alternative way to address this might be to still have to run the numix-folders script, but to have the script itself provide an option for the last setting, e.g. by entering "lastrun" for the style and be done.

An additional advantage of such an approach would be that Numix base and Numix-Circle stay "independent" of numix-folders in the sense that Numix base and Numix-Circle would not have to include a numix-folders postinstall.

A disadvantage of such an approach would be that the numix-folders script would have to be triggered manually every time Numix base or Numix-Circle updates e.g. via PPA, which can mean on a daily basis.

dirtydancing avatar Jul 23 '15 12:07 dirtydancing

@dirtydancing @wa4557 i think the best way is to proive a GUI for numix-folders so the user can save the settings in the configuration file

bilelmoussaoui avatar Jul 23 '15 12:07 bilelmoussaoui

@bil-elmoussaoui @wa4557 @Himanshu-Mishr : I've had a completely solution for this on my Ubuntu 15.04. You may want to have a look, at https://github.com/idmresettrial/numix-folders-autorun

trmdi avatar Jul 23 '15 13:07 trmdi

The problem with that script is that it's Ubuntu dependent, so we can't implement that as the solution. As others have mentioned it might be a good idea to implement the save feature along with the GUI as both will require a bit more substance in terms of a proper install method

Foggalong avatar Jul 23 '15 14:07 Foggalong

@Foggalong Ok, I just let them know about a solution on Ubuntu. I still wait for an official one from Numix. ^^

trmdi avatar Jul 23 '15 14:07 trmdi

I will do that using Python if everyone is ok with that. If anyone have an idea of a possible features or a design of the GUI please share it here.

Le 23 juil. 2015 à 16:10, idmresettrial [email protected] a écrit :

@Foggalong Ok, I just let them know about a solution on Ubuntu. I still wait for an official one from Numix. ^^

— Reply to this email directly or view it on GitHub.

bilelmoussaoui avatar Jul 23 '15 14:07 bilelmoussaoui

I guess python is not really necessary here (since the whole script is written in bash), a simple zenity GUI would be sufficient. I'd do it but unfotunately I'm extremely busy at the moment :(

andia89 avatar Jul 23 '15 14:07 andia89

I have no idea how zenity woks, but i will give it a try this weekend.

Le 23 juil. 2015 à 16:28, Andreas Angerer [email protected] a écrit :

I guess python is not really necessary here (since the whole script is written in bash), a simple zenity GUI would be sufficient. I'd do it but unfotunately I'm extremely busy at the moment :(

— Reply to this email directly or view it on GitHub.

bilelmoussaoui avatar Jul 23 '15 14:07 bilelmoussaoui

I am not in development of this repo but I would say saving user's settings somewhere ( in ~/.config ) and using it while upgrading, would be better idea. If config file not present then you can go with default settings. Keep it simple. Btw thank you for wonderful icons.

Himanshu-Mishr avatar Jul 23 '15 16:07 Himanshu-Mishr

Yeah, decided I'm gonna keep this open. Enough people have requested it now that it's clearly something people want :P

Foggalong avatar Jul 23 '15 17:07 Foggalong

CC: @PaoloRotolo

Foggalong avatar Sep 02 '15 13:09 Foggalong

A config file in ~/.config seems the best way to handle this, and use each distro's post installation routines to run a script that checks for existing config data, and applies the users preferences. This should allow for distro independence.

And I too am requesting this, I'd prefer not to have to re-assign folder colors several times per week. Thanks!

ghost avatar Sep 20 '15 04:09 ghost

@xHN35RQ there exists a config file already and running the script with numix-folders -p restores the previous settings. @Foggalong
Adding this: $(command -v numix-folders) -p >/dev/null 2>&1 to the postinstall routine (of the base numix-icon-theme of course) (the same place where the gtk-update-cache is done) should fix the issue for all non git-clone users, and doesn't do any harm if numix-folders is not installed. I really think this should be added (@PaoloRotolo is this reasonable?)

andia89 avatar Sep 24 '15 17:09 andia89

@PaoloRotolo ^

Foggalong avatar Sep 24 '15 17:09 Foggalong

Should this then not be added to Numix-Circle as well? Numix base encompasses the folder icons, but Numix-Circle encompasses the file manager icon which also changes according to the folder style.

dirtydancing avatar Sep 24 '15 18:09 dirtydancing

True.

andia89 avatar Sep 24 '15 18:09 andia89

:+1:

Foggalong avatar Sep 24 '15 18:09 Foggalong

As a note, people using git based installations don't need to worry about this problem anyway since git updates don't cause this problem

Foggalong avatar Sep 24 '15 18:09 Foggalong

there exists a config file already and running the script with numix-folders -p restores the previous settings.

@wa4557 Thanks for that info, but I don't want to run this script after every apt-get update. I just want my existing settings to stay the same. :smile:

ghost avatar Sep 25 '15 03:09 ghost

@Foggalong I am not sure what you mean with "git based installations don't need to worry about this problem".

E.g. with Arch/GNOME, when I run yaourt -Syua --devel --noconfirm in order to update i.a. all git-based AUR packages (when only the git version has updated without the AUR package itself having been updated), the folder icons are reset to the default as well. (for the Numix base and Numix-Circle AUR packages https://aur.archlinux.org/packages/numix-icon-theme-git/ and https://aur.archlinux.org/packages/numix-circle-icon-theme-git/).

This seems to imply that also the AUR packages would need to include some kind of postinstall routine.

dirtydancing avatar Sep 26 '15 18:09 dirtydancing

woah really? I use raw git for managing my Numix install and it doesn't reset so I assumed AUR would be the same. Unfortunately we don't administrate the AUR packages so it's up to the maintainer there to add it. They do occasionally popup on the GitHub though so they might see this :)

Foggalong avatar Sep 26 '15 19:09 Foggalong

Yeah, I am not really sure at this point if this is about the AUR package itself, because with git-based AUR packages, they often do not update with versionless "rolling" git projects, but you can still update the git version with the --devel flag. To me, this entire situation is not that big of a deal because I can simply run numix-folders (which has saved the previous configuration), and I am done. Anyways, I would agree that for Arch, this is something that the AUR package maintainers would need to address.

dirtydancing avatar Sep 26 '15 19:09 dirtydancing

But still, adding $(command -v numix-folders) -p >/dev/null 2>&1

to base and circle postinstall is a good idea, regardless of the situation for arch packages

andia89 avatar Sep 26 '15 19:09 andia89

Oh yeah, we'll definitely add it for the PPA :)

Foggalong avatar Sep 26 '15 19:09 Foggalong

+1 folders settings resets to default upon update. any new status on this?

grenzor avatar Nov 24 '15 06:11 grenzor

No update as of yet. @PaoloRotolo will probably announce it here when done :)

Foggalong avatar Nov 24 '15 17:11 Foggalong

Solved it like this:

/etc/numix-folders.conf

STYLE=6
COLOR=blue

/usr/local/bin/trigger-numix-folders.sh

#!/bin/bash

grep -q '/numix-icon-theme' || exit 0
touch /tmp/trigger-numix-folders-update

/usr/local/bin/numix-folders.sh

#!/bin/bash

numix_folders_apply() {
. /etc/numix-folders.conf
numix-folders --cli << EOF
$STYLE
$COLOR
EOF
rm -f /tmp/trigger-numix-folders-update
}

if [ -f /tmp/trigger-numix-folders-update ]; then
  if [ -f /etc/numix-folders.conf ]; then
    echo "restoring blue Numix icons (style 5)"
    numix_folders_apply
  fi
fi

/etc/apt/apt.conf.d/99numix-folders

DPkg::Pre-Install-Pkgs { "/usr/local/bin/trigger-numix-folders.sh"; }
DPkg::Post-Invoke { "/usr/local/bin/numix-folders.sh"; }

morph027 avatar Feb 02 '17 08:02 morph027

https://gitlab.com/snippets/1539528

morph027 avatar Feb 02 '17 12:02 morph027

All this talk about package manager hooks and more root entrenchment, when all of this could just be solved by creating a theme in $HOME/.icons with nothing but the customized folders, that inherits Numix. You could call it Numix-Folders. Then you would update Numix derivatives like Circle such that their inherits line inherits Numix-Folders and then Numix.

Is there a reason this method has been so aggressively avoided? Like, not even mentioned by anyone in this thread?

TiZ-HugLife avatar May 19 '17 16:05 TiZ-HugLife