From 1246f97bdf62e6f255680904b60d665540bc1f2c Mon Sep 17 00:00:00 2001 From: Ein Verne Date: Sun, 3 Jul 2022 17:33:23 +0800 Subject: [PATCH] Add termux support (#6) --- Makefile | 5 ++++ README.md | 11 ++++++++ config/bootstrap.conf.yml | 35 +++++++++++++++++++++++++ config/install.conf.yml | 33 ----------------------- config/termux.conf.yml | 22 ++++++++++++++++ termux/{ => .termux}/colors.properties | 0 termux/{ => .termux}/font.ttf | Bin termux/.termux/termux.properties | 1 + termux/setup.sh | 15 ++++++----- termux/termux.properties | 1 - 10 files changed, 82 insertions(+), 41 deletions(-) create mode 100644 config/termux.conf.yml rename termux/{ => .termux}/colors.properties (100%) rename termux/{ => .termux}/font.ttf (100%) create mode 100644 termux/.termux/termux.properties delete mode 100644 termux/termux.properties diff --git a/Makefile b/Makefile index 535a308..f7ac0c8 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,11 @@ _bootstrap: bootstrap: _prepare dotfiles _bootstrap ## Bootstrap new machine +termux: _prepare dotfiles termux ## Bootstrap new termux + +termux: + @./install -c config/termux.conf.yml + dotfiles: ## Update dotfiles @./install diff --git a/README.md b/README.md index 8c989e6..e8e017a 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,17 @@ Set up using dotbot: # under macOS make macos +## Termux setup +Install dependency first: + + pkg install make python vim git + +then: + + git clone git@github.com:einverne/dotfiles.git + cd dotfiles + make termux + ## Overview - using [dotbot](https://github.com/anishathalye/dotbot/) to manage dotfiles, [read more](https://blog.einverne.info/post/2020/08/use-dotbot-dotfiles-management.html) diff --git a/config/bootstrap.conf.yml b/config/bootstrap.conf.yml index 8da4795..850aab8 100644 --- a/config/bootstrap.conf.yml +++ b/config/bootstrap.conf.yml @@ -3,6 +3,9 @@ - ~/.zinit - ~/.tmux +- create: + - ~/.config/kitty + - shell: - description: Clone zinit quiet: true @@ -38,3 +41,35 @@ } update_shell + +- link: + ~/.config/espanso: + if: '[ `uname` = Linux ]' + path: espanso + ~/Library/Preferences/espanso: + if: '[ `uname` = Darwin ]' + path: espanso + ~/.hammerspoon: + if: '[ `uname` = Darwin ]' + path: hammerspoon + ~/.mackup.cfg: + if: '[ `uname` = Darwin ]' + path: mackup/mackup.cfg + ~/.Brewfile: + if: '[ `uname` = Darwin ]' + path: Brewfile + ~/.config/kitty/kitty.conf: + if: '[ `uname` = Darwin ]' + path: kitty/kitty.conf + ~/.config/kitty/base16-solarized-dark-256.conf: + if: '[ `uname` = Darwin ]' + path: kitty/base16-solarized-dark-256.conf + ~/.skhdrc: + if: '[ `uname` = Darwin ]' + path: skhd/skhdrc + ~/.yabairc: + if: '[ `uname` = Darwin ]' + path: yabai/yabairc + ~/.yabai_focus_display: + if: '[ `uname` = Darwin ]' + path: yabai/yabai_focus_display diff --git a/config/install.conf.yml b/config/install.conf.yml index 9a8f9ba..dba451e 100644 --- a/config/install.conf.yml +++ b/config/install.conf.yml @@ -5,9 +5,6 @@ - clean: ['~'] -- create: - - ~/.config/kitty - - link: ~/.dotfiles: force: true @@ -37,33 +34,3 @@ ~/.ideavimrc: if: '[ `uname` = Darwin ]' path: idea/.ideavimrc - ~/.config/espanso: - if: '[ `uname` = Linux ]' - path: espanso - ~/Library/Preferences/espanso: - if: '[ `uname` = Darwin ]' - path: espanso - ~/.hammerspoon: - if: '[ `uname` = Darwin ]' - path: hammerspoon - ~/.mackup.cfg: - if: '[ `uname` = Darwin ]' - path: mackup/mackup.cfg - ~/.Brewfile: - if: '[ `uname` = Darwin ]' - path: Brewfile - ~/.config/kitty/kitty.conf: - if: '[ `uname` = Darwin ]' - path: kitty/kitty.conf - ~/.config/kitty/base16-solarized-dark-256.conf: - if: '[ `uname` = Darwin ]' - path: kitty/base16-solarized-dark-256.conf - ~/.skhdrc: - if: '[ `uname` = Darwin ]' - path: skhd/skhdrc - ~/.yabairc: - if: '[ `uname` = Darwin ]' - path: yabai/yabairc - ~/.yabai_focus_display: - if: '[ `uname` = Darwin ]' - path: yabai/yabai_focus_display diff --git a/config/termux.conf.yml b/config/termux.conf.yml new file mode 100644 index 0000000..07abf5d --- /dev/null +++ b/config/termux.conf.yml @@ -0,0 +1,22 @@ +- shell: + - description: backup .termux + command: | + mv "$HOME/.termux" "$HOME/.termux.bak.$(date +%Y.%m.%d-%H:%M:%S)" + - description: install tools + command: | + pkg install -y termux-tools libcurl wget curl openssh vim git zsh unrar unzip less tree htop tsu neofetch fzf ncurses-utils + +- link: + ~/.termux: + path: termux/.termux + +- shell: + - description: Clone zinit + quiet: true + command: | + if cd ~/.zinit/bin; + then git pull; + else git clone https://github.com/zdharma-continuum/zinit.git ~/.zinit/bin; fi + - chsh -s zsh + - termux-reload-settings + - echo "Done!" diff --git a/termux/colors.properties b/termux/.termux/colors.properties similarity index 100% rename from termux/colors.properties rename to termux/.termux/colors.properties diff --git a/termux/font.ttf b/termux/.termux/font.ttf similarity index 100% rename from termux/font.ttf rename to termux/.termux/font.ttf diff --git a/termux/.termux/termux.properties b/termux/.termux/termux.properties new file mode 100644 index 0000000..ec07312 --- /dev/null +++ b/termux/.termux/termux.properties @@ -0,0 +1 @@ +extra-keys = [['ESC','/','|','HOME','UP','END','PGUP'],['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN']] diff --git a/termux/setup.sh b/termux/setup.sh index 6bfbb16..37c068d 100644 --- a/termux/setup.sh +++ b/termux/setup.sh @@ -2,25 +2,26 @@ echo -e "Installing dependencies ..." # https://github.com/4679/oh-my-termux -pkg install -y libcurl wget curl openssh vim git zsh unrar unzip less -pkg install -y tsu neofetch +pkg install -y libcurl wget curl openssh vim git zsh unrar unzip less tree htop tsu neofetch echo -e "Successfully Installed" if [ -d "$HOME/.termux" ]; then - mv $HOME/.termux $HOME/.termux.bak + mv "$HOME/.termux" "$HOME/.termux.bak.$(date +%Y.%m.%d-%H:%M:%S)" fi if [ ! -d $HOME/.termux ]; then mkdir $HOME/.termux fi -curl -fsLo $HOME/.termux/colors.properties --create-dirs https://github.com/einverne/dotfiles/raw/master/termux/colors.properties -curl -fsLo $HOME/.termux/termux.properties --create-dirs https://github.com/einverne/dotfiles/raw/master/termux/termux.properties -curl -fsLo $HOME/.termux/font.ttf --create-dirs https://github.com/einverne/dotfiles/raw/master/termux/font.ttf +ln -s "$HOME/dotfiles/termux/.termux" "$HOME/.termux" -git clone git://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh --depth 1 +git clone https://github.com/robbyrussell/oh-my-zsh $HOME/.oh-my-zsh --depth 1 cp $HOME/.oh-my-zsh/templates/zshrc.zsh-template $HOME/.zshrc sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="agnoster"/' $HOME/.zshrc + +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.zsh-syntax-highlighting" --depth 1 +echo "source $HOME/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$HOME/.zshrc" + chsh -s zsh termux-setup-storage diff --git a/termux/termux.properties b/termux/termux.properties deleted file mode 100644 index 60912e5..0000000 --- a/termux/termux.properties +++ /dev/null @@ -1 +0,0 @@ -extra-keys = [['ESC','/','-','HOME','UP','END','PGUP'],['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN']]