yorukot / superfile

Pretty fancy and modern terminal file manager
https://superfile.netlify.app
MIT License
5.69k stars 126 forks source link

custom config file not working on mac #120

Closed mactanxin closed 3 months ago

mactanxin commented 4 months ago

Describe the bug A clear and concise description of what the bug is. Installed from homebrew. After install, there's no ~/.config/superfile/config.toml or even the ~/.config/superfile/ folder.

I created the folder with mkdir -p ~/.config/superfile/, then touch & edited the config.toml followed from Tutorial, Themes section, nothting changed.

then I found ~/Library/Application\ Support/superfile/ folder and after edit config files it works.

Expected behavior generate config files in ~/.config/superfile folder and overwrite the default ones.

Screenshots If applicable, add screenshots to help explain your problem.

System information (please complete the following information):

yorukot commented 4 months ago

https://github.com/adrg/xdg

So it's not technically a bug I think the documentation needs to be updated..

image I actually update this in next version to make it easier for users to find the config file location.

albinabc commented 4 months ago

Was also expecting to user .config folder. But for me even the Application Support folder doesn't seem to work. Tried with both creating the folder /superfile and putting the config.toml / hotkeys.toml directly in the Application Support folder. Any suggestions? Can't run spl pl either, just gets me into superfile with "pl" as a search term.

yorukot commented 4 months ago

You should be running v1.1.2 v1.1.2 does not have this feature :(

albinabc commented 4 months ago

Ahh. Tested building from source now instead, and now the pl command works, and I can get the config path. However, one thing I'm noticing is that if I try to copy the path and paste for just opening in an editor, it doesn't find the config file because it doesn't escape the space in the "Application Support". However since it seemed to work for OP I guess that's not the culprit here...

albinabc commented 4 months ago

I tried updating the config path in the src and rebuilding, to see if I could put the config files in the .config/superfile folder instead. But that doesn't seem to work either. Not really getting those hotkeys, and can't get a theme to apply either.

A note, do I need to put themes like "catppuccin-latte" in the superfile/theme folder to be able to use it, or should it be available to begin with?

image

Note, running macOS 14.3 (23D56)

yorukot commented 4 months ago

@albinabc Are you using the current branch version? If so, you can try changing the data in /src/config/fixed_variable.go.

albinabc commented 4 months ago

Just updated to try, did the config in /src/config/fixed_variable.go as you mentioned, rebuilt and moved the executable (to a non-privileged folder and running from there instead), but no difference. So what I'm testing to check if it has applied if I close the application with q (I'm using the vim hotkeys file) and also if the theme specified in config.toml has applied. Nothing seems to apply, and as the screenshot in my previous message, the path looks right after running spf pl. The command spf eh yields nothing, is that expected?

yorukot commented 4 months ago

Would you like to send your fixed_variable.go because I tested that it changes after updating it.

// ...

var HomeDir = xdg.Home
var SuperFileMainDir = "/home/nightcat/Documents/code/superfile" + "/superfile"
var SuperFileCacheDir = xdg.CacheHome + "/superfile"
var SuperFileDataDir = xdg.DataHome + "/superfile"
var SuperFileStateDir = xdg.StateHome + "/superfile"

// ...
albinabc commented 4 months ago
var HomeDir = xdg.Home
var SuperFileMainDir =  "~/.config/superfile"
var SuperFileCacheDir =  "~/.config/superfile"
var SuperFileDataDir =  "~/.config/superfile"
var SuperFileStateDir = "~/.config/superfile"

And also

var (
    ThemeFoldera      string = SuperFileMainDir + "/theme"
    LastCheckVersiona string = SuperFileDataDir + "/lastCheckVersion"
    ThemeFileVersiona string = SuperFileDataDir + "/themeFileVersion"
    FirstUseChecka    string = SuperFileDataDir + "/firstUseCheck"
    PinnedFilea       string = SuperFileDataDir + "/pinned.json"
    ConfigFilea       string = SuperFileMainDir + "/config.toml"
    HotkeysFilea      string = SuperFileMainDir + "/hotkeys.toml"
    ToggleDotFilea    string = SuperFileDataDir + "/toggleDotFile"
    LogFilea          string = SuperFileStateDir + "/superfile.log"
)

And yes this seems to apply, before I had updated it to .config/superfile I got the Application Support folder outputted from spf pl. The thing is that it doesn't seem to matter, because in neither case I can get any configuration/hotkeys to load.

yorukot commented 4 months ago

I tested it a little bit and I probably know why, you should use full paths instead of relative paths (~).

albinabc commented 4 months ago

Heyy that works! I guess it's still a mystery as to why the original XDG path did not work for me, because then I hadn't fiddled with the paths or anything. But it's a viable workaround, thanks for the help!