71 lines
1.9 kB
1
# ╭───────┬────────────╮
2
# │ gnome │ background │
3
# ╰───────┴────────────╯
4
5
rwx_gnome_background_black() {
6
rwx_gnome_set_background "color-shading-type" "solid"
7
rwx_gnome_set_background "primary-color" "#000000"
8
}
9
10
rwx_gnome_background_white() {
11
rwx_gnome_set_background "color-shading-type" "solid"
12
rwx_gnome_set_background "primary-color" "#ffffff"
13
}
14
15
rwx_gnome_background_win3() {
16
rwx_gnome_set_background "color-shading-type" "vertical"
17
rwx_gnome_set_background "primary-color" "#000000"
18
rwx_gnome_set_background "secondary-color" "#0000ff"
19
}
20
21
# ╭───────┬───────╮
22
# │ gnome │ proxy │
23
# ╰───────┴───────╯
24
25
rwx_gnome_proxy() {
26
local value
27
case "${1}" in
28
"on") value="manual" ;;
29
*) value="none" ;;
30
esac
31
gsettings set "org.gnome.system.proxy" "mode" "${value}"
32
}
33
34
# ╭───────┬─────╮
35
# │ gnome │ set │
36
# ╰───────┴─────╯
37
38
rwx_gnome_set() {
39
local group="${1}"
40
local key="${2}"
41
local value="${3}"
42
[ -n "${value}" ] || return
43
gsettings set "${group}" "${key}" "${value}"
44
}
45
46
rwx_gnome_set_background() {
47
local key="${1}"
48
local value="${2}"
49
[ -n "${value}" ] || return
50
rwx_gnome_set "org.gnome.desktop.background" "${key}" "${value}"
51
}
52
53
# ╭───────┬────────────╮
54
# │ gnome │ workspaces │
55
# ╰───────┴────────────╯
56
57
rwx_gnome_workspaces_primary() {
58
local bool
59
local group="org.gnome.mutter"
60
local name="workspaces-only-on-primary"
61
local var="${group}/${name}"
62
# get
63
bool="$(gsettings get "${group}" "${name}")"
64
rwx_log_debug "${var}: ${bool}"
65
# not
66
bool="$(rwx_not "${bool}")"
67
rwx_log_debug "bool: ${bool}"
68
# set
69
gsettings set "${group}" "${name}" "${bool}"
70
rwx_log_info "${var}: ${bool}"
71
}
72