rwx/sh/gnome.sh

72 lines
1.9 KiB
Bash
Raw Normal View History

2025-01-13 03:46:57 +00:00
# ╭───────┬────────────╮
# │ gnome │ background │
# ╰───────┴────────────╯
2025-01-13 03:32:30 +00:00
rwx_gnome_background_black() {
rwx_gnome_set_background "color-shading-type" "solid"
rwx_gnome_set_background "primary-color" "#000000"
}
rwx_gnome_background_white() {
rwx_gnome_set_background "color-shading-type" "solid"
rwx_gnome_set_background "primary-color" "#ffffff"
}
rwx_gnome_background_win3() {
rwx_gnome_set_background "color-shading-type" "vertical"
rwx_gnome_set_background "primary-color" "#000000"
rwx_gnome_set_background "secondary-color" "#0000ff"
}
2025-01-13 03:46:57 +00:00
# ╭───────┬───────╮
# │ gnome │ proxy │
# ╰───────┴───────╯
2024-11-29 17:56:59 +00:00
rwx_gnome_proxy() {
2024-11-18 11:40:20 +00:00
local value
case "${1}" in
"on") value="manual" ;;
*) value="none" ;;
esac
gsettings set "org.gnome.system.proxy" "mode" "${value}"
}
2025-01-13 03:46:57 +00:00
# ╭───────┬─────╮
# │ gnome │ set │
# ╰───────┴─────╯
rwx_gnome_set() {
local group="${1}"
local key="${2}"
local value="${3}"
[ -n "${value}" ] || return
gsettings set "${group}" "${key}" "${value}"
}
rwx_gnome_set_background() {
local key="${1}"
local value="${2}"
[ -n "${value}" ] || return
rwx_gnome_set "org.gnome.desktop.background" "${key}" "${value}"
}
# ╭───────┬────────────╮
# │ gnome │ workspaces │
# ╰───────┴────────────╯
2024-11-29 17:56:59 +00:00
rwx_gnome_workspaces_primary() {
2024-11-12 05:52:21 +00:00
local bool
local group="org.gnome.mutter"
2024-11-12 06:28:41 +00:00
local name="workspaces-only-on-primary"
local var="${group}/${name}"
# get
bool="$(gsettings get "${group}" "${name}")"
2024-11-29 18:58:07 +00:00
rwx_log_debug "${var}: ${bool}"
2024-11-12 06:28:41 +00:00
# not
2024-11-29 18:58:07 +00:00
bool="$(rwx_not "${bool}")"
rwx_log_debug "bool: ${bool}"
2024-11-12 06:28:41 +00:00
# set
gsettings set "${group}" "${name}" "${bool}"
2024-11-29 18:58:07 +00:00
rwx_log_info "${var}: ${bool}"
2023-08-21 12:32:38 +00:00
}