Created
September 9, 2014 10:19
-
-
Save rfc1459/8885630a7dd562da9f1c to your computer and use it in GitHub Desktop.
Stupid wrapper for gnome-keyring-daemon on MATE 1.8 and XFCE4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Stupid workaround for a stupid problem: both MATE 1.8 and XFCE4 start | |
# gnome-keyring-daemon with *ALL* components enabled because gkd sets env | |
# vars through a GNOME-only DBus interface (org.gnome.SettingsDaemon.Setenv) | |
# This script wraps gkd and upon detection of the hardcoded command line | |
# replaces it with a saner one. | |
# Drop the script as "gnome-keyring-daemon" somewhere higher up in your PATH | |
# (possibly ~/bin or ~/.local/bin, depending on your profile) | |
import os | |
import sys | |
gkd_path = '/usr/bin/gnome-keyring-daemon' | |
args = [gkd_path] | |
if len(sys.argv) == 2 and sys.argv[1] == '--start': | |
# Ok, we're being called by mate-session-manager or xfce-session, do our magic | |
# Get rid of gpg and ssh integration, start only PKCS#11 and password management | |
args.extend(['--start', '--components=pkcs11,secrets']) | |
else: | |
# Simple passthrough | |
args.extend(sys.argv[1:]) | |
# Here we go - make damn sure to preserve the original environment! | |
os.execve(gkd_path, args, os.environ) | |
# TODO: handle failure scenarios | |
sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks. This wrapper made my day better. If anyone wants a reason why Linux is not gaining grounds on Desktop/Laptop environments, this is one.