forked from jkubrynski/settings-keeper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgnome.sh
executable file
·38 lines (34 loc) · 883 Bytes
/
gnome.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
function store {
echo "storing...";
if [ ! -d gnome ]; then
mkdir gnome
fi
dconf dump /org/gnome/desktop/wm/keybindings/ > gnome/keybindings.dconf
dconf dump /org/gnome/desktop/wm/preferences/ > gnome/preferences.dconf
dconf dump /org/gnome/shell/ > gnome/shell.dconf
git add -A gnome/
now=$(date +"%Y-%m-%d %H:%M")
git commit -m "Changes from $now"
git push origin master
}
function load {
echo "loading...";
load_file keybindings.dconf /org/gnome/desktop/wm/keybindings/
load_file preferences.dconf /org/gnome/desktop/wm/preferences/
load_file shell.dconf /org/gnome/shell/
}
function load_file {
echo $1 into $2
if [ -f gnome/$1.dconf ]; then
dconf load $2 < gnome/$1.dconf
fi
}
case $1 in
"store" )
store;;
"load" )
load;;
*)
echo "usage: ./gnome.sh store or ./gnome.sh load";;
esac