1
0
Fork 0
mirror of https://github.com/kou029w/dotfiles.git synced 2025-01-18 08:05:01 +00:00

create termux addon

This commit is contained in:
Nebel 2022-06-15 00:15:50 +09:00
parent c07e13edfd
commit 7d592c85ed
4 changed files with 51 additions and 26 deletions

View file

@ -2,6 +2,20 @@
set -euo pipefail
cd -- "$(dirname -- "$0")"
. ../mod.bash
function install_gsettings() {
local uid
local gsettings_file
local gsettings_dir
uid=${SUDO_UID:-$(id -u)}
gsettings_file=$1
gsettings_dir=$2
< "$gsettings_file" \
sudo --user="#$uid" \
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$uid/bus" \
dconf load "$gsettings_dir"
}
(($(id -u) == 0)) \
&& [[ -f /etc/debian_version ]] \
&& install_apt_packages

View file

@ -1,16 +1,3 @@
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
@ -26,6 +13,19 @@ function install_dotfiles() {
done
}
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_addons() {
local addon
for addon in "$@"; do
@ -35,16 +35,3 @@ function install_addons() {
)
done
}
function install_gsettings() {
local uid
local gsettings_file
local gsettings_dir
uid=${SUDO_UID:-$(id -u)}
gsettings_file=$1
gsettings_dir=$2
< "$gsettings_file" \
sudo --user="#$uid" \
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$uid/bus" \
dconf load "$gsettings_dir"
}

12
termux/install Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
set -euo pipefail
cd -- "$(dirname -- "$0")"
function install_pkg_packages() {
local packages
. packages.bash
pkg upgrade -y
pkg install -y "${packages[@]}"
}
install_pkg_packages

12
termux/packages.bash Normal file
View file

@ -0,0 +1,12 @@
packages=(
dnsutils
gh
git
iproute2
jq
mdbook
nodejs-lts
openssh
rclone
sqlite
)