Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store config in ~/.qutebrowser on OS X #383

Closed
The-Compiler opened this issue Dec 19, 2014 · 11 comments
Closed

Store config in ~/.qutebrowser on OS X #383

The-Compiler opened this issue Dec 19, 2014 · 11 comments
Labels
component: config Issues related to configuration. os: macOS Issues which only happen on macOS. priority: 2 - low Issues which are currently not very important.
Milestone

Comments

@The-Compiler
Copy link
Member

The config file should probably be in ~/.qutebrowser under OS X, not what Qt uses by default.

Note we should have code which moves the config from the old to the new place.

Related discussions:

11:20 <asdfqwerhkjdsafa> on osx the config file is installed to ~/Library/Preferences/qutebrowser/qutebrowser.conf
11:20 <The-Compiler> asdfqwerhkjdsafa: yes?
11:20 <asdfqwerhkjdsafa> and cp ing it into ~/.config doesn't seem to work, it's just ignored
11:21 <asdfqwerhkjdsafa> I thought it was supposed to be in ~/.config/qutebrowser
11:21 <The-Compiler> asdfqwerhkjdsafa: ah, yeah. Forget what I said and edit it there then ;)
11:21 <The-Compiler> I assumed you were on Linux
11:21 <asdfqwerhkjdsafa> I should be in .config on osx too
11:21 <asdfqwerhkjdsafa> I like to keep my dot files in git
11:21 <asdfqwerhkjdsafa> it* should
11:23 <asdfqwerhkjdsafa> in the least it should at least read in ~/.config, no?
11:23 <The-Compiler> ~/.config is in the XDG basedir spec which doesn't really apply to OS X
11:25 <asdfqwerhkjdsafa> what
11:25 <oed> asdfqwerhkjdsafa: you could symlink them.
11:25 <oed> ln -s ~/Library/Preferences/qutebrowser/qutebrowser.conf ~/.config/qutebrowser/qutebrowser.conf
11:26 <The-Compiler> I don't get how ~/.config would be a thing on OS X, apart from misguided Linux tools
11:26 <asdfqwerhkjdsafa> ~/.files are a thing on OS X
11:26 <asdfqwerhkjdsafa> they aren't misguided
11:26 <asdfqwerhkjdsafa> cmus and mpv follow that convention
11:27 <asdfqwerhkjdsafa> OS X is just BSD
11:27 <The-Compiler> ~/.config is in a spec which has nothing to do with OS X, and Qt gives me those standard paths
11:27 <asdfqwerhkjdsafa> isn't it just a unix spec or something?
11:28 <asdfqwerhkjdsafa> It doesn't really matter
11:28 <asdfqwerhkjdsafa> literally every single cross platform tool with a config file I've ever tried just uses normal dot files
11:28 <asdfqwerhkjdsafa> either ~/.appname or ~/.config/appname/appname.cong
11:29 <asdfqwerhkjdsafa> oed: _I_ could but I don't think I should have to
11:30 <asdfqwerhkjdsafa> I'm reading the XDG spec, I don't see why you'd think it doesn't apply to OS X. OS X is basically linux with a diffrent gui and better hardware support :P
11:31 <oed> but are the XDG environment variables defined in osx?
11:31 <asdfqwerhkjdsafa> oed: no
11:32 <The-Compiler> https://developer.apple.com/library/mac/documentation/General/Conceptual/MOSXAppProgrammingGuide/AppRuntime/AppRuntime.html#//apple_ref/doc/uid/TP40010543-CH2-SW9
11:34 <asdfqwerhkjdsafa> please just believe me when I say this is inconsistent.
11:35 <asdfqwerhkjdsafa> as a user, this is making my life harder, and I swear to you it's true for other people in my position
11:35 <asdfqwerhkjdsafa> I'm not the special case
11:35 <The-Compiler> and I just looked at the Qt code, it calls the OS X function FSFindFolder with kPreferencesFolderType
11:35 <posativ> iirc OS X does not ship with xdg-* utils
11:36 <The-Compiler> so *the OS X API* is saying this is the right place
11:36 <asdfqwerhkjdsafa> no one on OS X is going to say "oh thank god the the preferences are in the Library folder, away from all my dot files"
11:36 <posativ> you can use XDG-foo though, a few tools use it and store config and stuff in .config or .local/share
11:37 <The-Compiler> there are also (generally linux-centric) tools which store stuff in dotfiles in my home-folder under Windows. I don't consider that the right thing to do.
11:37 <asdfqwerhkjdsafa> posativ: fair enough, but that's not really my point. People on OS X still have dot files, and most have .config folders where we store our config files
11:38 <posativ> asdfqwerhkjdsafa: OS X could begin to implement XDG instead of bringing iOS to the desktop. But that's obviously not their current strategy. The whole point of XDG is to not have your ~ cluttered with about 1000 files
11:38 <asdfqwerhkjdsafa> The-Compiler: I'm amused that this actually turned into a discussion
11:39 <asdfqwerhkjdsafa> posativ: how is that relevant?
11:39 <asdfqwerhkjdsafa> this is my case
11:39 <asdfqwerhkjdsafa> I want to have config files all in the same place
11:40 <The-Compiler> asdfqwerhkjdsafa: Me too! Every OS X related standard says what Qt does is the right thing to do, and I'm sure the Qt people took a closer look at that than I did.
11:40 <posativ> it is useful to have dedicated folders for config and application data, even if it is not directly in your ~/ but in ~/Library/...
11:40 <asdfqwerhkjdsafa> every single other tool except qute does what I expect
11:40 <asdfqwerhkjdsafa> eg cmus
11:40 <posativ> cmus doesn't respect XDG
11:40 <posativ> it just uses ~/.cmus
11:41 <asdfqwerhkjdsafa> the screen shots of cmus on cmus.github.io are on os x but it stores stuff in .config
11:41 <asdfqwerhkjdsafa> space .config $ ls
11:41 <asdfqwerhkjdsafa> cmus  mpv  qutebrowser
11:42 <asdfqwerhkjdsafa> I don't know if that's true but mine is in .config and it's happy to oblige
11:42 <asdfqwerhkjdsafa> The-Compiler: that honestly can't be right man
11:42 <posativ> even the manpage says .cmus :S
11:43 <The-Compiler> asdfqwerhkjdsafa: either symlink it, or create an alias or something starting qutebrowser with -c and your location. I can't see how the OS X API would return something not appropriate for OS X.
11:43 <asdfqwerhkjdsafa> The-Compiler: for example the apple link is probably more for .app files
11:43 <asdfqwerhkjdsafa> but this helps no one!!
11:43 <asdfqwerhkjdsafa> this can't be right
11:44 <asdfqwerhkjdsafa> I'm sure if you were an OS X user you'd realize how dumb this convo is haha
11:44 <asdfqwerhkjdsafa> I swear
11:44 <asdfqwerhkjdsafa> you're alienating OS X users from your software
11:45 <asdfqwerhkjdsafa> everything's supposed to be easy on macs
11:45 <asdfqwerhkjdsafa> brew install qutebrowser
11:45 <asdfqwerhkjdsafa> vi ~/.qutebrowser or vi ~/.config/qutebrowser/qutebrowser.conf
11:45 <posativ> I've been an OS X user and my ~/ or ~/.config was always full of stuff from different packages.
11:45 <asdfqwerhkjdsafa> that's all I should need to do
11:45 <asdfqwerhkjdsafa> that's all I should need to do
11:46 <asdfqwerhkjdsafa> I can't symlink my dot files everytime I make a change
11:46 <asdfqwerhkjdsafa> this is crazy
11:46 <oed> asdfqwerhkjdsafa: I don't think you understand how symlinks work then
11:46 <asdfqwerhkjdsafa> no I have a special case
11:47 <asdfqwerhkjdsafa> which is still kind of besides the point as well, since I shouldn't _need_ to in the first place
11:48 <asdfqwerhkjdsafa> oh well, you guys will be easier to convice near v1.0 when other OS X users back me up so I don't sound crazy :P
11:48 <The-Compiler> lhynes: what do you think about this? ^
11:50 <asdfqwerhkjdsafa> all I'm saying is you're trying to respect the conventions you're reading about which I fully understand and commend, but it's actually inconsistent for actual users. 
11:55 <The-Compiler> asdfqwerhkjdsafa: the other thing is I'd actually either need to hardcode ~/.config or implement the whole XDG basedir spec *by hand*, because Qt probably doesn't let me say "I'm on OS X but please behave like I'm on Linux"
11:56 <The-Compiler> posativ: also, what do you think would make more sense?
11:57 <posativ> use ~/.qutebrowser because OS X doesn't implement XDG
11:59 <asdfqwerhkjdsafa> works for me
12:00 <asdfqwerhkjdsafa> as much as I hate having tons of files in ~ it seems like the easiest solution
12:00 <The-Compiler> I still want some more opinions on this though - right now it's really questionable for me, and it'd break everything for all existing users
12:01 <The-Compiler> (and no, I don't really want to implement reading from both paths to be honest...)
12:03 <asdfqwerhkjdsafa> actually OS X might implement XDG
12:03 <asdfqwerhkjdsafa> just judging from cmus' docs
12:03 <SmallTock> The-Compiler: Maybe there can be a function to move config from the old location to the new location before loading the browser. That'd stay in for a few weeks or so.
12:06 <lhynes> The-Compiler: ~/Library/preferences is, imo, the domain of a gui apps which write their prefs through a Preferences pane in the gui. They're not the sort of prefs you open with an editor and fiddle with that way.
12:08 <lhynes> I actually view ~/.config/foo/config as being a bit 'non-standard', I would expect qutebrowser to have its config in either ~/.qutebrowserrc or ~/.qutebrowser/config or somesuch.
12:09 <lhynes> (Which is why one of my first questions in here was 'where does the config file get written?'.)
12:16 <The-Compiler> lhynes: then the question is how many people edit the config by hand compared to people who use :set or qute:settings ;)
12:19 <lhynes> The-Compiler: I'm an inveterate config file fiddler. Compulsive, actually. ;) So I favour editing by hand. Except in the case of irssi, which is prone to segfaults if you dick around in the config too much. And honestly, I had very little luck in :set-ting settings from inside qb, which was my first port-of-call (when I couldn't find the config in ~/).
12:24 <lhynes> The-Compiler: For instance `:set editor = mvim -f "{}"` in qb complains 'Unrecognized arguments -f "{}"'. So then I'm trying various incantations to try and get it to work, when it's much simpler to just open the config in vim and change it. Job done.
12:34 <lhynes> The-Compiler: So my vote would be for '~/.qutebrowser/qutebrowserrc' (or qutebrowser.conf) and editing settings by hand primarily.
12:43 <SmallTock> How else would you store config? I'd expect a dotfile
12:43 <lhynes> The-Compiler: I would. Homebrew installs MacVim.app but it still reads from .vimrc.
11:58 <The-Compiler> OS X User hier: Wo würdet ihr config-Dateien unter OS X für eine GUI-Applikation suchen? fdik?
11:58 <The-Compiler> Die OS X API/Doku und Qt sagen ~/Library/Preferences/APPNAME, andere Applikationen nehmen wohl ~/.config/APPNAME oder ~/.APPNAME
11:59 <The-Compiler> aber ein User besteht gerade drauf, dass das sehr untypisch sei, und sonst alles andere Dotfiles verwendet, und qutebrowser das gefälligst auch so machen soll, allen Standards zum Trotz!!11!
12:06 <bhaak>  ~/.config/APPNAME  ist XDG Standard, bzw. das ist der default von $XDG_CONFIG_HOME.
12:07 <bhaak> aber zu behaupten, das sei untypisch, ist doch sehr eigenwillig.
12:30 <The-Compiler> Klar, aber XDG ist IMHO doch nicht wirklich auf OS X anwendbar ;)
12:32 <fdik> The-Compiler: gibt zwei Möglichkeiten
12:32 <fdik> The-Compiler: bei native Mac-Programmen sollte es ~/Library/Preferences/APPNAME sein
12:33 <fdik> The-Compiler: dann erwartet man allerdings auch ein Application Bundle
12:33 <fdik> The-Compiler: sonst Unix-style
12:33 <fdik> The-Compiler: ein Application Bundle wäre jedoch die beste Idee
12:35 <The-Compiler> fdik: und unix-style mit einem .app wär völlig verkehrt? Weil beides will ich nicht wirklich machen :D
12:36 <The-Compiler> Und .app ist geplant, aber die Leute hätten das wohl trotzdem als dotfile erwartet, weil typischerweise von Hand editiert
12:52 <fdik> The-Compiler: files in ~/Library/Preferences/ sind oft Textdateien, XML o.ä.
12:52 <fdik> The-Compiler: aber die Erwartungshaltung ist so, wie die meisten Programme sind.
12:53 <fdik> The-Compiler: und das sind halt Entweder MacOS X Application Bundles mit allem, was dazugehört, oder Unix-Programme
12:53 <fdik> The-Compiler: bei letzterem ist es genau wie bei allen Unix/Linux-Programmen
12:56 <The-Compiler> fdik: okay - wenn ich nun beides distributen will (also auch .app-Bundles, ähnlich wie die .msi's unter Windows), dann wäre ~/.qutebrowser wohl am sinnvollsten? Oder ~/.config/qutebrowser, so XDG-mässig?
12:59 <fdik> The-Compiler: ein App-Bundle hat mit einer .MSI nichts gemein
12:59 <fdik> The-Compiler: und App-Bundle-Benutzer erwarten die Einstellungen wirklich in ~/Library/Preferences/
12:59 <The-Compiler> Bleh. Ich kann ja schlecht beides implementieren :D
12:59 <fdik> The-Compiler: dazu erwartet man, dass wenn man sie löscht, dass die Anwendung dann mit Standardeinstellungen wieder funktioniert
13:00 <fdik> The-Compiler: warum nicht?
13:00 <The-Compiler> fdik: und MacVim/mpv nutzen angeblich auch mit dem .app dotfiles
13:00 <The-Compiler> alles so verwirrend :D
13:01 <The-Compiler> fdik: gut, lesen von beiden Orten wäre nicht das Problem - aber wenn noch nix existiert, habe ich keine Ahnung wie ich herausfinde, ob ich nun als .app laufe oder nicht
13:19 <bhaak> The-Compiler: das ist eh konfus. ein durchschnittlicher OSX-Benutzer editiert seine configs nicht von hand. wo immer die auch liegen :)
13:22 <bhaak> und OSX ist unixoid (auch wenn Apple es eigentlich nicht gerne sieht, wenn du dotfiles nimmst), da sind dotfiles halt ueblich.
13:24 <bhaak> ich wuerde so vorgehen. wenn es einfach zu programmieren ist, zuerst in ~/Library/Preferences schauen, dann dotfile (und wieder dorthin zurueckschreiben). sonst in ~/Library/Preferences schreiben
13:25 <bhaak> und wenn das zu wackelig wird, dann halt nur dotfile benutzen. immerhin bist nachher DU es, der dafuer auch fehlerberichte kriegt. und da ist es halt schon viel einfacher, wenn man nur an einem ort fuer die config schauen muss
@The-Compiler The-Compiler added enhancement component: config Issues related to configuration. labels Dec 19, 2014
@The-Compiler
Copy link
Member Author

This should probably be done together with #499.

@The-Compiler The-Compiler added this to the config revolution milestone Jun 16, 2015
@jadedarko
Copy link

Is there any chance you could reconsider XDG support (Use $XDG_CONFIG_HOME/qutebrowser/ if the environment variable is set, then ~/.config/qutebrowser/ if that folder exists, and finally ~/.qutebrowser/ as the default fallback?)

There is a surprisingly high percentage of OS X users that jump back and forth between linux and OS X, and therefore set XDG_CONFIG_HOME, etc. on OS X so as to have one set of dotfiles for both OSes.

As a prominent example, git honours XDG_CONFIG_HOME on both OSes.

@The-Compiler The-Compiler added the priority: 2 - low Issues which are currently not very important. label Oct 1, 2015
@The-Compiler The-Compiler added the os: macOS Issues which only happen on macOS. label Apr 13, 2016
@illusaen
Copy link

illusaen commented May 2, 2017

So, as a long-time OSX user here, I really don't want you to start putting config files in $HOME. I like them in ~/Library/Preferences, where all my other app config files are.

@sandersantema
Copy link

Not using $home seems really weird to me, all the other projects i've downloaded until now use $home for their config files. For instance bash, zsh, emacs, spacemacs, gem, kwm, mutt, npm and nvm all have their config or config directories in $home. "Normal" apps use ~/Library/Preferences but those are never altered, they're configured using a GUI. Config files in $home are usually named like this ."config name". The dot on the beginning of the file name causes the file to be hidden so if you don't turn on hidden files it won't be visible.

@illusaen
Copy link

illusaen commented Jun 9, 2017

I have other hidden files that I edit often, so I always do ls -al. Having a bunch of extraneous files would be annoying.

@The-Compiler
Copy link
Member Author

I've thought about this some more with the new config. With that, there will be an autoconfig.yml with the settings set via the GUI (:set or qute://settings), and a (optional) config.py which is intended to be written by hand.

  • The config.py will be searched in ~/.qutebrowser/config.py
  • The autoconfig.yml will be searched in ~/Library/Preferences/qutebrowser/qutebrowser.conf

This seems close to what multiple people mentioned about that ~/Library/Preferences are typically used for configurations done via a GUI, and ~/.foo is typically used for Unix-like applications.

I'm not going to implement XDG support for macOS, sorry. The whole "where should a directory go" logic is quite complex already as is. If the color of my bikeshed doesn't match yours, either use the GUI to edit the config, or use --basedir 😉

@The-Compiler The-Compiler moved this from Backlog to Before merge in Config revolution Jul 6, 2017
The-Compiler added a commit that referenced this issue Sep 13, 2017
This doesn't actually migrate things yet.
See #2791, #383.
The-Compiler added a commit that referenced this issue Sep 13, 2017
@The-Compiler
Copy link
Member Author

Done in the new-config branch.

@The-Compiler The-Compiler moved this from Before merge to Done in Config revolution Sep 13, 2017
@trigun539

This comment has been minimized.

@jgkamat

This comment has been minimized.

@The-Compiler
Copy link
Member Author

I'm reconsidering my view on not respecting XDG on macOS - see #5179 for details.

@juanibiapina
Copy link

Thank you for reconsidering XDG on macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: config Issues related to configuration. os: macOS Issues which only happen on macOS. priority: 2 - low Issues which are currently not very important.
Projects
No open projects
Development

No branches or pull requests

7 participants