Posts
Search
Contact
Cookies
About
RSS

Getting rid of *kit, no policykit no consolekit etc etc etc

Added 1 Jul 2015, 8:34 a.m. edited 18 Jun 2023, 1:12 a.m.
I've always has issue with especially policykit for its arcane config files and lack of a single definitive go document source who.knows.what.setting.to.change!=usable or course next week its probably blame.the.user.they.dont.know.it.got.changed and aside anything else all these "essentials" are plain just not necessary and almost certainly do get in the way and make life harder! As anyone who as installed a minimal cruftless Gentoo install its actually not difficult to avoid things like policykit and consolekit - unlike systemd you don't even need a simple mask - just keep your eye on what newly installed packages have in their USE flags... For me there were only a couple of thing's missing - one was automounting which isn't a major feature for me pmount-gui and a couple of desktop files to make a mount and unmount menu appear make a trivial replacement. shutting down and resetting does require a password and while I could easily live with this I decided to make my own logoff menu. While you can do loads with python and for example gtk, I decided on an even more rapid solution - zenity is a really nice bit of kit... First off though some ground work
%wheel ALL=(ALL) NOPASSWD: /sbin/reboot, /sbin/poweroff
this means all in the wheel group can use sudo reboot (or poweroff) without need for a password, you may want to change this to specific users or create your own group for this function, its your system all said and done! The menu script using zenity is really quite an easy and simple bash script
#/bin/bash

int=`zenity --height 240 --list --text ''  --column 'Select...' "Log Out" "Reboot" "Switch Off" `

[[ $int = "Log Out" ]] && xfce4-session-logout --logout --fast 
[[ $int = "Reboot" ]] && sudo reboot
[[ $int = "Switch Off" ]] && sudo poweroff
Its fairly self evident what's going on here... create a desktop file for it in ~/.local/share/applications also copy /usr/share/applications/xfce4-session-logout.desktop into ~/.local/share/applications then as we don't want to see it add the following key/value
Hidden=true
and now for the hardest part - editing the xfce menu first you need to copy /etc/xdg/menus/xfce-applications.menu to .config/menus/xfce-applications.menu this allows you to edit the menu without it getting overwritten next update. immediately after the entry for "about" add your own entry
        <Filename>xfce4-about.desktop</Filename>
        <Filename>shutit.desktop</Filename>
You can see here the shutit.desktop I created for the script - and hopefully thats all there is to it. So can you really survive without policykit consolekit pulseaudiokit and systemdkit...? well yes basically Gimp, Blender, Lmms, Libre Office, etc all just carry on quite happily AND you have something less mysterious and altogether easier to maintain...