Skip to content

Commit

Permalink
Revert "Mitigate GUI DoS (part 1)"
Browse files Browse the repository at this point in the history
First of all Ctrl+Alt+P is too common key combo (for example conflicts
with Firefox's "New Private Window"). But even if that wouldn't be true,
in the current shape it does more harm than good, because it is
not documented (hard to discover when actually needed), and also
pause system VMs which in case of sys-usb and USB keyboard is
fatal.

Lets rethink this first.

This reverts commit 9459331.
QubesOS/qubes-issues#881
QubesOS/qubes-issues#4101
Fixes QubesOS/qubes-issues#4700
  • Loading branch information
marmarek committed Jan 28, 2019
1 parent c760ce5 commit 516ba21
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 3 deletions.
7 changes: 7 additions & 0 deletions xfce4-settings-qubes/qubes-update-xfce-config.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Desktop Entry]
Name=Update Qubes specific xfce config
Exec=/usr/lib/qubes/update-xfce-config
Terminal=false
Type=Application
OnlyShowIn=XFCE;
StartupNotify=false
33 changes: 33 additions & 0 deletions xfce4-settings-qubes/update-xfce-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

set -e

UPDATE_CONFIG_DONE_FILE="$HOME/.config/qubes-xfce-config-update"
UPDATE_CONFIG_DONE=$(cat "$UPDATE_CONFIG_DONE_FILE" 2>/dev/null || echo 0)

# reset xfconf property if it has given default value
reset_xfconf_if_default() {
local channel="$1"
local prop="$2"
local default="$3"
local current

current=$(xfconf-query -c "$channel" -p "$prop") || return 0
if [ "$current" = "$default" ]; then
xfconf-query -c "$channel" -p "$prop" -r
fi
}

if [ "$UPDATE_CONFIG_DONE" -lt 1 ]; then
reset_xfconf_if_default \
"xfce4-keyboard-shortcuts" \
"/commands/custom/<Control><Shift>P" \
"qvm-pause --all"
reset_xfconf_if_default \
"xfce4-keyboard-shortcuts" \
"/commands/custom/<Control><Alt><Shift>P" \
"qvm-unpause --all"
fi

UPDATE_CONFIG_DONE=1
echo "$UPDATE_CONFIG_DONE" > "$UPDATE_CONFIG_DONE_FILE"
2 changes: 0 additions & 2 deletions xfce4-settings-qubes/xfce4-keyboard-shortcuts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
<property name="Print" type="string" value="xfce4-screenshooter -f"/>
<property name="&lt;Alt&gt;Print" type="string" value="xfce4-screenshooter -w"/>
<property name="XF86Terminal" type="string" value="xfce4-terminal"/>
<property name="&lt;Control&gt;&lt;Shift&gt;P" type="string" value="qvm-pause --all"/>
<property name="&lt;Control&gt;&lt;Alt&gt;&lt;Shift&gt;P" type="string" value="qvm-unpause --all"/>
</property>
</property>
<property name="xfwm4" type="empty">
Expand Down
8 changes: 7 additions & 1 deletion xfce4-settings-qubes/xfce4-settings-qubes.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Source5: xfce4-session.xml
Source6: xfce4-power-manager.xml
Source7: xfce4-keyboard-shortcuts.xml
Source8: xfce4-xss-lock.desktop
Source9: qubes-update-xfce-config.desktop
Source10: update-xfce-config

Requires: qubes-artwork
Requires: xfce4-panel
Expand All @@ -40,8 +42,10 @@ install -m 644 -D %{SOURCE4} %{buildroot}%{_sysconfdir}/xdg/xfce4/xfconf/xfce-pe
install -m 644 -D %{SOURCE5} %{buildroot}%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml.qubes
install -m 644 -D %{SOURCE6} %{buildroot}%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml.qubes
install -m 644 -D %{SOURCE7} %{buildroot}%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml.qubes
install -m 644 -D %{SOURCE8} %{buildroot}%{_sysconfdir}/xdg/autostart/xfce4-xss-lock.desktop
ln -s ../../panel/default.xml %{buildroot}%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
install -m 644 -D %{SOURCE8} %{buildroot}%{_sysconfdir}/xdg/autostart/xfce4-xss-lock.desktop
install -m 644 -D %{SOURCE9} %{buildroot}%{_sysconfdir}/xdg/autostart/qubes-update-xfce-config.desktop
install -m 755 -D %{SOURCE10} %{buildroot}/usr/lib/qubes/update-xfce-config

%define settings_replace() \
qubesfile="%{1}" \
Expand Down Expand Up @@ -109,6 +113,8 @@ fi
%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml.qubes
%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml.qubes
%{_sysconfdir}/xdg/autostart/xfce4-xss-lock.desktop
%{_sysconfdir}/xdg/autostart/qubes-update-xfce-config.desktop
/usr/lib/qubes/update-xfce-config

%changelog

0 comments on commit 516ba21

Please sign in to comment.