Skip to main content
Topic: [Solved] Script which "does not return my hand"  (Read 824 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

[Solved] Script which "does not return my hand"

Hello and bonjour,

As I read that it is better to use pacman than pamac to make the updates, I created a small script (yes, I'm too lazy or too in a hurry to write "sudo pacman -Syyu").

Here is the content of my sript:
Code: [Select]
#! /bin/bash
xfce4-terminal --maximize -H -x sudo pacman -Syyu

I put a launcher in the dashboard and the script launches fine, except it "does not return my hand"  (French expression).
In short: when the process is terminated, I do not see an information that the process is finished, or the line :
Code: [Select]
jp-artix:[jp]:~$

I searched, searched but found nothing, probably because I am trying to reinvent the wheel. Shame on me. :)

Thanks in advance for your suggestions.

Re: Script which "does not return my hand"

Reply #1
It's because you're not starting a login shell, you're executing a script and its stdio/stdout/stderr are not connected to terminals but to xfce4-terminal's buffers.


Re: Script which "does not return my hand"

Reply #3
You can make xfce4-terminal spawn a sequence of commands that, after running your command, execs your preferred shell, giving you back control:

Code: [Select]
#!/bin/sh
exec xfce4-terminal --maximize -H -x sh -c 'sudo pacman -Syyu; exec bash'

Bonus for s6 users:
Code: [Select]
#!/bin/execlineb -P
xfce4-terminal --maximize -H -x foreground { sudo pacman -Syyu } unexport ? bash

 

Re: Script which "does not return my hand"

Reply #4
Try this,

Code: [Select]
xfce4-terminal --maximize -H --tab -x sudo pacman -Syyu

Re: Script which "does not return my hand"

Reply #5
You can make xfce4-terminal spawn a sequence of commands that, after running your command, execs your preferred shell, giving you back control:

Code: [Select]
#!/bin/sh
exec xfce4-terminal --maximize -H -x sh -c 'sudo pacman -Syyu; exec bash'
Great !
I had tried to add something after ";" but I couldn't find ...

Thank you !  8)

Re: Script which "does not return my hand"

Reply #6
Code: [Select]
xfce4-terminal --maximize -H --tab -x sudo pacman -Syyu
It also works and allows you to continue.  8)
I couldn't find the --tab option in the manuals.
I note it!

But the order from Capezotte allows to keep the result of the previous order, which interests me more here.

Thank you !