Compare commits
2 commits
7d18cfa2ce
...
1cad82456e
Author | SHA1 | Date | |
---|---|---|---|
1cad82456e | |||
9e785b7ce1 |
4 changed files with 24 additions and 7 deletions
4
sh/fs.sh
4
sh/fs.sh
|
@ -1,3 +1,7 @@
|
||||||
|
# ╭────╮
|
||||||
|
# │ fs │
|
||||||
|
# ╰────╯
|
||||||
|
|
||||||
rwx_fs_make_btrfs() {
|
rwx_fs_make_btrfs() {
|
||||||
local device="${1}"
|
local device="${1}"
|
||||||
local label="${2}"
|
local label="${2}"
|
||||||
|
|
16
sh/gnome.sh
16
sh/gnome.sh
|
@ -23,12 +23,18 @@ rwx_gnome_background_win3() {
|
||||||
# ╰───────┴───────╯
|
# ╰───────┴───────╯
|
||||||
|
|
||||||
rwx_gnome_proxy() {
|
rwx_gnome_proxy() {
|
||||||
local value
|
local port="${1}"
|
||||||
case "${1}" in
|
local prefix="org.gnome.system.proxy"
|
||||||
"on") value="manual" ;;
|
case "${port}" in
|
||||||
*) value="none" ;;
|
"")
|
||||||
|
gsettings set "${prefix}" "mode" "none"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
gsettings set "${prefix}" "mode" "manual"
|
||||||
|
gsettings set "${prefix}.socks" "host" "localhost"
|
||||||
|
gsettings set "${prefix}.socks" "port" "${port}"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
gsettings set "org.gnome.system.proxy" "mode" "${value}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭───────┬─────╮
|
# ╭───────┬─────╮
|
||||||
|
|
|
@ -84,12 +84,14 @@ rwx_find_shell() {
|
||||||
# │ main │ ifs │
|
# │ main │ ifs │
|
||||||
# ╰──────┴─────╯
|
# ╰──────┴─────╯
|
||||||
|
|
||||||
|
# set internal field separator to line feed
|
||||||
rwx_ifs_set() {
|
rwx_ifs_set() {
|
||||||
_RWX_IFS="${IFS}"
|
_RWX_IFS="${IFS}"
|
||||||
IFS="
|
IFS="
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# unset internal field separator
|
||||||
rwx_ifs_unset() {
|
rwx_ifs_unset() {
|
||||||
IFS="${_RWX_IFS}"
|
IFS="${_RWX_IFS}"
|
||||||
unset RWX_IFS
|
unset RWX_IFS
|
||||||
|
@ -99,6 +101,7 @@ rwx_ifs_unset() {
|
||||||
# │ main │ source │
|
# │ main │ source │
|
||||||
# ╰──────┴────────╯
|
# ╰──────┴────────╯
|
||||||
|
|
||||||
|
# source code from file path
|
||||||
rwx_source() {
|
rwx_source() {
|
||||||
local path="${1}"
|
local path="${1}"
|
||||||
[ -d "${path}" ] ||
|
[ -d "${path}" ] ||
|
||||||
|
|
|
@ -92,7 +92,7 @@ rwx_self_init() {
|
||||||
_rwx_cmd_rwx_install() { rwx_self_install "${@}"; }
|
_rwx_cmd_rwx_install() { rwx_self_install "${@}"; }
|
||||||
rwx_self_install() {
|
rwx_self_install() {
|
||||||
local target="${1}"
|
local target="${1}"
|
||||||
local command file root
|
local command file name root
|
||||||
# code
|
# code
|
||||||
if [ -n "${target}" ]; then
|
if [ -n "${target}" ]; then
|
||||||
root="${target}${RWX_ROOT_SYSTEM}"
|
root="${target}${RWX_ROOT_SYSTEM}"
|
||||||
|
@ -101,10 +101,14 @@ rwx_self_install() {
|
||||||
fi
|
fi
|
||||||
# commands
|
# commands
|
||||||
root="${target}/usr/local/bin"
|
root="${target}/usr/local/bin"
|
||||||
|
name="${RWX_SELF_NAME}.sh"
|
||||||
|
file="${root}/${name}"
|
||||||
|
rwx_remove "${file}"
|
||||||
|
rwx_link "${file}" "${RWX_MAIN_PATH}"
|
||||||
for command in $(rwx_self_commands); do
|
for command in $(rwx_self_commands); do
|
||||||
file="${root}/${command}"
|
file="${root}/${command}"
|
||||||
rwx_remove "${file}"
|
rwx_remove "${file}"
|
||||||
rwx_link "${file}" "${RWX_MAIN_PATH}"
|
rwx_link "${file}" "${name}"
|
||||||
done
|
done
|
||||||
# sh
|
# sh
|
||||||
file="${target}/etc/profile.d/${RWX_SELF_NAME}.sh"
|
file="${target}/etc/profile.d/${RWX_SELF_NAME}.sh"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue