xinitrc is not working for multiple environments #124

Closed
opened 2018-05-26 14:05:49 +00:00 by philm · 8 comments
philm commented 2018-05-26 14:05:49 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: Chrysostomus

The current version of xinitrc that uses the get_session function is meant to allow easily switching between desktop environments from tty. It does not do what it is supposed to. This one works:

https://github.com/manjaro/desktop-settings/blob/master/community/bspwm/skel/.xinitrc

It does not interfere with displaymanagers or autologin, and if you run startx <name_of_environment it starts the desired environment as it is supposed to.

If anyone doesn't have anything against it, I'll be fixing it for different editions.

@oberon2007 @philmmanjaro @Ste74

*Created by: Chrysostomus* The current version of xinitrc that uses the get_session function is meant to allow easily switching between desktop environments from tty. It does not do what it is supposed to. This one works: https://github.com/manjaro/desktop-settings/blob/master/community/bspwm/skel/.xinitrc It does not interfere with displaymanagers or autologin, and if you run `startx <name_of_environment` it starts the desired environment as it is supposed to. If anyone doesn't have anything against it, I'll be fixing it for different editions. @oberon2007 @philmmanjaro @Ste74
PRESFIL commented 2020-07-19 08:44:42 +00:00 (Migrated from gitlab2.manjaro.org)

I have the same problem under manjaro-i3-community. Maybe you are an old ticket, or you missed it (because you changed the repository structure), but this is old problem.

I think we should do as it says here:

  • add $1 ($1 inside function evaluates to function's parameters - not to script's parameters. Here $1 parameter need to be passed explicitly)
  • replace the interpreter with bash (POSIX sh does not supports += operator, as shellcheck tells)

The following patch works for me:

diff --git a/community/i3/skel/.xinitrc b/community/i3/skel/.xinitrc
index 1c510bc..5aa8c64 100644
--- a/community/i3/skel/.xinitrc
+++ b/community/i3/skel/.xinitrc
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # ~/.xinitrc
 #
@@ -63,4 +63,4 @@ get_session(){
        echo "dbus-launch ${dbus_args[*]}"
 }

-exec $(get_session)
+exec $(get_session "$1")

but these fixes need to be applied to all **/.xintirc files (or write a single one), not just for manjaro-xfce (as far as i understand, they are not needed when running through desktop-manager).

I have the same problem under **manjaro-i3-community**. Maybe you are an old ticket, or you missed it (because you changed the repository structure), but this is [old](https://forum.manjaro.org/t/stable-something-wrong-with-default-xinitrc/37595/4) problem. I think we should do as it says [here](https://forum.manjaro.org/t/stable-something-wrong-with-default-xinitrc/37595/4): - add `$1` (`$1` inside function evaluates to function's parameters - not to script's parameters. Here `$1` parameter need to be passed explicitly) - replace the interpreter with bash (**POSIX sh** does not supports `+=` operator, as `shellcheck` tells) The following patch works for me: ```diff diff --git a/community/i3/skel/.xinitrc b/community/i3/skel/.xinitrc index 1c510bc..5aa8c64 100644 --- a/community/i3/skel/.xinitrc +++ b/community/i3/skel/.xinitrc @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # ~/.xinitrc # @@ -63,4 +63,4 @@ get_session(){ echo "dbus-launch ${dbus_args[*]}" } -exec $(get_session) +exec $(get_session "$1") ``` but these fixes need to be applied to **all** `**/.xintirc` files (or write a single one), not just for **manjaro-xfce** (as far as i understand, they are not needed when running through desktop-manager).
oberon commented 2020-08-04 09:38:14 +00:00 (Migrated from gitlab2.manjaro.org)

yes. we never adjusted that in all the different places... Fixing that now finally.

yes. we never adjusted that in all the different places... Fixing that now finally.
oberon commented 2020-08-04 09:38:55 +00:00 (Migrated from gitlab2.manjaro.org)

mentioned in commit manjaro-kde-settings@e6e6af5cff6f659631b14b15ceee8588c24708fc

mentioned in commit manjaro-kde-settings@e6e6af5cff6f659631b14b15ceee8588c24708fc
oberon commented 2020-08-04 09:47:33 +00:00 (Migrated from gitlab2.manjaro.org)

mentioned in commit manjaro-xfce-settings@20c236b14645fbf3d969bcc484e94869e01daf88

mentioned in commit manjaro-xfce-settings@20c236b14645fbf3d969bcc484e94869e01daf88
oberon commented 2020-08-04 09:56:54 +00:00 (Migrated from gitlab2.manjaro.org)

mentioned in commit manjaro-gnome-settings@256c4af6b55e208d443a247e4810c9783fb1b31d

mentioned in commit manjaro-gnome-settings@256c4af6b55e208d443a247e4810c9783fb1b31d
oberon commented 2020-08-04 10:21:24 +00:00 (Migrated from gitlab2.manjaro.org)

mentioned in commit 7c6322e094

mentioned in commit 7c6322e0944c68aebfed6f8af3a138bd6f2e8c2c
oberon commented 2020-08-04 10:51:02 +00:00 (Migrated from gitlab2.manjaro.org)

closed

closed
oberon commented 2020-08-04 10:51:02 +00:00 (Migrated from gitlab2.manjaro.org)

changed the description

changed the description
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
profiles/desktop-settings#124
No description provided.