diff options
author | jakob.stendahl <jakob.stendahl@infomedia.dk> | 2024-04-10 21:21:26 +0200 |
---|---|---|
committer | jakob.stendahl <jakob.stendahl@infomedia.dk> | 2024-04-10 21:21:26 +0200 |
commit | c163ded79bb284c2b2bc1ed8fdddfcb8ede60806 (patch) | |
tree | 10a4e06c6c81ba1bc52042f990320c97489b57c7 | |
parent | b9f486ba609ae7313283f75cf7161c974d67ce30 (diff) | |
download | dotfiles-c163ded79bb284c2b2bc1ed8fdddfcb8ede60806.tar.gz dotfiles-c163ded79bb284c2b2bc1ed8fdddfcb8ede60806.zip |
Add some indicators
-rwxr-xr-x | bin/toggle-theme | 2 | ||||
-rwxr-xr-x | bin/trikketid | 13 | ||||
-rwxr-xr-x | bin/update-theme | 27 | ||||
-rw-r--r-- | linux/alacritty/inferno.yaml | 29 | ||||
-rw-r--r-- | linux/alacritty/papertheme_prod.yaml | 28 | ||||
-rw-r--r-- | linux/alacritty/papertheme_staging.yaml | 28 | ||||
-rw-r--r-- | linux/tmux.conf.m4 | 12 |
7 files changed, 136 insertions, 3 deletions
diff --git a/bin/toggle-theme b/bin/toggle-theme index 5710508..2601c90 100755 --- a/bin/toggle-theme +++ b/bin/toggle-theme @@ -26,6 +26,7 @@ if [ "$THEME" = "dark" ]; then # Update tmux (Consider making a theme switch in the m4 config and re-running that instead of having it configured here) tmux set-environment THEME "light" + tmux set-environment ALACRITTY_THEME "${LIGHTTHEME}" tmux set -g status-bg "#F2EEDE" tmux set -g status-fg colour15 tmux setw -g window-status-current-style "bg=colour0,fg=colour255" @@ -47,6 +48,7 @@ else # Update tmux tmux set-environment THEME "dark" + tmux set-environment ALACRITTY_THEME "${DARKTHEME}" tmux set -g status-bg "#0c0c0c" tmux set -g status-fg "#d6d6d6" tmux setw -g window-status-style "bg=colour235,fg=colour7" diff --git a/bin/trikketid b/bin/trikketid new file mode 100755 index 0000000..4f36e35 --- /dev/null +++ b/bin/trikketid @@ -0,0 +1,13 @@ +#!/bin/bash + +# Used to make the dataset significantly smaller +# operators are listed here https://developer.entur.org/pages-real-time-intro +OPERATOR="RUT" + +API_URL="https://api.entur.io" + +curl -X POST "${API_URL}/realtime/v1/services/${OPERATOR}" +curl -X POST "${API_URL}/realtime/v1/services" + + + diff --git a/bin/update-theme b/bin/update-theme new file mode 100755 index 0000000..2d233d4 --- /dev/null +++ b/bin/update-theme @@ -0,0 +1,27 @@ +#!/bin/bash + +ALACRITTYCONF="${HOME}/.config/alacritty/alacritty.yml" + +CURRENT_WINDOW_NAME=$(tmux display-message -p "#W" | tr '[:upper:]' '[:lower:]') +export $(tmux show-env | grep THEME) + +DARK_THEME="campbell" +LIGHT_THEME="papertheme" +PRODUCTION_THEME="papertheme_prod" +STAGING_THEME="papertheme_staging" + +if [[ "$CURRENT_WINDOW_NAME" == prod* ]]; then + sed -i "s/${ALACRITTY_THEME}/${PRODUCTION_THEME}/" "${ALACRITTYCONF}" + tmux set-environment ALACRITTY_THEME "${PRODUCTION_THEME}" +elif [[ "$CURRENT_WINDOW_NAME" == staging* ]]; then + sed -i "s/${ALACRITTY_THEME}/${STAGING_THEME}/" "${ALACRITTYCONF}" + tmux set-environment ALACRITTY_THEME "${STAGING_THEME}" +else + if [ "$THEME" = "dark" ]; then + sed -i "s/${ALACRITTY_THEME}/${DARK_THEME}/" "${ALACRITTYCONF}" + tmux set-environment ALACRITTY_THEME "${DARK_THEME}" + else + sed -i "s/${ALACRITTY_THEME}/${LIGHT_THEME}/" "${ALACRITTYCONF}" + tmux set-environment ALACRITTY_THEME "${LIGHT_THEME}" + fi +fi diff --git a/linux/alacritty/inferno.yaml b/linux/alacritty/inferno.yaml new file mode 100644 index 0000000..8181442 --- /dev/null +++ b/linux/alacritty/inferno.yaml @@ -0,0 +1,29 @@ +# Inferno theme +# Source: https://github.com/hafiz-muhammad/inferno-alacritty-theme/blob/main/inferno.yml +colors: + # Default colors + primary: + background: '0x270d06' + foreground: '0xd9d9d9' + + # Normal colors + normal: + black: '0x330000' + red: '0xff3300' + green: '0xff6600' + yellow: '0xff9900' + blue: '0xffcc00' + magenta: '0xff6600' + cyan: '0xff9900' + white: '0xd9d9d9' + + # Bright colors + bright: + black: '0x663300' + red: '0xff6633' + green: '0xff9966' + yellow: '0xffcc99' + blue: '0xffcc33' + magenta: '0xff9966' + cyan: '0xffcc99' + white: '0xd9d9d9' diff --git a/linux/alacritty/papertheme_prod.yaml b/linux/alacritty/papertheme_prod.yaml new file mode 100644 index 0000000..a2eda1f --- /dev/null +++ b/linux/alacritty/papertheme_prod.yaml @@ -0,0 +1,28 @@ +# Colors (Paper Theme) +colors: + # Default colors + primary: + background: '#fcabab' + foreground: '#000000' + + # Normal colors + normal: + black: '#000000' + red: '#CC3E28' + green: '#216609' + yellow: '#B58900' + blue: '#1E6FCC' + magenta: '#5C21A5' + cyan: '#158C86' + white: '#AAAAAA' + + # Bright colors + bright: + black: '#555555' + red: '#CC3E28' + green: '#216609' + yellow: '#B58900' + blue: '#1E6FCC' + magenta: '#5C21A5' + cyan: '#158C86' + white: '#AAAAAA' diff --git a/linux/alacritty/papertheme_staging.yaml b/linux/alacritty/papertheme_staging.yaml new file mode 100644 index 0000000..1342ad7 --- /dev/null +++ b/linux/alacritty/papertheme_staging.yaml @@ -0,0 +1,28 @@ +# Colors (Paper Theme) +colors: + # Default colors + primary: + background: '#fccd8a' + foreground: '#000000' + + # Normal colors + normal: + black: '#000000' + red: '#CC3E28' + green: '#216609' + yellow: '#B58900' + blue: '#1E6FCC' + magenta: '#5C21A5' + cyan: '#158C86' + white: '#AAAAAA' + + # Bright colors + bright: + black: '#555555' + red: '#CC3E28' + green: '#216609' + yellow: '#B58900' + blue: '#1E6FCC' + magenta: '#5C21A5' + cyan: '#158C86' + white: '#AAAAAA' diff --git a/linux/tmux.conf.m4 b/linux/tmux.conf.m4 index 63de4ae..a781d9f 100644 --- a/linux/tmux.conf.m4 +++ b/linux/tmux.conf.m4 @@ -49,9 +49,6 @@ bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xc set -g visual-bell on set -g bell-action any -# Scroll in shell -set -g mouse on - # Sync panes bind-key = set-window-option synchronize-panes @@ -93,6 +90,15 @@ bind -n M-C-i display-popup -E "nvim -c 'e ~/Nextcloud/wiki/I45/Hendelser.md' -c bind-key T run-shell "toggle-theme" +m4_changequote({, })m4_dnl +m4_ifelse(DT_DOTFILES_TYPE, {local}, { +set-hook -g session-window-changed 'run-shell "update-theme"' +set-hook -g window-renamed 'run-shell "update-theme"' +bind-key P run-shell "tmux display-message -p '#W' | grep -q '^PROD' || tmux rename-window 'PROD #{window_name}'" +bind-key S run-shell "tmux display-message -p '#W' | grep -q '^STAGING' || tmux rename-window 'STAGING #{window_name}'" +})m4_dnl +m4_changequote(`, ')m4_dnl + # -- Theme -------------------------------------------------------------------- m4_ifelse(DT_DOTFILES_TYPE, `local', `m4_dnl set -g status-justify left |