summaryrefslogtreecommitdiffstats
path: root/linhes/linhes-system/lh_system_start.sh
blob: 6ba1cb05a3072f96de8deb7ef4cf60268dbae9c3 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash

. /etc/profile
#. /etc/systemconfig

function msg(){
    /usr/bin/notify-send --app-name="LinHES" --icon=dialog-information "$1" "$2"
}

function applyUIsettings(){
    cp /usr/share/linhes/templates/plasma-org.kde.plasma.desktop-appletsrc ~/.config/
    #restart plasma
    kquitapp5 plasmashell
    kstart5 plasmashell > /dev/null 2>&1
    plasma-apply-colorscheme BreezeDark
    kwriteconfig5 --group KDE --key SingleClick false
    kwriteconfig5 --file ~/.config/kscreenlockerrc --group Daemon --key Autolock false
    kwriteconfig5 --file ~/.config/kscreenlockerrc --group Daemon --key LockOnResume false
    #disable file indexing
    balooctl disable
    sleep 2
    plasma-apply-wallpaperimage /usr/share/linhes/templates/lights-bud-abstract-4k-cq.jpg
    msg "Welcome to LinHES 9!"
}

function make_nanorc(){
    mkdir ~/.config/nano
    echo -e 'set tabsize 4\nset tabstospaces\ninclude "/usr/share/nano/*.nanrc"' >> ~/.config/nano/nanorc
}

function notify_scan(){
    if [ -e /tmp/scan_report ]
    then
        msg "New Storage Found" "Run add_storage.py for details."
    fi
}

function first_configure(){
    echo "First configure..."
    if [ ! $SystemType = "Frontend_only" ]
    then
        if [ ! -f ~/.config/lh_configured ]
        then
            applyUIsettings
            msg "New install of LinHES. Starting setup."
            # only run mythfilldatabase for masterbackends
            if [ $SystemType = "Master_backend" ]
            then
                #nice -n 19 mythfilldatabase --quiet &
                msg "Guide data is being loaded." "Until this completes some shows will appear as unknown in the program guide."
            fi
            touch ~/.config/lh_configured
        fi
    else
        if [ ! -f ~/.config/lh_configured ]
        then
            applyUIsettings
            touch -f ~/.config/lh_configured
        fi
    fi
}



#-------MAIN-------
first_configure
/usr/bin/enableIRWake.sh &
notify_scan