Last active
October 9, 2019 11:50
-
-
Save nottux/e2fbb928ccd827e8a450eac6b5fa43e2 to your computer and use it in GitHub Desktop.
kdeconnectd disabling auto-start but still being able to launch it manually solution
This file contains hidden or 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
| if [ "$1" = run ] | |
| then echo "press Ctrl+C to stop" | |
| a=$(mktemp -d) | |
| sudo -E su -c "cp /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd $a;chmod -R 777 $a;su $USER -c $a/kdeconnectd&su $USER -c kdeconnect-indicator" | |
| rm -rfv $a | |
| fi | |
| if [ "$1" = disable ] | |
| then sudo chmod -x /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd | |
| fi | |
| if [ "$1" = enable ] | |
| then sudo chmod +x /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd | |
| fi | |
| if [ "$1" != enable -a "$1" != disable -a "$1" != run ] | |
| then echo -e "I have disabled kdeconnectd, see 'https://unix.stackexchange.com/questions/384306/why-does-kdeconnect-listen-on-port-1716-tcp-all-the-time-how-to-close-the-port/509476#509476' to how i did it"\\nto re-enable it, run:\\nsudo chmod +x /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd\\n"OR run this script with 'enable'"\\n"Ex: 'kdeconnectd enable'"\\nAnd reboot the computer\\n\\n"to disable run this script with 'disable'"\\n"Ex: 'kdeconnectd disable'"\\n\\nyou can also run:\\n"'a=\$(mktemp -d);sudo -E su -c \"cp /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd $a;chmod -R 777 $a;su \$USER -c \$a/kdeconnectd&su \$USER -c kdeconnect-indicator\";rm -rfv \$a'"\\n"if you run this with 'run'"\\n"Ex: 'kdeconnectd run'"\\nThis will run the suggested command | |
| fi | |
| #using "-E" instead of "--preserve-env=USER seems to work better, kdeconnect-cli works this way. if "--preserve-env" used istead; it launches indicator but doesn't allow kdeconnect-cli to work. With "-E"; indicator won't show up until you pair with a device but it allows kdeconnect-cli to work |
Author
Author
fixed the help message, one of the $a's were missing a backslash to be visible
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
finally, previous had wrong quotation mark and i made it, now this is what i call "final revision"