mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 03:37:55 +00:00
svg-desktop: adds os name and improves positioning
Signed-off-by: Jed Reynolds <jed@bitratchet.com>
This commit is contained in:
@@ -4,7 +4,7 @@ A="'"
|
||||
function set_background() {
|
||||
gsettings set "org.mate.background" "$1" "$2"
|
||||
}
|
||||
|
||||
. /etc/os-release
|
||||
SourceFile="/usr/share/backgrounds/mate/desktop/Ubuntu-Mate-Cold-no-logo.png"
|
||||
DesktopFile="/home/lanforge/Pictures/desktop.svg"
|
||||
my_version=`cat /var/www/html/installed-ver.txt`
|
||||
@@ -12,6 +12,8 @@ my_hostname=`hostname`
|
||||
my_dev=`ip ro sho | awk '/default via/{print $5}'`
|
||||
my_ip=`ip a sho $my_dev | awk '/inet /{print $2}'`
|
||||
my_mac=`ip a sho | grep -A1 "$my_dev" | awk '/ether /{print $2}'`
|
||||
my_os="$PRETTY_NAME"
|
||||
my_lfver=`cat /var/www/html/installed-ver.txt`
|
||||
fill_color=${my_mac//:/}
|
||||
fill_color=${fill_color:6:12}
|
||||
X=220
|
||||
@@ -24,31 +26,35 @@ Y=150
|
||||
# -scale 1600x900 \
|
||||
# $DesktopFile
|
||||
|
||||
# font-family: 'Source Code Pro', 'FreeMono', 'Liberation Mono', 'DejaVu Sans Mono', 'Lucida Sans Typewriter', 'Consolas', mono, sans-serif;
|
||||
cat > $DesktopFile <<_EOF_
|
||||
<svg viewBox='0 0 1600 900' width='1600' height='900' xmlns='http://www.w3.org/2000/svg'>
|
||||
<style>
|
||||
text {
|
||||
fill: #$fill_color;
|
||||
stroke: black;
|
||||
stroke: rgba(4, 64, 4, 64);
|
||||
stroke-width: 1px;
|
||||
text-anchor: left;
|
||||
font-size: 35px;
|
||||
font-family: 'DejaVu Sans Bold', sans-serif;
|
||||
font-size: 36px;
|
||||
font-family: 'Consolas';
|
||||
font-weight: bold;
|
||||
opacity: 0.8;
|
||||
}
|
||||
#bgrec {
|
||||
fill: gray;
|
||||
opacity: 0.5;
|
||||
stroke-width: 8px;
|
||||
stroke-width: 6px;
|
||||
stroke: rgba(50, 50, 50, 255);
|
||||
}
|
||||
</style>
|
||||
<g>
|
||||
<rect id='bgrec' x='150' y='30' rx='10' ry='10' width='550px' height='160px'></rect>
|
||||
<rect id='bgrec' x='250' y='50' rx='10' ry='10' width='550px' height='160px'>
|
||||
</rect>
|
||||
<g>
|
||||
<text x='170' y='70'>$my_hostname</text>
|
||||
<text x='170' y='120'>$my_dev $my_ip</text>
|
||||
<text x='170' y='170'>$my_mac</text>
|
||||
<text x='270' y='85'>$my_hostname $my_lfver</text>
|
||||
<text x='270' y='120'>$my_dev $my_ip</text>
|
||||
<text x='270' y='160'>$my_mac</text>
|
||||
<text x='270' y='200'>$my_os</text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
Reference in New Issue
Block a user