Script and README update

This commit is contained in:
unix121
2017-05-01 19:12:30 +03:00
parent 3121051867
commit fc08e510cf
2 changed files with 51 additions and 0 deletions
+4
View File
@@ -48,6 +48,10 @@ files are before you use it.
~/.dmenurc
</li>
</li>You will still have to make some changes "by hand" even after using the script
once it's still under development and doesn't change everything on it's own.
</li>
<li>For common issues check the issues section in the repository</li>
</ul>
<h1>How to use the scripts</h1>
+47
View File
@@ -158,6 +158,51 @@ overwrite(){
}
# Added as a fast fix on the issue that the script would not
# Replace background and foreground in the polybar configuration
# Needs further improvements.
overwrite_exact(){
local f1=$1
local f2=$2
local l=$3
if local line1=$(cat $f1 | grep -w "^$l")
then
if [ ! -z "$line1" ]
then
#echo $line1
if local line2=$(cat $f2 | grep -w "^$l")
then
if [ ! -z "$line2" ]
then
#echo $line2
#line=$( grep -w "$line2" $f2 )
#replacement=$line1
#echo $replacement
if ! sed -i "s/$line2/$line1/g" $f2
then
msg -f "Failed to apply change: Overwrite "$l" ."
else
msg -s "Applied change: Overwrite "$l" ."
fi
else
msg -f "Failed to apply change: Overwrite "$l" ."
fi
else
msg -f "Failed to apply change: Overwrite "$l" ."
fi
else
msg -f "Failed to apply change: Overwrite "$l" ."
fi
else
msg -f "Failed to apply change: Overwrite "$l" ."
fi
}
configure(){
# This script will add the necessary lines to the configuration
# Files in order to make those themes work.
@@ -699,6 +744,8 @@ then
overwrite $f1 $f2 "tray-detached"
overwrite $f1 $f2 "tray-background"
overwrite $f1 $f2 "wm-restack"
overwrite_exact $f1 $f2 "background"
overwrite_exact $f1 $f2 "foreground"
else
# Failed to located user's polybar configuration file.