rwx/sh/gnome.sh
2025-01-13 04:46:57 +01:00

71 lines
1.9 KiB
Bash

# ╭───────┬────────────╮
# │ gnome │ background │
# ╰───────┴────────────╯
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"
}
# ╭───────┬───────╮
# │ gnome │ proxy │
# ╰───────┴───────╯
rwx_gnome_proxy() {
local value
case "${1}" in
"on") value="manual" ;;
*) value="none" ;;
esac
gsettings set "org.gnome.system.proxy" "mode" "${value}"
}
# ╭───────┬─────╮
# │ 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 │
# ╰───────┴────────────╯
rwx_gnome_workspaces_primary() {
local bool
local group="org.gnome.mutter"
local name="workspaces-only-on-primary"
local var="${group}/${name}"
# get
bool="$(gsettings get "${group}" "${name}")"
rwx_log_debug "${var}: ${bool}"
# not
bool="$(rwx_not "${bool}")"
rwx_log_debug "bool: ${bool}"
# set
gsettings set "${group}" "${name}" "${bool}"
rwx_log_info "${var}: ${bool}"
}