summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRanieri Althoff <ranisalt@gmail.com>2017-10-05 01:08:06 -0300
committerRanieri Althoff <ranisalt@gmail.com>2017-10-05 01:10:11 -0300
commite089921b366683948653f2446d0babdb9632fcc2 (patch)
tree654ca38f5e33fefd6224d8bcc94d4f53b0d091f8
parent4684d04083af23449cf1003272f8a18bb9c18dfd (diff)
Add resource file for sway
-rw-r--r--pywal/__main__.py2
-rw-r--r--pywal/export.py1
-rw-r--r--pywal/reload.py7
-rw-r--r--pywal/templates/colors-sway21
4 files changed, 30 insertions, 1 deletions
diff --git a/pywal/__main__.py b/pywal/__main__.py
index cbb0ba6..8b08459 100644
--- a/pywal/__main__.py
+++ b/pywal/__main__.py
@@ -69,7 +69,7 @@ def get_args(args):
help="Print \"wal\" version.")
arg.add_argument("-e", action="store_true",
- help="Skip Reloading Environment gtk/xrdb/i3/polybar")
+ help="Skip Reloading Environment gtk/xrdb/i3/sway/polybar")
return arg.parse_args(args)
diff --git a/pywal/export.py b/pywal/export.py
index d2db143..5aaf2c6 100644
--- a/pywal/export.py
+++ b/pywal/export.py
@@ -34,6 +34,7 @@ def get_export_type(export_type):
"putty": "colors-putty.reg",
"scss": "colors.scss",
"shell": "colors.sh",
+ "sway": "colors-sway",
"xresources": "colors.Xresources",
"yaml": "colors.yml",
}.get(export_type, export_type)
diff --git a/pywal/reload.py b/pywal/reload.py
index 41283eb..b8a06f2 100644
--- a/pywal/reload.py
+++ b/pywal/reload.py
@@ -52,11 +52,18 @@ def polybar():
util.disown(["pkill", "-USR1", "polybar"])
+def sway():
+ """Reload sway colors."""
+ if shutil.which("swaymsg"):
+ util.disown(["swaymsg", "reload"])
+
+
def env(xrdb_file=None):
"""Reload environment."""
gtk()
xrdb(xrdb_file)
i3()
+ sway()
polybar()
print("reload: Reloaded environment.")
diff --git a/pywal/templates/colors-sway b/pywal/templates/colors-sway
new file mode 100644
index 0000000..62de8cf
--- /dev/null
+++ b/pywal/templates/colors-sway
@@ -0,0 +1,21 @@
+set $wallpaper "{wallpaper}"
+
+set $background "{background}"
+set $foreground "{foreground}"
+
+set $color0 "{color0}"
+set $color1 "{color1}"
+set $color2 "{color2}"
+set $color3 "{color3}"
+set $color4 "{color4}"
+set $color5 "{color5}"
+set $color6 "{color6}"
+set $color7 "{color7}"
+set $color8 "{color8}"
+set $color9 "{color9}"
+set $color10 "{color10}"
+set $color11 "{color11}"
+set $color12 "{color12}"
+set $color13 "{color13}"
+set $color14 "{color14}"
+set $color15 "{color15}"