You are not logged in.

#21 2017-08-19 18:36:32

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Openbox autostart script to check updates

Steve wrote:

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

#22 2017-08-19 18:42:07

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,057

Re: Openbox autostart script to check updates

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

#23 2017-08-19 18:46:27

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: Openbox autostart script to check updates

tknomanzr wrote:

please be sure you update before you upgrade in your bash script

Good point! Post edited...

Offline

#24 2017-08-20 01:50:35

Steve
Member
Registered: 2017-01-03
Posts: 642

Re: Openbox autostart script to check updates

@ 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

#25 2017-08-20 02:02:04

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 1,146

Re: Openbox autostart script to check updates

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

#26 2017-08-20 02:09:42

Steve
Member
Registered: 2017-01-03
Posts: 642

Re: Openbox autostart script to check updates

@ bearded blunder so maybe this if using apt-get.

apt-get update && apt-get --just-print upgrade

Offline

#27 2017-08-20 02:14:13

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 1,146

Re: Openbox autostart script to check updates

Steve wrote:

@ bearded blunder so maybe this if using apt-get.

apt-get update && apt-get --just-print upgrade
B_B's mindset wrote:

"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

#28 2017-08-20 02:25:49

Steve
Member
Registered: 2017-01-03
Posts: 642

Re: Openbox autostart script to check updates

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

Board footer

Powered by FluxBB