summarylogtreecommitdiffstats
path: root/optimus-manager.install
blob: 4339c45fb02f89c3e675cb2f375a6f60a9bc2751 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31


post_install() {

    echo "optimus-manager : enabling optimus-manager.service"
    mkdir -p /etc/systemd/system/graphical.target.wants/
    ln -s /usr/lib/systemd/system/optimus-manager.service /etc/systemd/system/graphical.target.wants/optimus-manager.service
    
    bold=$(tput bold)
    red=$(tput setaf 1)
    normal=$(tput sgr0)
    echo "${bold}${red}Please reboot your computer before using optimus-manager${normal}"
}

post_remove() {

	echo "optimus-manager : cleaning up auto-generated Xorg conf"

    xorg_conf=/etc/X11/xorg.conf.d/10-optimus-manager.conf
    if [ -f "$xorg_conf" ]; then
        rm $xorg_conf
    fi

    echo "optimus-manager : disabling optimus-manager.service"

    service_file_link=/etc/systemd/system/graphical.target.wants/optimus-manager.service
    if [ -L "$service_file_link" ]; then
        rm $service_file_link
    fi

}