Porteus Settings Centre

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
User avatar
agreimann
Samurai
Samurai
Posts: 137
Joined: 19 Apr 2011, 21:09
Location: U.S.

Re: Welcome box being implemented

Post#61 by agreimann » 20 Jun 2011, 21:10

Interesting it doesn't work run from guest.... I ran the program on 64-bit Edition with only one bug, which I experienced in the firewall portion (and module writing of that part). The whole thing should work provided the root password is provided when needed--I can develop a hotfix for the program if needed. Thanks for the heads up! ;) Can't wait for Porteus 1.0 to get released to the world!

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Welcome box being implemented

Post#62 by brokenman » 21 Jun 2011, 02:22

Don't work for me as guest in 32bit. I get the welcome screen, i click the next button and the show is over. The last version worked.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
agreimann
Samurai
Samurai
Posts: 137
Joined: 19 Apr 2011, 21:09
Location: U.S.

Re: Welcome box being implemented

Post#63 by agreimann » 21 Jun 2011, 05:34

brokenman, this is another bug that I may or may not have documented. The program is lacking a condition that **needs to** be there as soon as possible. You are right--it is show-stopping.

What is wrong is that the program needs to make a changes folder, so it does just that. The problem is I rushed this program out so fast I did not put in an if condition to stop the directory from being made if it is already there. Why is that important? Simply put, the program stops because the statement goes somewhat like this in plain language:

If the directory is made successfully and exits as such (0) then execute the next stage of the program along with it.

Now, if I can be allowed to make a few hotfixes by tomorrow (since that is the release date), I think I can get this thing in order, namely in getting an if statement and repaired scripting in place. Hamza has already offered to help for version 2.0, which I think will become a collaborative project. As for now, I really would like to get 1.1 out to fix any mistakes.

Somehow I knew that this release would be a Vista, guys. :D Both had something in common--they were released at too rushed a rate. :)

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Welcome box being implemented

Post#64 by fanthom » 21 Jun 2011, 15:20

@agreimann
i have merged all scripts into one (to avoid asking 10 times for root password), added a 'selection menu' where user can run a single function and made few other tweaks to PSA.
i'll stick to this version for 1.0 - if you dont mind.

Cheers
Please add [Solved] to your thread title if the solution was found.

User avatar
agreimann
Samurai
Samurai
Posts: 137
Joined: 19 Apr 2011, 21:09
Location: U.S.

Re: Welcome box being implemented

Post#65 by agreimann » 21 Jun 2011, 16:09

Excellent! :) Not only will that save me time from doing things properly, but it means you get to release Porteus to the world faster! Is taking over it in order? :D It's your OS project it's on, so I certainly do not mind!

I hope that you found where the condition was needed, and that my post helped a bit. And I was thinking of the selection menu as the 'Panelette' folder was not cutting it. ;) Hopefully this'll be the last Vista I'll release!

Regards,

Andrew

jcuk
White ninja
White ninja
Posts: 21
Joined: 13 Mar 2011, 23:34
Location: Cambridge UK

Re: Welcome box being implemented

Post#66 by jcuk » 22 Jun 2011, 11:44

@fanthom
fanthom wrote:hmmm... some time ago brokenman wanted to do the same thing but he decided to not continue working on it.

Reason:
Porteus is a livecd linux and "Welcome" popup box at every boot can be little annoying.... (same as asking for changing default passwords)

How do you want to deal with it?

EDIT:\\
maybe popup window could appear only when "changes=" cheatcode is used?
May I suggest the approach the compromise that later Puppy Distros use?
...You get a small Grey area centre top on the startup Desktop ( optionally with a mouse over balloon )
You can click on it/raise and read the nice HTML intro screen... Dismiss, Then it goes away from the Desktop.
Or simply ignore it and get going ( but it stays there occupying a small and insignificant space )

User avatar
agreimann
Samurai
Samurai
Posts: 137
Joined: 19 Apr 2011, 21:09
Location: U.S.

Re: Welcome box being implemented

Post#67 by agreimann » 25 Jun 2011, 18:52

I think the more proper title to change this to is "welcome box has been implemented".

With the project started by me, and Hamza and fanthom patching it up to be somewhat like the 1.1 version I envisioned, I think after collaboratively releasing another 2.0 with Hamza, I will quit my work for Porteus Settings Assistant, and after 2.0, leave this project into the hands of the Porteus community, so that they can work on what they think is best. I will be quite honest in that I do not know the Slackware method as well as I do other main distro bases (e.g. Fedora, Debian, or openSuse).

I scheduled the individual Google Code page porteus-settings-assistant sat on for removal, in hopes it can be hosted on a Porteus server or in the OS itself instead.

I believe the work should be a work for the whole community and not just mine (as a result, the copyright note on 2.0 will change to Porteus Community). I only wished I had the chance to get up to 1.1 and have finished the whole thing properly--I know that 1.0 beta was a milestone, but it sure didn't help that the final copy failed.

Thanks, guys. Regards,

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Welcome box being implemented

Post#68 by fanthom » 26 Jun 2011, 05:17

thanks agreimann for your work on this project. i see a great potential in this application. it could become a "Porteus Settings Centre" with all porteus utilities merged into one application.

I'm sure hamza will be interested in continuing working on this tool.

let us know when 2.0 is out :)
Please add [Solved] to your thread title if the solution was found.

User avatar
agreimann
Samurai
Samurai
Posts: 137
Joined: 19 Apr 2011, 21:09
Location: U.S.

Re: Welcome box being implemented

Post#69 by agreimann » 28 Jun 2011, 06:24

I have finally decided what will happen with Porteus Settings Assistant, now that the final version made it into Porteus 1.0.

Now that the Google Code page for porteus-settings-assistant is pending deletion, I will share my last reiteration of Porteus Settings Assistant (2.0) to Hamza. From there, any modifications that anyone in the Porteus Team want to do will be handled by him and the Porteus community, and I will quit all work on the program. My work after fixing the 1.0 version is done, as I accomplished what I set out to do--give Porteus a setup tool, which it now does in 1.0.

I believe this is for the best of the Porteus Team, so all can share, rather than me holding rights to it. Also, I'm not planning on 2.0 being nothing more than fixes of the flopped 1.0. I'm not planning on it being a release that will leap forward with a heap of features.

@fanthom: Thank you so much for fixing the bugs in 1.0 that I had left un-repaired, and also for your encouragement.

-----------------------------------------------------------------------------------------------------------------------------------------

With this said, I have submitted 2.0 (based on 1.1, actually, rather than the 1.0 version) to Hamza over e-mail.

Thank you for allowing me to be a part of this project. I'm glad to have accomplished my mission of making it a reality, and I'm glad it made it into 1.1. I will now completely turn over Porteus Settings Assistant to the Porteus community through Hamza, so that the whole community can benefit from it. My work on it is done. Thank you all you for encouragement, testing of the project, patience, and honesty.

Here is the full code, if Hamza does not distribute the script from here. To run, copy the source, open a shell, type either "kwrite /opt/porteus-scripts/xporteus-settings-assistant" or leafpad (same path), select all, paste and save it, and finally after closing the editor, do a chmod +x on the file. For those looking for the license, it falls under the same terms as Porteus itself, and as such, the license can be found in the porteus folder on the live media.

Code: Select all

#!/bin/bash
#
# This shell script program welcomes new users to the
# Porteus operating system.
#
# Copyright (C) 2011 Porteus Community
# Last modified 23:59 at 6/27/2011
#
# Contributors: fanthom, Hamza, agreimann
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program.  If not, see
# <http://www.gnu.org/licenses/>.

# Change to the root user if necessary once Porteus Settings Assistant is ready to run
if [ "$DISPLAY" ]; then
    if [ `whoami` != "root" ]; then
	# Add dialog box so that the user is aware of what is happening
	Xdialog --title "Password required" --left --icon /opt/porteus-scripts/icons/exclamation-red-48.png --cancel-label "Close window" --ok-label "Continue" --yesno "Password required\n____________________________________________________________\n\nClick OK, then type in your password in the window that appears,\nand press enter to continue. This ensures that you are running\nthis application." 20 110
	su - -c "/opt/porteus-scripts/xporteus-settings-assistant `whoami`" || sleep 1
	exit
    fi
else
    echo "--------------------------------------------------------------------------"
    echo "Error"
    echo "--------------------------------------------------------------------------"
    echo "(x) To run Porteus Settings Assistant, you must start X first. Type startx,"
    echo "    then try again. This application will now quit."
    echo "--------------------------------------------------------------------------"
    exit
fi

# Check if the script was run by a normal user
if [ "$1" ]; then pth=/home/$1; else pth=/root; fi

wrk=/tmp/PSA
[ -d $wrk ] && rm -r $wrk
mkdir $wrk

. /usr/lib/macroport

choice() {
Xdialog --title "Jump to an option" --ok-label "Jump" --cancel-label "Don't jump now" --no-tags --icon=/opt/porteus-scripts/icons/step-panelette.png --left --menubox "Pick an option to leap forward to it\nwithout having to go through to other steps of\nthe application." 30 80 0 \
1 "Connect to the Internet" 2 "Turn on the firewall" 3 "Name this computer" 4 "Change password" 5 "Set up changes" 6 "Set language" 7 "Apply changes" 2> /tmp/.ans
[ $? -ne 0 ] && panelette
ans=`cat /tmp/.ans` && rm /tmp/.ans 2>/dev/null
case $ans in
    1 )
    wicd-gtk --no-tray >/dev/null 2>&1 && choice
    ;;
    2 )
    enable_firewall && choice
    ;;
    3 )
    enter_hostname && choice
    ;;
    4 )
    change_password && choice
    ;;
    5 )
    /tmp/.terminal -e make-changes.sh && choice
    ;;
    6 )
    [ "$1" ] && { su --login $1 -c '/tmp/.terminal -e "/opt/porteus-scripts/xlanguage-selection-tool"' && choice; } || { /tmp/.terminal -e "/opt/porteus-scripts/xlanguage-selection-tool" && choice; }
    ;;
    7 )
    create_module
    ;;
    * )
    choice
esac
}

enable_firewall() {
mkdir -p $wrk/etc/rc.d/rc3.d
cat >> /etc/rc.d/rc3.d/S-firewall << EOF
#!/bin/sh
# Enable Porteus firewall

if [ -x /etc/rc.d/rc.FireWall ]; then
    /etc/rc.d/rc.FireWall start
fi
EOF
chmod +x /etc/rc.d/rc3.d/S-firewall
cp /etc/rc.d/rc3.d/S-firewall $wrk/etc/rc.d/rc3.d
/etc/rc.d/rc.FireWall start
message "Porteus has now turned on the firewall."
}

enter_hostname() {
mkdir -p $wrk/etc
input "Enter a new name for this computer:"
NAM=${ANSW}
echo "$NAM" > /etc/HOSTNAME
hostname -F /etc/HOSTNAME
cp /etc/HOSTNAME $wrk/etc
message "Porteus has changed the name of this computer to $NAM."
}

change_password() {
/tmp/.terminal -e "su -c 'passwd root; echo; passwd guest'" && mkdir -p $wrk/etc && cp /etc/shadow $wrk/etc/shadow
}

welcome() {
# Start initial welcome
Xdialog --title "Welcome" --ok-label "Get started" --cancel "Later" --left --icon /opt/porteus-scripts/icons/welcome_step.png --yesno "Welcome to Porteus!\n_____________________________________________________________\n \nPorteus will ask you a few questions to help you set up your computer.\nThis process should only take a few minutes.\n \n(Note: you can also pick a step after pressing 'Get started'.)\n\nWould you like to get started now?" 20 110

# Set up button code variable
# This explains to the dialog what to do
clickchoice=$?

case $clickchoice in
0) panelette;;
1) exit;
esac
}

panelette() {
# Set up changes
Xdialog --title "Jump to a step" --ok-label "Continue" --cancel "Pick a step" --left --icon /opt/porteus-scripts/icons/step-panelette.png --yesno "Jump to a step\n_____________________________________________________________\n \nIf you have run Settings Assistant before, it may be helpful to jump\nto a step, rather than to have to go through all the steps again.\n \nWould you like to continue setting up your computer or close this\nwindow and pick a step yourself?" 20 110

# Set up button code variable
# This explains to the dialog what to do
clickchoice=$?

case $clickchoice in
0) internet;;
1) choice;;
255) exit;
esac
}

internet() {
# Help configure the wireless connection
Xdialog --title "Connect to the Internet" --ok-label "Help me connect" --cancel "Skip this step" --left --icon /opt/porteus-scripts/icons/step1-internet.png --yesno "Step 1/6: Connect to the Internet\n_____________________________________________________________\n \nIf you're using a wired connection, you may already be connected.\n \nHowever, to allow Porteus to connect using a wireless connection,\nyou may need to enter wireless settings.\n \nOnce you click 'Help me connect', Porteus will automatically open\nwireless settings, where you can tell Porteus how you connect to\nthe Internet.\n \nWhen you're finished connecting, close the window, after\nwhich Porteus will continue helping you set your computer up." 27 110

# Set up button code variable
# This explains to the dialog what to do
clickchoice=$?

case $clickchoice in
0) wicd-gtk --no-tray >/dev/null 2>&1 && firewall;;
1) firewall;;
255) exit;
esac
}

firewall() {
# Explain users
Xdialog --title "Turn on firewall" --ok-label "Turn on firewall" --cancel "Leave firewall off" --left --icon /opt/porteus-scripts/icons/step3-firewall.png --yesno "Step 2/6: Turn on the firewall\n_____________________________________________________________\n \nBy default, Porteus does not enable the firewall when it starts up.\nKeeping a firewall on is one of the ways that you can help keep\nPorteus secure from serious outside attacks when you are\nconnected to the Internet. Do you want to turn on the firewall\nnow?" 27 110

# Set up button code variable
# This explains to the dialog what to do
clickchoice=$?

case $clickchoice in
0) enable_firewall && host_name;;
1) host_name;;
255) exit;
esac
}

host_name() {
# Roll out hostname box
Xdialog --title "Give your computer a name" --ok-label "Name this computer" --cancel "Skip this step" --left --icon /opt/porteus-scripts/icons/step4-hostname.png --yesno "Step 3/6: Name this computer\n_____________________________________________________________\n \nPorteus automatically names your computer, though this may not\nbe what you need to name this computer on the network.\n \nAfter clicking 'Name this computer', a window will pop up. Type in a name, save it, and close it." 27 110

# Set up button code variable
# This explains to the dialog what to do
clickchoice=$?

case $clickchoice in
0) enter_hostname && password;;
1) password;;
255) exit;
esac
}

password() {
# Set new passwords
Xdialog --title "Help keep your PC secure" --ok-label "Change passwords now" --cancel "Don't change passwords" --left --icon /opt/porteus-scripts/icons/step5-password.png --yesno "Step 4/6: Help keep your PC secure\n_____________________________________________________________\n \nPorteus by default has two account levels on the system--root and\nyour account.\n \nYour account is at guest level--it is the one you will use every time.\nThe root or system administrator account allows you to change\nsystem-wide settings, and is much more powerful.\n \nFor these reasons, it is strongly recommended to change the root\npassword from toor, and to set a password for yourself. It is also\nrecommended that the root password be increasingly different and\nstronger than your password.\n \nWould you like you change passwords now?" 27 110

# Set up button code variable
# This explains to the dialog what to do
clickchoice=$?

case $clickchoice in
0) change_password && changes;;
1) changes;;
255) exit;
esac
}

changes() {
# Set up changes
Xdialog --title "Set up changes" --ok-label "Yes, set up changes" --cancel "No, skip this step" --left --icon /opt/porteus-scripts/icons/step-changes.png --yesno "Step 5/6: Set up changes\n_____________________________________________________________\n \nWhen you save a file or change a setting, Porteus remembers it only\nuntil you restart or shut down.\n \nWould you like Porteus to keep changes even after you shut down and restart?" 20 110

# Set up button code variable
# This explains to the dialog what to do
clickchoice=$?

case $clickchoice in
0) /tmp/.terminal -e make-changes.sh && language;;
1) language;;
255) exit;
esac
}

language() {
# Set language
Xdialog --title "Set language" --ok-label "Pick my language" --cancel "Skip this step" --left --icon /opt/porteus-scripts/icons/step2-language.png --yesno "Step 6/6: What language do you speak?\n_____________________________________________________________\n \nPorteus can help you set the language you speak from the default\nEnglish.\n \nClick 'Pick my language' to open Language Settings to set your\nlanguage." 20 110

# Set up button code variable
# This explains to the dialog what to do
clickchoice=$?

case $clickchoice in
0) [ "$1" ] && { su --login $1 -c '/tmp/.terminal -e "xlanguage-selection-tool"' && complete; } || { /tmp/.terminal -e "xlanguage-selection-tool" && complete; };;
1) complete;;
255) exit;
esac
}

complete() {
# Finish
Xdialog --title "Settings Assistant Complete" --ok-label "Finish" --cancel "Restart" --left --icon /opt/porteus-scripts/icons/tick-green.png --yesno "Thank you for your time. That's it!\n_____________________________________________________________\n \nPorteus will now apply these settings so that next time you restart,\nyou will be able to work more efficiently. Click Finish to close, and\nenjoy Porteus.\n \nWe hope that you like the work we've put into making this release\ngreat." 20 110

# Set up button code variable
# This explains to the dialog what to do
clickchoice=$?

case $clickchoice in
0) create_module;;
1) /tmp/terminal -e "su -c reboot";
esac
}

create_module() {
module=`find $wrk | wc -l`
if [ "$module" -gt 1 ]; then
    moddir=`awk 'c-->0;/Porteus data found in/{c=1}' /mnt/live/var/log/livedbg`
    touch $moddir/_test 2>/dev/null && rm $moddir/_test
    if [ $? -eq 0 ]; then
        rm $moddir/modules/settings.xzm 2>/dev/null
        dir2xzm $wrk $moddir/modules/settings.xzm >/dev/null 2>&1
        message "Your new settings have been saved to $moddir/modules/settings.xzm."
        exit
    else
        message "$moddir/modules is on a read-only filesystem.\nYour settings could not be saved in the location you selected.\nPorteus is attempting to save changes to your desktop..."
        rm $pth/Desktop/PSA-settings.xzm 2> /dev/null; dir2xzm $wrk $pth/Desktop/PSA-settings.xzm >/dev/null
        message "Your settings have been alternatively saved to $pth/Desktop/PSA-settings.xzm.\nPlease move this module to the porteus/modules folder and restart Porteus for changes to take effect."
        exit
    fi
else
    infobox "No settings were specified. Settings Assistant is closing..." 2000
    exit
fi
}

welcome && create_module
Regards,

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Porteus Settings Centre

Post#70 by Hamza » 13 Jul 2011, 08:45

Hi,

@all,

The new name of this project is "Porteus Settings Centre"

Thanks to everyone !

Bye!
NjVFQzY2Rg==

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Porteus Control Center

Post#71 by brokenman » 13 Jul 2011, 18:24

Will this mean we have two control centers? One for KDE and one for Porteus? The Kmenu already lists a control center.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Porteus Control Center

Post#72 by Hamza » 14 Jul 2011, 09:41

This app will have a panel for all Porteus Apps (like Porteus 2 USB or Porteus Encryptor..)

Any suggestions are welcomes!

If the community want to have another for this app, you can post it.

Cheers!
NjVFQzY2Rg==

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Porteus Control Center

Post#73 by brokenman » 15 Jul 2011, 20:01

I would recommend including the KDE wizard launcher from your app. Do you know the one i mean?
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Porteus Control Center

Post#74 by Hamza » 16 Jul 2011, 11:50

No, I did not understood what you mean.
NjVFQzY2Rg==

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Porteus Settings Centre

Post#75 by brokenman » 16 Jul 2011, 13:24

kpersonalizer
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply