help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

display manager doesn't read ~/.xsession when it is a symlink


From: Rodrigo Morales
Subject: display manager doesn't read ~/.xsession when it is a symlink
Date: Fri, 17 Mar 2023 15:18:29 -0500

Table of Contents
_________________

1. The context
2. The problem
3. The question
4. Appendix


1 The context
=============

  I'm using the [display manager]/[login manager] that is bundled with
  GUIX by default.

  Consider the following `~/.xsession' file.

  ,----
  | cat ~/.xsession
  `----

  ,----
  | # Map Caps Lock to Ctrl
  | setxkbmap -option 'ctrl:nocaps' -layout us
  | # Start Emacs using the exwm script
  | exwm
  `----

  I've noticed that when `~/.xsession' doesn't have execute permissions
  (see code block below) and when I try to log in to my account through
  the display manager, the display manager is shown again (i.e. the
  window manager is not started).

  ,----
  | ls -l ~/.xsession
  `----

  ,----
  | -rw-r--r-- 1 rdrg users 108 Mar 17 14:34 /home/rdrg/.xsession
  `----

  When the file has execute permissions (see code block below) and when
  I log in to my account through the display manager, the window manager
  is started. So, I conclude that `~/.xsession' requires execute
  permissions.

  ,----
  | chmod +x ~/.xsession
  | ls -l ~/.xsession
  `----

  ,----
  | -rwxr-xr-x 1 rdrg users 108 Mar 17 14:34 /home/rdrg/.xsession
  `----


2 The problem
=============

  I have created `~/my/guix-config/xdg/xsession' in `~/my/guix-config/',
  which is the directory that contains a git repo with all my
  configurations (see file structure below).

  ,----
  | find ~/my/guix-config ! -path '*/.git/*' | tree -a --fromfile
  `----

  ,----
  | .
  | └── home
  |     └── rdrg
  |         └── my
  |             └── guix-config
  |                 ├── fontconfig
  |                 │   └── fonts.conf
  |                 ├── .git
  |                 ├── home-configuration.scm
  |                 ├── mpv
  |                 │   ├── input.conf
  |                 │   └── mpv.conf
  |                 ├── rime
  |                 │   └── default.custom.yaml
  |                 ├── tmux
  |                 │   └── tmux.conf
  |                 ├── xdg
  |                 │   ├── defaults.list
  |                 │   ├── emacsclient-open-file.desktop
  |                 │   ├── inkscape.desktop
  |                 │   ├── mpv.desktop
  |                 │   ├── okular.desktop
  |                 │   ├── xsession
  |                 │   └── zathura.desktop
  |                 └── zathura
  |                     └── zathurarc
  |
  | 11 directories, 15 files
  `----

  The file `~/my/guix-config/xdg/xsession' has the same content as the
  file shown in the first section and it has execute permissions.

  ,----
  | cat ~/my/guix-config/xdg/xsession
  `----

  ,----
  | # Map Caps Lock to Ctrl
  | setxkbmap -option 'ctrl:nocaps' -layout us
  | # Start Emacs using the exwm script
  | exwm
  `----

  ,----
  | ls -l ~/my/guix-config/xdg/xsession
  `----

  ,----
  | -rwxr-xr-x 1 rdrg users 108 Mar 17 15:07
/home/rdrg/my/guix-config/xdg/xsession
  `----

  I've symlinked `~/my/guix-config/xdg/xsession' to `~/.xsession' by
  using the following instruction in
  `~/my/guix-config/home-configuration.scm' (see appendix for my
  complete configuration)

  ,----
  | (... some omitted lines ...)
  |    (service
  |     home-files-service-type
  |     `((".xsession"
  |        ,(local-file "xdg/xsession"))
  | (... some omitted lines ...)
  | #+END_SRC scheme
  |
  | I use the following command to create symbolic links from =$HOME= to my
git repo.
  |
  | #+BEGIN_SRC sh
  | guix home reconfigure ~/my/guix-config/home-configuration.scm
  `----

  After completion of `guix home reconfigure', the file `~/.xsession' is
  a symbolic link.

  ,----
  | ls -l ~/.xsession
  `----

  ,----
  | lrwxrwxrwx 1 rdrg users 52 Mar 17 14:47 /home/rdrg/.xsession ->
/gnu/store/hs5d7dkq6ywzd062yg4dcqfx5v0wa7dj-xsession
  `----

  The problem is that when I try to log in through the display manager,
  I'm redirected again to the display manager (the same behavior
  described above when `~/.xsession' is a regular file and doesn't have
  execute permissions).


3 The question
==============

  Is it possible for the display manager correctly execute `~/.xsession'
  even when it is a symbolic link?

  I need to do this because I use `guix home reconfigure
  ~/my/guix-config/home-configuration.scm' to configure my `$HOME', so
  `~/.xsession' is a symbolic link.


4 Appendix
==========

  ,----
  | cat ~/my/guix-config/home-configuration.scm
  `----

  ,----
  | ;; This "home-environment" file can be passed to 'guix home reconfigure'
  | ;; to reproduce the content of your profile.  This is "symbolic": it
only
  | ;; specifies package names.  To reproduce the exact same profile, you
also
  | ;; need to capture the channels being used, as returned by "guix
describe".
  | ;; See the "Replicating Guix" section in the manual.
  |
  | (use-modules (gnu home)
  |              (gnu packages)
  |              (gnu services)
  |              (guix gexp)
  |              (gnu home services)
  |              (gnu home services shells)
  |              (gnu home services ssh)
  |              ;; zathura
  |              ;; zathura-pdf-mupdf
  |              ;; xournalpp
  |              (gnu packages pdf)
  |              ;; okular
  |              (gnu packages kde)
  |              ;; inkscape
  |              (gnu packages inkscape)
  |              ;; git
  |              (gnu packages version-control)
  |              ;; libreoffice
  |              (gnu packages libreoffice)
  |              ;; mpv
  |              (gnu packages video)
  |              ;; audacity
  |              (gnu packages audio)
  |              ;; ripgrep
  |              (gnu packages rust-apps)
  |              ;; tmux
  |              (gnu packages tmux)
  |              ;; xdg-utils
  |              (gnu packages freedesktop)
  |              ;; font-misc-misc
  |              (gnu packages xorg)
  |              ;; rsync
  |              (gnu packages rsync)
  |              ;; tree
  |              (gnu packages admin)
  |              ;; emacs-rime
  |              (gnu packages emacs-xyz)
  |              ;; xcape
  |              (gnu packages xdisorg))
  |
  | (home-environment
  |  ;; Below is the list of packages that will show up in your
  |  ;; Home profile, under ~/.guix-home/profile.
  |  (packages
  |   (list
  |    git
  |    okular
  |    tree
  |    xdg-utils
  |    font-misc-misc
  |    zathura
  |    zathura-pdf-mupdf
  |    tmux
  |    inkscape
  |    xournalpp
  |    libreoffice
  |    mpv
  |    audacity
  |    ;; Transfer files between systems. Both the host and the
  |    ;; destination must have rsync installed in order transfer files
  |    ;; mutually.
  |    rsync
  |    ripgrep
  |    setxkbmap
  |    xcape
  |    emacs-rime))
  |  ;; Below is the list of Home services.  To search for available
  |  ;; services, run 'guix home search KEYWORD' in a terminal.
  |  (services
  |   (list
  |    (simple-service
  |     'some-useful-env-vars-service
  |     home-environment-variables-service-type
  |     '(("EDITOR" . "emacsclient")))
  |    (service
  |     home-openssh-service-type
  |     (home-openssh-configuration
  |      (hosts
  |       (list
  |        (openssh-host
  |         (name "desktop")
  |         (host-name "192.168.1.35")
  |         (user "beep1560")
  |         (port 22))))))
  |    (service
  |     home-bash-service-type
  |     (home-bash-configuration
  |      (aliases
  |       '(("grep" . "grep --color=auto")
  |         ("ll" . "ls -l")
  |         ("ls" . "ls -p --color=auto")
  |         ("d" . "cd ~/Downloads")))))
  |    (service
  |     home-files-service-type
  |     `((".xsession"
  |        ,(local-file "xdg/xsession"))
  |       (".local/share/applications/defaults.list"
  |        ,(local-file "xdg/defaults.list"))
  |       (".local/share/applications/emacsclient-open-file.desktop"
  |        ,(local-file "xdg/emacsclient-open-file.desktop"))
  |       (".local/share/applications/inkscape.desktop"
  |        ,(local-file "xdg/inkscape.desktop"))
  |       (".local/share/applications/okular.desktop"
  |        ,(local-file "xdg/okular.desktop"))
  |       (".local/share/applications/zathura.desktop"
  |        ,(local-file "xdg/zathura.desktop"))
  |       (".local/share/applications/mpv.desktop"
  |        ,(local-file "xdg/mpv.desktop"))))
  |    (service
  |     home-xdg-configuration-files-service-type
  |     `(("tmux/tmux.conf"
  |        ,(local-file "tmux/tmux.conf"))
  |       ("ibus/rime/default.custom.yaml"
  |        ,(local-file "rime/default.custom.yaml"))
  |       ("mpv/mpv.conf"
  |        ,(local-file "mpv/mpv.conf"))
  |       ("mpv/input.conf"
  |        ,(local-file "mpv/input.conf"))
  |       ("zathura/zathurarc"
  |        ,(local-file "zathura/zathurarc")))))))
  `----


reply via email to

[Prev in Thread] Current Thread [Next in Thread]