- This topic has 30 replies, 7 voices, and was last updated Feb 7-2:17 pm by VW.
-
AuthorPosts
-
February 5, 2020 at 5:41 am #32444Member
PPC
Hi. I recently updated the yad-updater script to be much more graphical and smarter:
Now the “sudo apt update” part of the script is done in a window, with a pulsating bar, that also shows a text line, displaying what the update process is doing. If the system is up to date, a window telling the user that pops up. If there are updates available, the user is presented with a terminal window that shows all of the “sudo apt dist-upgrade” process, so the user can answer yes or no to any question (using the keyboard). When the upgrade finishes, the user gets a small window that shows the last line that the process outputed (usefull to warn users if they accidentally pressed “n” ). If the user presses the “ok” button, the window closes.
Simple, fast and efficient, but a fully GUI way to perform a “sudo apt update && sudo apt dist-upgrade”, for users that are afraid to/don’t know how to do it or just dislike using the terminal for such a basic but important task.Is anyone is interested, feel free to test it and report any bugs or offer suggestions.
The code available is at:
EDIT:
If you want to test the script:
1- Open the above link
2- Copy all the contents of the frame titled “RAW Paste Data”
3- Create a empty text file. Call it, for example antiX-updater.sh
4- Open the file you just created, paste the contents of the link there and save it.
5- Make the file executable (in thunar right click it, Properties – Permitions)
6- Run the file (from the terminal or, if using Thunar, right click – open …)- This topic was modified 3 years, 3 months ago by PPC.
- This topic was modified 3 years, 3 months ago by Brian Masinick.
February 5, 2020 at 7:14 am #32445MemberModdIt
::@PPC May I return the Hum, I think you had a brilliant idea for your excellent cron driven updater script and this grafical extension. A choice of full gui or notification only along with cron driven checks is my humble opinion cake and icing.
You suggested
At installation/ first boot run a (yad) script (also available in the C.C.) that asks how often should antiX automatically check for updates (choices: Never/Daily/Weekly/Monthly).Maybe a button in control center could be added in update to existing installations. A message notifying users of the additional functionality and daily check as default setting. Great stuff.
February 5, 2020 at 7:29 am #32446Moderator
caprea
::Hey PPC, I had to run dos2unix first to make the script run here.
dos2unix antix_gui_updater.shFebruary 5, 2020 at 9:34 am #32447MemberPPC
::Hey PPC, I had to run dos2unix first to make the script run here.
dos2unix antix_gui_updater.shHi Caprea, that’s strange… I don’t even have that package (dos2unix) installed.
If you copy the contents of the “RAW Paste Data” to the terminal do you still have that problem?
The script simply uses yad and gksudo… It runs without a problem on my antiX 19.1, 64 bits, installed to hard drive…
I don’t even know what can cause that problem…
Can anyone help with that, please ?EDIT: I did a little search on-line- Caprea- I’m betting you copy and pasted the code from the main window. Try copying just the (simple) code displayed in “RAW Paste Data” to your .sh file and try running the script directly. Let me know if that works, please.
P.
- This reply was modified 3 years, 3 months ago by PPC.
February 5, 2020 at 10:16 am #32456Moderator
caprea
::Yes the problem was more or less on my side, I clicked the download button for convenience. Then dos2unix must be used.
A simple copy and paste of the code works without problems.February 5, 2020 at 2:33 pm #32459Moderator
christophe
::I like it!
(I don’t mind typing the commands or running cli-aptiX for my updates/upgrades, but I like it.)
So far the testing shows no problems, but I had just checked for upgrades prior to seeing your post… I’m keeping it (I made a .desktop file & placed it on my ROX panel). I’ll report back…- This reply was modified 3 years, 3 months ago by christophe.
confirmed antiX frugaler, since 2019
February 6, 2020 at 3:19 am #32470MemberPPC
::I made some minor (cosmetic) changes to the script.
The newer version is available at: https://pastebin.com/X4WTdJHBBug:
I just realized that if the user has roxterminal window, that causes the yad windows to appear before the right time (ex: the message that should pop up after the apt upgrade, pops up during the apt upgrade). Anyone that knows more Bash than me, please help me out with that…EDIT: Please check my latest post for a bug free version of the code
Changes:
1- Thinking about the possibility of using “antiX updater” to check for updates automatically (example: via a cron or acron job), I changed the text that initially shows up when “antiX updater” starts – just in case the computer is a laptop that is not connected to the internet when the update window pops up, it now starts by saying “Waiting for a Network connection…”. If the computer is connected to the internet that disappears almost instantly, if not the user is informed why nothing is happening…
2- The small message windows that pop up after the update or upgrade procedures now only have a “Ok” button that closes the window. They are mere information messages- there’s really nothing to cancel…I particularly need input on this subject:
I think there’s only one single point that may need improvement: what the window that pops up after the upgrade process shows. The current yad-updater version simply says “Done”, because the user can read all the output in the terminal window where “sudo apt upgrade” just ran, but I also thought a bit more information could be useful, so the proposed version of the script shows the terminal window and stores everything to a log file then presents the last line of that log on the pop up window (this was useful in a older version of the script that always performed the upgrade after the update, even if there was nothing the upgrade- the message then returned info about 0 packages updated.
Currently this last window is useful when it displays information about the user pressing the “n” key to any query, but returning the last line of the log is probably a very strange and cryptic information to present to most users that just want to know their system is up to date.
If anyone wants to try out a version of this, more simple final upgrade message, simply try editing the script and changing the third to last line (that begins with “else”) to:
else x-terminal-emulator -T " antiX - Updater" -e /bin/bash -c "sudo apt dist-upgrade && sleep 1 &&" && yad --center --width=250 --text="\n Finished." --button="OK":1 --title=antiX-Updater@Moddit – Thanks! I actually have a cron job for starting yad-updater everyday, but I find it to be too distracting… I don’t consider myself an advanced user, but I really don’t like stuff popping up on me when I doing something else… I would rather click the “antiX updater” icon when I feel like it!
If anticapitalista chooses to make automaticaly checking for updates available out of the box, I can see many users complaining about the fact that the “checking for updates” window keeps disturbing them, almost like it does in Windows… We can’t please everyone (and I’m one of the folks that began thinking about allowing antiX to auto-check for updates 🙂 )@Christophe – thanks for the positive review! Also thanks for reminding me about the .desktop file (I already sent one to the “DistroWatch user reviews” thread- I pasted it below). I used icewm-toolbar-manager to add its icon to my toolbar, but it does not show up in “app select”, even after being copied to the correct folder…
Proposed .desktop file (made assuming this script will be the new yad-updater version, for now it simple launches the current “dumb” yad-updater available in antiX 19.X). If you want to use it to start this script change the line
“Exec=yad-updater” to something like “Exec=path/to/your/script/name_of_the_script.sh”[Desktop Entry] Name=antiX Updater Name[am]=antiX ማሻሻያ Name[ca]=antiX Updater Name[cs]=antiX Updater Name[de]=antiX Updater Name[el]=antiX Updater Name[es]=antiX Actualizador Name[fr]=antiX Mise à jour Name[hu]=antiX frissítő Name[it]=antiX Aggiornamenti Name[ja]=antiX Updater Name[kk]=antiX Updater Name[lt]=antiX Updater Name[nl]=antiX Updater Name[pl]=antiX Updater Name[pt]=Actualizador do antiX Name[pt_BR]=Atualizador do antiX Name[ro]=antiX Updater Name[ru]=antiX Updater Name[sk]=antiX Updater Name[sv]=antiX Uppdaterare Name[tr]=antiX Updater Name[uk]=antiX Updater Name[zh_TW]=antiX 更新 Exec=yad-updater Icon=/usr/share/icons/mnotify-some-wireframe.png StartupNotify=false Categories=antiX;- This reply was modified 3 years, 3 months ago by PPC.
- This reply was modified 3 years, 3 months ago by PPC.
- This reply was modified 3 years, 3 months ago by PPC.
February 6, 2020 at 7:45 am #32479Member
VW
::Surely the easiest way to do this is with .bash_aliases
alias upd8='sudo apt-get update && sudo apt-get dist-upgrade' alias aclean='sudo apt-get autoclean' alias arem='sudo apt-get autoremove'Al you ever need!
“These are the times that try men's souls" - Thomas Paine
February 6, 2020 at 8:39 am #32481Forum Admin
anticapitalista
::IIRC we already have these alias set up on antiX in /etc/bash.bashrc
#apt-get alias agu="apt-get update" alias agd="apt-get dist-upgrade" alias agc="apt-get clean" alias ag="apt-get update;apt-get dist-upgrade" alias aga="apt-get autoremove" #apt alias au="apt update" alias ad="apt dist-upgrade" alias ac="apt clean" alias aud="apt update;apt dist-upgrade" alias aa="apt autoremove"Philosophers have interpreted the world in many ways; the point is to change it.
antiX with runit - leaner and meaner.
February 6, 2020 at 8:47 am #32482Moderator
Brian Masinick
::Like any useful system there are several ways to update the system. Pick the one that works out for you.
- This reply was modified 3 years, 3 months ago by Brian Masinick.
--
Brian MasinickFebruary 6, 2020 at 8:50 am #32483MemberPPC
::Hi, everyone: new and bug free version (and I choose a final “apt dist-upgrade” pop up message that simply says “Finished”, so not to confuse newbies. Advanced users can read the output of the terminal window or check the apt log…)
@VW thanks for the help! I found out a different way to solve the bug… I’m always learning…
P.S.- if any user wants to simulate what happens when there’s a update available, there’s a simple way- edit the script and change the text in line nr 10 (that begins with “for reqsubstr”) from “up to date” to anything else, like “JUST TESTING”. Save the file and execute it… This always forces the script to perform the “apt dist-upgrade”, even if there are no updates available…
Unless there’s some unforeseen event, this will be the final version… I have paid work to do!!!
Edit: I never mentioned this before, but I wrote the script so it is able to run in any Debian system that has yad and gksudo installed (ex: Mx-Linux or even a pure Debian install), because I changed it not to use Rox terminal, but use the default terminal (that was a compromise- using Rox terminal had a plus side- I used the flag that removed the menu from the terminal window, making it look less like a terminal, so not to scare newbies).
I hope anti ends up using this little script, a lot of work went into this 12 lines of code… 🙂Edit 2: I just now read anticapitalista’s and Mr Masinick posts. Thanks for the help!
And I truly think that having a easily accessible (by that I mean “using a single click”), dedicated and fully GUI way to update and upgrade the system can only make antiX even easier to use. I can’t recall that there’s any essential task that users have to do that has to be done using the terminal…P.
- This reply was modified 3 years, 3 months ago by PPC.
- This reply was modified 3 years, 3 months ago by PPC.
- This reply was modified 3 years, 3 months ago by PPC.
February 6, 2020 at 5:29 pm #32500Member
VW
::PPC said
I’m always learning
Me too. Now I’m just wondering why I am running “dist-upgrade” when I should be using “upgrade”?
LOL
“These are the times that try men's souls" - Thomas Paine
February 6, 2020 at 6:35 pm #32502Moderator
Brian Masinick
::I tried the script and it worked very well.
I’m going to check back to make sure that I downloaded the latest version.
Thanks for working on this. I will make sure that the latest version is the one I keep and if I have any other questions or comments I will let you know.
Great work! 😁
--
Brian MasinickFebruary 6, 2020 at 8:14 pm #32503Moderator
christophe
::I just used the script and this time there was one package to upgrade. It worked great! Just as expected. Good job!
confirmed antiX frugaler, since 2019
February 7, 2020 at 3:05 am #32506MemberModdIt
::ppc wrote: I would rather click the “antiX updater” icon when I feel like it!
while I fully understand that position I must point out:The starting point was posts on DW complaining about no notification of available updates.
The latest script gives an excellent one click upgrade but unfortunately has not adressed the original issue.
Which means the complaints will not be stilled.
My scripting skills are far worse than those pertaining to communication, will see if I can get a notifier working,
at least for our group purposes. Probably a wider audience would lynch me. 😉 -
AuthorPosts
- The topic ‘Fully GUI script to update antiX’ is closed to new replies.