Xfce4 brightness control seems don’t work right, so i decided to test it… then it show that xfce4 power manager which usually control the brightness value make brightness down to much, and i find 2 tutorial here and here.
Indeed there was also xbacklight also which installed with xorg, but xbacklight dont get smooth enough for me, so there on the 1st tutorial which give satisfaction to me.
[code]
/*
* Change/query the brightness of LCD screen.
*/
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
FILE *fp;
int bright = 0;
const char *kFileName = “/sys/class/backlight/acpi_video0/brightness”;
fp = fopen(kFileName, “r”);
fscanf(fp, “%d”, &bright);
fclose(fp);
switch (argc) {
case 1:
printf(“%dn”, bright);
break;
case 2:
fp = fopen(kFileName, “w”);
bright += atoi(argv[1]);
fprintf(fp, “%dn”, bright);
fclose(fp);
break;
default:
fprintf(stderr, “Usage: lcd-brightness [value]n”);
return -1;
}
return 0;
}
[/code]
Then compile like usual, there was a notice for you the hardware diff will give diff place of your brightness setup. [code]/sys/class/backlight/acpi_video0/brightness[/code] that’s mine, ATI , dell laptop maybe have diff place of this file, so you must know the file first.
then from the second tutorial…. because im using XFCE4 so yes, this is how to disable brightness schortcut,
[code]xfconf-query -c xfce4-power-manager -n -t bool -p /xfce4-power-manager/change-brightness-on-key-events -s false[/code]
[code]xfconf-query -c xfce4-power-manager -n -t bool -p /xfce4-power-manager/show-brightness-popup -s false[/code]
the first one will disable the key events, the second will disable the popup…
so then after that, copy the output file a.out to /usr/local/bin/lcd-brightness , then bind it to shorcut key, if you want some notif just make a bash… 🙂