Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xiccd to be enabled by default #15

Closed
es20490446e opened this issue Nov 13, 2017 · 1 comment
Closed

xiccd to be enabled by default #15

es20490446e opened this issue Nov 13, 2017 · 1 comment

Comments

@es20490446e
Copy link
Contributor

es20490446e commented Nov 13, 2017

Currently, when you install xiccd in your system, it isn't available to ArgyllCMS and DisplayCAL till you manually start it.

I would be nice if instead it was enabled by default on system start up, so non technical users could also make use of these tools.

#!/bin/bash

file="xiccd.desktop"
dir="/etc/xdg/autostart"

lines="[Desktop Entry]
Encoding=UTF-8
Name=Xiccd
GenericName=Screen Color Bridge
Comment=Enables screen color calibration
Exec=xiccd
Terminal=false
Type=Application
Categories="


mainFunction () {
    changeToDir "$dir"
    removeFile "$file"
    addLines "$lines" "$file"
}


addLines () {
    for line in "$1"; do
        echo "$line" | sudo tee --append "$2" > /dev/null
    done
}


changeToDir () {
    if [ ! -d "$1" ]; then
        (>&2 echo "changeToDir: $1 doesn't exist")
        exit 1
    fi

    cd "$1"
}


removeFile () {
    if [ -f "$1" ]; then
        sudo rm "$1"
    fi
}


mainFunction
@es20490446e
Copy link
Contributor Author

Super-seeded by #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant