feat: show the bubble on gnome
This commit is contained in:
1 parent
f232f796fc
commit
2a9b0d3f91
28 files changed
+2278
-1077
No files matched your search
+8
-9
@@ -276,8 +276,7 @@ fu_ui_status() {
|
||||
# heading, with only the label after it
|
||||
# type bool, choice (steps through the choices) or camera
|
||||
# needs a bool setting this one does nothing without; it is dimmed while
|
||||
# that is off. Layers is no setting: whether the desktop can show
|
||||
# the bubble at all (GNOME cannot).
|
||||
# that is off
|
||||
FU_SETTINGS=(
|
||||
"group|Lock screen"
|
||||
"user|LockScreen|bool|yes|Unlock with your face"
|
||||
@@ -295,7 +294,7 @@ FU_SETTINGS=(
|
||||
"sys|Adapt|bool|yes|Learn from every unlock"
|
||||
"sys|SkipLidClosed|bool|yes|Not when the lid is closed"
|
||||
"group|Bubble"
|
||||
"user|Bubble|bool|yes|Show the bubble||Layers"
|
||||
"user|Bubble|bool|yes|Show the bubble"
|
||||
"user|BubbleStyle|choice|full|Style|full,minimal|Bubble"
|
||||
"user|AnimationSpeed|choice|normal|Animation speed|slow,normal,fast|Bubble"
|
||||
"user|BubbleForPrompts|bool|yes|Also for sudo and admin prompts||Bubble"
|
||||
@@ -304,10 +303,12 @@ FU_SETTINGS=(
|
||||
# fu_setting_help <Key> <value>
|
||||
# What a setting does, shown under the list for the selected one.
|
||||
fu_setting_help() {
|
||||
if [[ $FU_DESKTOP == gnome && $1 =~ ^(Bubble|BubbleStyle|AnimationSpeed|BubbleForPrompts)$ ]]; then
|
||||
fu_msg "GNOME does not let other programs show above its windows, so there is no bubble on GNOME."
|
||||
return
|
||||
fi
|
||||
case "$FU_DESKTOP:$1" in
|
||||
gnome:Bubble)
|
||||
fu_msg "On GNOME a small GNOME extension shows the bubble. Turning face unlock on switches it on."
|
||||
return
|
||||
;;
|
||||
esac
|
||||
case "$1:$2" in
|
||||
LockScreen:*) fu_msg "Unlocks the lock screen when it sees your face. Off: only your password works there." ;;
|
||||
ScanOnWake:*) fu_msg "Scans when you press a key or move the mouse on the lock screen, and when the computer wakes up." ;;
|
||||
@@ -523,8 +524,6 @@ fu_ui_settings() {
|
||||
values[i]="$FU_SETTING_VALUE"
|
||||
current[${keys[i]}]="$FU_SETTING_VALUE"
|
||||
done
|
||||
current[Layers]=yes
|
||||
[[ $FU_DESKTOP == gnome ]] && current[Layers]=no current[Bubble]=no
|
||||
dirty=0
|
||||
fi
|
||||
|
||||
|
||||
@@ -145,6 +145,46 @@ fu_agent_hint() {
|
||||
fi
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# The bubble's GNOME Shell extension
|
||||
# ---------------------------------------------------------------------------
|
||||
# GNOME lets no program draw above its windows; its extensions may. The
|
||||
# package brings one, and turning face unlock on switches it on.
|
||||
|
||||
FU_GNOME_EXTENSION="face-unlock@loonixtools.github.io"
|
||||
|
||||
# fu_gnome_extension_enable
|
||||
# gnome-extensions only knows the extensions GNOME found when the session
|
||||
# started. One that came with the package later goes straight into the
|
||||
# setting, and GNOME loads it at the next login: returns 2 then.
|
||||
fu_gnome_extension_enable() {
|
||||
local list new
|
||||
fu_have gsettings || return 1
|
||||
if gnome-extensions info "$FU_GNOME_EXTENSION" > /dev/null 2>&1; then
|
||||
gnome-extensions enable "$FU_GNOME_EXTENSION" > /dev/null 2>&1 && return 0
|
||||
fi
|
||||
list="$(gsettings get org.gnome.shell enabled-extensions 2>/dev/null)" || return 1
|
||||
case "$list" in
|
||||
*"'$FU_GNOME_EXTENSION'"*) return 2 ;;
|
||||
'@as []'|'[]') new="['$FU_GNOME_EXTENSION']" ;;
|
||||
*) new="${list%]}, '$FU_GNOME_EXTENSION']" ;;
|
||||
esac
|
||||
gsettings set org.gnome.shell enabled-extensions "$new" || return 1
|
||||
return 2
|
||||
}
|
||||
|
||||
fu_gnome_extension_disable() {
|
||||
local list
|
||||
fu_have gsettings || return 0
|
||||
gnome-extensions disable "$FU_GNOME_EXTENSION" > /dev/null 2>&1 && return 0
|
||||
list="$(gsettings get org.gnome.shell enabled-extensions 2>/dev/null)" || return 0
|
||||
list="${list//, \'$FU_GNOME_EXTENSION\'/}"
|
||||
list="${list//\'$FU_GNOME_EXTENSION\', /}"
|
||||
list="${list//\'$FU_GNOME_EXTENSION\'/}"
|
||||
[[ $list == '[]' ]] && list='@as []'
|
||||
gsettings set org.gnome.shell enabled-extensions "$list" > /dev/null 2>&1 || true
|
||||
}
|
||||
|
||||
fu_agent_disable() {
|
||||
systemctl --user disable --now "$FU_UNIT_AGENT" > /dev/null 2>&1 || true
|
||||
}
|
||||
Reference in new issue
Block a user