#!/bin/bash . /etc/profile #. /etc/systemconfig SystemType=Masterbackend 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 kwriteconfig5 --file ~/.config/ksmserverrc --group General --key loginMode emptySession #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 x11vnc_setup(){ konsole -e /bin/bash -i -c "echo 'Create VNC password.' && x11vnc --storepasswd" mkdir -p ~/.vnc touch ~/.vnc/x11vnc.log sudo /usr/bin/systemctl enable --now x11vnc.service } function bashrc_setup(){ if ! grep -q 'alias rscp=' ~/.bashrc; then echo -e "\nalias rscp='rsync -a --info=progress2'" >> ~/.bashrc fi if ! grep -q 'alias rsmv=' ~/.bashrc; then echo -e "alias rsmv='rsync -a --info=progress2 --remove-source-files'" >> ~/.bashrc fi } function nanorc_setup(){ sudo sed -i 's/# set tabsize.*/set tabsize 4/' /etc/nanorc sudo sed -i 's/# set tabstospaces.*/set tabstospaces/' /etc/nanorc sudo sed -i 's/# include "\/usr\/share\/nano\/\*.nanorc"/include "\/usr\/share\/nano\/\*.nanorc"/' /etc/nanorc } function storage_scan(){ if [ -e /tmp/scan_report ]; then msg "New Storage Found" "Run add_storage.py for details." fi } function install_lh_apps(){ #install programs that are not needed on the iso sudo pacman -Syyy --noconfirm firefox glances mythtv ncdu x11vnc } function first_configure(){ if [ ! -f ~/.config/lh_configured ]; then #apply settings for all system types applyUIsettings msg "New install of LinHES. Starting setup." install_lh_apps nanorc_setup bashrc_setup x11vnc_setup #apply settings for specific system types if [ ! $SystemType = "Frontend_only" ]; then # only run mythfilldatabase for masterbackends #nice -n 19 mythfilldatabase --quiet & msg "Guide data is being loaded." "Until this completes some shows will appear as unknown in the program guide." else msg "Frontend Only" #Frontend_only cmds fi touch ~/.config/lh_configured fi } #-------MAIN------- first_configure /usr/bin/enableIRWake.sh & storage_scan