mirror of
https://github.com/kou029w/dotfiles.git
synced 2025-01-18 08:05:01 +00:00
create desktop addon
This commit is contained in:
parent
960c151ef9
commit
c79b002155
19 changed files with 93 additions and 36 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1 @@
|
|||
*
|
||||
.*
|
||||
|
|
12
README.md
12
README.md
|
@ -3,3 +3,15 @@
|
|||
```sh
|
||||
./install
|
||||
```
|
||||
|
||||
## Installing Packages
|
||||
|
||||
```sh
|
||||
sudo ./install
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```sh
|
||||
sudo ./install desktop
|
||||
```
|
||||
|
|
2
desktop/etc/default/google-chrome
Normal file
2
desktop/etc/default/google-chrome
Normal file
|
@ -0,0 +1,2 @@
|
|||
repo_add_once="false"
|
||||
repo_reenable_on_distupgrade="false"
|
2
desktop/etc/default/slack
Normal file
2
desktop/etc/default/slack
Normal file
|
@ -0,0 +1,2 @@
|
|||
repo_add_once="false"
|
||||
repo_reenable_on_distupgrade="false"
|
7
desktop/install
Executable file
7
desktop/install
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
cd -- "$(dirname -- "$0")"
|
||||
. ../mod.bash
|
||||
(($(id -u) == 0)) \
|
||||
&& [[ -f /etc/debian_version ]] \
|
||||
&& install_apt_packages
|
9
desktop/packages.bash
Normal file
9
desktop/packages.bash
Normal file
|
@ -0,0 +1,9 @@
|
|||
packages=(
|
||||
birdtray
|
||||
code
|
||||
deja-dup
|
||||
easytag
|
||||
google-chrome-stable
|
||||
mozc-utils-gui
|
||||
slack-desktop
|
||||
)
|
|
@ -1 +0,0 @@
|
|||
# docker-ce.list
|
38
install
38
install
|
@ -1,39 +1,9 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
cd -- "$(dirname -- "$0")"
|
||||
|
||||
function install_dotfiles() {
|
||||
local home
|
||||
local dotfile
|
||||
home=$(eval echo ~"${SUDO_USER:-}")
|
||||
for dotfile in .*; do
|
||||
[[ $dotfile =~ ^(\.\.?|\.git)$ ]] && continue
|
||||
|
||||
dotfile=$(realpath "$dotfile")
|
||||
(
|
||||
cd -- "$home"
|
||||
ln -svf "$dotfile" .
|
||||
)
|
||||
done
|
||||
}
|
||||
|
||||
function install_apt_packages() {
|
||||
local packages
|
||||
local package
|
||||
packages=()
|
||||
for package in etc/apt/sources.list.d/*.list; do
|
||||
package=${package##*/}
|
||||
package=${package%.list}
|
||||
packages+=("$package")
|
||||
done
|
||||
|
||||
rsync -rv etc/apt/keyrings/ /usr/share/keyrings/
|
||||
rsync -rv etc/apt/sources.list.d/ /etc/apt/sources.list.d/
|
||||
apt update
|
||||
apt install -y "${packages[@]}"
|
||||
}
|
||||
|
||||
install_dotfiles
|
||||
. mod.bash
|
||||
(($(id -u) == 0)) \
|
||||
&& [[ -d /etc/apt/sources.list.d ]] \
|
||||
&& [[ -f /etc/debian_version ]] \
|
||||
&& install_apt_packages
|
||||
install_dotfiles
|
||||
install_addons "$@"
|
||||
|
|
37
mod.bash
Normal file
37
mod.bash
Normal file
|
@ -0,0 +1,37 @@
|
|||
function install_apt_packages() {
|
||||
local packages
|
||||
local apt_sources_dir
|
||||
. packages.bash
|
||||
eval "$(apt-config shell apt_sources_dir 'Dir::Etc::sourceparts/d')"
|
||||
rsync -rv etc/apt/keyrings/ /usr/share/keyrings/
|
||||
rsync -rv etc/apt/sources.list.d/ "$apt_sources_dir"
|
||||
[[ -d etc/default ]] \
|
||||
&& rsync -rv etc/default/ /etc/default/
|
||||
apt update
|
||||
apt install -y "${packages[@]}"
|
||||
}
|
||||
|
||||
function install_dotfiles() {
|
||||
local home
|
||||
local dotfile
|
||||
home=$(eval "echo ~${SUDO_USER:-}")
|
||||
for dotfile in .*; do
|
||||
[[ $dotfile =~ ^(\.\.?|\.git)$ ]] && continue
|
||||
|
||||
dotfile=$(realpath "$dotfile")
|
||||
(
|
||||
cd -- "$home"
|
||||
ln -svf "$dotfile" .
|
||||
)
|
||||
done
|
||||
}
|
||||
|
||||
function install_addons() {
|
||||
local addon
|
||||
for addon in "$@"; do
|
||||
(
|
||||
cd -- "$addon"
|
||||
./install
|
||||
)
|
||||
done
|
||||
}
|
19
packages.bash
Normal file
19
packages.bash
Normal file
|
@ -0,0 +1,19 @@
|
|||
packages=(
|
||||
cloudflared
|
||||
docker-ce
|
||||
docker-compose-plugin
|
||||
nodejs
|
||||
tailscale
|
||||
build-essential
|
||||
curl
|
||||
fdupes
|
||||
ffmpeg
|
||||
imagemagick
|
||||
knot-dnsutils
|
||||
qemu-user-static
|
||||
screen
|
||||
smartmontools
|
||||
)
|
||||
|
||||
[[ "$(df --output=fstype . | sed 1d)" == "btrfs" ]] \
|
||||
&& packages+=(snapper)
|
Loading…
Add table
Reference in a new issue