unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* to enable all profiles at login time
@ 2023-04-16 13:09 Gottfried
  2023-04-16 20:18 ` Wojtek Kosior via
  2023-04-17 17:25 ` Giovanni Biscuolo
  0 siblings, 2 replies; 18+ messages in thread
From: Gottfried @ 2023-04-16 13:09 UTC (permalink / raw)
  To: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 1061 bytes --]

Hi,

according to the cookbook
I added
--------------------------------------------
for i in $GUIX_EXTRA_PROFILES/*; do
   profile=$i/$(basename "$i")
   if [ -f "$profile"/etc/profile ]; then
     GUIX_PROFILE="$profile"
     . "$GUIX_PROFILE"/etc/profile
   fi
   unset profile
done
-----------------------------------------------
into my .bash_profile file
in order to enable all profiles at login time:
------------------------------------------------
My .bash_profile file looks now like that:

# Honor per-interactive-shell startup file
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi

for i in $GUIX_EXTRA_PROFILES/*; do
   profile=$i/$(basename "$i")
   if [ -f "$profile"/etc/profile ]; then
     GUIX_PROFILE="$profile"
     . "$GUIX_PROFILE"/etc/profile
   fi
   unset profile
done
-----------------------------------------------

but when starting MATE Desktop all my profiles are not enabled.

Could somebody help because probably the two entries in my .bash_profile
got a mistake.

-- 
Kind regards

Gottfried


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: to enable all profiles at login time
  2023-04-16 13:09 to enable all profiles at login time Gottfried
@ 2023-04-16 20:18 ` Wojtek Kosior via
  2023-04-17  7:37   ` Gottfried
  2023-04-17 17:25 ` Giovanni Biscuolo
  1 sibling, 1 reply; 18+ messages in thread
From: Wojtek Kosior via @ 2023-04-16 20:18 UTC (permalink / raw)
  To: Gottfried; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 4521 bytes --]

Hi Gottfried,

I see 3 potential problems.

1.
The snippet you addet to .bashrc refers to a variable named
"GUIX_EXTRA_PROFILES". Is this variable defined somewhere? Is seems it
isn't. It should be assigned the path to the directory holding your
profiles so you could for example add a

    GUIX_EXTRA_PROFILES=/path/to/directory/with/my/guix/profiles

line before the `for` loop. Of course, replacing the
"/path/to/directory/with/my/guix/profiles" with the appropriate path
for your system.

2.
Why is `basename` being used here? Consider the following example:

- "GUIX_EXTRA_PROFILES" is set to /home/user/my-extra-guix-stuff
- you have 1 extra Guix profile under
  "/home/user/my-extra-guix-stuff/music"
- the profile mentioned above has its `profile` script under
  "/home/user/my-extra-guix-stuff/music/etc/profile"

Now, let's look at what the

    profile=$i/$(basename "$i")

line does. This line is inside a `for` loop, in each iteration the
variable "i" holds the path to one of the profiles under
"/home/user/my-extra-guix-stuff". In one iteration "i" is going to hold
the string "/home/user/my-extra-guix-stuff/music". The `basename "$i"`
command therefore outputs just "music". So the line we're analyzing
assigns the string "/home/user/my-extra-guix-stuff/music/music" to
variable called "profile". Is this what we wanted? The next line is
going to check for the existence of file
"/home/user/my-extra-guix-stuff/music/music/etc/profile" but it should
instead check for the existence of
"/home/user/my-extra-guix-stuff/music/etc/profile". So you might want
to e.g. replace the line

    profile=$i/$(basename "$i")

with just

    profile=$i

3.
You edited "~/.bash_profile" which is indeed known to be read by bash.

However, this is not that simple. Bash has 3 possible modes of running:
non-interactive shell, interactive shell and (interactive) login shell.
The "login shell" mode is meant to be used when, well, bash is spawned
in a terminal upon user login. "~/.bash_profile" is *only* read by bash
in this mode and not in the other 2. In interactive shell mode, bash
reads "~/.bashrc" *instead*.

When you, for example, execute a `bash` command inside an
already-running shell, the child bash shell that spawns is not going to
consider itself a login shell but rather a mere interactive shell. To
make bash think is is a login shell, you can e.g. start it with a `-l`
flag, like `bash -l`.

The problem is, most terminal emulators by default don't start bash
this way. The 2 solutions I've been using are to either
- change the configuration of one's terminal emulator to start bash
  with `-l`
- or make the ".bashrc" script check if current interactive shell was
  spawned by a teminal emulator process and if yes, have it activate the
  Guix profiles.

The 1st solution is the proper one, the 2nd one is just a workaround
for terminal emulators that are not configurable enough :)


Wojtek


-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
-- (sig_end)


On Sun, 16 Apr 2023 13:09:00 +0000
Gottfried <gottfried@posteo.de> wrote:

> Hi,
> 
> according to the cookbook
> I added
> --------------------------------------------
> for i in $GUIX_EXTRA_PROFILES/*; do
>    profile=$i/$(basename "$i")
>    if [ -f "$profile"/etc/profile ]; then
>      GUIX_PROFILE="$profile"
>      . "$GUIX_PROFILE"/etc/profile
>    fi
>    unset profile
> done
> -----------------------------------------------
> into my .bash_profile file
> in order to enable all profiles at login time:
> ------------------------------------------------
> My .bash_profile file looks now like that:
> 
> # Honor per-interactive-shell startup file
> if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
> 
> for i in $GUIX_EXTRA_PROFILES/*; do
>    profile=$i/$(basename "$i")
>    if [ -f "$profile"/etc/profile ]; then
>      GUIX_PROFILE="$profile"
>      . "$GUIX_PROFILE"/etc/profile
>    fi
>    unset profile
> done
> -----------------------------------------------
> 
> but when starting MATE Desktop all my profiles are not enabled.
> 
> Could somebody help because probably the two entries in my .bash_profile
> got a mistake.
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: to enable all profiles at login time
  2023-04-16 20:18 ` Wojtek Kosior via
@ 2023-04-17  7:37   ` Gottfried
  2023-04-17 11:56     ` Wojtek Kosior via
  0 siblings, 1 reply; 18+ messages in thread
From: Gottfried @ 2023-04-17  7:37 UTC (permalink / raw)
  To: Wojtek Kosior; +Cc: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 6695 bytes --]

Hi,
thanks for helping me.

------------------------------------------------------------------
1.
I added:
"GUIX_EXTRA_PROFILES=/home/gfp/Projekte"
to my /.bash_profile

2.
I changed the sentence
"profile=$i/$(basename "$i")"
  to:
  "profile=$i"

3.
my /.bash_profile looks now, after changing like this:

# Honor per-interactive-shell startup file
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi

GUIX_EXTRA_PROFILES=/home/gfp/Projekte
for i in $GUIX_EXTRA_PROFILES/*; do
   profile=$i
   if [ -f "$profile"/etc/profile ]; then
     GUIX_PROFILE="$profile"
     . "$GUIX_PROFILE"/etc/profile
   fi
   unset profile
done

----------------------------------------------------------------------
4.
my /.bashrc looks like this

# Bash initialization for interactive non-login shells and
# for remote shells (info "(bash) Bash Startup Files").

# Export 'SHELL' to child processes.  Programs such as 'screen'
# honor it and otherwise use /bin/sh.
export SHELL

if [[ $- != *i* ]]
then
     # We are being invoked from a non-interactive shell.  If this
     # is an SSH session (as in "ssh host command"), source
     # /etc/profile so we get PATH and other essential variables.
     [[ -n "$SSH_CLIENT" ]] && source /etc/profile

     # Don't do anything else.
     return
fi

# Source the system-wide file.
source /etc/bashrc

# Adjust the prompt depending on whether we're in 'guix environment'.
if [ -n "$GUIX_ENVIRONMENT" ]
then
     PS1='\u@\h \w [env]\$ '
else
     PS1='\u@\h \w\$ '
fi
alias ls='ls -p --color=auto'
alias ll='ls -l'
alias grep='grep --color=auto'

---------------------------------------------------------------------
> change the configuration of one's terminal emulator to start bash
>>    with `-l`

5.
Where do I have to add "-l" in /.bashrc?


Kind regards

Gottfried





Am 16.04.23 um 22:18 schrieb Wojtek Kosior:
> Hi Gottfried,
> 
> I see 3 potential problems.
> 
> 1.
> The snippet you addet to .bashrc refers to a variable named
> "GUIX_EXTRA_PROFILES". Is this variable defined somewhere? Is seems it
> isn't. It should be assigned the path to the directory holding your
> profiles so you could for example add a
> 
>      GUIX_EXTRA_PROFILES=/path/to/directory/with/my/guix/profiles
> 
> line before the `for` loop. Of course, replacing the
> "/path/to/directory/with/my/guix/profiles" with the appropriate path
> for your system.
> 
> 2.
> Why is `basename` being used here? Consider the following example:
> 
> - "GUIX_EXTRA_PROFILES" is set to /home/user/my-extra-guix-stuff
> - you have 1 extra Guix profile under
>    "/home/user/my-extra-guix-stuff/music"
> - the profile mentioned above has its `profile` script under
>    "/home/user/my-extra-guix-stuff/music/etc/profile"
> 
> Now, let's look at what the
> 
>      profile=$i/$(basename "$i")
> 
> line does. This line is inside a `for` loop, in each iteration the
> variable "i" holds the path to one of the profiles under
> "/home/user/my-extra-guix-stuff". In one iteration "i" is going to hold
> the string "/home/user/my-extra-guix-stuff/music". The `basename "$i"`
> command therefore outputs just "music". So the line we're analyzing
> assigns the string "/home/user/my-extra-guix-stuff/music/music" to
> variable called "profile". Is this what we wanted? The next line is
> going to check for the existence of file
> "/home/user/my-extra-guix-stuff/music/music/etc/profile" but it should
> instead check for the existence of
> "/home/user/my-extra-guix-stuff/music/etc/profile". So you might want
> to e.g. replace the line
> 
>      profile=$i/$(basename "$i")
> 
> with just
> 
>      profile=$i
> 
> 3.
> You edited "~/.bash_profile" which is indeed known to be read by bash.
> 
> However, this is not that simple. Bash has 3 possible modes of running:
> non-interactive shell, interactive shell and (interactive) login shell.
> The "login shell" mode is meant to be used when, well, bash is spawned
> in a terminal upon user login. "~/.bash_profile" is *only* read by bash
> in this mode and not in the other 2. In interactive shell mode, bash
> reads "~/.bashrc" *instead*.
> 
> When you, for example, execute a `bash` command inside an
> already-running shell, the child bash shell that spawns is not going to
> consider itself a login shell but rather a mere interactive shell. To
> make bash think is is a login shell, you can e.g. start it with a `-l`
> flag, like `bash -l`.
> 
> The problem is, most terminal emulators by default don't start bash
> this way. The 2 solutions I've been using are to either
> - change the configuration of one's terminal emulator to start bash
>    with `-l`
> - or make the ".bashrc" script check if current interactive shell was
>    spawned by a teminal emulator process and if yes, have it activate the
>    Guix profiles.
> 
> The 1st solution is the proper one, the 2nd one is just a workaround
> for terminal emulators that are not configurable enough :)
> 
> 
> Wojtek
> 
> 
> -- (sig_start)
> website: https://koszko.org/koszko.html
> PGP: https://koszko.org/key.gpg
> fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A
> 
> ♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
> ✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
> -- (sig_end)
> 
> 
> On Sun, 16 Apr 2023 13:09:00 +0000
> Gottfried <gottfried@posteo.de> wrote:
> 
>> Hi,
>>
>> according to the cookbook
>> I added
>> --------------------------------------------
>> for i in $GUIX_EXTRA_PROFILES/*; do
>>     profile=$i/$(basename "$i")
>>     if [ -f "$profile"/etc/profile ]; then
>>       GUIX_PROFILE="$profile"
>>       . "$GUIX_PROFILE"/etc/profile
>>     fi
>>     unset profile
>> done
>> -----------------------------------------------
>> into my .bash_profile file
>> in order to enable all profiles at login time:
>> ------------------------------------------------
>> My .bash_profile file looks now like that:
>>
>> # Honor per-interactive-shell startup file
>> if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
>>
>> for i in $GUIX_EXTRA_PROFILES/*; do
>>     profile=$i/$(basename "$i")
>>     if [ -f "$profile"/etc/profile ]; then
>>       GUIX_PROFILE="$profile"
>>       . "$GUIX_PROFILE"/etc/profile
>>     fi
>>     unset profile
>> done
>> -----------------------------------------------
>>
>> but when starting MATE Desktop all my profiles are not enabled.
>>
>> Could somebody help because probably the two entries in my .bash_profile
>> got a mistake.
>>
> 
> 

-- 




[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: to enable all profiles at login time
  2023-04-17  7:37   ` Gottfried
@ 2023-04-17 11:56     ` Wojtek Kosior via
  2023-04-17 12:45       ` Gottfried
  0 siblings, 1 reply; 18+ messages in thread
From: Wojtek Kosior via @ 2023-04-17 11:56 UTC (permalink / raw)
  To: Gottfried; +Cc: help-guix


[-- Attachment #1.1: Type: text/plain, Size: 9762 bytes --]

> Hi,
> thanks for helping me.
> 
> ------------------------------------------------------------------
> 1.
> I added:
> "GUIX_EXTRA_PROFILES=/home/gfp/Projekte"
> to my /.bash_profile
> 
> 2.
> I changed the sentence
> "profile=$i/$(basename "$i")"
>   to:
>   "profile=$i"
> 
> 3.
> my /.bash_profile looks now, after changing like this:
> 
> [...]

Looks good :)

> Where do I have to add "-l" in /.bashrc?

You don't add it to `.bashrc`. Instead, you need to configure your
*terminal emulator*. It is the graphical application that you use to
access the command line. Since you mentioned you're using Mate desktop,
I suspect the terminal emulator you are using is "mate-terminal" and
I'll give you instructions for that. If you happen to be using
a different one (like xfce4-terminal, konsole, sakura, xterm, etc.),
the steps are going to be slightly different.

So, right-click somewhene in your mate-terminal window and choose
"Profiles->Profile Preferences" as in the attached screenshot. Then, in
the "Editing Profile" windows that shows, switch to the "Title and
Command" tab and tick the "Run command as a login shell" option (as
shown in the second attached screenshot). Finally, close the "Editing
Profile" window.

Once you restart mate-terminal, it should run bash as a login shell.
You can verify this by running the following command (well, 2 commands)

    shopt -q login_shell; echo $?

If the bash instance you're interacting with is a login shell, it shall
print "0". Otherwise, it'll print "1".


Now, it might be good to clarify some things. What we're doing here
does *not* enable your profiles when you start the Mate desktop. It
instead enables them when you start mate-terminal with bash in it. In
other words, your profiles get enabled when you "log in" in a terminal.
And here we're just causing the execution of mate-terminal application
to be treated as such login.

But don't worry about these details — this is what you want. The lines
you now have in your `.bash_profile` will also enable your Guix
profiles when you log in through a TTY or through SSH. This is the
correct behavior :)


Best luck ;)

Wojtek


-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
-- (sig_end)


On Mon, 17 Apr 2023 07:37:40 +0000
Gottfried <gottfried@posteo.de> wrote:

> Hi,
> thanks for helping me.
> 
> ------------------------------------------------------------------
> 1.
> I added:
> "GUIX_EXTRA_PROFILES=/home/gfp/Projekte"
> to my /.bash_profile
> 
> 2.
> I changed the sentence
> "profile=$i/$(basename "$i")"
>   to:
>   "profile=$i"
> 
> 3.
> my /.bash_profile looks now, after changing like this:
> 
> # Honor per-interactive-shell startup file
> if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
> 
> GUIX_EXTRA_PROFILES=/home/gfp/Projekte
> for i in $GUIX_EXTRA_PROFILES/*; do
>    profile=$i
>    if [ -f "$profile"/etc/profile ]; then
>      GUIX_PROFILE="$profile"
>      . "$GUIX_PROFILE"/etc/profile
>    fi
>    unset profile
> done
> 
> ----------------------------------------------------------------------
> 4.
> my /.bashrc looks like this
> 
> # Bash initialization for interactive non-login shells and
> # for remote shells (info "(bash) Bash Startup Files").
> 
> # Export 'SHELL' to child processes.  Programs such as 'screen'
> # honor it and otherwise use /bin/sh.
> export SHELL
> 
> if [[ $- != *i* ]]
> then
>      # We are being invoked from a non-interactive shell.  If this
>      # is an SSH session (as in "ssh host command"), source
>      # /etc/profile so we get PATH and other essential variables.
>      [[ -n "$SSH_CLIENT" ]] && source /etc/profile
> 
>      # Don't do anything else.
>      return
> fi
> 
> # Source the system-wide file.
> source /etc/bashrc
> 
> # Adjust the prompt depending on whether we're in 'guix environment'.
> if [ -n "$GUIX_ENVIRONMENT" ]
> then
>      PS1='\u@\h \w [env]\$ '
> else
>      PS1='\u@\h \w\$ '
> fi
> alias ls='ls -p --color=auto'
> alias ll='ls -l'
> alias grep='grep --color=auto'
> 
> ---------------------------------------------------------------------
> > change the configuration of one's terminal emulator to start bash  
> >>    with `-l`  
> 
> 5.
> Where do I have to add "-l" in /.bashrc?
> 
> 
> Kind regards
> 
> Gottfried
> 
> 
> 
> 
> 
> Am 16.04.23 um 22:18 schrieb Wojtek Kosior:
> > Hi Gottfried,
> > 
> > I see 3 potential problems.
> > 
> > 1.
> > The snippet you addet to .bashrc refers to a variable named
> > "GUIX_EXTRA_PROFILES". Is this variable defined somewhere? Is seems it
> > isn't. It should be assigned the path to the directory holding your
> > profiles so you could for example add a
> > 
> >      GUIX_EXTRA_PROFILES=/path/to/directory/with/my/guix/profiles
> > 
> > line before the `for` loop. Of course, replacing the
> > "/path/to/directory/with/my/guix/profiles" with the appropriate path
> > for your system.
> > 
> > 2.
> > Why is `basename` being used here? Consider the following example:
> > 
> > - "GUIX_EXTRA_PROFILES" is set to /home/user/my-extra-guix-stuff
> > - you have 1 extra Guix profile under
> >    "/home/user/my-extra-guix-stuff/music"
> > - the profile mentioned above has its `profile` script under
> >    "/home/user/my-extra-guix-stuff/music/etc/profile"
> > 
> > Now, let's look at what the
> > 
> >      profile=$i/$(basename "$i")
> > 
> > line does. This line is inside a `for` loop, in each iteration the
> > variable "i" holds the path to one of the profiles under
> > "/home/user/my-extra-guix-stuff". In one iteration "i" is going to hold
> > the string "/home/user/my-extra-guix-stuff/music". The `basename "$i"`
> > command therefore outputs just "music". So the line we're analyzing
> > assigns the string "/home/user/my-extra-guix-stuff/music/music" to
> > variable called "profile". Is this what we wanted? The next line is
> > going to check for the existence of file
> > "/home/user/my-extra-guix-stuff/music/music/etc/profile" but it should
> > instead check for the existence of
> > "/home/user/my-extra-guix-stuff/music/etc/profile". So you might want
> > to e.g. replace the line
> > 
> >      profile=$i/$(basename "$i")
> > 
> > with just
> > 
> >      profile=$i
> > 
> > 3.
> > You edited "~/.bash_profile" which is indeed known to be read by bash.
> > 
> > However, this is not that simple. Bash has 3 possible modes of running:
> > non-interactive shell, interactive shell and (interactive) login shell.
> > The "login shell" mode is meant to be used when, well, bash is spawned
> > in a terminal upon user login. "~/.bash_profile" is *only* read by bash
> > in this mode and not in the other 2. In interactive shell mode, bash
> > reads "~/.bashrc" *instead*.
> > 
> > When you, for example, execute a `bash` command inside an
> > already-running shell, the child bash shell that spawns is not going to
> > consider itself a login shell but rather a mere interactive shell. To
> > make bash think is is a login shell, you can e.g. start it with a `-l`
> > flag, like `bash -l`.
> > 
> > The problem is, most terminal emulators by default don't start bash
> > this way. The 2 solutions I've been using are to either
> > - change the configuration of one's terminal emulator to start bash
> >    with `-l`
> > - or make the ".bashrc" script check if current interactive shell was
> >    spawned by a teminal emulator process and if yes, have it activate the
> >    Guix profiles.
> > 
> > The 1st solution is the proper one, the 2nd one is just a workaround
> > for terminal emulators that are not configurable enough :)
> > 
> > 
> > Wojtek
> > 
> > 
> > -- (sig_start)
> > website: https://koszko.org/koszko.html
> > PGP: https://koszko.org/key.gpg
> > fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A
> > 
> > ♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
> > ✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
> > -- (sig_end)
> > 
> > 
> > On Sun, 16 Apr 2023 13:09:00 +0000
> > Gottfried <gottfried@posteo.de> wrote:
> >   
> >> Hi,
> >>
> >> according to the cookbook
> >> I added
> >> --------------------------------------------
> >> for i in $GUIX_EXTRA_PROFILES/*; do
> >>     profile=$i/$(basename "$i")
> >>     if [ -f "$profile"/etc/profile ]; then
> >>       GUIX_PROFILE="$profile"
> >>       . "$GUIX_PROFILE"/etc/profile
> >>     fi
> >>     unset profile
> >> done
> >> -----------------------------------------------
> >> into my .bash_profile file
> >> in order to enable all profiles at login time:
> >> ------------------------------------------------
> >> My .bash_profile file looks now like that:
> >>
> >> # Honor per-interactive-shell startup file
> >> if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
> >>
> >> for i in $GUIX_EXTRA_PROFILES/*; do
> >>     profile=$i/$(basename "$i")
> >>     if [ -f "$profile"/etc/profile ]; then
> >>       GUIX_PROFILE="$profile"
> >>       . "$GUIX_PROFILE"/etc/profile
> >>     fi
> >>     unset profile
> >> done
> >> -----------------------------------------------
> >>
> >> but when starting MATE Desktop all my profiles are not enabled.
> >>
> >> Could somebody help because probably the two entries in my .bash_profile
> >> got a mistake.
> >>  
> > 
> >   
> 



[-- Attachment #1.2: mate-terminal-profiles-preferences.png --]
[-- Type: image/png, Size: 31368 bytes --]

[-- Attachment #1.3: mate-terminal-editing-profile.png --]
[-- Type: image/png, Size: 35503 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: to enable all profiles at login time
  2023-04-17 11:56     ` Wojtek Kosior via
@ 2023-04-17 12:45       ` Gottfried
  2023-04-17 12:55         ` Wojtek Kosior via
  2023-04-17 18:32         ` Sergiu Ivanov
  0 siblings, 2 replies; 18+ messages in thread
From: Gottfried @ 2023-04-17 12:45 UTC (permalink / raw)
  To: Wojtek Kosior; +Cc: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 12328 bytes --]

Hi,

thanks for help.

> ou don't add it to `.bashrc`. Instead, you need to configure your
>> *terminal emulator*. It is the graphical application that you use to
>> access the command line. Since you mentioned you're using Mate desktop,
>> I suspect the terminal emulator you are using is "mate-terminal" and
>> I'll give you instructions for that. If you happen to be using
>> a different one (like xfce4-terminal, konsole, sakura, xterm, etc.),
>> the steps are going to be slightly different.
>> 
>> So, right-click somewhene in your mate-terminal window and choose
>> "Profiles->Profile Preferences" as in the attached screenshot. Then, in
>> the "Editing Profile" windows that shows, switch to the "Title and
>> Command" tab and tick the "Run command as a login shell" option (as
>> shown in the second attached screenshot). Finally, close the "Editing
>> Profile" window.

1.
I already had this option enabled in the MATE terminal

2.
> shopt -q login_shell; echo $?
>> 
>> If the bash instance you're interacting with is a login shell, it shall
>> print "0". Otherwise, it'll print "1".

gfp@Tuxedo ~$ shopt -q login_shell; echo $?
0

3.
How do you create this screenshot with the red arrow?
I know how to create a screenshot,
but I don’t know how to add something remarks with red colour.
Which package do you use for this?

4.
> your profiles get enabled when you "log in" in a terminal.
>> And here we're just causing the execution of mate-terminal application
>> to be treated as such login.

So how can I now enable all e.g. 10 profiles at once in the terminal?
which commands do I have to use?

I enabled always one profile by one:

guix shell -p ~/Projekte/Libreoffice/guix-profil
to open libreoffice

guix shell -p ~/Projekte/Musik/guix-profil
to open the music profil with several packages

and so on...

5.
is there also a possibility to enable all my profiles when I log in to 
my MATE desktop?
so that I can save time and don’t need to open one profile after another 
in the terminal?

(Except the case, if there is a possibility, question 4, to open all 
profiles at once by one command in the MATE terminal, so that I have all 
packages in all profiles enabled at once)


Kind regards

Gottfried



Am 17.04.23 um 13:56 schrieb Wojtek Kosior:
>> Hi,
>> thanks for helping me.
>>
>> ------------------------------------------------------------------
>> 1.
>> I added:
>> "GUIX_EXTRA_PROFILES=/home/gfp/Projekte"
>> to my /.bash_profile
>>
>> 2.
>> I changed the sentence
>> "profile=$i/$(basename "$i")"
>>    to:
>>    "profile=$i"
>>
>> 3.
>> my /.bash_profile looks now, after changing like this:
>>
>> [...]
> 
> Looks good :)
> 
>> Where do I have to add "-l" in /.bashrc?
> 
> You don't add it to `.bashrc`. Instead, you need to configure your
> *terminal emulator*. It is the graphical application that you use to
> access the command line. Since you mentioned you're using Mate desktop,
> I suspect the terminal emulator you are using is "mate-terminal" and
> I'll give you instructions for that. If you happen to be using
> a different one (like xfce4-terminal, konsole, sakura, xterm, etc.),
> the steps are going to be slightly different.
> 
> So, right-click somewhene in your mate-terminal window and choose
> "Profiles->Profile Preferences" as in the attached screenshot. Then, in
> the "Editing Profile" windows that shows, switch to the "Title and
> Command" tab and tick the "Run command as a login shell" option (as
> shown in the second attached screenshot). Finally, close the "Editing
> Profile" window.
> 
> Once you restart mate-terminal, it should run bash as a login shell.
> You can verify this by running the following command (well, 2 commands)
> 
>      shopt -q login_shell; echo $?
> 
> If the bash instance you're interacting with is a login shell, it shall
> print "0". Otherwise, it'll print "1".
> 
> 
> Now, it might be good to clarify some things. What we're doing here
> does *not* enable your profiles when you start the Mate desktop. It
> instead enables them when you start mate-terminal with bash in it. In
> other words, your profiles get enabled when you "log in" in a terminal.
> And here we're just causing the execution of mate-terminal application
> to be treated as such login.
> 
> But don't worry about these details — this is what you want. The lines
> you now have in your `.bash_profile` will also enable your Guix
> profiles when you log in through a TTY or through SSH. This is the
> correct behavior :)
> 
> 
> Best luck ;)
> 
> Wojtek
> 
> 
> -- (sig_start)
> website: https://koszko.org/koszko.html
> PGP: https://koszko.org/key.gpg
> fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A
> 
> ♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
> ✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
> -- (sig_end)
> 
> 
> On Mon, 17 Apr 2023 07:37:40 +0000
> Gottfried <gottfried@posteo.de> wrote:
> 
>> Hi,
>> thanks for helping me.
>>
>> ------------------------------------------------------------------
>> 1.
>> I added:
>> "GUIX_EXTRA_PROFILES=/home/gfp/Projekte"
>> to my /.bash_profile
>>
>> 2.
>> I changed the sentence
>> "profile=$i/$(basename "$i")"
>>    to:
>>    "profile=$i"
>>
>> 3.
>> my /.bash_profile looks now, after changing like this:
>>
>> # Honor per-interactive-shell startup file
>> if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
>>
>> GUIX_EXTRA_PROFILES=/home/gfp/Projekte
>> for i in $GUIX_EXTRA_PROFILES/*; do
>>     profile=$i
>>     if [ -f "$profile"/etc/profile ]; then
>>       GUIX_PROFILE="$profile"
>>       . "$GUIX_PROFILE"/etc/profile
>>     fi
>>     unset profile
>> done
>>
>> ----------------------------------------------------------------------
>> 4.
>> my /.bashrc looks like this
>>
>> # Bash initialization for interactive non-login shells and
>> # for remote shells (info "(bash) Bash Startup Files").
>>
>> # Export 'SHELL' to child processes.  Programs such as 'screen'
>> # honor it and otherwise use /bin/sh.
>> export SHELL
>>
>> if [[ $- != *i* ]]
>> then
>>       # We are being invoked from a non-interactive shell.  If this
>>       # is an SSH session (as in "ssh host command"), source
>>       # /etc/profile so we get PATH and other essential variables.
>>       [[ -n "$SSH_CLIENT" ]] && source /etc/profile
>>
>>       # Don't do anything else.
>>       return
>> fi
>>
>> # Source the system-wide file.
>> source /etc/bashrc
>>
>> # Adjust the prompt depending on whether we're in 'guix environment'.
>> if [ -n "$GUIX_ENVIRONMENT" ]
>> then
>>       PS1='\u@\h \w [env]\$ '
>> else
>>       PS1='\u@\h \w\$ '
>> fi
>> alias ls='ls -p --color=auto'
>> alias ll='ls -l'
>> alias grep='grep --color=auto'
>>
>> ---------------------------------------------------------------------
>>> change the configuration of one's terminal emulator to start bash
>>>>     with `-l`
>>
>> 5.
>> Where do I have to add "-l" in /.bashrc?
>>
>>
>> Kind regards
>>
>> Gottfried
>>
>>
>>
>>
>>
>> Am 16.04.23 um 22:18 schrieb Wojtek Kosior:
>>> Hi Gottfried,
>>>
>>> I see 3 potential problems.
>>>
>>> 1.
>>> The snippet you addet to .bashrc refers to a variable named
>>> "GUIX_EXTRA_PROFILES". Is this variable defined somewhere? Is seems it
>>> isn't. It should be assigned the path to the directory holding your
>>> profiles so you could for example add a
>>>
>>>       GUIX_EXTRA_PROFILES=/path/to/directory/with/my/guix/profiles
>>>
>>> line before the `for` loop. Of course, replacing the
>>> "/path/to/directory/with/my/guix/profiles" with the appropriate path
>>> for your system.
>>>
>>> 2.
>>> Why is `basename` being used here? Consider the following example:
>>>
>>> - "GUIX_EXTRA_PROFILES" is set to /home/user/my-extra-guix-stuff
>>> - you have 1 extra Guix profile under
>>>     "/home/user/my-extra-guix-stuff/music"
>>> - the profile mentioned above has its `profile` script under
>>>     "/home/user/my-extra-guix-stuff/music/etc/profile"
>>>
>>> Now, let's look at what the
>>>
>>>       profile=$i/$(basename "$i")
>>>
>>> line does. This line is inside a `for` loop, in each iteration the
>>> variable "i" holds the path to one of the profiles under
>>> "/home/user/my-extra-guix-stuff". In one iteration "i" is going to hold
>>> the string "/home/user/my-extra-guix-stuff/music". The `basename "$i"`
>>> command therefore outputs just "music". So the line we're analyzing
>>> assigns the string "/home/user/my-extra-guix-stuff/music/music" to
>>> variable called "profile". Is this what we wanted? The next line is
>>> going to check for the existence of file
>>> "/home/user/my-extra-guix-stuff/music/music/etc/profile" but it should
>>> instead check for the existence of
>>> "/home/user/my-extra-guix-stuff/music/etc/profile". So you might want
>>> to e.g. replace the line
>>>
>>>       profile=$i/$(basename "$i")
>>>
>>> with just
>>>
>>>       profile=$i
>>>
>>> 3.
>>> You edited "~/.bash_profile" which is indeed known to be read by bash.
>>>
>>> However, this is not that simple. Bash has 3 possible modes of running:
>>> non-interactive shell, interactive shell and (interactive) login shell.
>>> The "login shell" mode is meant to be used when, well, bash is spawned
>>> in a terminal upon user login. "~/.bash_profile" is *only* read by bash
>>> in this mode and not in the other 2. In interactive shell mode, bash
>>> reads "~/.bashrc" *instead*.
>>>
>>> When you, for example, execute a `bash` command inside an
>>> already-running shell, the child bash shell that spawns is not going to
>>> consider itself a login shell but rather a mere interactive shell. To
>>> make bash think is is a login shell, you can e.g. start it with a `-l`
>>> flag, like `bash -l`.
>>>
>>> The problem is, most terminal emulators by default don't start bash
>>> this way. The 2 solutions I've been using are to either
>>> - change the configuration of one's terminal emulator to start bash
>>>     with `-l`
>>> - or make the ".bashrc" script check if current interactive shell was
>>>     spawned by a teminal emulator process and if yes, have it activate the
>>>     Guix profiles.
>>>
>>> The 1st solution is the proper one, the 2nd one is just a workaround
>>> for terminal emulators that are not configurable enough :)
>>>
>>>
>>> Wojtek
>>>
>>>
>>> -- (sig_start)
>>> website: https://koszko.org/koszko.html
>>> PGP: https://koszko.org/key.gpg
>>> fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A
>>>
>>> ♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
>>> ✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
>>> -- (sig_end)
>>>
>>>
>>> On Sun, 16 Apr 2023 13:09:00 +0000
>>> Gottfried <gottfried@posteo.de> wrote:
>>>    
>>>> Hi,
>>>>
>>>> according to the cookbook
>>>> I added
>>>> --------------------------------------------
>>>> for i in $GUIX_EXTRA_PROFILES/*; do
>>>>      profile=$i/$(basename "$i")
>>>>      if [ -f "$profile"/etc/profile ]; then
>>>>        GUIX_PROFILE="$profile"
>>>>        . "$GUIX_PROFILE"/etc/profile
>>>>      fi
>>>>      unset profile
>>>> done
>>>> -----------------------------------------------
>>>> into my .bash_profile file
>>>> in order to enable all profiles at login time:
>>>> ------------------------------------------------
>>>> My .bash_profile file looks now like that:
>>>>
>>>> # Honor per-interactive-shell startup file
>>>> if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
>>>>
>>>> for i in $GUIX_EXTRA_PROFILES/*; do
>>>>      profile=$i/$(basename "$i")
>>>>      if [ -f "$profile"/etc/profile ]; then
>>>>        GUIX_PROFILE="$profile"
>>>>        . "$GUIX_PROFILE"/etc/profile
>>>>      fi
>>>>      unset profile
>>>> done
>>>> -----------------------------------------------
>>>>
>>>> but when starting MATE Desktop all my profiles are not enabled.
>>>>
>>>> Could somebody help because probably the two entries in my .bash_profile
>>>> got a mistake.
>>>>   
>>>
>>>    
>>
> 
> 

-- 



[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: to enable all profiles at login time
  2023-04-17 12:45       ` Gottfried
@ 2023-04-17 12:55         ` Wojtek Kosior via
  2023-04-17 14:30           ` Martin Castillo
  2023-04-17 14:55           ` Gottfried
  2023-04-17 18:32         ` Sergiu Ivanov
  1 sibling, 2 replies; 18+ messages in thread
From: Wojtek Kosior via @ 2023-04-17 12:55 UTC (permalink / raw)
  To: Gottfried; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 14665 bytes --]

> Hi,
> 
> thanks for help.

> 1.
> I already had this option enabled in the MATE terminal
>
> [...]
>
> 2.
> > shopt -q login_shell; echo $?  
> >> 
> >> If the bash instance you're interacting with is a login shell, it shall
> >> print "0". Otherwise, it'll print "1".  
> 
> gfp@Tuxedo ~$ shopt -q login_shell; echo $?
> 0

Then you're all set. It should be working now :)

Try closing the terminal and opening it again. Are the commands from
your profiles (e.g. `libreoffice`) available immediately, without the
need to run any manual `guix` commands? They should be

> 3.
> How do you create this screenshot with the red arrow?
> I know how to create a screenshot,
> but I don’t know how to add something remarks with red colour.
> Which package do you use for this?

I just edited the screenshot with Gimp 😅

> 5.
> is there also a possibility to enable all my profiles when I log in
> to my MATE desktop?

So that all applications (including terminal emulators, regardless of
their configuration) open with them already enabled? There's no such
possibility I know of :/

Best,
Wojtek


-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
-- (sig_end)


On Mon, 17 Apr 2023 12:45:28 +0000
Gottfried <gottfried@posteo.de> wrote:

> Hi,
> 
> thanks for help.
> 
> > ou don't add it to `.bashrc`. Instead, you need to configure your  
> >> *terminal emulator*. It is the graphical application that you use to
> >> access the command line. Since you mentioned you're using Mate desktop,
> >> I suspect the terminal emulator you are using is "mate-terminal" and
> >> I'll give you instructions for that. If you happen to be using
> >> a different one (like xfce4-terminal, konsole, sakura, xterm, etc.),
> >> the steps are going to be slightly different.
> >> 
> >> So, right-click somewhene in your mate-terminal window and choose
> >> "Profiles->Profile Preferences" as in the attached screenshot. Then, in
> >> the "Editing Profile" windows that shows, switch to the "Title and
> >> Command" tab and tick the "Run command as a login shell" option (as
> >> shown in the second attached screenshot). Finally, close the "Editing
> >> Profile" window.  
> 
> 1.
> I already had this option enabled in the MATE terminal
> 
> 2.
> > shopt -q login_shell; echo $?  
> >> 
> >> If the bash instance you're interacting with is a login shell, it shall
> >> print "0". Otherwise, it'll print "1".  
> 
> gfp@Tuxedo ~$ shopt -q login_shell; echo $?
> 0
> 
> 3.
> How do you create this screenshot with the red arrow?
> I know how to create a screenshot,
> but I don’t know how to add something remarks with red colour.
> Which package do you use for this?
> 
> 4.
> > your profiles get enabled when you "log in" in a terminal.  
> >> And here we're just causing the execution of mate-terminal application
> >> to be treated as such login.  
> 
> So how can I now enable all e.g. 10 profiles at once in the terminal?
> which commands do I have to use?
> 
> I enabled always one profile by one:
> 
> guix shell -p ~/Projekte/Libreoffice/guix-profil
> to open libreoffice
> 
> guix shell -p ~/Projekte/Musik/guix-profil
> to open the music profil with several packages
> 
> and so on...
> 
> 5.
> is there also a possibility to enable all my profiles when I log in to 
> my MATE desktop?
> so that I can save time and don’t need to open one profile after another 
> in the terminal?
> 
> (Except the case, if there is a possibility, question 4, to open all 
> profiles at once by one command in the MATE terminal, so that I have all 
> packages in all profiles enabled at once)
> 
> 
> Kind regards
> 
> Gottfried
> 
> 
> 
> Am 17.04.23 um 13:56 schrieb Wojtek Kosior:
> >> Hi,
> >> thanks for helping me.
> >>
> >> ------------------------------------------------------------------
> >> 1.
> >> I added:
> >> "GUIX_EXTRA_PROFILES=/home/gfp/Projekte"
> >> to my /.bash_profile
> >>
> >> 2.
> >> I changed the sentence
> >> "profile=$i/$(basename "$i")"
> >>    to:
> >>    "profile=$i"
> >>
> >> 3.
> >> my /.bash_profile looks now, after changing like this:
> >>
> >> [...]  
> > 
> > Looks good :)
> >   
> >> Where do I have to add "-l" in /.bashrc?  
> > 
> > You don't add it to `.bashrc`. Instead, you need to configure your
> > *terminal emulator*. It is the graphical application that you use to
> > access the command line. Since you mentioned you're using Mate desktop,
> > I suspect the terminal emulator you are using is "mate-terminal" and
> > I'll give you instructions for that. If you happen to be using
> > a different one (like xfce4-terminal, konsole, sakura, xterm, etc.),
> > the steps are going to be slightly different.
> > 
> > So, right-click somewhene in your mate-terminal window and choose
> > "Profiles->Profile Preferences" as in the attached screenshot. Then, in
> > the "Editing Profile" windows that shows, switch to the "Title and
> > Command" tab and tick the "Run command as a login shell" option (as
> > shown in the second attached screenshot). Finally, close the "Editing
> > Profile" window.
> > 
> > Once you restart mate-terminal, it should run bash as a login shell.
> > You can verify this by running the following command (well, 2 commands)
> > 
> >      shopt -q login_shell; echo $?
> > 
> > If the bash instance you're interacting with is a login shell, it shall
> > print "0". Otherwise, it'll print "1".
> > 
> > 
> > Now, it might be good to clarify some things. What we're doing here
> > does *not* enable your profiles when you start the Mate desktop. It
> > instead enables them when you start mate-terminal with bash in it. In
> > other words, your profiles get enabled when you "log in" in a terminal.
> > And here we're just causing the execution of mate-terminal application
> > to be treated as such login.
> > 
> > But don't worry about these details — this is what you want. The lines
> > you now have in your `.bash_profile` will also enable your Guix
> > profiles when you log in through a TTY or through SSH. This is the
> > correct behavior :)
> > 
> > 
> > Best luck ;)
> > 
> > Wojtek
> > 
> > 
> > -- (sig_start)
> > website: https://koszko.org/koszko.html
> > PGP: https://koszko.org/key.gpg
> > fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A
> > 
> > ♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
> > ✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
> > -- (sig_end)
> > 
> > 
> > On Mon, 17 Apr 2023 07:37:40 +0000
> > Gottfried <gottfried@posteo.de> wrote:
> >   
> >> Hi,
> >> thanks for helping me.
> >>
> >> ------------------------------------------------------------------
> >> 1.
> >> I added:
> >> "GUIX_EXTRA_PROFILES=/home/gfp/Projekte"
> >> to my /.bash_profile
> >>
> >> 2.
> >> I changed the sentence
> >> "profile=$i/$(basename "$i")"
> >>    to:
> >>    "profile=$i"
> >>
> >> 3.
> >> my /.bash_profile looks now, after changing like this:
> >>
> >> # Honor per-interactive-shell startup file
> >> if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
> >>
> >> GUIX_EXTRA_PROFILES=/home/gfp/Projekte
> >> for i in $GUIX_EXTRA_PROFILES/*; do
> >>     profile=$i
> >>     if [ -f "$profile"/etc/profile ]; then
> >>       GUIX_PROFILE="$profile"
> >>       . "$GUIX_PROFILE"/etc/profile
> >>     fi
> >>     unset profile
> >> done
> >>
> >> ----------------------------------------------------------------------
> >> 4.
> >> my /.bashrc looks like this
> >>
> >> # Bash initialization for interactive non-login shells and
> >> # for remote shells (info "(bash) Bash Startup Files").
> >>
> >> # Export 'SHELL' to child processes.  Programs such as 'screen'
> >> # honor it and otherwise use /bin/sh.
> >> export SHELL
> >>
> >> if [[ $- != *i* ]]
> >> then
> >>       # We are being invoked from a non-interactive shell.  If this
> >>       # is an SSH session (as in "ssh host command"), source
> >>       # /etc/profile so we get PATH and other essential variables.
> >>       [[ -n "$SSH_CLIENT" ]] && source /etc/profile
> >>
> >>       # Don't do anything else.
> >>       return
> >> fi
> >>
> >> # Source the system-wide file.
> >> source /etc/bashrc
> >>
> >> # Adjust the prompt depending on whether we're in 'guix environment'.
> >> if [ -n "$GUIX_ENVIRONMENT" ]
> >> then
> >>       PS1='\u@\h \w [env]\$ '
> >> else
> >>       PS1='\u@\h \w\$ '
> >> fi
> >> alias ls='ls -p --color=auto'
> >> alias ll='ls -l'
> >> alias grep='grep --color=auto'
> >>
> >> ---------------------------------------------------------------------  
> >>> change the configuration of one's terminal emulator to start bash  
> >>>>     with `-l`  
> >>
> >> 5.
> >> Where do I have to add "-l" in /.bashrc?
> >>
> >>
> >> Kind regards
> >>
> >> Gottfried
> >>
> >>
> >>
> >>
> >>
> >> Am 16.04.23 um 22:18 schrieb Wojtek Kosior:  
> >>> Hi Gottfried,
> >>>
> >>> I see 3 potential problems.
> >>>
> >>> 1.
> >>> The snippet you addet to .bashrc refers to a variable named
> >>> "GUIX_EXTRA_PROFILES". Is this variable defined somewhere? Is seems it
> >>> isn't. It should be assigned the path to the directory holding your
> >>> profiles so you could for example add a
> >>>
> >>>       GUIX_EXTRA_PROFILES=/path/to/directory/with/my/guix/profiles
> >>>
> >>> line before the `for` loop. Of course, replacing the
> >>> "/path/to/directory/with/my/guix/profiles" with the appropriate path
> >>> for your system.
> >>>
> >>> 2.
> >>> Why is `basename` being used here? Consider the following example:
> >>>
> >>> - "GUIX_EXTRA_PROFILES" is set to /home/user/my-extra-guix-stuff
> >>> - you have 1 extra Guix profile under
> >>>     "/home/user/my-extra-guix-stuff/music"
> >>> - the profile mentioned above has its `profile` script under
> >>>     "/home/user/my-extra-guix-stuff/music/etc/profile"
> >>>
> >>> Now, let's look at what the
> >>>
> >>>       profile=$i/$(basename "$i")
> >>>
> >>> line does. This line is inside a `for` loop, in each iteration the
> >>> variable "i" holds the path to one of the profiles under
> >>> "/home/user/my-extra-guix-stuff". In one iteration "i" is going to hold
> >>> the string "/home/user/my-extra-guix-stuff/music". The `basename "$i"`
> >>> command therefore outputs just "music". So the line we're analyzing
> >>> assigns the string "/home/user/my-extra-guix-stuff/music/music" to
> >>> variable called "profile". Is this what we wanted? The next line is
> >>> going to check for the existence of file
> >>> "/home/user/my-extra-guix-stuff/music/music/etc/profile" but it should
> >>> instead check for the existence of
> >>> "/home/user/my-extra-guix-stuff/music/etc/profile". So you might want
> >>> to e.g. replace the line
> >>>
> >>>       profile=$i/$(basename "$i")
> >>>
> >>> with just
> >>>
> >>>       profile=$i
> >>>
> >>> 3.
> >>> You edited "~/.bash_profile" which is indeed known to be read by bash.
> >>>
> >>> However, this is not that simple. Bash has 3 possible modes of running:
> >>> non-interactive shell, interactive shell and (interactive) login shell.
> >>> The "login shell" mode is meant to be used when, well, bash is spawned
> >>> in a terminal upon user login. "~/.bash_profile" is *only* read by bash
> >>> in this mode and not in the other 2. In interactive shell mode, bash
> >>> reads "~/.bashrc" *instead*.
> >>>
> >>> When you, for example, execute a `bash` command inside an
> >>> already-running shell, the child bash shell that spawns is not going to
> >>> consider itself a login shell but rather a mere interactive shell. To
> >>> make bash think is is a login shell, you can e.g. start it with a `-l`
> >>> flag, like `bash -l`.
> >>>
> >>> The problem is, most terminal emulators by default don't start bash
> >>> this way. The 2 solutions I've been using are to either
> >>> - change the configuration of one's terminal emulator to start bash
> >>>     with `-l`
> >>> - or make the ".bashrc" script check if current interactive shell was
> >>>     spawned by a teminal emulator process and if yes, have it activate the
> >>>     Guix profiles.
> >>>
> >>> The 1st solution is the proper one, the 2nd one is just a workaround
> >>> for terminal emulators that are not configurable enough :)
> >>>
> >>>
> >>> Wojtek
> >>>
> >>>
> >>> -- (sig_start)
> >>> website: https://koszko.org/koszko.html
> >>> PGP: https://koszko.org/key.gpg
> >>> fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A
> >>>
> >>> ♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
> >>> ✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
> >>> -- (sig_end)
> >>>
> >>>
> >>> On Sun, 16 Apr 2023 13:09:00 +0000
> >>> Gottfried <gottfried@posteo.de> wrote:
> >>>      
> >>>> Hi,
> >>>>
> >>>> according to the cookbook
> >>>> I added
> >>>> --------------------------------------------
> >>>> for i in $GUIX_EXTRA_PROFILES/*; do
> >>>>      profile=$i/$(basename "$i")
> >>>>      if [ -f "$profile"/etc/profile ]; then
> >>>>        GUIX_PROFILE="$profile"
> >>>>        . "$GUIX_PROFILE"/etc/profile
> >>>>      fi
> >>>>      unset profile
> >>>> done
> >>>> -----------------------------------------------
> >>>> into my .bash_profile file
> >>>> in order to enable all profiles at login time:
> >>>> ------------------------------------------------
> >>>> My .bash_profile file looks now like that:
> >>>>
> >>>> # Honor per-interactive-shell startup file
> >>>> if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
> >>>>
> >>>> for i in $GUIX_EXTRA_PROFILES/*; do
> >>>>      profile=$i/$(basename "$i")
> >>>>      if [ -f "$profile"/etc/profile ]; then
> >>>>        GUIX_PROFILE="$profile"
> >>>>        . "$GUIX_PROFILE"/etc/profile
> >>>>      fi
> >>>>      unset profile
> >>>> done
> >>>> -----------------------------------------------
> >>>>
> >>>> but when starting MATE Desktop all my profiles are not enabled.
> >>>>
> >>>> Could somebody help because probably the two entries in my .bash_profile
> >>>> got a mistake.
> >>>>     
> >>>
> >>>      
> >>  
> > 
> >   
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: to enable all profiles at login time
  2023-04-17 12:55         ` Wojtek Kosior via
@ 2023-04-17 14:30           ` Martin Castillo
  2023-04-17 14:55           ` Gottfried
  1 sibling, 0 replies; 18+ messages in thread
From: Martin Castillo @ 2023-04-17 14:30 UTC (permalink / raw)
  To: help-guix

Hi,

>> 5.
>> is there also a possibility to enable all my profiles when I log in
>> to my MATE desktop?
> 
> So that all applications (including terminal emulators, regardless of
> their configuration) open with them already enabled? There's no such
> possibility I know of :/

There is a way and I think it may even be standardized.
On my non-guix distro I use sddm as display-manager. On login, it 
executes /usr/share/sddm/scripts/Xsession as my user.

It contains:
   9 case $SHELL in
  10   */bash)
  11     [ -z "$BASH" ] && exec $SHELL $0 "$@"
  12     set +o posix
  13     [ -f /etc/profile ] && . /etc/profile
  14     if [ -f $HOME/.bash_profile ]; then
  15       . $HOME/.bash_profile
  16     elif [ -f $HOME/.bash_login ]; then
  17       . $HOME/.bash_login
  18     elif [ -f $HOME/.profile ]; then
  19       . $HOME/.profile
  20     fi
...
  41   */fish)
  42     xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
  43     $SHELL --login -c "/bin/sh -c 'export -p' > $xsess_tmp"
  44     . $xsess_tmp
  45     rm -f $xsess_tmp
  46     ;;
  47   *) # Plain sh, ksh, and anything we do not know.
  48     [ -f /etc/profile ] && . /etc/profile
  49     [ -f $HOME/.profile ] && . $HOME/.profile


So it does try to find shell specific config files (for those that it 
knows about).

You need to know what display-manager (the program where you log in to 
your user) you use and look at its documentation to see what files it 
may source before it logs you in.

In that case, you don't need to launch bash as login shell in your 
terminal, because all the profiles are activated when you login.

Martin


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

* Re: to enable all profiles at login time
  2023-04-17 12:55         ` Wojtek Kosior via
  2023-04-17 14:30           ` Martin Castillo
@ 2023-04-17 14:55           ` Gottfried
  2023-04-17 20:15             ` Wojtek Kosior via
  1 sibling, 1 reply; 18+ messages in thread
From: Gottfried @ 2023-04-17 14:55 UTC (permalink / raw)
  To: Wojtek Kosior; +Cc: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 1269 bytes --]

Hi,
thanks for help


> Then you're all set. It should be working now 😄
> 
> Try closing the terminal and opening it again. Are the commands from
> your profiles (e.g. `libreoffice`) available immediately, without the
> need to run any manual `guix` commands? They should be

No, I put libreoffice in a separate profile,
so in the terminal it is not found:

gfp@Tuxedo ~$ libreoffice
-bash: libreoffice: Kommando nicht gefunden.
gfp@Tuxedo ~$ frescobaldi
-bash: frescobaldi: Kommando nicht gefunden.
gfp@Tuxedo ~$ lilypond
-bash: lilypond: Kommando nicht gefunden.

Also other packages from different profiles are not found.

-------------------------------------------------------------------------
But I have a symbol of libreoffice on my desktop and if I klick on it, 
it will open libreoffice (an older version).
The symbol didn’t disappear after uninstalling libreoffice from my 
default profile.
------------------------------------------------------------------------

So may be I didn’t understand everything yet, what I have to do.
-------------------------------------------------------------------------

I have to open each profile with
guix shell -p ~/Projekte/e.g.: Icecat/guix-profil

Kind regards

Gottfried

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: to enable all profiles at login time
  2023-04-16 13:09 to enable all profiles at login time Gottfried
  2023-04-16 20:18 ` Wojtek Kosior via
@ 2023-04-17 17:25 ` Giovanni Biscuolo
  1 sibling, 0 replies; 18+ messages in thread
From: Giovanni Biscuolo @ 2023-04-17 17:25 UTC (permalink / raw)
  To: Gottfried, help-guix

[-- Attachment #1: Type: text/plain, Size: 557 bytes --]

Hi Gottfried

I guess you are on a foreign distro

Gottfried <gottfried@posteo.de> writes:

[...]

> but when starting MATE Desktop all my profiles are not enabled.

graphical sessions environment is not controlled by .bash_profile (or
.profile)

If your distro works like Debian [1], try to add this to your ~/.xsessionrc:

if [ -f ~/.bash_profile ]; then
    . ~/.bash_profile
fi

Details here:
https://wiki.debian.org/Xsession#User_configuration

[...]

Happy hacking! Gio'

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]

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

* Re: to enable all profiles at login time
  2023-04-17 12:45       ` Gottfried
  2023-04-17 12:55         ` Wojtek Kosior via
@ 2023-04-17 18:32         ` Sergiu Ivanov
  2023-04-20 10:11           ` Gottfried
  1 sibling, 1 reply; 18+ messages in thread
From: Sergiu Ivanov @ 2023-04-17 18:32 UTC (permalink / raw)
  To: Gottfried; +Cc: Wojtek Kosior, help-guix

Hi Gottfried,

I have nothing to add about your main question but :

Gottfried <gottfried@posteo.de> [2023-04-17T14:45:28+0200]:
> How do you create this screenshot with the red arrow?

I use Flameshot, which comes in the package aptly named flameshot.

This program lets you choose the part of the screen to capture, and
allows you to add some basic graphics, e.g. arrows, text, shapes, etc.

GIMP is good, and I also use it for screenshots from time to time, but
Flameshot is often much faster to use.

-
Sergiu


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

* Re: to enable all profiles at login time
  2023-04-17 14:55           ` Gottfried
@ 2023-04-17 20:15             ` Wojtek Kosior via
  2023-04-18 15:19               ` Gottfried
  0 siblings, 1 reply; 18+ messages in thread
From: Wojtek Kosior via @ 2023-04-17 20:15 UTC (permalink / raw)
  To: Gottfried; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 2718 bytes --]

> No, I put libreoffice in a separate profile,
> so in the terminal it is not found:
> 
> gfp@Tuxedo ~$ libreoffice
> -bash: libreoffice: Kommando nicht gefunden.
> gfp@Tuxedo ~$ frescobaldi
> -bash: frescobaldi: Kommando nicht gefunden.
> gfp@Tuxedo ~$ lilypond
> -bash: lilypond: Kommando nicht gefunden.
> 
> Also other packages from different profiles are not found.

I see the problem now. The profile paths on your system are not like
"/home/gfp/Projekte/Libreoffice" but rather like
"/home/gfp/Projekte/Libreoffice/guix-profil". So we need to add
"/guix-profil" to each profile path.

You can try replacing

    profile=$i

line with

    profile=$i/guix-profil

In your `.bash_profile`.

Once you do this it'll (hopefully!) work :) And then you can choose to
either stay at the setup I suggested or e.g. try using X session
startup files as others suggested (which btw seems like a neat solution)

Wojtek

-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
-- (sig_end)


On Mon, 17 Apr 2023 14:55:10 +0000
Gottfried <gottfried@posteo.de> wrote:

> Hi,
> thanks for help
> 
> 
> > Then you're all set. It should be working now 😄
> > 
> > Try closing the terminal and opening it again. Are the commands from
> > your profiles (e.g. `libreoffice`) available immediately, without the
> > need to run any manual `guix` commands? They should be  
> 
> No, I put libreoffice in a separate profile,
> so in the terminal it is not found:
> 
> gfp@Tuxedo ~$ libreoffice
> -bash: libreoffice: Kommando nicht gefunden.
> gfp@Tuxedo ~$ frescobaldi
> -bash: frescobaldi: Kommando nicht gefunden.
> gfp@Tuxedo ~$ lilypond
> -bash: lilypond: Kommando nicht gefunden.
> 
> Also other packages from different profiles are not found.
> 
> -------------------------------------------------------------------------
> But I have a symbol of libreoffice on my desktop and if I klick on it, 
> it will open libreoffice (an older version).
> The symbol didn’t disappear after uninstalling libreoffice from my 
> default profile.
> ------------------------------------------------------------------------
> 
> So may be I didn’t understand everything yet, what I have to do.
> -------------------------------------------------------------------------
> 
> I have to open each profile with
> guix shell -p ~/Projekte/e.g.: Icecat/guix-profil
> 
> Kind regards
> 
> Gottfried



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: to enable all profiles at login time
  2023-04-17 20:15             ` Wojtek Kosior via
@ 2023-04-18 15:19               ` Gottfried
  0 siblings, 0 replies; 18+ messages in thread
From: Gottfried @ 2023-04-18 15:19 UTC (permalink / raw)
  To: Wojtek Kosior; +Cc: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 3277 bytes --]

Hi,

thanks a lot for help.

Now it works, I can open the packages through my terminal.

> And then you can choose to
>> either stay at the setup I suggested or e.g. try using X session
>> startup files as others suggested (which btw seems like a neat solution)

What do you mean by trying X session, startup files as others suggested?
How can I do it?


Kind regards

Gottfried



Am 17.04.23 um 22:15 schrieb Wojtek Kosior:
>> No, I put libreoffice in a separate profile,
>> so in the terminal it is not found:
>>
>> gfp@Tuxedo ~$ libreoffice
>> -bash: libreoffice: Kommando nicht gefunden.
>> gfp@Tuxedo ~$ frescobaldi
>> -bash: frescobaldi: Kommando nicht gefunden.
>> gfp@Tuxedo ~$ lilypond
>> -bash: lilypond: Kommando nicht gefunden.
>>
>> Also other packages from different profiles are not found.
> 
> I see the problem now. The profile paths on your system are not like
> "/home/gfp/Projekte/Libreoffice" but rather like
> "/home/gfp/Projekte/Libreoffice/guix-profil". So we need to add
> "/guix-profil" to each profile path.
> 
> You can try replacing
> 
>      profile=$i
> 
> line with
> 
>      profile=$i/guix-profil
> 
> In your `.bash_profile`.
> 
> Once you do this it'll (hopefully!) work :) And then you can choose to
> either stay at the setup I suggested or e.g. try using X session
> startup files as others suggested (which btw seems like a neat solution)
> 
> Wojtek
> 
> -- (sig_start)
> website: https://koszko.org/koszko.html
> PGP: https://koszko.org/key.gpg
> fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A
> 
> ♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
> ✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
> -- (sig_end)
> 
> 
> On Mon, 17 Apr 2023 14:55:10 +0000
> Gottfried <gottfried@posteo.de> wrote:
> 
>> Hi,
>> thanks for help
>>
>>
>>> Then you're all set. It should be working now 😄
>>>
>>> Try closing the terminal and opening it again. Are the commands from
>>> your profiles (e.g. `libreoffice`) available immediately, without the
>>> need to run any manual `guix` commands? They should be
>>
>> No, I put libreoffice in a separate profile,
>> so in the terminal it is not found:
>>
>> gfp@Tuxedo ~$ libreoffice
>> -bash: libreoffice: Kommando nicht gefunden.
>> gfp@Tuxedo ~$ frescobaldi
>> -bash: frescobaldi: Kommando nicht gefunden.
>> gfp@Tuxedo ~$ lilypond
>> -bash: lilypond: Kommando nicht gefunden.
>>
>> Also other packages from different profiles are not found.
>>
>> -------------------------------------------------------------------------
>> But I have a symbol of libreoffice on my desktop and if I klick on it,
>> it will open libreoffice (an older version).
>> The symbol didn’t disappear after uninstalling libreoffice from my
>> default profile.
>> ------------------------------------------------------------------------
>>
>> So may be I didn’t understand everything yet, what I have to do.
>> -------------------------------------------------------------------------
>>
>> I have to open each profile with
>> guix shell -p ~/Projekte/e.g.: Icecat/guix-profil
>>
>> Kind regards
>>
>> Gottfried
> 
> 

-- 


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: to enable all profiles at login time
@ 2023-04-19 16:10 Gottfried
  2023-04-19 18:19 ` Martin Castillo
  0 siblings, 1 reply; 18+ messages in thread
From: Gottfried @ 2023-04-19 16:10 UTC (permalink / raw)
  To: g, help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 1437 bytes --]

Hi,

your email address is still blocked through my email-provider. So I 
don’t get it.

I am working on "Guix System" , not on a foreign distro.
So I don’t know if your suggestion I can use.
-- 
Kind regards

Gottfried

> Message: 1
> Date: Mon, 17 Apr 2023 19:25:57 +0200
> From: Giovanni Biscuolo <g@xelera.eu>
> To: Gottfried <gottfried@posteo.de>, help-guix@gnu.org
> Subject: Re: to enable all profiles at login time
> Message-ID: <87mt36o1y2.fsf@xelera.eu>
> Content-Type: text/plain; charset="utf-8"
> 
> Hi Gottfried
> 
> I guess you are on a foreign distro
> 
> Gottfried <gottfried@posteo.de> writes:
> 
> [...]
> 
>> but when starting MATE Desktop all my profiles are not enabled.
> 
> graphical sessions environment is not controlled by .bash_profile (or
> .profile)
> 
> If your distro works like Debian [1], try to add this to your ~/.xsessionrc:
> 
> if [ -f ~/.bash_profile ]; then
>     . ~/.bash_profile
> fi
> 
> Details here:
> https://wiki.debian.org/Xsession#User_configuration
> 
> [...]
> 
> Happy hacking! Gio'
> 
> -- 
> Giovanni Biscuolo
> 
> Xelera IT Infrastructures
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: signature.asc
> Type: application/pgp-signature
> Size: 849 bytes
> Desc: not available
> URL: <https://lists.gnu.org/archive/html/help-guix/attachments/20230417/0a961fe9/attachment.sig>


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: to enable all profiles at login time
  2023-04-19 16:10 Gottfried
@ 2023-04-19 18:19 ` Martin Castillo
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Castillo @ 2023-04-19 18:19 UTC (permalink / raw)
  To: help-guix

Hi,

Am 19.04.23 um 18:10 schrieb Gottfried:
> 
>> but when starting MATE Desktop all my profiles are not enabled.
> 
> graphical sessions environment is not controlled by .bash_profile (or
> .profile)

If sddm is used, this statement is false. Does source that file (if bash 
is the users shell) and therefore it influenced the environment 
variables of all applications started the graphical environment.

Gottfried, what display-manager do you use?

Maybe this command can tell you:
$ ps $(ps   -p $(pidof Xorg) -o ppid=)

Martin


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

* Re: to enable all profiles at login time
  2023-04-17 18:32         ` Sergiu Ivanov
@ 2023-04-20 10:11           ` Gottfried
  2023-04-20 10:20             ` Sergiu Ivanov
  0 siblings, 1 reply; 18+ messages in thread
From: Gottfried @ 2023-04-20 10:11 UTC (permalink / raw)
  To: Sergiu Ivanov; +Cc: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 937 bytes --]

Hi,

I installed flameshot, but it doesn’t open.
I tried it beforehand with guix shell flameshot and it worked not 
completely, but somehow.
But now, after installation it doesn’t open at all.

Do you have guix system or are you on an other distro?

Am 17.04.23 um 20:32 schrieb Sergiu Ivanov:
> Hi Gottfried,
> 
> I have nothing to add about your main question but :
> 
> Gottfried <gottfried@posteo.de> [2023-04-17T14:45:28+0200]:
>> How do you create this screenshot with the red arrow?
> 
> I use Flameshot, which comes in the package aptly named flameshot.
> 
> This program lets you choose the part of the screen to capture, and
> allows you to add some basic graphics, e.g. arrows, text, shapes, etc.
> 
> GIMP is good, and I also use it for screenshots from time to time, but
> Flameshot is often much faster to use.
> 
> -
> Sergiu

-- 
Kind regards

Gottfried
Guix System, MATE desktop



[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: to enable all profiles at login time
  2023-04-20 10:11           ` Gottfried
@ 2023-04-20 10:20             ` Sergiu Ivanov
  2023-04-20 11:28               ` Gottfried
  0 siblings, 1 reply; 18+ messages in thread
From: Sergiu Ivanov @ 2023-04-20 10:20 UTC (permalink / raw)
  To: Gottfried; +Cc: help-guix

Hi Gottfried,

Gottfried <gottfried@posteo.de> [2023-04-20T12:11:16+0200]:
> [[PGP Signed Part:Undecided]]
> Hi,
>
> I installed flameshot, but it doesn’t open.
> I tried it beforehand with guix shell flameshot and it worked not
> completely, but somehow.
> But now, after installation it doesn’t open at all.

When run without any command line arguments, Flameshot installs a tray
icon, near the volume icon and the Network Manager icon in my case.
To make a screenshot, I click on the icon, which dims the screen and
allows me to draw a rectangle to show the region I want to capture.

I have just discovered that you can run the "flameshot gui" command,
which has the same effect as clicking on the tray icon.  Maybe you could
try this option if you don't see the tray icon appear.

> Do you have guix system or are you on an other distro?

Yes, I run Guix System (and EXWM as the window manager).

-
Sergiu


> Am 17.04.23 um 20:32 schrieb Sergiu Ivanov:
>> Hi Gottfried,
>> I have nothing to add about your main question but :
>> Gottfried <gottfried@posteo.de> [2023-04-17T14:45:28+0200]:
>>> How do you create this screenshot with the red arrow?
>> I use Flameshot, which comes in the package aptly named flameshot.
>> This program lets you choose the part of the screen to capture, and
>> allows you to add some basic graphics, e.g. arrows, text, shapes, etc.
>> GIMP is good, and I also use it for screenshots from time to time,
>> but
>> Flameshot is often much faster to use.
>> -
>> Sergiu



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

* Re: to enable all profiles at login time
  2023-04-20 10:20             ` Sergiu Ivanov
@ 2023-04-20 11:28               ` Gottfried
  2023-04-20 13:51                 ` Sergiu Ivanov
  0 siblings, 1 reply; 18+ messages in thread
From: Gottfried @ 2023-04-20 11:28 UTC (permalink / raw)
  To: Sergiu Ivanov; +Cc: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 2587 bytes --]

Hi,

thanks for help.

it works,

> When run without any command line arguments, Flameshot installs a tray
>> icon, near the volume icon and the Network Manager icon in my case.
>> To make a screenshot, I click on the icon, which dims the screen and
>> allows me to draw a rectangle to show the region I want to capture.
>> 
>> I have just discovered that you can run the "flameshot gui" command,
>> which has the same effect as clicking on the tray icon.  Maybe you could
>> try this option if you don't see the tray icon appear.

Near the volume icon there appear two icons, both are flameshot.
I didn’t see those icons earlier, because they are in grey colour 
without anything on them, so they don’t stand out.

I don’t know why two instead of one, but it doesn’t matter.
It works, as you described, and that’s the most important.

thanks very much

Kind regards

Gottfried


Am 20.04.23 um 12:20 schrieb Sergiu Ivanov:
> Hi Gottfried,
> 
> Gottfried <gottfried@posteo.de> [2023-04-20T12:11:16+0200]:
>> [[PGP Signed Part:Undecided]]
>> Hi,
>>
>> I installed flameshot, but it doesn’t open.
>> I tried it beforehand with guix shell flameshot and it worked not
>> completely, but somehow.
>> But now, after installation it doesn’t open at all.
> 
> When run without any command line arguments, Flameshot installs a tray
> icon, near the volume icon and the Network Manager icon in my case.
> To make a screenshot, I click on the icon, which dims the screen and
> allows me to draw a rectangle to show the region I want to capture.
> 
> I have just discovered that you can run the "flameshot gui" command,
> which has the same effect as clicking on the tray icon.  Maybe you could
> try this option if you don't see the tray icon appear.
> 
>> Do you have guix system or are you on an other distro?
> 
> Yes, I run Guix System (and EXWM as the window manager).
> 
> -
> Sergiu
> 
> 
>> Am 17.04.23 um 20:32 schrieb Sergiu Ivanov:
>>> Hi Gottfried,
>>> I have nothing to add about your main question but :
>>> Gottfried <gottfried@posteo.de> [2023-04-17T14:45:28+0200]:
>>>> How do you create this screenshot with the red arrow?
>>> I use Flameshot, which comes in the package aptly named flameshot.
>>> This program lets you choose the part of the screen to capture, and
>>> allows you to add some basic graphics, e.g. arrows, text, shapes, etc.
>>> GIMP is good, and I also use it for screenshots from time to time,
>>> but
>>> Flameshot is often much faster to use.
>>> -
>>> Sergiu
> 

-- 



[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: to enable all profiles at login time
  2023-04-20 11:28               ` Gottfried
@ 2023-04-20 13:51                 ` Sergiu Ivanov
  0 siblings, 0 replies; 18+ messages in thread
From: Sergiu Ivanov @ 2023-04-20 13:51 UTC (permalink / raw)
  To: Gottfried; +Cc: help-guix

Gottfried <gottfried@posteo.de> [2023-04-20T13:28:05+0200]:
> [[PGP Signed Part:Undecided]]
> Hi,
>
> thanks for help.
>
> it works,

Great news!

> Near the volume icon there appear two icons, both are flameshot.
> I didn’t see those icons earlier, because they are in grey colour
> without anything on them, so they don’t stand out.
>
> I don’t know why two instead of one, but it doesn’t matter.
> It works, as you described, and that’s the most important.

Perhaps you can right-click on one of these icons to get a menu.
Normally, you should see an element like Quit on that menu.

-
Sergiu


> thanks very much
>
> Kind regards
>
> Gottfried
>
>
> Am 20.04.23 um 12:20 schrieb Sergiu Ivanov:
>> Hi Gottfried,
>> Gottfried <gottfried@posteo.de> [2023-04-20T12:11:16+0200]:
>>> [[PGP Signed Part:Undecided]]
>>> Hi,
>>>
>>> I installed flameshot, but it doesn’t open.
>>> I tried it beforehand with guix shell flameshot and it worked not
>>> completely, but somehow.
>>> But now, after installation it doesn’t open at all.
>> When run without any command line arguments, Flameshot installs
>> a tray
>> icon, near the volume icon and the Network Manager icon in my case.
>> To make a screenshot, I click on the icon, which dims the screen and
>> allows me to draw a rectangle to show the region I want to capture.
>> I have just discovered that you can run the "flameshot gui" command,
>> which has the same effect as clicking on the tray icon.  Maybe you could
>> try this option if you don't see the tray icon appear.
>> 
>>> Do you have guix system or are you on an other distro?
>> Yes, I run Guix System (and EXWM as the window manager).
>> -
>> Sergiu
>> 
>>> Am 17.04.23 um 20:32 schrieb Sergiu Ivanov:
>>>> Hi Gottfried,
>>>> I have nothing to add about your main question but :
>>>> Gottfried <gottfried@posteo.de> [2023-04-17T14:45:28+0200]:
>>>>> How do you create this screenshot with the red arrow?
>>>> I use Flameshot, which comes in the package aptly named flameshot.
>>>> This program lets you choose the part of the screen to capture, and
>>>> allows you to add some basic graphics, e.g. arrows, text, shapes, etc.
>>>> GIMP is good, and I also use it for screenshots from time to time,
>>>> but
>>>> Flameshot is often much faster to use.
>>>> -
>>>> Sergiu
>> 



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

end of thread, other threads:[~2023-04-20 13:54 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-16 13:09 to enable all profiles at login time Gottfried
2023-04-16 20:18 ` Wojtek Kosior via
2023-04-17  7:37   ` Gottfried
2023-04-17 11:56     ` Wojtek Kosior via
2023-04-17 12:45       ` Gottfried
2023-04-17 12:55         ` Wojtek Kosior via
2023-04-17 14:30           ` Martin Castillo
2023-04-17 14:55           ` Gottfried
2023-04-17 20:15             ` Wojtek Kosior via
2023-04-18 15:19               ` Gottfried
2023-04-17 18:32         ` Sergiu Ivanov
2023-04-20 10:11           ` Gottfried
2023-04-20 10:20             ` Sergiu Ivanov
2023-04-20 11:28               ` Gottfried
2023-04-20 13:51                 ` Sergiu Ivanov
2023-04-17 17:25 ` Giovanni Biscuolo
  -- strict thread matches above, loose matches on Subject: below --
2023-04-19 16:10 Gottfried
2023-04-19 18:19 ` Martin Castillo

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).