Skip to content

Commit a7fc8df

Browse files
rbujraveit65
authored andcommitted
dconf settings storage system
1 parent 6a21e17 commit a7fc8df

12 files changed

+2120
-0
lines changed
33.2 KB
Loading
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
#!/bin/bash
2+
# ---------------------------------------------------------------------------
3+
# Copyright 2018, Robert Buj <rbuj@fedoraproject.org>
4+
#
5+
# This program is free software: you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation, either version 3 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License at <http://www.gnu.org/licenses/> for
14+
# more details.
15+
# ---------------------------------------------------------------------------
16+
FILE=org_mate_desktop_background_logical_view
17+
TEXFILE=$FILE.tex
18+
19+
function browse_dir {
20+
echo "[$1" >> $TEXFILE
21+
for directory in $(dconf list $2$1 | sort); do
22+
case "$directory" in
23+
*/)
24+
if [ "$directory" == "background/" ]; \
25+
then
26+
browse_dir $directory "$2$1"
27+
else
28+
echo "[$directory" >> $TEXFILE
29+
echo "]" >> $TEXFILE
30+
fi
31+
;;
32+
*)
33+
echo "[$directory]" >> $TEXFILE
34+
;;
35+
esac
36+
done
37+
echo "]" >> $TEXFILE
38+
}
39+
40+
41+
cat << EOF > $TEXFILE
42+
\documentclass[tikz, border=5pt, multi]{standalone}
43+
\usepackage{forest}
44+
\usetikzlibrary{arrows.meta}
45+
\forestset{
46+
dir tree/.style={
47+
for tree={
48+
parent anchor=south west,
49+
child anchor=west,
50+
anchor=mid west,
51+
inner ysep=1pt,
52+
grow'=0,
53+
align=left,
54+
edge path={
55+
\noexpand\path [draw, \forestoption{edge}] (!u.parent anchor) ++(1em,0) |- (.child anchor)\forestoption{edge label};
56+
},
57+
font=\sffamily,
58+
if n children=0{}{
59+
delay={
60+
prepend={[,phantom, calign with current]}
61+
}
62+
},
63+
fit=band,
64+
before computing xy={
65+
l=2em
66+
}
67+
},
68+
}
69+
}
70+
\begin{document}
71+
\begin{forest}
72+
dir tree
73+
[/
74+
[org/
75+
[mate/
76+
EOF
77+
78+
for directory in $(dconf list '/org/mate/' | sort); do \
79+
case "$directory" in
80+
*/)
81+
if [ "$directory" == "desktop/" ]; \
82+
then
83+
browse_dir $directory "/org/mate/"
84+
else
85+
echo "[$directory" >> $TEXFILE
86+
echo "]" >> $TEXFILE
87+
fi
88+
;;
89+
*)
90+
echo "[$directory]" >> $TEXFILE
91+
;;
92+
esac
93+
done
94+
95+
cat << EOF >> $TEXFILE
96+
]
97+
]
98+
]
99+
\end{forest}
100+
\end{document}
101+
EOF
102+
103+
pdflatex $TEXFILE
104+
pdftocairo $FILE.pdf -png
105+
convert $FILE-1.png -resize 75% $FILE.png
9.32 KB
Loading
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#!/bin/bash
2+
# ---------------------------------------------------------------------------
3+
# Copyright 2018, Robert Buj <rbuj@fedoraproject.org>
4+
#
5+
# This program is free software: you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation, either version 3 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License at <http://www.gnu.org/licenses/> for
14+
# more details.
15+
# ---------------------------------------------------------------------------
16+
FILE=org_mate_desktop_background_only_logical_view
17+
TEXFILE=$FILE.tex
18+
19+
function browse_dir {
20+
echo "[$1" >> $TEXFILE
21+
for directory in $(dconf list $2$1); do
22+
case "$directory" in
23+
*/)
24+
browse_dir $directory "$2$1"
25+
;;
26+
*)
27+
echo "[$directory]" >> $TEXFILE
28+
;;
29+
esac
30+
done
31+
echo "]" >> $TEXFILE
32+
}
33+
34+
cat << EOF > $TEXFILE
35+
\documentclass[tikz, border=5pt, multi]{standalone}
36+
\usepackage{forest}
37+
\usetikzlibrary{arrows.meta}
38+
\forestset{
39+
dir tree/.style={
40+
for tree={
41+
parent anchor=south west,
42+
child anchor=west,
43+
anchor=mid west,
44+
inner ysep=1pt,
45+
grow'=0,
46+
align=left,
47+
edge path={
48+
\noexpand\path [draw, \forestoption{edge}] (!u.parent anchor) ++(1em,0) |- (.child anchor)\forestoption{edge label};
49+
},
50+
font=\sffamily,
51+
if n children=0{}{
52+
delay={
53+
prepend={[,phantom, calign with current]}
54+
}
55+
},
56+
fit=band,
57+
before computing xy={
58+
l=2em
59+
}
60+
},
61+
}
62+
}
63+
\begin{document}
64+
\begin{forest}
65+
dir tree
66+
[/
67+
[org/
68+
[mate/
69+
[desktop/
70+
EOF
71+
72+
browse_dir "background/" "/org/mate/desktop/"
73+
74+
cat << EOF >> $TEXFILE
75+
]
76+
]
77+
]
78+
]
79+
\end{forest}
80+
\end{document}
81+
EOF
82+
83+
pdflatex $TEXFILE
84+
pdftocairo $FILE.pdf -png
85+
convert $FILE-1.png -resize 75% $FILE.png
65.2 KB
Loading
66.3 KB
Loading

0 commit comments

Comments
 (0)