Skip to content

Commit

Permalink
Backup incase gsettings don't apply automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ngr31 committed Jan 23, 2024
1 parent 1f69ec6 commit c9596b7
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 0 deletions.
67 changes: 67 additions & 0 deletions config/files/usr/bin/dx-user-gsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env bash

# SCRIPT VERSION
USER_SETUP_VER=1
USER_SETUP_VER_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/cabos/gsettings-configured"
USER_SETUP_VER_RAN=$(cat "$USER_SETUP_VER_FILE")

## Backup incase local.d config doesn't take for whatever reason

# Run script if updated
if [[ -f $USER_SETUP_VER_FILE && "$USER_SETUP_VER" = "$USER_SETUP_VER_RAN" ]]; then
echo "GSettings setup v$VER has already run. Exiting..."
exit 0
fi

gsettings set org.gnome.shell favorite-apps "['org.mozilla.firefox.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Software.desktop', 'org.gnome.Terminal.desktop', 'code.desktop']"
gsettings set org.gnome.shell enabled-extensions "['hide-universal-access@akiirui.github.io', 'dash-to-panel@jderose9.github.com', 'blur-my-shell@aunetx', 'gsconnect@andyholmes.github.io', 'appindicatorsupport@rgcjonas.gmail.com', 's76-scheduler@mattjakeman.com', 'caffeine@patapon.info', 'arcmenu@arcmenu.com', 'workspace-switch-wraparound@theychx.org', 'disable-workspace-animation@ethnarque', 'disable-workspace-switcher-overlay@cleardevice', 'background-logo@fedorahosted.org']"

gsettings set org.gnome.shell.extensions.arcmenu arc-menu-icon 71
gsettings set org.gnome.shell.extensions.arcmenu custom-menu-button-icon-size 30
gsettings set org.gnome.shell.extensions.arcmenu menu-layout Eleven
gsettings set org.gnome.shell.extensions.arcmenu pinned-apps "[{'id': 'org.mozilla.firefox.desktop'}, {'id': 'org.gnome.Nautilus.desktop'}, {'id': 'org.gnome.Terminal.desktop'}, {'id': 'code.desktop'}]"
gsettings set org.gnome.shell.extensions.arcmenu power-options "[(0, true), (1, true), (2, true), (4, true), (6, true), (3, true), (5, false), (7, false)]"

gsettings set org.gnome.shell.extensions.dash-to-panel hide-overview-on-startup true
gsettings set org.gnome.shell.extensions.dash-to-panel isolate-workspaces true
gsettings set org.gnome.shell.extensions.dash-to-panel panel-element-positions '{"0":[{"element":"showAppsButton","visible":false,"position":"stackedTL"},{"element":"activitiesButton","visible":false,"position":"stackedTL"},{"element":"leftBox","visible":true,"position":"stackedTL"},{"element":"taskbar","visible":true,"position":"stackedTL"},{"element":"centerBox","visible":true,"position":"stackedBR"},{"element":"rightBox","visible":true,"position":"stackedBR"},{"element":"dateMenu","visible":true,"position":"stackedBR"},{"element":"systemMenu","visible":true,"position":"stackedBR"},{"element":"desktopButton","visible":true,"position":"stackedBR"}]}'

gsettings set org.gnome.shell.app-switcher current-workspace-only false

gsettings set org.gnome.mutter workspaces-only-on-primary false
gsettings set org.gnome.mutter dynamic-workspaces false

gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"
gsettings set org.gnome.desktop.wm.preferences num-workspaces 4

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['<Alt>Left']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['<Alt>Right']"

gsettings set org.gnome.desktop.peripherals.touchpad two-finger-scrolling-enabled true
gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false
gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true

gsettings set org.gnome.desktop.background picture-options zoom
gsettings set org.gnome.desktop.background picture-uri 'file:///usr/share/backgrounds/RockyMountain/RockyMountain1.jpg'
gsettings set org.gnome.desktop.background picture-uri-dark 'file:///usr/share/backgrounds/RockyMountain/RockyMountain2.jpg'
gsettings set org.gnome.desktop.background primary-color '7FC1CA'
gsettings set org.gnome.desktop.background secondary-color '000000'

gsettings set org.gnome.desktop.interface text-scaling-factor 1.5

gsettings set org.gnome.software allow-updates false
gsettings set org.gnome.software download-updates false
gsettings set org.gnome.software download-updates-notify false
gsettings set org.gnome.software packaging-format-preference "['flatpak:flathub-user']"

gsettings set org.gnome.settings-daemon.plugins.media-keys next "['<Alt>period']"
gsettings set org.gnome.settings-daemon.plugins.media-keys play "['<Alt>slash']"
gsettings set org.gnome.settings-daemon.plugins.media-keys previous "['<Alt>comma']"

gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true

gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"

# Prevent future executions
echo "Writing state file"
echo "$USER_SETUP_VER" > "$USER_SETUP_VER_FILE"
2 changes: 2 additions & 0 deletions config/files/usr/etc/dconf/db/gdm.d/99-cabos
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[org/gnome/desktop/peripherals/touchpad]
tap-to-click=true
61 changes: 61 additions & 0 deletions config/files/usr/etc/dconf/db/local.d/99-cabos
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[org/gnome/shell]
favorite-apps = ['org.mozilla.firefox.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Software.desktop', 'code.desktop']
enabled-extensions = ['hide-universal-access@akiirui.github.io', 'dash-to-panel@jderose9.github.com', 'blur-my-shell@aunetx', 'gsconnect@andyholmes.github.io', 'appindicatorsupport@rgcjonas.gmail.com', 's76-scheduler@mattjakeman.com', 'caffeine@patapon.info', 'arcmenu@arcmenu.com', 'workspace-switch-wraparound@theychx.org', 'disable-workspace-animation@ethnarque', 'disable-workspace-switcher-overlay@cleardevice']

[org/gnome/mutter]
workspaces-only-on-primary = false
dynamic-workspaces = false

[org/gnome/shell/app-switcher]
current-workspace-only = false

[org/gnome/desktop/wm/preferences]
button-layout = ":minimize,maximize,close"
num-workspaces = 4

[org/gnome/desktop/wm/keybindings]
switch-to-workspace-left = ['<Alt>Left']
switch-to-workspace-right = ['<Alt>Right']

[org/gnome/settings-daemon/plugins/media-keys]
next = ['<Alt>period']
play = ['<Alt>slash']
previous = ['<Alt>comma']

[org/gnome/desktop/peripherals/touchpad]
two-finger-scrolling-enabled = true
natural-scroll = false
tap-to-click = true

[org/gnome/desktop/background]
picture-options = 'zoom'
picture-uri = 'file:///usr/share/backgrounds/RockyMountain/RockyMountain1.jpg'
picture-uri-dark = 'file:///usr/share/backgrounds/RockyMountain/RockyMountain2.jpg'
primary-color = '7FC1CA'
secondary-color = '000000'

[org/gnome/settings-daemon/plugins/color]
night-light-enabled = true

[org/gnome/desktop/interface]
text-scaling-factor = 1.5

[org/gnome/software]
allow-updates = false
download-updates = false
download-updates-notify = false
packaging-format-preference = ['flatpak:flathub-user']

[org/gnome/mutter]
experimental-features = ['scale-monitor-framebuffer']

[org/gnome/shell/extensions/arcmenu]
arc-menu-icon = 29
custom-menu-icon-button-size = 30
menu-layout = 'Eleven'
power-options = [(0, true), (1, true), (2, true), (4, true), (6, true), (3, true), (5, false), (7, false)]

[org/gnome/shell/extensions/dash-to-panel]
hide-overview-on-startup = true
isolate-workspaces = true
panel-element-positions = {"0":[{"element":"showAppsButton","visible":false,"position":"stackedTL"},{"element":"activitiesButton","visible":false,"position":"stackedTL"},{"element":"leftBox","visible":true,"position":"stackedTL"},{"element":"taskbar","visible":true,"position":"stackedTL"},{"element":"centerBox","visible":true,"position":"stackedBR"},{"element":"rightBox","visible":true,"position":"stackedBR"},{"element":"dateMenu","visible":true,"position":"stackedBR"},{"element":"systemMenu","visible":true,"position":"stackedBR"},{"element":"desktopButton","visible":true,"position":"stackedBR"}]}
14 changes: 14 additions & 0 deletions config/files/usr/lib/systemd/user/dx-user-gsettings.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Run
Wants=network-online.target
After=network-online.target ublue-user-setup.service

[Service]
Type=oneshot
ExecStart=/usr/bin/dx-user-gsettings
Restart=on-failure
RestartSec=30
StartLimitInterval=0

[Install]
WantedBy=default.target

0 comments on commit c9596b7

Please sign in to comment.