ppc76
Member
Posts: 4
Likes: 3
|
Post by ppc76 on Jul 9, 2020 9:53:34 GMT
[Note: I posted this in my initial "Hello" post, but this is probably the best place for these suggestions]
It was not just good stuff, updating Bodhi in this very old computer, and I even gave some suggestions in the LQ forum.. I don't like to critizise other people's work, mainly when it's really, really good. So, when I point small Bodhi shortcommings, I do try to help and present solutions that the Dev's may (or may not) take.
I know that this distro's take on Linux is minimalist- just the bare minimum, and the user installs what's needed (or installs the the version already loaded with many apps) But being minimalist does not have to push users to use the terminal, particulary on something as essential as having an up to date system (or set the right date)- so I wrote a script that just performes apt update and upgrade but without any need to interact with the terminal or type any commands.
Another thing I noticed is that there is no GUI way, out of the box, to set time. This is particulary important to me because, many months a year internet time servers do get my portuguese timezone wrong by an hour- so I have to adjust time settings by hand. I collaborated on getting a GUI that's ugly but efficient and allow users to manually set time, date, choose the correct timezeone or try to automaticly set time and date (that's now included on another distro) - for most users this last two options are the way to get the correct time on their systems. I addaped the script to run on Bodhi and published it on the LQ forum... I put my work where my mouth is- the Dev's should not have to do everyhting for themselves! We use something for free, it's our duty not to just complain but also try to help!!!
|
|
|
Post by Hippytaff on Jul 9, 2020 10:01:56 GMT
That's great PPC. Thank you for the input. Please feel free to post a link to your script and time app, or post them here for other people to use.
|
|
ppc76
Member
Posts: 4
Likes: 3
|
Post by ppc76 on Jul 9, 2020 20:15:55 GMT
Here's my script (dependencies: YAD)
#!/bin/bash #Date and Time Setting Tool Copyright 2009,2011 by Tony Brijeski under the GPL V2 # modified by skidoo and ppc - https://pastebin.com/1YmJHb95 ### NOTE: no validation is performed ~~ user can choose "Feb 31" DIALOG="`which yad` --width 400 --center --undecorated" TITLE="--always-print-result --dialog-sep --title=" TEXT="--text=" ENTRY="--entry " ENTRYTEXT="--entry-text " MENU="--list --print-column=1 --column=Pick:HD --column=_" YESNO="--question " MSGBOX="--info " SCALE="--scale " PASSWORD="--entry --hide-text " TITLETEXT="Manage Date and Time Settings" testroot="`whoami`" # howdy backticks galore if [ "$testroot" != "root" ]; then gksu $0 exit 1 fi while [ "$SETCHOICE" != "Exit" ]; do DAY="`date +%d`" MONTH="`date +%m`" YEAR="`date +%Y`" MINUTE="`date +%M`" HOUR="`date +%H`" SETCHOICE=`$DIALOG --no-buttons --center --height 300 $TITLE"$TITLETEXT" $MENU $TEXT" Manage Date and Time Settings\n Time Zone: $(cat /etc/timezone) \n Time: $HOUR:$MINUTE\n Date: $MONTH-$DAY-$YEAR\n\n" SETTIME " Set Current Time" SETDATE " Set Current Date" SETTZ " Choose Time Zone (using cursor and enter keys)" SETAUTO " Use Internet Time server to set automaticaly time/date" Exit " Quit"` SETCHOICE=`echo $SETCHOICE | cut -d "|" -f 1` if [ "$SETCHOICE" = "SETTIME" ]; then HOUR="`date +%H`" HOUR=`echo $HOUR | sed -e 's/^0//g'` SETHOUR=`$DIALOG --center $TITLE"$TITLETEXT" $SCALE --value=$HOUR --min-value=0 --max-value=23 $TEXT"Move the slider to the correct Hour"` if [ "$?" = "0" ]; then if [ "${#SETHOUR}" = "1" ]; then SETHOUR="0$SETHOUR" fi MINUTE="`date +%M`" MINUTE=`echo $MINUTE | sed -e 's/^0//g'` fi SETMINUTE=`$DIALOG --center $TITLE"$TITLETEXT" $SCALE --value=$MINUTE --min-value=0 --max-value=59 $TEXT"Move the slider to the correct Minute"` if [ "$?" = "0" ]; then if [ "${#SETMINUTE}" = "1" ]; then SETMINUTE="0$SETMINUTE" fi date $MONTH$DAY$SETHOUR$SETMINUTE$YEAR hwclock --systohc fi fi if [ "$SETCHOICE" = "SETDATE" ]; then var=`$DIALOG --form --separator="" --date-format="%Y%m%d" --field="Date:":DT` SETYEAR=$(echo ${var:0:4}) SETMONTH=$(echo ${var:4:2}) SETDAY=$(echo ${var:6:2}) MINUTE="`date +%M`" HOUR="`date +%H`" sudo date $SETMONTH$SETDAY$HOUR$MINUTE$SETYEAR hwclock --systohc fi if [ "$SETCHOICE" = "SETAUTO" ]; then sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z" hwclock --systohc fi if [ "$SETCHOICE" = "SETTZ" ]; then terminology -e "sudo dpkg-reconfigure tzdata" fi done exit 0
|
|
|
Post by Hippytaff on Jul 9, 2020 20:36:37 GMT
Cool. What does it do?
|
|
ppc76
Member
Posts: 4
Likes: 3
|
Post by ppc76 on Jul 9, 2020 20:40:55 GMT
Lol, sorry, I simply posted it, ansewring the previous post: it's a GUI to set time, date, automaticaly set the time using an internet time server or select the timezone (this last part is done using the CLI GUI- using the keyboard)
P.
|
|
|
Post by Hippytaff on Jul 9, 2020 21:08:13 GMT
Ah yes. I wasn’t sure which one...Thanks 👍
|
|