Skip to content

Commit

Permalink
feat: use soft link for global task file
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillmorozov committed Jul 12, 2024
1 parent dd8b91d commit 0a9c3f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
12 changes: 5 additions & 7 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ includes:

vars:
ALACRITTY_CONFIG_DIR: ~/.config/alacritty
GLOBAL_TASK_FILE: ~/Taskfile.yml
HELIX_CONFIG_DIR: ~/.config/helix
NEOVIM_CONFIG_DIR: ~/.config/nvim
VIMRC_PATH: ~/.vimrc
Expand Down Expand Up @@ -106,14 +107,11 @@ tasks:
TARGET_DIR: "{{.NEOVIM_CONFIG_DIR}}"

link-themes:
summary: >
Hardlink theme tasks as a global taskfile to be able to execute them from
anywhere. Hardlink is required because Task does not treat symlinks as
taskfiles.
status:
- "[ -f ~/Taskfile.yml ]"
cmds:
- ln -v {{.USER_WORKING_DIR}}/ThemeTasks.yml ~/Taskfile.yml
- task: link-file
vars:
SOURCE_FILE: "{{.USER_WORKING_DIR}}/ThemeTasks.yml"
TARGET_FILE: "{{.GLOBAL_TASK_FILE}}"

bootstrap:
desc: Bootstrap dotfiles
Expand Down
8 changes: 4 additions & 4 deletions ThemeTasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ tasks:
change-theme:
desc: Switch from one theme to another.
internal: true
silent: true
platforms: [linux]
silent: true
requires:
vars:
- NEW
Expand All @@ -31,8 +31,8 @@ tasks:
change-theme:
desc: Switch from one theme to another.
internal: true
silent: true
platforms: [darwin]
silent: true
requires:
vars:
- NEW
Expand All @@ -52,8 +52,8 @@ tasks:
silent: true
requires:
vars:
- GTK_THEME
- COLOR_SCHEME
- GTK_THEME
cmds:
- gsettings set org.cinnamon.desktop.interface gtk-theme {{.GTK_THEME}}
- gsettings set org.cinnamon.theme name {{.GTK_THEME}}
Expand All @@ -65,8 +65,8 @@ tasks:
deps:
- task: change-cinnamon-theme
vars:
GTK_THEME: "{{.GTK_LIGHT_THEME}}"
COLOR_SCHEME: prefer-light
GTK_THEME: "{{.GTK_LIGHT_THEME}}"
- task: change-theme
vars:
NEW: "{{.ALACRITTY_LIGHT_THEME}}.yml"
Expand Down

0 comments on commit 0a9c3f3

Please sign in to comment.