The officially official Devuan Forum!

You are not logged in.

#26 2025-01-05 21:26:18

mtbvfr
Member
Registered: 2017-07-29
Posts: 150  

Re: Screen Brightness app for SysTray?

RedGreen925 wrote:

You can extract the file

Happy New Day,

Are you referring to extraction of the deb file?

The postinst script is as follows:

#!/bin/sh
set -e
# Automatically added by dh_installinit/13.11.4
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	if [ -z "${DPKG_ROOT:-}" ] && [ -x "/etc/init.d/fnfxd" ]; then
		update-rc.d fnfxd defaults >/dev/null
		if [ -n "$2" ]; then
			_dh_action=restart
		else
			_dh_action=start
		fi
		invoke-rc.d --skip-systemd-native fnfxd $_dh_action || exit 1
	fi
fi
# End automatically added section

Thanks!!

Last edited by mtbvfr (2025-01-05 21:50:22)

Offline

#27 2025-01-05 22:12:53

mtbvfr
Member
Registered: 2017-07-29
Posts: 150  

Re: Screen Brightness app for SysTray?

sudo apt remove fnfxd

produced the following:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libpeas-1.0-0 libpeas-common libwpe-1.0-1 libwpebackend-fdo-1.0-1
  linux-image-6.1.0-10-686-pae
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  fnfxd
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 70.7 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 137890 files and directories currently installed.)
Removing fnfxd (0.3-18) ...
Stopping Toshiba hotkeys utils: invoke-rc.d: initscript fnfxd, action "stop" failed.
dpkg: error processing package fnfxd (--remove):
installed fnfxd package pre-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Starting Toshiba hotkeys utils: FnFX Daemon v0.3 (c) 2003, 2004 Timo Hoenig <tho
enig@nouse.net>

fatal error: Could not open /proc/acpi/toshiba/keys.
Please make sure that your kernel has enabled the Toshiba option in the ACPI sec
tion.
For more information read the documentation and/or http://fnfx.sf.net/index.php?
section=doc#kernel.

invoke-rc.d: initscript fnfxd, action "start" failed.
dpkg: error while cleaning up:
installed fnfxd package post-installation script subprocess returned error exit
status 1
Errors were encountered while processing:
fnfxd
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

The pre-removal script is as follows:

#!/bin/sh
set -e
# Automatically added by dh_installinit/13.11.4
if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -x "/etc/init.d/fnfxd" ] ; then
	invoke-rc.d --skip-systemd-native fnfxd stop || exit 1
fi
# End automatically added section

Offline

#28 2025-01-05 23:48:12

RedGreen925
Member
Registered: 2024-12-07
Posts: 57  

Re: Screen Brightness app for SysTray?

Try the sudo rm /etc/init.d/fnfxd to remove the test for it being positive and allowing the removal without the update-rc.d being called to try and stop it. That package is junk there is no way it should fail trying to set the run level like it is doing here.

Offline

#29 2025-01-06 03:06:30

mtbvfr
Member
Registered: 2017-07-29
Posts: 150  

Re: Screen Brightness app for SysTray?

RedGreen925 wrote:

Try the sudo rm /etc/init.d/fnfxd

sudo rm /etc/init.d/fnfxd produced no output and the file was deleted.

sudo apt remove fnfxd produced the following output:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libpeas-1.0-0 libpeas-common libwpe-1.0-1 libwpebackend-fdo-1.0-1
  linux-image-6.1.0-10-686-pae
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  fnfxd
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 70.7 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 137890 files and directories currently installed.)
Removing fnfxd (0.3-18) ...
Processing triggers for man-db (2.11.2-2) ...

It is no longer shown as installed in synaptic.

fnfxd_0.3-18_i386.deb file still resides in /var/cache/apt/archives.

Run from the / directory, sudo find -name *fnfxd* | grep fnfxd produced the following output:

./etc/rc2.d/S03fnfxd
./etc/rc6.d/K01fnfxd
./etc/rc0.d/K01fnfxd
./etc/fnfxd
./etc/fnfxd/fnfxd.conf
./etc/rc4.d/S03fnfxd
./etc/rc3.d/S03fnfxd
./etc/rc5.d/S03fnfxd
./etc/rc1.d/K01fnfxd
./var/cache/apt/archives/fnfxd_0.3-18_i386.deb
./var/lib/dpkg/info/fnfxd.postrm
./var/lib/dpkg/info/fnfxd.list

sudo /sbin/modprobe toshiba_acpi produced no output.

sudo /sbin/lsmod | grep toshiba_acpi produced the following output which has some extra flags(?) compared to your example:

toshiba_acpi           53248  0
industrialio           65536  1 toshiba_acpi
sparse_keymap          16384  1 toshiba_acpi
rfkill                 20480  6 toshiba_bluetooth,bluetooth,toshiba_acpi,cfg80211
video                  57344  3 amdgpu,radeon,toshiba_acpi
wmi                    24576  2 video,toshiba_acpi
battery                24576  1 toshiba_acpi

Offline

#30 2025-01-06 04:30:07

RedGreen925
Member
Registered: 2024-12-07
Posts: 57  

Re: Screen Brightness app for SysTray?

The output of the lsmod would be different with your machine as it actually has the hardware needed/used by the module. The output for the rc?.d leftovers is because the --purge option was not used when removing the package so left behind the configuration files. The package left in the archives folder is normal until the apt clean or apt autoclean commands are run to clear the cache one clears the entire cache the second leaves packages that are still available in the archives in the cache. You want to do the sudo apt autoremove to get rid of the packages not needed anymore to clean the excess junk off the system. I really have no idea if you want to try it again from the start and see if the package will actually install without error with the module loaded before starting the install. If you do at least you now know how to remove the thing if it fails once more.

Offline

#31 2025-01-06 05:23:05

mtbvfr
Member
Registered: 2017-07-29
Posts: 150  

Re: Screen Brightness app for SysTray?

sudo apt autoremove produced the following:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  libpeas-1.0-0 libpeas-common libwpe-1.0-1 libwpebackend-fdo-1.0-1
  linux-image-6.1.0-10-686-pae
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
After this operation, 188 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 137881 files and directories currently installed.)
Removing libpeas-1.0-0:i386 (1.34.0-1+b1) ...
Removing libpeas-common (1.34.0-1) ...
Removing libwpebackend-fdo-1.0-1:i386 (1.14.2-1) ...
Removing libwpe-1.0-1:i386 (1.14.0-1) ...
Removing linux-image-6.1.0-10-686-pae (6.1.38-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-10-686-pae
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found theme: /usr/share/desktop-base/grub-themes/desktop-grub-theme/theme.txt
Found linux image: /boot/vmlinuz-6.1.0-28-686-pae
Found initrd image: /boot/initrd.img-6.1.0-28-686-pae
Found linux image: /boot/vmlinuz-6.1.0-27-686-pae
Found initrd image: /boot/initrd.img-6.1.0-27-686-pae
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
done
Processing triggers for libc-bin (2.36-9+deb12u9) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...

I'm hoping that didn't remove MX Linux from the Grub Menu.

Installing fnfxd from synaptic produced the following:

(dpkg-preconfigure:5560): Gtk-WARNING **: 15:02:30.976: Theme parsing error: gtk-widgets.css:1346:25: The style property GtkRange:stepper-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(dpkg-preconfigure:5560): Gtk-WARNING **: 15:02:30.976: Theme parsing error: gtk-widgets.css:1347:34: The style property GtkScrollbar:min-slider-length is deprecated and shouldn't be used anymore. It will be removed in a future version

(dpkg-preconfigure:5560): Gtk-WARNING **: 15:02:30.976: Theme parsing error: gtk-widgets.css:1348:28: The style property GtkRange:stepper-spacing is deprecated and shouldn't be used anymore. It will be removed in a future version

(dpkg-preconfigure:5560): Gtk-WARNING **: 15:02:30.976: Theme parsing error: gtk-widgets.css:1349:34: The style property GtkRange:trough-under-steppers is deprecated and shouldn't be used anymore. It will be removed in a future version
Selecting previously unselected package fnfxd.
(Reading database ... 132741 files and directories currently installed.)
Preparing to unpack .../archives/fnfxd_0.3-18_i386.deb ...
Unpacking fnfxd (0.3-18) ...
Setting up fnfxd (0.3-18) ...
Processing triggers for man-db (2.11.2-2) ...

According to the Installed Files tab of synaptic there is supposed to be an /etc/init.d/fnfxd file but there isn't.

The following directory and files do exist:

/etc/fnfxd
/etc/fnfxd/fnfxd.conf
/etc/fnfxd/keymap

fnfxd.conf contains the assignments for the F6 and F7 keys for adjusting brightness.

Should I now reboot to see if the change takes effect?

Offline

#32 2025-01-06 07:05:00

mtbvfr
Member
Registered: 2017-07-29
Posts: 150  

Re: Screen Brightness app for SysTray?

In Post #29 I had deleted /etc/init.d/fnfxd.

Why was it not installed again?

What's the best way to do a complete removal and purge so that I can reinstall using apt instead?

Offline

#33 2025-01-06 10:26:27

mtbvfr
Member
Registered: 2017-07-29
Posts: 150  

Re: Screen Brightness app for SysTray?

I tried installing on MX Linux 24.3 with apt install after doing modprobe and lsmod and the following output before which there were no errors as there was when I installed on Devuan with synaptic:

Setting up fnfxd (0.3-18) ...
Starting Toshiba hotkeys utils: FnFX Daemon v0.3 (c) 2003, 2004 Timo Hoenig <thoenig@nouse.net>

fatal error: Could not open /proc/acpi/toshiba/keys.
Please make sure that your kernel has enabled the Toshiba option in the ACPI section.
For more information read the documentation and/or http://fnfx.sf.net/index.php?section=doc#kernel.

invoke-rc.d: initscript fnfxd, action "start" failed.
dpkg: error processing package fnfxd (--configure):
installed fnfxd package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
fnfxd

I can't find any reference to /proc/acpi/toshiba/keys in the files in the .deb file.

/proc/acpi/toshiba was created today. Would that have been done by the use of modprobe?

I've started searching on "Could not open /proc/acpi/toshiba/keys".

Offline

#34 2025-01-06 11:05:10

mtbvfr
Member
Registered: 2017-07-29
Posts: 150  

Re: Screen Brightness app for SysTray?

Interesting page:

https://bugs.launchpad.net/ubuntu/+sour … bug/127611

My Sister's Laptop has a Phoenix BIOS 1.70.

I noticed today that the Laptop seems to be running cooler now.

Offline

#35 2025-01-06 11:29:20

RedGreen925
Member
Registered: 2024-12-07
Posts: 57  

Re: Screen Brightness app for SysTray?

Would that have been done by the use of modprobe?

It is responsible for loading the module for use by the installed programs. Looks like there is some bug in the Devuan then if it installs and works fine in the MX. Both do not use the systemd garbage so have that in common but apparently not enough for the same package to work on both OSs.

Edit: Now there is thought now I think of it, does the package from Devuan install without errors on the MX or the other way around will the MX install on the Devuan. If they both use the same libraries/dependencies  they should be interchangeable.

Last edited by RedGreen925 (2025-01-06 11:32:38)

Offline

#36 2025-01-06 22:01:28

mtbvfr
Member
Registered: 2017-07-29
Posts: 150  

Re: Screen Brightness app for SysTray?

Now there is thought now I think of it,

It doesn't install correctly in MX neither, see post #33.

Just looked at the Devuan environment and there is no /proc/acpi/toshiba directory at present, only the /proc/acpi.

I noticed the Laptop running cooler when using Devuan also.

I will try Complete Removal from Synaptic again and then reinstalling using apt in the Devuan environment and see if the output is different to MX

The post by Mavrik on 8th, 2007, 11:43 AM and some following ones on the following page are interesting.

https://ubuntuforums.org/archive/index. … 16358.html

In a search for "Phoenix BIOS 1.70 acpi" I found the following pages:

https://support.dynabook.com/support/vi … Id=1401578

https://support.dynabook.com/support/vi … Id=1991832

Others to look at too.

The Fn Key only works with the F10 and F11 Keys on my Sister's Laptop which are for using the overlayed Numpad. Windoze XP was installed on the original Hard Drive and there is a Windows Vista Capable sticker near the Fingerprint reader,

She told me that with Win XP, there is a Brightness Adjustment feature in Settings.

If Devuan created a Brightness Adjustment Applet using xrandr, that would solve the problem.

Using xrandr --output LVDS --brightness 0.5 for example reduces the brightness by half.

Offline

#37 2025-01-06 23:36:31

RedGreen925
Member
Registered: 2024-12-07
Posts: 57  

Re: Screen Brightness app for SysTray?

It doesn't install correctly in MX neither, see post #33.

Damn missed that way to early in the morning to be replying.

If Devuan created a Brightness Adjustment Applet using xrandr, that would solve the problem.

Using xrandr --output LVDS --brightness 0.5 for example reduces the brightness by half.

Perfect time to scratch your own itch as the saying goes in Linux. Create a file with these contents.

#!/bin/bash

# A script to halve the brightness of the display
xrandr --output LVDS --brightness 0.5

Make it executable.

chmod +x /path/to/brightness.sh

Put it in your home bin directory if you use one or /usr/local/bin so it will be in the PATH then
brightness.sh used in a shell will execute the command. If using xbindkeys and xdotool you should be able to map it to a key shortcut to just have it done with that shortcut. Or perhaps a .desktop file can be made to run the command via a click on its icon. Just a couple of ways of doing it and as I say scratching your own itch. I have dozens of little scripts I run all the time from my cloning/backup one that will clone or backup my running system to media conversion, file copying to other machines, the list is endless.

Offline

#38 2025-01-07 01:58:35

mtbvfr
Member
Registered: 2017-07-29
Posts: 150  

Re: Screen Brightness app for SysTray?

If using xbindkeys and xdotool

Thanks for reminding me about those. It must be like 7+ years when I did something with those when I bought a Micro$oft Natural Keyboard with the "Wave" style key layout. It has 5 extra keys that can be programmed for whatever. I stopped using it because I prefer the layout of the Home-End-Delete-PageUp-PageDown and Multimedia Keys of my 2004 Micro$oft Natural Multimedia PS/2 keyboard for which I bought a Perixx PS/2 to USB adapter. It also has much better Build Quality.

I may even have it setup on this MX 19.4 installation I'm on and still using as my Daily OS. I will look into it later. What would be good is to be able to prompt the User for a value.

Offline

#39 2025-01-07 02:45:20

zapper
Member
Registered: 2017-05-29
Posts: 985  

Re: Screen Brightness app for SysTray?

light and xsct work for me

if you use certain window managers, you can autostart it  too when you log in.

Actually edit:

I just noticed I didn't read the title carefully enough.

My bad...

Last edited by zapper (2025-01-07 02:47:16)


Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term  If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!

Offline

#40 2025-01-07 10:31:16

mtbvfr
Member
Registered: 2017-07-29
Posts: 150  

Re: Screen Brightness app for SysTray?

Complete removal by Synaptic occurred without error.

Installation using apt produced the same error in Post #33.

Although xbindkeys and xdotool are installed on my Daily Driver, there wasn't any .xbindkeysrc in my Home directory. sad

Is there any other directory where such a configuration file exists?

It may have been MX17 or MX18 I was using that.

I can't remember, now, how I got my head around this stuff.

Is there better documentation on the use of xbindkeys than the following page?

https://wiki.archlinux.org/title/Xbindkeys

Section 2.2 Backlight control I find interesting but I find Section 5 confusing as it refers to xmodmap.

I am wondering if I could use XF86MonBrightnessUp and XF86MonBrightnessDown in the graphical Settings Editor for xfconf.

Offline

#41 2025-01-07 10:34:00

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,523  

Re: Screen Brightness app for SysTray?

This one is a little fancier and requires yad to be installed. It gives you a graphical slider. I'm not sure I did the gamma parts right and I never use that.

#!/usr/bin/env bash
# set_bright3b

set -x

# Set these names according to what xrandr tells you.
# For a single monitor, comment out the second xrandr command
# at the bottom of the script.

monitor_1="LVDS-1"
monitor_2=""

get_current_values () {
	
	current_bright=$(xrandr --verbose | grep -m1 Brightness | cut -d"." -f2)
	
	if  [ "$current_bright" = 0 ] ; then
		let current_bright="9"
	fi
	
	current_gamma=$(xrandr --verbose |grep -m1 Gamma | cut -d":" -f3)
	gamma1="$current_gamma"
}

select_brightness () {
	
	br1=$(yad --scale --title=Brightness --width=300 --min-value=2 --max-value=10  --value="${current_bright:0:1}" \
		--mark=2:2  --mark=3:3 --mark=4:4 --mark=5:5 --mark=6:6 --mark=7:7 --mark=8:8 --mark=9:9 --mark=10:10 \
		--page=1 --button=OK:0 --button="Gamma":1 --button=Exit:2)
		
		exit_code="$?"
		
		if [[ $exit_code -eq 1 ]] ; then
			br1="${current_bright:0:1}"
			select_gamma
		elif [[ $exit_code -eq 2 ]] ; then
			exit 0
		fi
}

select_gamma () {
	gm1=$(yad --form --field=Gamma:NUM "${current_gamma}\!0.5..1.5\!0.1\!1")
	gamma1="${gm1:0:3}"
}

get_current_values
select_brightness

if [ "$br1" = 10 ] ; then
	bright1="1.0"
	bright2="1.0"
else
	bright1="0.$br1"
	bright2="$bright1"
	# Uncomment the following 3 lines if monitor2 should be less bright.
	#br2="$br1"
	#(( br2-=1 ))
	#bright2="0.$br2"
fi

xrandr --output "$monitor_1" --brightness "$bright1" --gamma "${gamma1}:${gamma1}:${gamma1}"
#xrandr --output "$monitor_2" --brightness "$bright2" --gamma "${gamma1}:${gamma1}:${gamma1}"

exit 0

Offline

#42 2025-01-07 10:54:42

mtbvfr
Member
Registered: 2017-07-29
Posts: 150  

Re: Screen Brightness app for SysTray?

fsmithred wrote:

This one is a little fancier

Thanks mate, I will give it a go mañana.

Should I comment out the lines referring to gamma?

Ah, I see, I think. You are only using select_brightness in the Main Procedure.

Offline

#43 2025-01-07 13:47:02

RedGreen925
Member
Registered: 2024-12-07
Posts: 57  

Re: Screen Brightness app for SysTray?

Although xbindkeys and xdotool are installed on my Daily Driver, there wasn't any .xbindkeysrc in my Home directory. sad

Is there any other directory where such a configuration file exists?

You are supposed to create it in your ~ directory though like most of these things. I would imagine the option exists to start the program specifying another location for the config file passed as option at startup. The reference file for it lives at the /usr/share/doc/xbindkeys/examples/xbindkeysrc copy that to your ~/.xbindkeysrc then edit for your changes.

alias afl='apt-file list'
root@9600k:~# afl xbindkeys
xbindkeys: /etc/xdg/autostart/xbindkeys.desktop
xbindkeys: /usr/bin/xbindkeys
xbindkeys: /usr/bin/xbindkeys_autostart
xbindkeys: /usr/bin/xbindkeys_show
xbindkeys: /usr/share/doc/xbindkeys/BUGS
xbindkeys: /usr/share/doc/xbindkeys/NEWS.Debian.gz
xbindkeys: /usr/share/doc/xbindkeys/NEWS.gz
xbindkeys: /usr/share/doc/xbindkeys/README.Debian
xbindkeys: /usr/share/doc/xbindkeys/README.gz
xbindkeys: /usr/share/doc/xbindkeys/TODO
xbindkeys: /usr/share/doc/xbindkeys/changelog.Debian.gz
xbindkeys: /usr/share/doc/xbindkeys/changelog.gz
xbindkeys: /usr/share/doc/xbindkeys/copyright
xbindkeys: /usr/share/doc/xbindkeys/examples/xbindkeysrc
xbindkeys: /usr/share/doc/xbindkeys/examples/xbindkeysrc-combo.scm
xbindkeys: /usr/share/doc/xbindkeys/examples/xbindkeysrc.scm
xbindkeys: /usr/share/doc/xbindkeys/examples/xbindkeysrc1
xbindkeys: /usr/share/doc/xbindkeys/examples/xbindkeysrc2
xbindkeys: /usr/share/man/man1/xbindkeys.1.gz
xbindkeys: /usr/share/man/man1/xbindkeys_autostart.1.gz
xbindkeys: /usr/share/man/man1/xbindkeys_show.1.gz
xbindkeys: /usr/share/menu/xbindkeys

Edit: The script I use in the KDE autostart system setting to start it up on login.

zeus@9600k:~$ cat bin/xbindkeys.sh 
#!/bin/bash
# enable it on login if xbindkeys is installed.
if [ -f "/usr/bin/xbindkeys" ]; then
        xbindkeys
fi

Last edited by RedGreen925 (2025-01-07 13:50:06)

Offline

#44 2025-01-07 14:56:56

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,523  

Re: Screen Brightness app for SysTray?

@mtbvfr - you don't need to comment out any lines for the gamma settings. If you want to play with the gamma settings, just click on the gamma button when the window comes up and you can adjust it. If you run it a second time, it won't show your last setting. I obviously don't understand how it works.

Offline

#45 2025-01-08 06:57:21

mtbvfr
Member
Registered: 2017-07-29
Posts: 150  

Re: Screen Brightness app for SysTray?

@fsmithred - Works great!!

Were you referring to the last setting for the Gamma or the Brightness?

What's usually the best way, with Yad, to store the Brightness value that can later be retrieved by a bash script using xrandr on startup?

Thanks!!

Last edited by mtbvfr (2025-01-08 06:58:38)

Offline

#46 2025-01-08 09:02:07

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,523  

Re: Screen Brightness app for SysTray?

I meant the setting for the gamma. For example, if you set it to 0.8 and then run the script again, the gamma settings window comes up and shows the value as 1.4 instead of 0.8.

If you need the desktop to come up at a decreased brightness, you could add the one-liner script that was posted above in your startup applications.

Offline

Board footer