Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Disable or remove suspend and switch user from KDE start menu

  1. #11
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    1,930
    Blog Entries
    1

    Default Re: Disable or remove suspend and switch user from KDE start menu

    Quote Originally Posted by uvoigt View Post
    Actually I am using the "Application Menu" and not the "Application Launcher".
    When switching to Application Launcher it is possible to remove the "Leave" menu.

    Thanks

    P.S. I am still curious why the polkit settings did have no effect...
    For sure it takes effect for new sessions but not for existing ones.
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

  2. #12

    Default Re: Disable or remove suspend and switch user from KDE start menu

    Quote Originally Posted by deano_ferrari View Post
    Did you investigate the KDE thread and KDE Kiosk restrictions page I linked to?
    Yes, I found both pages before starting this thread. Anyhow I did not find any KDE submit action.

    I added the following lines to /etc/xdg/kdeglobals and that removed the "Switch user" and "Lock" item:
    Code:
    [KDE Action Restrictions][$i]
    logout=false
    action/lock_screen=false
    action/switch_user=false
    action/start_new_session=false
    
    [KDE Control Module Restrictions][$i]
    kcm_sddm.desktop=false
    kcmsmserver.desktop=false

  3. #13

    Default Re: Disable or remove suspend and switch user from KDE start menu

    Quote Originally Posted by karlmistelberger View Post
    For sure it takes effect for new sessions but not for existing ones.
    It did not take effect even after a reboot or better: KDE does not care about even after a reboot.

  4. #14
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    1,930
    Blog Entries
    1

    Default Re: Disable or remove suspend and switch user from KDE start menu

    Quote Originally Posted by uvoigt View Post
    It did not take effect even after a reboot or better: KDE does not care about even after a reboot.
    What are your versions:

    Code:
    erlangen:~ # zypper se --installed-only --details polkit
    Loading repository data...
    Reading installed packages...
    
    S | Name                    | Type    | Version                   | Arch   | Repository
    --+-------------------------+---------+---------------------------+--------+--------------------
    i | libpolkit-qt5-1-1       | package | 0.113.0-1.4               | x86_64 | openSUSE-20191106-0
    i | libpolkit0              | package | 0.116-3.3                 | x86_64 | openSUSE-20191106-0
    i | polkit                  | package | 0.116-3.3                 | x86_64 | openSUSE-20191106-0
    i | polkit-default-privs    | package | 1550+20200417.940923e-1.1 | noarch | openSUSE-20191106-0
    i | polkit-kde-agent-5      | package | 5.18.4.1-1.1              | x86_64 | openSUSE-20191106-0
    i | polkit-kde-agent-5-lang | package | 5.18.4.1-1.1              | noarch | openSUSE-20191106-0
    erlangen:~ #
    What are your changes:

    Code:
    erlangen:~ # rpm -V polkit polkit-default-privs polkit-kde-agent-5 polkit-kde-agent-5-lang
    S.5....T.  c /etc/polkit-default-privs.local
    erlangen:~ #
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

  5. #15

    Default Re: Disable or remove suspend and switch user from KDE start menu

    Code:
    # zypper se --installed-only --details polkit
    Loading repository data...
    Reading installed packages...
    
    S  | Name                    | Type    | Version           | Arch   | Repository
    ---+-------------------------+---------+-------------------+--------+-----------------------
    i+ | libpolkit-qt-1-1        | package | 0.112.0-lp151.2.2 | x86_64 | Main Repository
    i+ | libpolkit-qt5-1-1       | package | 0.112.0-lp151.2.3 | x86_64 | Main Repository
    i+ | libpolkit0              | package | 0.114-lp151.5.3.1 | x86_64 | Main Update Repository
    i+ | polkit                  | package | 0.114-lp151.5.3.1 | x86_64 | Main Update Repository
    i+ | polkit-default-privs    | package | 13.2-lp151.16.6.1 | noarch | Main Update Repository
    i+ | polkit-kde-agent-5      | package | 5.12.8-lp151.1.2  | x86_64 | Main Repository
    i+ | polkit-kde-agent-5-lang | package | 5.12.8-lp151.1.2  | noarch | Main Repository
    i+ | typelib-1_0-Polkit-1_0  | package | 0.114-lp151.5.3.1 | x86_64 | Main Update Repository
    Code:
    #  rpm -V polkit polkit-default-privs polkit-kde-agent-5 polkit-kde-agent-5-lang
    .....U...    /etc/polkit-1/rules.d
    .....U...    /usr/share/polkit-1/rules.d
    S.5....T.  c /etc/polkit-default-privs.local
    Code:
    # ll /etc/polkit-1/rules.d/
    total 60
    -rw-r--r-- 1 root root   321 Jul 30  2019 50-default.rules
    -rw-r--r-- 1 root root 55757 May  6 09:46 90-default-privs.rules
    
    # grep -i -A1 suspend /etc/polkit-1/rules.d/*
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.login1.inhibit-handle-suspend-key':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    --
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.login1.suspend-ignore-inhibit':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    --
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.libvirt.api.domain.suspend':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'auth_admin_keep', 'auth_admin_keep', 'auth_admin_keep' ],
    --
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.upower.suspend':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    --
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.login1.suspend':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    --
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.login1.suspend-multiple-sessions':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    #
    Code:
    # ll /usr/share/polkit-1/rules.d/
    total 8
    -rw-r--r-- 1 root root 257 Oct 22  2019 org.freedesktop.packagekit.rules
    -rw-r--r-- 1 root root 330 Mar 25 15:28 systemd-networkd.rules
    
    # grep -i suspend /usr/share/polkit-1/rules.d/*
    #

  6. #16
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    1,930
    Blog Entries
    1

    Default Re: Disable or remove suspend and switch user from KDE start menu

    Quote Originally Posted by uvoigt View Post
    Code:
    # zypper se --installed-only --details polkit
    Loading repository data...
    Reading installed packages...
    
    S  | Name                    | Type    | Version           | Arch   | Repository
    ---+-------------------------+---------+-------------------+--------+-----------------------
    i+ | libpolkit-qt-1-1        | package | 0.112.0-lp151.2.2 | x86_64 | Main Repository
    i+ | libpolkit-qt5-1-1       | package | 0.112.0-lp151.2.3 | x86_64 | Main Repository
    i+ | libpolkit0              | package | 0.114-lp151.5.3.1 | x86_64 | Main Update Repository
    i+ | polkit                  | package | 0.114-lp151.5.3.1 | x86_64 | Main Update Repository
    i+ | polkit-default-privs    | package | 13.2-lp151.16.6.1 | noarch | Main Update Repository
    i+ | polkit-kde-agent-5      | package | 5.12.8-lp151.1.2  | x86_64 | Main Repository
    i+ | polkit-kde-agent-5-lang | package | 5.12.8-lp151.1.2  | noarch | Main Repository
    i+ | typelib-1_0-Polkit-1_0  | package | 0.114-lp151.5.3.1 | x86_64 | Main Update Repository
    Code:
    #  rpm -V polkit polkit-default-privs polkit-kde-agent-5 polkit-kde-agent-5-lang
    .....U...    /etc/polkit-1/rules.d
    .....U...    /usr/share/polkit-1/rules.d
    S.5....T.  c /etc/polkit-default-privs.local
    Code:
    # ll /etc/polkit-1/rules.d/
    total 60
    -rw-r--r-- 1 root root   321 Jul 30  2019 50-default.rules
    -rw-r--r-- 1 root root 55757 May  6 09:46 90-default-privs.rules
    
    # grep -i -A1 suspend /etc/polkit-1/rules.d/*
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.login1.inhibit-handle-suspend-key':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    --
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.login1.suspend-ignore-inhibit':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    --
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.libvirt.api.domain.suspend':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'auth_admin_keep', 'auth_admin_keep', 'auth_admin_keep' ],
    --
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.upower.suspend':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    --
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.login1.suspend':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    --
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.login1.suspend-multiple-sessions':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    #
    Code:
    # ll /usr/share/polkit-1/rules.d/
    total 8
    -rw-r--r-- 1 root root 257 Oct 22  2019 org.freedesktop.packagekit.rules
    -rw-r--r-- 1 root root 330 Mar 25 15:28 systemd-networkd.rules
    
    # grep -i suspend /usr/share/polkit-1/rules.d/*
    #
    I made the following changes, which work:

    Code:
    erlangen:~ # cat /etc/polkit-default-privs.local
    #
    # /etc/polkit-default-privs.local
    #
    # This file is used by the set_polkit_default_privs tool to generate polkit
    # rules. It is meant for local overrides of the active profile (defined in
    # /etc/sysconfig/security) by the administrator of the system: any definitions
    # here take precedence over the distribution defaults in
    # /etc/polkit-default-privs.<profile>.
    #
    # The syntax for this file is defined in polkit-default-privs(5). Note that you
    # need to run /sbin/set_polkit_default_privs for changes to take effect.
    org.freedesktop.login1.inhibit-handle-hibernate-key no:no:no
    org.freedesktop.login1.hibernate no:no:no
    org.freedesktop.login1.hibernate-multiple-sessions no:no:no
    org.freedesktop.login1.hibernate-ignore-inhibit no:no:no
    erlangen:~ # 
    
    erlangen:~ # grep -i -A1 hibernate /etc/polkit-1/rules.d/*
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.login1.hibernate':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.login1.hibernate-ignore-inhibit':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.login1.hibernate-multiple-sessions':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    --
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.login1.inhibit-handle-hibernate-key':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'no', 'no', 'no' ],
    --
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.freedesktop.upower.hibernate':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'auth_admin', 'auth_admin', 'yes' ],
    --
    /etc/polkit-1/rules.d/90-default-privs.rules:           'org.libvirt.api.domain.hibernate':
    /etc/polkit-1/rules.d/90-default-privs.rules-                   [ 'auth_admin_keep', 'auth_admin_keep', 'auth_admin_keep' ],
    erlangen:~ #
    The hibernate button is gone in the Application Launcher.
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

  7. #17

    Default Re: Disable or remove suspend and switch user from KDE start menu

    Thanks for your efforts!

    I installed your polkit-default-privs.local file, ran set_polkit_default_privs and rebooted the system.
    Anyhow the Suspend button is still visible and active

    I guess there's somethings buggy in my versions of KDE and/or polkit.
    Or there is some other setting why the polkit settings are not respected.

  8. #18
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    1,930
    Blog Entries
    1

    Default Re: Disable or remove suspend and switch user from KDE start menu

    Quote Originally Posted by uvoigt View Post
    Thanks for your efforts!

    I installed your polkit-default-privs.local file, ran set_polkit_default_privs and rebooted the system.
    Anyhow the Suspend button is still visible and active

    I guess there's somethings buggy in my versions of KDE and/or polkit.
    Or there is some other setting why the polkit settings are not respected.
    What about packages libpolkit-qt-1-1 and typelib-1_0-Polkit-1_0? Try to remove them.
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

  9. #19

    Default Re: Disable or remove suspend and switch user from KDE start menu

    Quote Originally Posted by karlmistelberger View Post
    What about packages libpolkit-qt-1-1 and typelib-1_0-Polkit-1_0? Try to remove them.
    I have removed them but Suspend is still visible.

  10. #20
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    1,930
    Blog Entries
    1

    Default Re: Disable or remove suspend and switch user from KDE start menu

    Quote Originally Posted by uvoigt View Post
    I have removed them but Suspend is still visible.
    Updated Leap 15.1. It has no hibernate button from scratch. zypper se -is polkit finds:

    Code:
    erlangen:~ # cat /mnt/root/zypper.polkit 
    Loading repository data...
    Reading installed packages...
    
    S | Name                    | Type    | Version           | Arch   | Repository            
    --+-------------------------+---------+-------------------+--------+-----------------------
    i | gconf-polkit            | package | 3.2.6-lp151.2.3   | x86_64 | Main Repository       
    i | libpolkit-qt5-1-1       | package | 0.112.0-lp151.2.3 | x86_64 | Main Repository       
    i | libpolkit0              | package | 0.114-lp151.5.3.1 | x86_64 | Main Update Repository
    i | polkit                  | package | 0.114-lp151.5.3.1 | x86_64 | Main Update Repository
    i | polkit-default-privs    | package | 13.2-lp151.16.6.1 | noarch | Main Update Repository
    i | polkit-kde-agent-5      | package | 5.12.8-lp151.1.2  | x86_64 | Main Repository       
    i | polkit-kde-agent-5-lang | package | 5.12.8-lp151.1.2  | noarch | Main Repository       
    erlangen:~ #
    Make sure you only use recommended repos (you can disable additional repos and enable them when done) :

    Code:
    erlangen:~ # ll /mnt/etc/zypp/repos.d/
    total 44
    -rw-r--r-- 1 root root 189 Nov 21 22:02 repo-debug-non-oss.repo
    -rw-r--r-- 1 root root 193 Nov 21 22:02 repo-debug-update-non-oss.repo
    -rw-r--r-- 1 root root 172 Nov 21 22:02 repo-debug-update.repo
    -rw-r--r-- 1 root root 167 Nov 21 22:02 repo-debug.repo
    -rw-r--r-- 1 root root 171 Nov 21 22:04 repo-non-oss.repo
    -rw-r--r-- 1 root root 160 Nov 21 22:04 repo-oss.repo
    -rw-r--r-- 1 root root 192 Nov 21 22:02 repo-source-non-oss.repo
    -rw-r--r-- 1 root root 170 Nov 21 22:02 repo-source.repo
    -rw-r--r-- 1 root root 176 Nov 21 22:04 repo-update-non-oss.repo
    -rw-r--r-- 1 root root 159 Nov 21 22:04 repo-update.repo
    erlangen:~ #
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •