Nama / swayrst

Restore workspaces in sway to displays and move applications to saved workspaces
MIT License
54 stars 7 forks source link

Changed reference to i3 in file path to sway #1

Closed MNolan147 closed 1 year ago

MNolan147 commented 1 year ago

The file path refers to ~/.config/i3/workspace_. As this script pertains to sway, it should point to ~/.config/sway/workspace_.

Nama commented 1 year ago

Yes, that makes sense. But a lot of people come from i3 and probably never renamed their folder? (at least, I didn't XD)

Maybe a check which exists would be good, but both can exist, too. I'll merge and look for a better solution.

Thank you.

MNolan147 commented 1 year ago

Alright, I'll work on a better solution now.

Nama commented 1 year ago

I can't find anything to output the path to the config with IPC. swaymsg -t get_config outputs the config without any info on the path. No environment variable seem to be set.

This is from the man page, maybe we could check the folders 1-4 and stop at the first existing folder. Since the first ones are all sway folders. I'll probably code that next week, if you don't code till then^^

   sway searches for a config file in the following locations, in this order:

   1.   ~/.sway/config
   2.   $XDG_CONFIG_HOME/sway/config (suggested location)
   3.   ~/.i3/config
   4.   $XDG_CONFIG_HOME/i3/config
   5.   /etc/sway/config
   6.   /etc/i3/config

   If unset, $XDG_CONFIG_HOME defaults to ~/.config.