You are not logged in.
It's possible to click a script: Konsole launches prompting the argument(s), e.g. to install package(s):
#!/bin/bash
cd
konsole -e bash -c 'read a
sudo pacman -Syu $a
sudo rm -r /tmp/a
bash'then I write e.g.
zaz chromium-bsuBut the title: I click something, Konsole launches with already written e.g.
sudo pacman -Syu ?
The goal is to avoid writing or copy-pasting e.g. sudo pacman -Syu , a simple click.
Last edited by bivan (2026-06-08 18:52:31)
Offline
This will do what you wanted, but I am not sure why you want it?
#!/bin/bash
cd
konsole -e bash -c 'read a; sudo pacman -Syu $a;tail -f /dev/null'Rlu: 222126
Offline
It seems the OP tries to drop into an interactive shell?
In that case this will have to be done in the bashrc - either a custom one (passed to bash) or eg. controlled by an environment that can be set w/ invoking the specific konsole instance.
Offline
I edited my 1st post, more clear.
Offline
Sorta, but I guess you're looking for https://man.archlinux.org/man/rlwrap.1#P, ?
Last edited by seth (2026-06-08 19:29:10)
Offline
#!/bin/bash
cd
rlwrap -P 'sudo pacman -Syu ' konsolethis script launches Konsole normally, nothing pre-written, no.
So a package (other than rlwrap) would work? But not created?
Or a new Konsole option?
Last edited by bivan (2026-06-08 20:09:16)
Offline
You run konsole w/ "rlwrap -P whatever bash", rlwrap'ping konsole makes no sense at all.
Offline
If you are going to click something, open konsole, then alias something to echo 'pacman -Syu' and add the package names, you still only click once and only type their names once.
Otherwise you are just making it difficult to achieve something you will do all the time.
Rlu: 222126
Offline
#!/bin/bash
cd
konsole -e rlwrap -P 'sudo pacman -Syu ' bashit works at 1st impression, but then if I write e.g. zaz chromium-bsu , it's messed, the letters:
z chromium-bsu2f-4817-81fa-c5eb880b82af ~]$ sudo pacman -Syu zaLast edited by bivan (2026-06-08 21:01:15)
Offline
it's messed, the letters.
https://deepl.com/translate
Or maybe link a screenshot.
rlwrap will inevitably have *some* impact here (notably the ctrl+c behavior and tab completion)
Also why are you posting some bash script?
You can just run
konsole -e rlwrap -P 'sudo pacman -Syu ' bashAlso please elaborate what exactly you're trying to achieve here - why is your OP approach to read the packages you're going to install and then pass them to pacman -Syu not desirable?
What's the purpose of all of this itfp? Why do you want to launch some special konsole instead of just entering "pacman -Syu whatever"?
Offline
I edited my previous post.
Is it a rlwrap bug? Should I report?
Yes my OP approach works, I just wonder if the title is possible, more pure, I'm lazy to write "sudo pacman -Syu ".
Offline
Do you get this w/
konsole -e rlwrap -P 'sudo pacman -Syu ' bash --norcor
xterm -e rlwrap -P 'sudo pacman -Syu ' bash --norc?
Edit: how wide is your terminal? Do you expect the input to wrap where it rewinds?
rlwrap isn't exactly written to wrap an interactive shell - it's to provide readline features to "dumb" processes.
Last edited by seth (2026-06-08 21:14:50)
Offline
The 1st: yes, but I write zaz chromium-bsu then press Enter: the text appears glitched (need a video here, or why not you try yourself?).
The 2nd: I haven't xterm, why xterm?
Edit: 1920*1080 display, I unchecked Konsole, Remember window size, no, there's space for all the command.
Last edited by bivan (2026-06-08 21:31:50)
Offline
Thanks to Gemini:
Configure Konsole..., Enable the security sensitive parts of the DBus API
#!/bin/bash
cd
if ! pgrep -x konsole
then konsole
fi
/usr/lib/qt6/bin/qdbus org.kde.konsole /Sessions/1 org.kde.konsole.Session.sendText 'sudo pacman -Syu 'theorically it should work: if Konsole runs: ok but if not: there isn't "sudo pacman -Syu ", despite "sleep 1" between "then konsole" & "fi", why?
Last edited by bivan (2026-06-08 23:51:53)
Offline
or why not you try yourself? why xterm?
Because I don't have and won't install KDE and this doesn't happen w/ other TEs
theorically it should work: if Konsole runs: ok but if not: there isn't "sudo pacman -Syu ", despite "sleep 1" between "then konsole" & "fi", why?
Because that script is sketchy and relies on various assumptions - afair konsole injects its bus into the environment so you can just "konsole -e env PRESET_PACMAN=true bash" and in your bashrc
if $PRESET_PACMAN; then qdbus6 $KONSOLE_DBUS org.kde.konsole.Session.sendText 'sudo pacman -Syu '; fiKONSOLE_DBUS is a placeholder, check "printenv" to find the actual variable.
Offline
omg I discovered a strange issue answering the why, e.g.
#!/bin/bash
cd
konsole
dolphinonly Konsole launches! Then if I close it, Dolphin launches! wtf, how to launch both?
Last edited by bivan (Yesterday 11:27:04)
Offline
That is expected as bash executes commands sequentially : once a command finishes it starts the next command.
There is a method to tell bash NOT to wait until a command has finished but immediately run the next one . The technique is called backgrounding, see https://web.archive.org/web/20160616013 … -properly/ .
Note that backgrounded commans will not be stopped when the bash script that started them finishes .
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Thanks (but web.archive.org ? There isn't a regular web site, as https://wiki.archlinux.org/ ?), a working script:
#!/bin/bash
cd
if ! pgrep -x konsole
then konsole &
sleep 0.2
fi
qdbus6 $(qdbus6|grep konsole) /Sessions/1 org.kde.konsole.Session.sendText 'sudo pacman -Syu 'sleep 0.1 is too short
$(qdbus6|grep konsole) instead of org.kde.konsole as before because seems since I did "konsole &",
qdbus6|grep konsolegives like org.kde.konsole-733471 , org.kde.konsole-733604 ... why?
Offline
felixmilea.comis 404 and there're countless bash tutorials, https://ryanstutorials.net/bash-scripting-tutorial/
What do you think the parameterless "cd" does?
Also, again: stop this nonsense.
Check the output of "printenv", there'll be some variables specific to konsole.
You'll use those in the bashrc - grepping for random konsole interfaces will not at all guarantee what you're trying to do.
Offline
cd because if no: it's the script's directory.
This script works, so why editing bashrc? Now I just wonder why it's org.kde.konsole-some_number , only org.kde.konsole before.
Offline
cd because
Don't rely on interactive shortcuts, if you want to enter $HOME, cd $HOME
This script works
gives like org.kde.konsole-733471 , org.kde.konsole-733604 ... why?
there isn't "sudo pacman -Syu ", despite "sleep 1"
Because the script "works" (or not) based on wild assumptions about the context that are not necessarily true.
Offline