dotfiles

Yes, my $HOME has a git repo now :(

git clone git://git.shimmy1996.com/dotfiles.git
commit 670ff76801b74effb657a0c099962c888cbe240f
parent f5a330ad342e5ff7856b452660a6f456509c14cd
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Mon, 21 Jan 2019 10:22:54 -0500

Add script to change gtk settings under wayland.

Diffstat:
M.config/sway/config | 9+++++++--
M.gitignore | 1+
A.local/bin/sway/import-gsettings | 11+++++++++++
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/.config/sway/config b/.config/sway/config
@@ -43,6 +43,12 @@ client.unfocused        $base01 $base00 $base05 $base01 $base01
 client.urgent           $base08 $base08 $base00 $base08 $base08
 client.placeholder      $base00 $base00 $base05 $base00 $base00
 client.background       $base07
+## GTK Settings
+exec_always ~/.local/bin/sway/import-gsettings \
+            gtk-theme:gtk-theme-name \
+            icon-theme:gtk-icon-theme-name \
+            cursor-theme:gtk-cursor-theme-name \
+            font-name:gtk-font-name
 
 ### Output Configuration
 #
@@ -280,4 +286,4 @@ include /etc/sway/config.d/*
 exec --no-startup-id greenclip daemon
 exec --no-startup-id mako
 exec --no-startup-id dropbox
-exec --no-startup-id fcitx -d-
\ No newline at end of file
+exec --no-startup-id fcitx -d
diff --git a/.gitignore b/.gitignore
@@ -44,6 +44,7 @@
 !.local/bin
 !.local/bin/*
 !.local/bin/i3blocks/*
+!.local/bin/sway/*
 !.local/share
 !.local/share/applications
 !.local/share/applications/emacs.desktop
diff --git a/.local/bin/sway/import-gsettings b/.local/bin/sway/import-gsettings
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+# usage: import-gsettings <gsettings key>:<settings.ini key> <gsettings key>:<settings.ini key> ...
+
+expression=""
+for pair in "$@"; do
+    IFS=:; set -- $pair
+    expressions="$expressions -e 's:^$2=(.*)$:gsettings set org.gnome.desktop.interface $1 \1:e'"
+done
+IFS=
+eval exec sed -E $expressions "${XDG_CONFIG_HOME:-$HOME/.config}"/gtk-3.0/settings.ini >/dev/null