aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kernozhitsky <[email protected]>2018-12-26 20:32:27 +0300
committerAlexander Kernozhitsky <[email protected]>2018-12-26 20:32:27 +0300
commitb24a77ae79aac04ae8128de75523834b16aff54e (patch)
tree9aa54ec45ad34fefc2dc91e08c646794269779d0
parent8660e97873df5adc5ff4d0a632694f2f1540c5da (diff)
Fix race condition during the build
-rw-r--r--TODO3
-rw-r--r--src/_global.scss82
-rwxr-xr-xsrc/build_theme.sh13
-rw-r--r--src/gtk318/gtk.scss2
-rw-r--r--src/gtk320/gtk.scss2
-rwxr-xr-x[-rw-r--r--]src/render_assets.py22
6 files changed, 24 insertions, 100 deletions
diff --git a/TODO b/TODO
index fc07643..88f69f7 100644
--- a/TODO
+++ b/TODO
@@ -1 +1,4 @@
* Remove SASS deprecation warnings
+* Fix theme name for GTK+2.0
+* Document build_theme.sh
+* Build the theme into ${CMAKE_BINARY_DIR}
diff --git a/src/_global.scss b/src/_global.scss
deleted file mode 100644
index 6daddf1..0000000
--- a/src/_global.scss
+++ /dev/null
@@ -1,82 +0,0 @@
-$ButtonBackgroundAlternate:rgb(77,77,77);
-$ButtonBackgroundNormal:rgb(49,54,59);
-$ButtonDecorationFocus:rgb(61,174,233);
-$ButtonDecorationHover:rgb(61,174,233);
-$ButtonForegroundActive:rgb(61,174,233);
-$ButtonForegroundInactive:189,195,199;
-$ButtonForegroundLink:rgb(41,128,185);
-$ButtonForegroundNegative:rgb(218,68,83);
-$ButtonForegroundNeutral:rgb(246,116,0);
-$ButtonForegroundNormal:rgb(239,240,241);
-$ButtonForegroundPositive:rgb(39,174,96);
-$ButtonForegroundVisited:rgb(127,140,141);
-$DisabledColor:rgb(56,56,56);
-$DisabledColorAmount:0;
-$DisabledColorEffect:0;
-$DisabledContrastAmount:0.65;
-$DisabledContrastEffect:1;
-$DisabledIntensityAmount:0.1;
-$DisabledIntensityEffect:2;
-$InactiveChangeSelectionColor:true;
-$InactiveColor:rgb(112,111,110);
-$InactiveColorAmount:0.025;
-$InactiveColorEffect:2;
-$InactiveContrastAmount:0.1;
-$InactiveContrastEffect:2;
-$InactiveEnable:false;
-$InactiveIntensityAmount:0;
-$InactiveIntensityEffect:0;
-$SelectionBackgroundAlternate:rgb(29,153,243);
-$SelectionBackgroundNormal:rgb(61,174,233);
-$SelectionDecorationFocus:rgb(61,174,233);
-$SelectionDecorationHover:rgb(61,174,233);
-$SelectionForegroundActive:rgb(252,252,252);
-$SelectionForegroundInactive:239,240,241;
-$SelectionForegroundLink:rgb(253,188,75);
-$SelectionForegroundNegative:rgb(218,68,83);
-$SelectionForegroundNeutral:rgb(246,116,0);
-$SelectionForegroundNormal:rgb(239,240,241);
-$SelectionForegroundPositive:rgb(39,174,96);
-$SelectionForegroundVisited:rgb(189,195,199);
-$TooltipBackgroundAlternate:rgb(77,77,77);
-$TooltipBackgroundNormal:rgb(49,54,59);
-$TooltipDecorationFocus:rgb(61,174,233);
-$TooltipDecorationHover:rgb(61,174,233);
-$TooltipForegroundActive:rgb(61,174,233);
-$TooltipForegroundInactive:189,195,199;
-$TooltipForegroundLink:rgb(41,128,185);
-$TooltipForegroundNegative:rgb(218,68,83);
-$TooltipForegroundNeutral:rgb(246,116,0);
-$TooltipForegroundNormal:rgb(239,240,241);
-$TooltipForegroundPositive:rgb(39,174,96);
-$TooltipForegroundVisited:rgb(127,140,141);
-$ViewBackgroundAlternate:rgb(49,54,59);
-$ViewBackgroundNormal:rgb(35,38,41);
-$ViewDecorationFocus:rgb(61,174,233);
-$ViewDecorationHover:rgb(61,174,233);
-$ViewForegroundActive:rgb(61,174,233);
-$ViewForegroundInactive:189,195,199;
-$ViewForegroundLink:rgb(41,128,185);
-$ViewForegroundNegative:rgb(218,68,83);
-$ViewForegroundNeutral:rgb(246,116,0);
-$ViewForegroundNormal:rgb(239,240,241);
-$ViewForegroundPositive:rgb(39,174,96);
-$ViewForegroundVisited:rgb(127,140,141);
-$WMactiveBackground:rgb(49,54,59);
-$WMactiveBlend:rgb(255,255,255);
-$WMactiveForeground:rgb(239,240,241);
-$WMinactiveBackground:rgb(49,54,59);
-$WMinactiveBlend:rgb(75,71,67);
-$WMinactiveForeground:rgb(127,140,141);
-$WindowBackgroundAlternate:rgb(77,77,77);
-$WindowBackgroundNormal:rgb(49,54,59);
-$WindowDecorationFocus:rgb(61,174,233);
-$WindowDecorationHover:rgb(61,174,233);
-$WindowForegroundActive:rgb(61,174,233);
-$WindowForegroundInactive:189,195,199;
-$WindowForegroundLink:rgb(41,128,185);
-$WindowForegroundNegative:rgb(218,68,83);
-$WindowForegroundNeutral:rgb(246,116,0);
-$WindowForegroundNormal:rgb(239,240,241);
-$WindowForegroundPositive:rgb(39,174,96);
-$WindowForegroundVisited:rgb(127,140,141);
diff --git a/src/build_theme.sh b/src/build_theme.sh
index 3fdf309..ef457b2 100755
--- a/src/build_theme.sh
+++ b/src/build_theme.sh
@@ -14,9 +14,9 @@ create_folders () {
build_sass() {
if command -v sassc >/dev/null 2>&1; then
- sassc "$1" "$2"
+ sassc -I "$3" "$1" "$2"
else
- sass --cache-location /tmp/sass-cache "$1" "$2"
+ sass -I "$3" --cache-location /tmp/sass-cache "$1" "$2"
fi
}
@@ -38,13 +38,16 @@ install_theme () {
render_theme () {
create_folders "$2"
- python3 render_assets.py "$1" "$2/assets"
- build_sass gtk318/gtk.scss "$2/gtk-3.18/gtk.css"
- build_sass gtk320/gtk.scss "$2/gtk-3.20/gtk.css"
cp -R gtk2/* "$2/gtk-2.0/"
+ python3 render_assets.py -c "$1" -a "$2/assets" -g "$2/gtk-2.0" -G "$2"
+ build_sass gtk318/gtk.scss "$2/gtk-3.18/gtk.css" "$2"
+ build_sass gtk320/gtk.scss "$2/gtk-3.20/gtk.css" "$2"
+ rm -f "$2/_global.scss"
install_theme "$2" "$3"
}
+# TODO : add --help and improve parameter parsing
+
COLOR_SCHEME="$1"
INSTALL_TARGET="$2"
diff --git a/src/gtk318/gtk.scss b/src/gtk318/gtk.scss
index 7901fed..2887989 100644
--- a/src/gtk318/gtk.scss
+++ b/src/gtk318/gtk.scss
@@ -1,4 +1,4 @@
[email protected] '../global';
@import '../functions';
@import '../colors';
diff --git a/src/gtk320/gtk.scss b/src/gtk320/gtk.scss
index 7901fed..2887989 100644
--- a/src/gtk320/gtk.scss
+++ b/src/gtk320/gtk.scss
@@ -1,4 +1,4 @@
[email protected] '../global';
@import '../functions';
@import '../colors';
diff --git a/src/render_assets.py b/src/render_assets.py
index a7b8207..aa1d823 100644..100755
--- a/src/render_assets.py
+++ b/src/render_assets.py
@@ -6,6 +6,7 @@ import os
import errno
import sys
import re
+import argparse
def make_sure_path_exists(path):
try:
@@ -654,19 +655,18 @@ def mix(color, mix_color, amount):
return (r,g,b)
#___________________________________________________________________________________
-if len(sys.argv) >= 2:
- filename = sys.argv[1]
-else:
- filename = '/usr/share/color-schemes/Breeze.colors'
+parser = argparse.ArgumentParser(description='Pregenerates Breeze assets according to the specified color scheme.')
+parser.add_argument('--colorscheme', '-c', action='store', default='/usr/share/color-schemes/Breeze.colors', help='color scheme to use')
+parser.add_argument('--assets-dir', '-a', action='store', default='assets', help='location of the directory to place assets')
+parser.add_argument('--gtk2-dir', '-g', action='store', default='gtk2', help='location of gtk2 directory to define the colorscheme variables')
+parser.add_argument('--gtk3-scss-dir', '-G', action='store', default='.', help='location of _global.scss to define the colorscheme variables')
-if len(sys.argv) >= 3:
- assets_path = sys.argv[2]
-else:
- assets_path = 'assets'
+args = parser.parse_args()
+assets_path = args.assets_dir
make_sure_path_exists(assets_path)
-_colors = ReadKdeGlobals().read_globals(filename)
+_colors = ReadKdeGlobals().read_globals(args.colorscheme)
border_color = Color(_colors,'WindowBackgroundNormal','WindowForegroundNormal', 0.75)
window_bg = Color(_colors,'WindowBackgroundNormal')
@@ -746,7 +746,7 @@ mixed(border_color.rgb,window_bg.rgb,button_active.rgb)
toolbar(border_color.rgb,window_bg.rgb,button_hover.rgb)
-gtk2 = open('gtk2/gtkrc', 'w')
+gtk2 = open(os.path.join(args.gtk2_dir, 'gtkrc'), 'w')
gtk2.write(
'# Theme: Breeze-gtk\n'
'# Description: Breeze theme for GTK+2.0\n'
@@ -781,7 +781,7 @@ gtk2.write(
)
gtk2.close()
-gtk3 = open('_global.scss', 'w')
+gtk3 = open(os.path.join(args.gtk3_scss_dir, '_global.scss'), 'w')
for key in sorted(_colors):
if key == 'DisabledColor' or key == 'InactiveColor':
gtk3.write('${0}:rgb({1});\n'.format(key,_colors[key]))