Hello,
I have Porteus 5 with changes saved using the .bat file method.
However, the brightness level is not saved across boots. Every time I boot, the brightness is increased to max.
Is there a way to load the same brightness that was set last time I logged in?
Also, same question for Wifi switch, bluetooth switch, num lock, etc.
Solution:
Solution provided by Rava
It won't save the brightness across the boots, but will revert the brightness to a set level every time you login.
[Solved] To stop auto max brightness on booting
[Solved] To stop auto max brightness on booting
Last edited by meet on 11 Apr 2020, 03:33, edited 1 time in total.
- Ed_P
- Contributor
- Posts: 8369
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
To stop auto max brightness on booting
Describe your .bat file method. Who wrote it, how is it run, when is it run. Post the contents of the file also would be helpful.
Ed
To stop auto max brightness on booting
Well, I made it. Based on the suggestions on this forum and the instructions that were given in Porteus documentation.
How it is run and when it is run? I dunno. I never open the file. Porteus OS would be using it I guess. As the files that I create and settings that I change (like theme, etc) are saved across reboots.
Only the things that I mentioned in the question are not saved.
- Ed_P
- Contributor
- Posts: 8369
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
To stop auto max brightness on booting
1. A .bat file is a DOS command script. This is Linux.
2. A save changes file is a .dat file. porteussave.dat
3. The .dat file is created by Porteus in the /changes directory and used after the 1st reboot.
4. If only some things are saved implies your .dat file is full.
5. How big is your .dat file?
2. A save changes file is a .dat file. porteussave.dat
3. The .dat file is created by Porteus in the /changes directory and used after the 1st reboot.
4. If only some things are saved implies your .dat file is full.
5. How big is your .dat file?
Ed
- Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
To stop auto max brightness on booting
I presume you speak about a notebook or laptop here.
I wrote myself a script that can change the brightness from the CLI. You need to be root to change it.As you can see, when started without parameter it just tells you what level the screen brightness currently is set to.
And it also tells you which file to change.
The change is quite easy. The allowed range differs from system to system, with my notebook the allowed range is from 0 to 7, so there are 8 levels.
0 is the less bright and 7 the brightest.
The number for the brightest can likely differ for your system.
To change is simply do this:to set it to 0.
Then make sure the above file is saved in your .dat file. Reboot and it should work.
If it does not, edit the /etc/rc.d/rc.local to add the above line. Again save /etc/rc.d/rc.local into your .dat file. reboot.
Please report back here if my tips have been helpful so that others know they worked, which I hope they will.
In my system, when the brightness level is set, the PC remembers that by itself, but I presume that also differs from system to system.
I wrote myself a script that can change the brightness from the CLI. You need to be root to change it.
Code: Select all
# setscreenbrightness.sh
/sys/class/backlight/acpi_video0/brightness is set to 0
And it also tells you which file to change.
The change is quite easy. The allowed range differs from system to system, with my notebook the allowed range is from 0 to 7, so there are 8 levels.
0 is the less bright and 7 the brightest.
The number for the brightest can likely differ for your system.
To change is simply do this:
Code: Select all
echo 0 > /sys/class/backlight/acpi_video0/brightness
Then make sure the above file is saved in your .dat file. Reboot and it should work.
If it does not, edit the /etc/rc.d/rc.local to add the above line. Again save /etc/rc.d/rc.local into your .dat file. reboot.
Please report back here if my tips have been helpful so that others know they worked, which I hope they will.
In my system, when the brightness level is set, the PC remembers that by itself, but I presume that also differs from system to system.
Cheers!
Yours Rava
Yours Rava
To stop auto max brightness on booting
Hey Thanks for the complete response.Rava wrote: ↑10 Apr 2020, 22:13I presume you speak about a notebook or laptop here.
I wrote myself a script that can change the brightness from the CLI. You need to be root to change it.As you can see, when started without parameter it just tells you what level the screen brightness currently is set to.Code: Select all
# setscreenbrightness.sh /sys/class/backlight/acpi_video0/brightness is set to 0
And it also tells you which file to change.
The change is quite easy. The allowed range differs from system to system, with my notebook the allowed range is from 0 to 7, so there are 8 levels.
0 is the less bright and 7 the brightest.
The number for the brightest can likely differ for your system.
To change is simply do this:to set it to 0.Code: Select all
echo 0 > /sys/class/backlight/acpi_video0/brightness
Then make sure the above file is saved in your .dat file. Reboot and it should work.
If it does not, edit the /etc/rc.d/rc.local to add the above line. Again save /etc/rc.d/rc.local into your .dat file. reboot.
Please report back here if my tips have been helpful so that others know they worked, which I hope they will.
In my system, when the brightness level is set, the PC remembers that by itself, but I presume that also differs from system to system.
This was not working in Porteus 5. But now I am using Porteus 4 with KDE. Here the system settings have the option to set the brightness for three different categories - plugged in, on battery, and low battery. I have set the brightness level in all three cases and it reverts the brightness level to that every time I log in.
Your scripts as I see, will also revert the brightness to the set parameter for each boot.
This works. Though, I was looking for a way to "save" the brightness level across sessions, so that brightness set in one session is set again when I log on the next time. (Not the linux session, session in general sense).
- Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
[Solved] To stop auto max brightness on booting
When you want one setting globally, /etc/rc.d/rc.local is your file andmeet wrote: ↑11 Apr 2020, 03:31Your scripts as I see, will also revert the brightness to the set parameter for each boot.
This works. Though, I was looking for a way to "save" the brightness level across sessions, so that brightness set in one session is set again when I log on the next time. (Not the linux session, session in general sense).
Code: Select all
echo 0 > /sys/class/backlight/acpi_video0/brightness
When you need more fine tuning you have to create setup files like /etc/rc.d/rc.local but for each session its own, I would have no clue how do create such since I never needed it, but in Linux, thus can be done.
Then edit such setup file and instead of echo 0 use the number you need.
For your convenience here is the code of my script. make sure it is only executable by root since the normal user cannot access it anyway.
Code: Select all
#!/bin/sh
# set screen brightness level or get it without parameter
# Known bug: no sanity check if $1 is valid, not even if $1 is numerical! - user will get an error like "line 12: echo: write error: Invalid argument"
if [ $UID -ne 0 ]; then
echo "You need to be root to run $0"
exit 1
fi
if [ "$#" = "0" ]; then
echo /sys/class/backlight/acpi_video0/brightness is set to $(cat /sys/class/backlight/acpi_video0/brightness)
else
echo $1 > /sys/class/backlight/acpi_video0/brightness
fi
Code: Select all
chmod 0744 /usr/local/bin/setscreenbrightness.sh
Cheers!
Yours Rava
Yours Rava