Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Update lxqtbacklight_backend.c #212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion lxqtbacklight/linux_backend/driver/lxqtbacklight_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,35 @@ static void show_blacklight()
printf("%s %d %d\n", driver, max_value, actual);
free(driver);
}

static void show_max()
{
char *driver = get_driver();
if( driver == NULL ) {
return;
}
int max_value = read_max_backlight(driver);
printf("%d\n", max_value);
free(driver);
}
static void show_val()
{
char *driver = get_driver();
if( driver == NULL ) {
return;
}
int actual = read_backlight(driver);
printf("%d\n", actual);
free(driver);
}
static void show_driver()
{
char *driver = get_driver();
if( driver == NULL ) {
return;
}
printf("%s\n", driver);
free(driver);
}
static void change_blacklight(int value, int percent_ok)
{
char *driver = get_driver();
Expand Down Expand Up @@ -159,6 +187,9 @@ static void help(char *argv0)
printf("%s [backlight-level [ %% ]] [--help]\n"
"--help Shows this message.\n"
"--show Shows actual brightness level.\n"
"--show-max Shows maximum brightness level.\n"
"--show-value Shows value of brightness level.\n"
"--show-driver Shows driver in use.\n"
"--inc Increases actual brightness level.\n"
"--dec Decreases actual brightness level.\n"
"--stdin Read backlight value from stdin\n"
Expand All @@ -183,6 +214,15 @@ int main(int argc, char *argv[])
} if( !strcmp(argv[n], "--show") ) {
show_blacklight();
return 0;
} if( !strcmp(argv[n], "--show-max") ) {
show_max();
return 0;
} if( !strcmp(argv[n], "--show-value") ) {
show_val();
return 0;
} if( !strcmp(argv[n], "--show-driver") ) {
show_driver();
return 0;
} if( !strcmp(argv[n], "--inc") ) {
increases_blacklight();
return 0;
Expand Down