"Quick Setup" Variables from CLI?

versatile 64-bit multi-user Linux distribution

Moderators: kirk, jamesbond, p310don, JakeSFR, step, Forum moderators

Post Reply
Neo_78
Posts: 376
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 206 times
Been thanked: 9 times

"Quick Setup" Variables from CLI?

Post by Neo_78 »

Is there a way to set the variables that are provided via the "Quick Setup" script on the desktop from the command line?

- system language
- keyboard language
- time zone

I am trying to automate the initial FatDog setup of those variables with a bash script.

Thanks for your feedback! :thumbup:

don570
Posts: 626
Joined: Sat Nov 21, 2020 4:43 pm
Has thanked: 5 times
Been thanked: 98 times

Re: "Quick Setup" Variables from CLI?

Post by don570 »

I'm no expert but I think that a change of system language needs a restart of X,
whereas a change of clock can be done with a command.

Shinobar was the first to experiment with this script called 'first run'
https://oldforum.puppylinux.com/viewtopic.php?p=438875
_________________________________________

Clarity
Posts: 3355
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1383 times
Been thanked: 444 times

Re: "Quick Setup" Variables from CLI?

Post by Clarity »

FATDOG doesn't have or use FirstRUN. It has, instead, a collection of Control Panel utilities; one of which is the set for the things you ask about.

Your question stem from the "Quick Setup" icon on the FD desktop.

If you right click on the icon, and follow thru to is properties page, you'll see the following:

FD812-script.jpg
FD812-script.jpg (92.19 KiB) Viewed 588 times

Hope this is helpful.

User avatar
Keef
Posts: 250
Joined: Tue Dec 03, 2019 8:05 pm
Has thanked: 3 times
Been thanked: 67 times

Re: "Quick Setup" Variables from CLI?

Post by Keef »

You could look into 'setxkbmap'for the keyboard
The LANG variable sets the locale ("system language") eg 'export LANG=en_GB.utf8'

You can set these easily enough from the terminal, but they will only last for the session - won't survive a reboot.
Have a look in ~/.fatdog/
You could write your variables directly to here, which is probably what you want (in which case, the first bit I wrote is a bit redundant).

The timezone is set by symlinking your preferred zone from /usr/share/zoneinfo/ to etc/timezone.

Code: Select all

ln -s /usr/share/zoneinfo/Europe/London /etc/localtime
Neo_78
Posts: 376
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 206 times
Been thanked: 9 times

Re: "Quick Setup" Variables from CLI?

Post by Neo_78 »

Thanks @don570 @Clarity @Keef.

Just to clarify: the idea is to write a bash script with fixed values to set the timezone, locale, keyboard layout, etc. for subsequent image remastering instead of having to use Fatdog's Quick Setup script. You can then use the script to automatically set the correct language, keyboard layout, time etc. instead of having to visually set those values in the menu. (Considering that one always uses the same, fixed values).

It should also restart X as this seems to be required for those changes to take effect. In the remastered image, those changes will then be persistent.

don570
Posts: 626
Joined: Sat Nov 21, 2020 4:43 pm
Has thanked: 5 times
Been thanked: 98 times

restart X

Post by don570 »

It should also restart X as this seems to be required for those changes to take effect.

I believe so too. As mentioned in prior post it is possible to set the language for a terminal session.
For example...

Code: Select all

export LANG=en; /usr/bin/geany

__________________________________________

Clarity
Posts: 3355
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1383 times
Been thanked: 444 times

Re: "Quick Setup" Variables from CLI?

Post by Clarity »

Question: Would adding Puppy Linux's FirstRUN to FATDOG cover your objective in a single screen?

I, kinda, agree that this would be preferable to the FATDOG icon...but its developers might not see that as the audience they want.

But, is that what you are seeking; namely a single screen albeit a script that sets all of this in a single 'clear' effort like FirstRUN does?

Neo_78
Posts: 376
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 206 times
Been thanked: 9 times

Re: "Quick Setup" Variables from CLI?

Post by Neo_78 »

I think the current visual quick setup menu is fine.

I just don't want to run it manually every time I setup a new system. So the idea is to run a separate script and set the same, fixed, pre-pogrammed values automatically without any interaction or input.

Clarity
Posts: 3355
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1383 times
Been thanked: 444 times

Re: "Quick Setup" Variables from CLI?

Post by Clarity »

I think, you are suggesting a 'capture' of answers upon a first use such that a future program could use that capture in future setups...if referenced. Hope I am seeing this correctly.

chiron
Posts: 15
Joined: Tue Jul 28, 2020 8:15 am
Location: Frankonia/EU
Has thanked: 4 times
Been thanked: 5 times

Re: "Quick Setup" Variables from CLI?

Post by chiron »

I would do the whole procedure once via the GUI, then create a savefile and see which files were created and their contents. Take the files, put them into a package and install said package at first startup, or use an sfs-file.

User avatar
dr__Dan
Posts: 77
Joined: Tue Jul 28, 2020 5:06 am
Has thanked: 45 times
Been thanked: 26 times

Re: "Quick Setup" Variables from CLI?

Post by dr__Dan »

Following on from Chiron: A possible route to get the needed file locations and contents: Start up with no savefile and shutdown immediately, creating a save file. Start again with no savefile, run the Quick Setup and add your information, then shut down again, creating a different savefile. Start up and use Meld on the two save files. It should show the needed locations, and the script to write to them shouldn't be too complicated. From reviewing the init scripts, it looks like if it is placed in /etc/rc.d/rc.local it should set the variables before X starts, so you won't need to restart X.

9 years on with Fatdog64. :D

don570
Posts: 626
Joined: Sat Nov 21, 2020 4:43 pm
Has thanked: 5 times
Been thanked: 98 times

Re: "Quick Setup" Variables from CLI?

Post by don570 »

I save my data to a folder however as Dr Dan says it is possible to use save-files.
Multiple save-files are possible, so one save-file could be used for French language, another for English etc.
This would reduce effort of setting up a keyboard for a specific language.
__________________________________________________________________________________

Neo_78
Posts: 376
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 206 times
Been thanked: 9 times

Re: "Quick Setup" Variables from CLI?

Post by Neo_78 »

Good idea @chiron and @dr__Dan. The thing is I am using FatDog remastered in RAM-only mode, so no restart.

Maybe the developer team could shed some light on the required variables that could be set from cli or the files that need to be adjusted? Preset configuration files could then be put in place with cp in the script.

User avatar
dr__Dan
Posts: 77
Joined: Tue Jul 28, 2020 5:06 am
Has thanked: 45 times
Been thanked: 26 times

Re: "Quick Setup" Variables from CLI?

Post by dr__Dan »

Perhaps on a different computer, just to get the needed data? I was supposing that the info would be added to your remastering.

Dan

9 years on with Fatdog64. :D

Clarity
Posts: 3355
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1383 times
Been thanked: 444 times

Re: "Quick Setup" Variables from CLI?

Post by Clarity »

@dr__Dan I agree. But this, in agreement, would also work, as well:

  • A pristine boot of FD, use the desktop Icon for setup,

  • then immediately shutdown saving the session in its folder.

  • Upon reboot, choose RAM only (pristine again) and

  • upon desktop, open the save-session folder that was saved to see the changes.

This way, the ONLY contents would be those changes he is seeking. From there, a script/screen-app/package could use any files found from the prior pristine boot's session.

User avatar
dr__Dan
Posts: 77
Joined: Tue Jul 28, 2020 5:06 am
Has thanked: 45 times
Been thanked: 26 times

Re: "Quick Setup" Variables from CLI?

Post by dr__Dan »

@Clarity, my purpose in suggesting two save files, one with no changes and one with only localization setup is to cull out the various files and directories that are automatically created in a new savefile, which Meld would differentiate nicely. We are in agreement.

@Neo_78, I'm not understanding how running in RAM prevents shutting down. I've seen that you are running a remastered Fatdog64, and that you are working towards a goal of security, as you have been from your first posts. If you really can't do this, PM me and I will do it on my end and pass the results to you.

Dan

9 years on with Fatdog64. :D

Neo_78
Posts: 376
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 206 times
Been thanked: 9 times

Re: "Quick Setup" Variables from CLI?

Post by Neo_78 »

Thanks @dr__Dan. This is not so much about security but rather about automating the whole customization process for remastering / final image creation. Will try your suggestion. :thumbup2:

Post Reply

Return to “FatDog64”