You are not logged in.
...
Yes removing hold executes the script and the terminal closes, but would be nice to keep it open at the default "sc@debian $"
You are running a command in a new terminal, not a new shell - that is what "-e|--exec" does. So you won't get a shell prompt in that window.
EDIT: Try this...
x-terminal-emulator --hold -e 'bash -c "/path/to/script; exec bash"'
Last edited by damo (2017-08-19 19:09:34)
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
I prefer autostarted terminals for tiling type stuff where I might place an mocp instance somewhere and a journalctl -xf terminal somewhere. For an autostarted update/upgrade (please be sure you update before you upgrade in your bash script) I would most likely want the terminal window front and center, then dispose of it when its job is done kind of similar to how dialogs work.
Offline
please be sure you update before you upgrade in your bash script
Good point! Post edited...
Offline
@ damo, thanks for clarifying, that works perfectly now in the terminal.
@obscurant, that is a good idea too, cheers.
@ tknomanzr, i was of the thought that "apt-get -u upgrade" did not download or install an update rather did this...
-u, --show-upgraded
Show upgraded packages. Print out a list of all packages that are to be upgraded.
Configuration Item: APT::Get::Show-Upgraded.
https://linux.die.net/man/8/apt-get
Then after checking the upgradable do "apt-get update && apt-get upgrade".
But i found a better way to just print a list of upgrades.
apt list --upgradable
https://unix.stackexchange.com/question … stall-them
would this be a better command to just check updates and list the upgrades first?
sudo apt update && apt list --upgradable
Last edited by Steve (2017-08-20 01:59:04)
Offline
Call me over-cautious, but i hesitate myself to mix any combination containing nore than one of:
apt <anything>
apt-get <anything>
aptitude <anything>
Personally I'd stick with using one of the above be it apt <something>, apt-get <aomething>, or aptitude <something>
assuming the potions ate present to do whatever with the command, and if not, switch to the whichever supports <command> <whatever> universally..
Last edited by Bearded_Blunder (2017-08-20 02:02:23)
Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me
Offline
@ bearded blunder so maybe this if using apt-get.
apt-get update && apt-get --just-print upgrade
Offline
@ bearded blunder so maybe this if using apt-get.
apt-get update && apt-get --just-print upgrade
"Perfect!"
Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me
Offline
So confirmed working now with the following.
Hoas bash script.
#! /bin/sh
while true; do
read -p "Shall we check for updates [y/n]?" yn
case $yn in
[Yy]*) sudo apt-get update && sudo apt-get --just-print upgrade; break;;
[Nn]*) echo "OK, nevermind."; exit;;
*) echo "Please answer yes or no.";;
esac
done
damo's commands inside of openbox autostart.
sleep 7 && x-terminal-emulator --hold -e 'bash -c "~/bin/update.sh; exec bash"'
Ive put this at the end of the autostart file so it is last to load.
Thanks for the help all, much appreciated.
Offline