From 821a3d8730a3a1091e2af8f6c2395fe31c87c18d Mon Sep 17 00:00:00 2001 From: Andrea Schiavini Date: Wed, 22 Nov 2017 20:14:03 +0100 Subject: Base16 shell integration (#3) Base16 shell integration --- README.md | 14 ++++++++++++++ hook/rofi.sh | 9 +++++++++ 2 files changed, 23 insertions(+) create mode 100755 hook/rofi.sh diff --git a/README.md b/README.md index 4153195..4c5a166 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,17 @@ Add the theme to your `~/.config/rofi/config` mkdir ~/.config/rofi curl https://raw.githubusercontent.com/0xdec/base16-rofi/master/themes/base16-default-dark.config >> ~/.config/rofi/config ``` + +### Base16-shell hook + +This repo also provides a hook to switch the rofi colorscheme automatically when a base16_shell theme is set. The setup is pretty straightforward: + +``` +> export BASE16_SHELL_HOOKS=$HOME/.config/base16-shell/hooks +> mkdir -p $BASE16_SHELL_HOOKS +> cp hook/rofi.sh $BASE16_SHELL_HOOKS && chmod +x $BASE16_SHELL_HOOK/rofi.sh +``` + +Then set the `rofi_config_file` and `rofi_themes_dir` variables in the script. + + diff --git a/hook/rofi.sh b/hook/rofi.sh new file mode 100755 index 0000000..816aac7 --- /dev/null +++ b/hook/rofi.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +rofi_config_file=$HOME/.config/rofi/config +rofi_themes_dir=$HOME/sources/base16-rofi/themes + +rofi_theme_file=$rofi_themes_dir/base16-$BASE16_THEME.config +if [ -f "$rofi_theme_file" ] && [ -f $rofi_config_file ]; then + cp "$rofi_theme_file" "$rofi_config_file" + echo 'Rofi theme updated' +fi -- cgit v1.2.3