Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
setup_lubuntu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nvmnghia
setup_lubuntu
Commits
a556186c
Commit
a556186c
authored
Sep 13, 2019
by
nvmnghia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix /home/nvmnghia. Fix run code with wrong sudo.
parent
9f20a976
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
13 deletions
+36
-13
SetupLubuntu.sh
SetupLubuntu.sh
+36
-13
No files found.
SetupLubuntu.sh
View file @
a556186c
...
...
@@ -6,12 +6,36 @@ then
exec sudo
/bin/bash
"
$0
"
"
$@
"
fi
# https://unix.stackexchange.com/questions/190571/sudo-in-non-interactive-script
# Detect the user who launched the script
usr
=
$(
env
|
grep
SUDO_USER |
cut
-d
=
-f
2
)
apt update
-y
apt
install
-y
openssh-server
apt
install
-y
openssh-server curl wget
# https://stackoverflow.com/a/5171935/5959593
echo
"Change background"
PCMAN_SETTINGS
=
~/.config/pcmanfm-qt/lxqt/settings.conf
sed
-i
.bak
"s/BgColor=.*/BgColor=#ffffff/g"
${
PCMAN_SETTINGS
}
# pcmanfm-qt --desktop --profile lubuntu --display :0 &
echo
"Install Chrome"
apt-get
install
libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt
install
./google-chrome
*
.deb
echo
"Set as default"
xdg-settings
set
default-web-browser google-chrome.desktop
LXQT_SESS_CONF
=
~/.config/lxqt/session.conf
sed
-i
.bak
"s/BROWSER=.*/BROWSER=/usr/bin/google-chrome/g"
${
LXQT_SESS_CONF
}
# Courtesy of Don Cullen
# https://askubuntu.com/a/905895/892000
echo
"Install VSCode"
echo
"Install VSCode
and extensions
"
curl https://packages.microsoft.com/keys/microsoft.asc | gpg
--dearmor
>
microsoft.gpg
mv
microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
bash
-c
'echo "deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
...
...
@@ -19,13 +43,13 @@ bash -c 'echo "deb [arch=amd64] http://packages.microsoft.com/repos/vscode stabl
apt update
-y
apt
install
-y
code
if
!
[
-x
"
$(
command
-v
code
)
"
]
;
then
echo
"Error, now install using local deb package
and extensions
"
if
!
[
-x
"
$(
command
-v
code
)
"
]
;
then
# Not installed
echo
"Error, now install using local deb package"
dpkg
-i
./code.deb
fi
while
read
p
;
do
code
--install-extension
$p
sudo
-u
$usr
code
--install-extension
$p
done
< code_ext.txt
...
...
@@ -36,11 +60,10 @@ rm skype.deb
echo
"Install anaconda"
ANACONDA_LATEST
=
$(
wget
-r
--spider
-l
1 https://repo.anaconda.com/archive/ 2>&1 |
grep
Anaconda3
\
|
grep
-v
ppc64le |
grep
-m
1 Linux
)
# -m 1 to grep the first match
ANACONDA_LATEST
=
${
ANACONDA_LATEST
##*--
}
# Keep the https part, which is right after '-- '
ANACONDA_LATEST
=
$(
wget
-r
--spider
-l
1 https://repo.anaconda.com/archive/ 2>&1 |
grep
Anaconda3 |
grep
-v
ppc64le |
grep
-m
1 Linux
)
ANACONDA_LATEST
=
${
ANACONDA_LATEST
##*--
}
# Keep the https part, which is right after '-- ' ^ -m 1 to grep the first match
wget
-O
anaconda.sh
$ANACONDA_LATEST
bash
-p
$HOME
/anaconda
sudo
-u
$usr
bash
-p
$HOME
/anaconda
rm
anaconda.sh
...
...
@@ -51,9 +74,7 @@ rm get-docker.sh
echo
"Install GPU driver"
if
lspci
-nnk
|
grep
-i
vga
-A3
|
grep
'in use'
|
grep
-q
'i915'
;
then
echo
"Intel GPU, good luck poor guy"
else
if
lspci
-nnk
|
grep
-i
vga
-A3
|
grep
-q
'nvidia'
;
then
echo
"nVIDIA GPU, check driver"
if
lspci
-nnk
|
grep
-i
vga
-A3
|
grep
'in use'
|
grep
-q
'nvidia'
;
then
echo
"Use nVIDIA driver, hope u got the latest cuz I won't check"
...
...
@@ -69,6 +90,8 @@ else
echo
"Install nvidia-container-toolkit"
apt
install
-y
nvidia-container-toolkit
else
echo
"Intel GPU, good luck poor guy"
fi
apt update
-y
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment