From d2b60a2fd2ab378f4033ef4fce2c086658218994 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sat, 25 Apr 2020 20:58:10 -0400 Subject: [PATCH] Added management of icon and gtk theme. --- sway/makefile | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/sway/makefile b/sway/makefile index 42ee6f8..21979f5 100644 --- a/sway/makefile +++ b/sway/makefile @@ -4,6 +4,9 @@ SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) include ../lib/shared.mk TARGET := $(XDG_DIR)/sway +PATH_ICON_BOSTON := "$$HOME/.icons/Boston" +PATH_GTK_ANT_NEBULA := "$$HOME/.theme/Ant-Nebula" + install: | init update init: @@ -12,6 +15,31 @@ init: else $(report) header "Setting up sway" $(mk_link) $(SRC) $(TARGET) + $(MAKE) -C $(SRC) init_icons + $(MAKE) -C $(SRC) init_theme + fi + +init_icons: + if [ ! -e $(PATH_ICON_BOSTON) ] ; then + git clone "https://github.com/heychrisd/Boston-Icons" $(PATH_ICON_BOSTON) + ; $(report) "Installed Boston icons." + else + $(report) debug "$(PATH_ICON_BOSTON) already exists. Skipping" + fi + +init_theme: + if [ ! -e $(PATH_GTK_ANT_NEBULA) ] ; then + git clone "https://github.com/EliverLara/Ant-Nebula" $(PATH_GTK_ANT_NEBULA) + ; $(report) "Installed Ant Nebula GTK." + else + $(report) debug "$(PATH_GTK_ANT_NEBULA) already exists. Skipping" + fi + if (( $$+commands[gsettings] )) ; then + gsettings set org.gnome.desktop.interface gtk-theme "Ant-Nebula" \ + && gsettings set org.gnome.desktop.wm.preferences theme "Ant-Nebula" \ + ; $(report) "Set theme in gnome" + else + $(report) debug "gsettings not installed. Skipping" fi update: @@ -20,8 +48,30 @@ update: else $(report) header "Reloading sway" swaymsg reload ; $(report) "sway reload" + $(MAKE) -C $(SRC) update_icons + $(MAKE) -C $(SRC) update_theme + fi + +update_icons: + if [ ! -e $(PATH_ICON_BOSTON) ] ; then + cd $(PATH_ICON_BOSTON) + git pull ; $(report) "Updated Boston icons." + fi + +update_theme: + if [ ! -e $(PATH_GTK_ANT_NEBULA) ] ; then + cd $(PATH_GTK_ANT_NEBULA) + git pull ; $(report) "Updated Ant Nebula GTK." fi remove: $(report) header "Removing sway" $(rm_link) $(TARGET) + if [ -e $(PATH_ICON_BOSTON) ] ; then + rm -rf $(PATH_ICON_BOSTON) \ + ; $(report) "Removed $(PATH_ICON_BOSTON)" + fi + if [ -e $(PATH_GTK_ANT_NEBULA) ] ; then + rm -rf $(PATH_GTK_ANT_NEBULA) \ + ; $(report) "Removed $(PATH_GTK_ANT_NEBULA)" + fi