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

Screen Dimming #651

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Screen Dimming #651

wants to merge 7 commits into from

Conversation

fossfreedom
Copy link
Contributor

Description

This PR adds power-dimming support if configured in BCC Power

i.e. if idle-dim is configured then swayidle will dim after 30 seconds and resume with the original set brightness.
It uses gsd-power to configure brightness settings.

Marking as draft until the screenlock PR is dealt with and then this will need rebasing.

Submitter Checklist

  • Squashed commits with git rebase -i (if needed)
  • Built budgie-desktop and verified that the patch worked (if needed)

This is to aid packagers/developers where there are apps
that are needed to successfully run budgie-desktop.
For the final packaging, distros can switch off this check
to speed up build-time i.e. limit the number of additional
dependencies these packages would bring in.
Copy link
Member

@EbonJaeger EbonJaeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an interesting mix of spaces and tabs used for indentation in the screenlock.vala file, in some cases, both on the same line.

Comment on lines +75 to +83
/**
* Try in order, and load the first one that exists:
* - /etc/budgie-desktop/[gtklock.ini | gtklock.css]
* - /usr/share/budgie-desktop/[gtklock.ini | gtklock.css]
*/
string[] system_configs = {
@"file://$(Budgie.CONFDIR)/budgie-desktop/gtklock.ini",
@"file://$(Budgie.DATADIR)/budgie-desktop/gtklock.ini"
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we care about files in ~/.config?

Comment on lines +127 to +146
if (sleep_inactive_battery_type == "suspend" && sleep_inactive_battery_timeout != 0) {
output = "timeout " + sleep_inactive_battery_timeout.to_string();
output += " 'if dbus-send --print-reply=literal --dest=org.buddiesofbudgie.BudgieScreenlock /org/buddiesofbudgie/Screenlock org.buddiesofbudgie.BudgieScreenlock.OnBattery | grep \"boolean true\" > /dev/null; then systemctl suspend; fi' ";
}

if (sleep_inactive_ac_type == "suspend" && sleep_inactive_ac_timeout !=0) {
output += " timeout " + sleep_inactive_ac_timeout.to_string();
output += " 'if dbus-send --print-reply=literal --dest=org.buddiesofbudgie.BudgieScreenlock /org/buddiesofbudgie/Screenlock org.buddiesofbudgie.BudgieScreenlock.OnBattery | grep \"boolean false\" > /dev/null; then systemctl suspend; fi' ";
}

return output;
}

private string calculate_dim() {
isdimmable = this.power.get_boolean("idle-dim");

if (!isdimmable) return "";

return "timeout 30 'dbus-send --type=method_call --dest=org.buddiesofbudgie.BudgieScreenlock /org/buddiesofbudgie/Screenlock org.buddiesofbudgie.BudgieScreenlock.Dim' resume 'dbus-send --type=method_call --dest=org.buddiesofbudgie.BudgieScreenlock /org/buddiesofbudgie/Screenlock org.buddiesofbudgie.BudgieScreenlock.Undim' ";
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do this when we have the methods available to us right in this class?

Comment on lines +238 to +239
yield;
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to yield here?

Comment on lines +253 to +254
yield;
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants