[PATCH] Add ~/.stumpwm.d/config as an init-file option

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Add ~/.stumpwm.d/config as an init-file option

Edward Trumbo
It seems to me now that we have a commonly used $HOME/.stumpwm.d
directory, we could be using it for our init file(s) as well.

stumpwm.lisp starts out with the not-well-publicized "load-rc-file"
function, which currently gives us three options for placing and
locating StumpWM's init: an XDG-style $HOME/config/stumpwm/config, the
$HOME/.stumpwmrc we're all familiar with, and a system-wide
/etc/stumpwmrc. The obvious option is being overlooked.

Maybe I just like my $HOME to be as neat as I can make it, or I like to
keep related things all in the same place. Anyway, I've just applied
this trivial patch and it's working for me. To the options listed above,
it adds a "dir-rc" pointing to $HOME/.stumpwm.d/config.

---
 stumpwm.lisp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/stumpwm.lisp b/stumpwm.lisp
index 0a38fef..323d76a 100644
--- a/stumpwm.lisp
+++ b/stumpwm.lisp
@@ -43,10 +43,12 @@ further up. "
                  dir)))
          (user-rc
            (probe-file (merge-pathnames #p".stumpwmrc" (user-homedir-pathname))))
+         (dir-rc
+           (probe-file (merge-pathnames #p".stumpwm.d/config" (user-homedir-pathname))))
          (conf-rc
            (probe-file (merge-pathnames #p"stumpwm/config" xdg-config-dir)))
          (etc-rc (probe-file #p"/etc/stumpwmrc"))
-         (rc (or user-rc conf-rc etc-rc)))
+         (rc (or user-rc dir-rc conf-rc etc-rc)))
     (if rc
         (if catch-errors
             (handler-case (load rc)
--
1.8.4


--
Edward Trumbo

"In Emacs Veritas."



_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add ~/.stumpwm.d/config as an init-file option

J David Smith
In my opinion, ~/.stumpwm.d/init.lisp would be a better location (to better match with the ~/.emacs.d/init.el).

Other than that, great idea. +1

 - J David Smith

Edward Trumbo <[hidden email]> writes:

> It seems to me now that we have a commonly used $HOME/.stumpwm.d
> directory, we could be using it for our init file(s) as well.
>
> stumpwm.lisp starts out with the not-well-publicized "load-rc-file"
> function, which currently gives us three options for placing and
> locating StumpWM's init: an XDG-style $HOME/config/stumpwm/config, the
> $HOME/.stumpwmrc we're all familiar with, and a system-wide
> /etc/stumpwmrc. The obvious option is being overlooked.
>
> Maybe I just like my $HOME to be as neat as I can make it, or I like to
> keep related things all in the same place. Anyway, I've just applied
> this trivial patch and it's working for me. To the options listed above,
> it adds a "dir-rc" pointing to $HOME/.stumpwm.d/config.
>
> ---
>  stumpwm.lisp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/stumpwm.lisp b/stumpwm.lisp
> index 0a38fef..323d76a 100644
> --- a/stumpwm.lisp
> +++ b/stumpwm.lisp
> @@ -43,10 +43,12 @@ further up. "
>                   dir)))
>           (user-rc
>             (probe-file (merge-pathnames #p".stumpwmrc" (user-homedir-pathname))))
> +         (dir-rc
> +           (probe-file (merge-pathnames #p".stumpwm.d/config" (user-homedir-pathname))))
>           (conf-rc
>             (probe-file (merge-pathnames #p"stumpwm/config" xdg-config-dir)))
>           (etc-rc (probe-file #p"/etc/stumpwmrc"))
> -         (rc (or user-rc conf-rc etc-rc)))
> +         (rc (or user-rc dir-rc conf-rc etc-rc)))
>      (if rc
>          (if catch-errors
>              (handler-case (load rc)
> --
> 1.8.4

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add ~/.stumpwm.d/config as an init-file option

Edward Trumbo
Thanks, and I agree ~/.stumpwm.d/init.lisp would be better.

--
Edward Trumbo

"In Emacs Veritas."


J David Smith <[hidden email]> writes:

> In my opinion, ~/.stumpwm.d/init.lisp would be a better location (to better match with the ~/.emacs.d/init.el).
>
> Other than that, great idea. +1
>
>  - J David Smith
>
> Edward Trumbo <[hidden email]> writes:
>
>> It seems to me now that we have a commonly used $HOME/.stumpwm.d
>> directory, we could be using it for our init file(s) as well.
>>
>> stumpwm.lisp starts out with the not-well-publicized "load-rc-file"
>> function, which currently gives us three options for placing and
>> locating StumpWM's init: an XDG-style $HOME/config/stumpwm/config, the
>> $HOME/.stumpwmrc we're all familiar with, and a system-wide
>> /etc/stumpwmrc. The obvious option is being overlooked.
>>
>> Maybe I just like my $HOME to be as neat as I can make it, or I like to
>> keep related things all in the same place. Anyway, I've just applied
>> this trivial patch and it's working for me. To the options listed above,
>> it adds a "dir-rc" pointing to $HOME/.stumpwm.d/config.
>>
>> ---
>>  stumpwm.lisp | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/stumpwm.lisp b/stumpwm.lisp
>> index 0a38fef..323d76a 100644
>> --- a/stumpwm.lisp
>> +++ b/stumpwm.lisp
>> @@ -43,10 +43,12 @@ further up. "
>>                   dir)))
>>           (user-rc
>>             (probe-file (merge-pathnames #p".stumpwmrc" (user-homedir-pathname))))
>> +         (dir-rc
>> +           (probe-file (merge-pathnames #p".stumpwm.d/config" (user-homedir-pathname))))
>>           (conf-rc
>>             (probe-file (merge-pathnames #p"stumpwm/config" xdg-config-dir)))
>>           (etc-rc (probe-file #p"/etc/stumpwmrc"))
>> -         (rc (or user-rc conf-rc etc-rc)))
>> +         (rc (or user-rc dir-rc conf-rc etc-rc)))
>>      (if rc
>>          (if catch-errors
>>              (handler-case (load rc)
>> --
>> 1.8.4

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add ~/.stumpwm.d/config as an init-file option

Edward Trumbo
In reply to this post by Edward Trumbo
This is a revised version of my patch, incorporating J David Smith's
suggestion to use the more Lispy/Emacsey "~/.stumpwm.d/init.lisp" as the
option for an init file.

On a related note, I'd like to see the options for init-file placement
get more "press". Our documentation (Info/Wiki/etc.) doesn't mention
this anywhere, to my knowledge. I'd like to amend the relevant section
of the wiki with some references to it, and possibly even add a page in
the manual. First, I think we should see whether this patch merits
inclusion in the code base.

---
 stumpwm.lisp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/stumpwm.lisp b/stumpwm.lisp
index 0a38fef..dd13023 100644
--- a/stumpwm.lisp
+++ b/stumpwm.lisp
@@ -43,10 +43,12 @@ further up. "
                  dir)))
          (user-rc
            (probe-file (merge-pathnames #p".stumpwmrc" (user-homedir-pathname))))
+         (dir-rc
+           (probe-file (merge-pathnames #p".stumpwm.d/init.lisp" (user-homedir-pathname))))
          (conf-rc
            (probe-file (merge-pathnames #p"stumpwm/config" xdg-config-dir)))
          (etc-rc (probe-file #p"/etc/stumpwmrc"))
-         (rc (or user-rc conf-rc etc-rc)))
+         (rc (or user-rc dir-rc conf-rc etc-rc)))
     (if rc
         (if catch-errors
             (handler-case (load rc)
--
1.8.4


--
Edward Trumbo

"In Emacs Veritas."


Edward Trumbo <[hidden email]> writes:

> Thanks, and I agree ~/.stumpwm.d/init.lisp would be better.

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add ~/.stumpwm.d/config as an init-file option

David Bjergaard
Pull requests welcome! I'll merge this patch when I get a chance.  

    Dave

Edward Trumbo <[hidden email]> writes:

> This is a revised version of my patch, incorporating J David Smith's
> suggestion to use the more Lispy/Emacsey "~/.stumpwm.d/init.lisp" as the
> option for an init file.
>
> On a related note, I'd like to see the options for init-file placement
> get more "press". Our documentation (Info/Wiki/etc.) doesn't mention
> this anywhere, to my knowledge. I'd like to amend the relevant section
> of the wiki with some references to it, and possibly even add a page in
> the manual. First, I think we should see whether this patch merits
> inclusion in the code base.
>
> ---
>  stumpwm.lisp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/stumpwm.lisp b/stumpwm.lisp
> index 0a38fef..dd13023 100644
> --- a/stumpwm.lisp
> +++ b/stumpwm.lisp
> @@ -43,10 +43,12 @@ further up. "
>                   dir)))
>           (user-rc
>             (probe-file (merge-pathnames #p".stumpwmrc" (user-homedir-pathname))))
> +         (dir-rc
> +           (probe-file (merge-pathnames #p".stumpwm.d/init.lisp" (user-homedir-pathname))))
>           (conf-rc
>             (probe-file (merge-pathnames #p"stumpwm/config" xdg-config-dir)))
>           (etc-rc (probe-file #p"/etc/stumpwmrc"))
> -         (rc (or user-rc conf-rc etc-rc)))
> +         (rc (or user-rc dir-rc conf-rc etc-rc)))
>      (if rc
>          (if catch-errors
>              (handler-case (load rc)
> --
> 1.8.4

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add ~/.stumpwm.d/config as an init-file option

Edward Trumbo
In reply to this post by Edward Trumbo
Thank you. I've created a fork and pull request and I look forward to
any discussion or its acceptance.

Please be patient with me. Until yesterday my Git experience was limited
to clones and pulls, and today I'm hip-deep in checkouts, forks,
commits, and several other things I've already forgotten in the past
hour. After confronting Git, I don't know whether to give up beer or
drink more of it. ;-)

--
Edward Trumbo

"In Emacs Veritas."


David Bjergaard <[hidden email]> writes:

> Pull requests welcome! I'll merge this patch when I get a chance.  
>
>     Dave
>
> Edward Trumbo <[hidden email]> writes:
>
>> This is a revised version of my patch, incorporating J David Smith's
>> suggestion to use the more Lispy/Emacsey "~/.stumpwm.d/init.lisp" as the
>> option for an init file.
>>
>> On a related note, I'd like to see the options for init-file placement
>> get more "press". Our documentation (Info/Wiki/etc.) doesn't mention
>> this anywhere, to my knowledge. I'd like to amend the relevant section
>> of the wiki with some references to it, and possibly even add a page in
>> the manual. First, I think we should see whether this patch merits
>> inclusion in the code base.
>>
>> ---
>>  stumpwm.lisp | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/stumpwm.lisp b/stumpwm.lisp
>> index 0a38fef..dd13023 100644
>> --- a/stumpwm.lisp
>> +++ b/stumpwm.lisp
>> @@ -43,10 +43,12 @@ further up. "
>>                   dir)))
>>           (user-rc
>>             (probe-file (merge-pathnames #p".stumpwmrc" (user-homedir-pathname))))
>> +         (dir-rc
>> +           (probe-file (merge-pathnames #p".stumpwm.d/init.lisp" (user-homedir-pathname))))
>>           (conf-rc
>>             (probe-file (merge-pathnames #p"stumpwm/config" xdg-config-dir)))
>>           (etc-rc (probe-file #p"/etc/stumpwmrc"))
>> -         (rc (or user-rc conf-rc etc-rc)))
>> +         (rc (or user-rc dir-rc conf-rc etc-rc)))
>>      (if rc
>>          (if catch-errors
>>              (handler-case (load rc)
>> --
>> 1.8.4

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add ~/.stumpwm.d/config as an init-file option

David Bjergaard
Always drink more ;).  I'm more than happy to merge patches too, its
just soo much easier with a PR.  I was more referring to your suggestion
of adding the documentation to the manual/wiki.  The wiki is super easy
to edit.  The manual less so. At a minimum opening an issue with a
description of what needs to be added is enough.

Cheers,

    Dave

Edward Trumbo <[hidden email]> writes:

> Thank you. I've created a fork and pull request and I look forward to
> any discussion or its acceptance.
>
> Please be patient with me. Until yesterday my Git experience was limited
> to clones and pulls, and today I'm hip-deep in checkouts, forks,
> commits, and several other things I've already forgotten in the past
> hour. After confronting Git, I don't know whether to give up beer or
> drink more of it. ;-)

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add ~/.stumpwm.d/config as an init-file option

Edward Trumbo
Thanks for the quick acceptance! I'll update the wiki with some
reference to the different init file styles soon, and I'll open an issue
to discuss the manual.

--
Edward Trumbo

"In Emacs Veritas."


David Bjergaard <[hidden email]> writes:

> Always drink more ;).  I'm more than happy to merge patches too, its
> just soo much easier with a PR.  I was more referring to your suggestion
> of adding the documentation to the manual/wiki.  The wiki is super easy
> to edit.  The manual less so. At a minimum opening an issue with a
> description of what needs to be added is enough.
>
> Cheers,
>
>     Dave
>
> Edward Trumbo <[hidden email]> writes:
>
>> Thank you. I've created a fork and pull request and I look forward to
>> any discussion or its acceptance.
>>
>> Please be patient with me. Until yesterday my Git experience was limited
>> to clones and pulls, and today I'm hip-deep in checkouts, forks,
>> commits, and several other things I've already forgotten in the past
>> hour. After confronting Git, I don't know whether to give up beer or
>> drink more of it. ;-)

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add ~/.stumpwm.d/config as an init-file option

Stefan Reichör
Hi Edward,

do you have a pointer with the required steps for your pull request?

Would be great to have this information (all needed git commands)
somewhere in a visible place.

I have some minor improvements for stumpwm. Would be nice to push them
upstream as well ;-)

Stefan.

> Thanks for the quick acceptance! I'll update the wiki with some
> reference to the different init file styles soon, and I'll open an issue
> to discuss the manual.

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add ~/.stumpwm.d/config as an init-file option

Edward Trumbo
Hi Stefan,

I wish I could be more help, but everything I just did I pieced together
from StumpWM's Info manual (Hacking/Using Git...) and Github's own help
pages. In short, I'm not the right person to ask.

--
Edward Trumbo

"In Emacs Veritas."


Stefan Reichör <[hidden email]> writes:

> Hi Edward,
>
> do you have a pointer with the required steps for your pull request?
>
> Would be great to have this information (all needed git commands)
> somewhere in a visible place.
>
> I have some minor improvements for stumpwm. Would be nice to push them
> upstream as well ;-)
>
> Stefan.
>
>> Thanks for the quick acceptance! I'll update the wiki with some
>> reference to the different init file styles soon, and I'll open an issue
>> to discuss the manual.

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add ~/.stumpwm.d/config as an init-file option

David Bjergaard
In reply to this post by Stefan Reichör
Hi Stefan,

I'm sorry this isn't better documented.  I think the easiest way is:
1. Fork stumpwm to your account (this is different from cloning!)
2. Hack whatever changes you need
3. Open github.com/stumpwm/stumpwm
4. Click on the pull requests button
5. On this page it will show open PR for stumpwm, click "New pull request"
6. Then on the new page select "compare across forks"
7. Make stumpwm/stumpwm the base fork, and the base branch "master"
8. Make the head fork your-username/stumpwm and the branch whatever
   branch your submitting from (probably also master)
9. Then you should see a diff and be able to create the pull request
   with a description.
   
Let me know if you have any trouble.  If these instructions are clear
enough feel free to copy them to the wiki.

    Dave

Stefan Reichör <[hidden email]> writes:

> Hi Edward,
>
> do you have a pointer with the required steps for your pull request?
>
> Would be great to have this information (all needed git commands)
> somewhere in a visible place.
>
> I have some minor improvements for stumpwm. Would be nice to push them
> upstream as well ;-)
>
> Stefan.
>
>> Thanks for the quick acceptance! I'll update the wiki with some
>> reference to the different init file styles soon, and I'll open an issue
>> to discuss the manual.

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel