-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtos
executable file
·135 lines (127 loc) · 4.15 KB
/
tos
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/usr/bin/env bash
# MIT License
#
# Copyright (c) 2020 Tom Meyers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# TOS is the Tom OS update script. This script manages everything for maintaining and upgrading.
# To understand how to install the software go to https://github.com/ODEX-TOS/tools
# Archinstall and dialogarchinstall are scripts that install arch from scratch and also install custom software to more personalise the os
# Once you have installed arch and have cloned the helper-scripts into a $PATH file you will have the tool TOS.
# This tool is a wrapper around arch based tools.
# It can install packages from the repo's and AUR. It also aids with ssh, networking, updating, installing software and more.
# It basically wraps multiple commands into one simple to use command.
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;35m'
ORANGE='\033[1;33m'
NC='\033[0m' # No Color
export SUDO_ASKPASS="/usr/share/tos-rofi/askpass"
name=$(basename "$0")
directory="/usr/share/"
#directory="$(pwd)/"
themefile="$HOME/.config/tos/theme"
extended="$directory"tos-helper
TUTORIAL_DIR="$directory"tos-tutorial
case "$1" in
"c" | "calamares")
calamares
;;
"-p" | "--profile")
if [[ "$2" == "" ]]; then
printf "${RED}Please supply an image as input $NC\n"
exit 1
fi
convert "$2" -resize 200x200\! "$HOME/.face.png"
mv "$HOME/.face.png" "$HOME/.face"
# now create the 'face' in account services
pkexec bash -c 'cp "'"$HOME"'/.face" "/var/lib/AccountsService/icons/'"$USER"'"
echo "[User]
Session=tde
XSession=tde
Icon=/var/lib/AccountsService/icons/'"$USER"'
SystemAccount=false
" | tee "/var/lib/AccountsService/users/'"$USER"'" 1>/dev/null'
;;
"is" | "installer-server")
printf "${RED} This installer is outdated and no longer works${NC}\n"
printf "${RED} Use ${GREEN}tos calamares${RED} to install tos the correct way${NC}\n"
exit 1
tos-cli-installer
;;
"-m" | "--mount")
cryptsetup open "$2"3 "$3"
mount /dev/mapper/tos-root /mnt
mount /dev/mapper/tos-home /mnt/home
if [[ "$4" == "" ]]; then
mount "$2"1 /mnt/boot/efi
else
mount "$2"1 /mnt/boot
fi
arch-chroot /mnt
;;
"-S"* | "-R"* | "-Q"*|"-U"*)
if [ "$(id -u)" != "0" ]; then
yay "${@:1}"
else
printf "${RED}Package management as root is very dangerous$NC\n"
printf "${RED}Not all functionality is available to mitigate security vulnerability${NC}"
pacman "${@:1}"
fi
;;
"-iso")
source "$extended"/installer.sh
;;
"-c" | "--crypto")
source "$extended"/etc.sh
;;
"-t" | "--true-color")
source "$extended"/etc.sh
;;
"info" | "i")
source "$extended"/etc.sh
;;
"g" | "gpg")
source "$extended"/gpg.sh
;;
"n" | "network")
source "$extended"/network.sh
;;
"t" | "theme")
source "$extended"/theme.sh
;;
"b" | "bluetooth")
source "$extended"/bluetooth.sh
;;
"v" | "volume")
source "$extended"/volume.sh
;;
"s" | "screen")
source "$extended"/screen.sh
;;
"sh" | "shell")
source "$extended"/shell.sh
;;
"tutorial" | "tut")
bash "$TUTORIAL_DIR/main.sh"
;;
**)
source "$extended"/help.sh
;;
esac