-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
base: main
Are you sure you want to change the base?
Screen Dimming #651
Conversation
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.
There was a problem hiding this 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.
/** | ||
* 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" | ||
}; |
There was a problem hiding this comment.
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
?
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' "; | ||
} |
There was a problem hiding this comment.
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?
yield; | ||
return; |
There was a problem hiding this comment.
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?
yield; | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here?
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
git rebase -i
(if needed)