unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Service implementation for LXQt desktop
@ 2020-09-03  6:41 Reza Alizadeh Majd
  2020-09-07  9:45 ` Ludovic Courtès
  2020-09-28  6:31 ` Reza Alizadeh Majd
  0 siblings, 2 replies; 4+ messages in thread
From: Reza Alizadeh Majd @ 2020-09-03  6:41 UTC (permalink / raw)
  To: guix-devel

Hi Guix, 

working on a service definition for LXQt desktop, I need to perform a
series of default configurations. for example to set the window manager,
prepare default panel, set the default theme, etc.

these configurations should be located $XDG_CONFIG_DIRS so the default
paths are:

/run/current-system/profile/etc/xdg
/home/$USER/.guix-profile/etc/xdg
/home/$USER/.config/

I wanted to use `activation-service-type` to prepare default
configurations in users home directory, but don't know how to access
each user's home directory. 

the other option is to provide default configurations in store and
symlink them in system profile. could anyone help me to do this using
activation snippet? 

this is the service implementation that I'm working on:

--8<---------------cut here---------------start------------->8---
(define-record-type* <lxqt-desktop-configuration>
  lxqt-desktop-configuration make-lxqt-desktop-configuration
  lxqt-desktop-configuration?
  (package lxqt-package (default lxqt-modified-dev)))


(define %lxqt-activation
  #~(begin
      (let* ((conf-dir "DON'T KNOW HOW TO SET PATH FOR PROFILE")
             (session-conf (string-append conf-dir "/session.conf")))
        (use-modules (guix build utils))
        (mkdir-p conf-dir)
        (unless (file-exists? session-conf)
          (call-with-output-file session-conf
            (lambda (port)
              (format port "# Auto Generated by Lxqt Service
[General]
window_manager=openbox")))))))


(define lxqt-desktop-service-type
  (service-type
   (name 'lxqt-desktop)
   (extensions
    (list (service-extension profile-service-type
                             (compose list lxqt))))
          (service-extension activation-service-type
                             (const %lxqt-activation))
   (default-value (lxqt-desktop-configuration))
   (description "Run the LXQt desktop environment.")))

--8<---------------cut here---------------end--------------->8---

Kind regards,
Reza

-- 
Reza Alizadeh Majd
PantherX Team
https://www.pantherx.org/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Service implementation for LXQt desktop
  2020-09-03  6:41 Service implementation for LXQt desktop Reza Alizadeh Majd
@ 2020-09-07  9:45 ` Ludovic Courtès
  2020-09-07 11:00   ` Reza Alizadeh Majd
  2020-09-28  6:31 ` Reza Alizadeh Majd
  1 sibling, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2020-09-07  9:45 UTC (permalink / raw)
  To: Reza Alizadeh Majd; +Cc: guix-devel

Hi Reza,

Reza Alizadeh Majd <r.majd@pantherx.org> skribis:

> working on a service definition for LXQt desktop, I need to perform a
> series of default configurations. for example to set the window manager,
> prepare default panel, set the default theme, etc.
>
> these configurations should be located $XDG_CONFIG_DIRS so the default
> paths are:
>
> /run/current-system/profile/etc/xdg
> /home/$USER/.guix-profile/etc/xdg
> /home/$USER/.config/
>
> I wanted to use `activation-service-type` to prepare default
> configurations in users home directory, but don't know how to access
> each user's home directory. 

Instead of accessing each users’s home directory, I strongly recommend
adding a new “skeleton”: a set of files that are automatically added to
new home directories when a new user account shows up.

To do that, the lxqt service can extend ‘account-service-type’ with new
skeletons.  I can’t find an example of that but let us know if it’s
harder than it seems!

Thanks,
Ludo’.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Service implementation for LXQt desktop
  2020-09-07  9:45 ` Ludovic Courtès
@ 2020-09-07 11:00   ` Reza Alizadeh Majd
  0 siblings, 0 replies; 4+ messages in thread
From: Reza Alizadeh Majd @ 2020-09-07 11:00 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Hi Ludovic,

On Mon, 07 Sep 2020 11:45:01 +0200
Ludovic Courtès <ludo@gnu.org> wrote:

> Instead of accessing each users’s home directory, I strongly recommend
> adding a new “skeleton”: a set of files that are automatically added
> to new home directories when a new user account shows up.

as I know, skeletons only apply on new home directories, and for
example if an existing user wants to switch from XFCE to LXQt desktop,
related skeleton files wont be applied on their home directory.

> To do that, the lxqt service can extend ‘account-service-type’ with
> new skeletons.  I can’t find an example of that but let us know if
> it’s harder than it seems!

as I understand from the documents, `account-service-type` extension
returns a list of `user-account` and `user-group` records. I also
didn't find any reference related to ad skeletons to `user-account`.



a solution that I was thinking of was to add these configurations, to
the related `$XDG_CONFIG_DIRS` path in system profile located in
`/run/current-system/profile/etc/xdg/...` just don't know which service
extension I should extend for this purpose. 

Thanks,
Reza

-- 
Reza Alizadeh Majd
PantherX Team
https://www.pantherx.org/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Service implementation for LXQt desktop
  2020-09-03  6:41 Service implementation for LXQt desktop Reza Alizadeh Majd
  2020-09-07  9:45 ` Ludovic Courtès
@ 2020-09-28  6:31 ` Reza Alizadeh Majd
  1 sibling, 0 replies; 4+ messages in thread
From: Reza Alizadeh Majd @ 2020-09-28  6:31 UTC (permalink / raw)
  To: guix-devel

On Thu, 3 Sep 2020 11:11:42 +0430
Reza Alizadeh Majd <r.majd@pantherx.org> wrote:

> Hi Guix, 
> 
> working on a service definition for LXQt desktop, I need to perform a
> series of default configurations. for example to set the window
> manager, prepare default panel, set the default theme, etc.
> 
> these configurations should be located $XDG_CONFIG_DIRS so the default
> paths are:
> 
> /run/current-system/profile/etc/xdg
> /home/$USER/.guix-profile/etc/xdg
> /home/$USER/.config/
> 
> I wanted to use `activation-service-type` to prepare default
> configurations in users home directory, but don't know how to access
> each user's home directory. 
> 
> the other option is to provide default configurations in store and
> symlink them in system profile. could anyone help me to do this using
> activation snippet? 
> 
> this is the service implementation that I'm working on:
> 
> --8<---------------cut here---------------start------------->8---
> (define-record-type* <lxqt-desktop-configuration>
>   lxqt-desktop-configuration make-lxqt-desktop-configuration
>   lxqt-desktop-configuration?
>   (package lxqt-package (default lxqt-modified-dev)))
> 
> 
> (define %lxqt-activation
>   #~(begin
>       (let* ((conf-dir "DON'T KNOW HOW TO SET PATH FOR PROFILE")
>              (session-conf (string-append conf-dir "/session.conf")))
>         (use-modules (guix build utils))
>         (mkdir-p conf-dir)
>         (unless (file-exists? session-conf)
>           (call-with-output-file session-conf
>             (lambda (port)
>               (format port "# Auto Generated by Lxqt Service
> [General]
> window_manager=openbox")))))))
> 
> 
> (define lxqt-desktop-service-type
>   (service-type
>    (name 'lxqt-desktop)
>    (extensions
>     (list (service-extension profile-service-type
>                              (compose list lxqt))))
>           (service-extension activation-service-type
>                              (const %lxqt-activation))
>    (default-value (lxqt-desktop-configuration))
>    (description "Run the LXQt desktop environment.")))
> 
> --8<---------------cut here---------------end--------------->8---
> 
> Kind regards,
> Reza
> 

does anyone have any suggestion about this initial configurations for a
new desktop service (LXQt)? 

check the other desktop services, I didn't find any reference about
this type of initial configurations in service definitions, is this
type of modifications need to be applied on package definition instead?

Regards,
Reza

-- 
Reza Alizadeh Majd
PantherX Team
https://www.pantherx.org/


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-28  6:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03  6:41 Service implementation for LXQt desktop Reza Alizadeh Majd
2020-09-07  9:45 ` Ludovic Courtès
2020-09-07 11:00   ` Reza Alizadeh Majd
2020-09-28  6:31 ` Reza Alizadeh Majd

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).