From eda2c1c7d4fc6ad4d23f829eb41eb5bfda9a6520 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 15 Nov 2021 20:53:47 +0100 Subject: Added cross platform configuration for alacritty (with a 'darwin' or 'linux' in the filename) --- config/alacritty/alacritty.darwin.yml | 81 +++++++++++++++++++++++++++++++++++ config/alacritty/alacritty.linux.yml | 80 ++++++++++++++++++++++++++++++++++ config/alacritty/alacritty.yml | 81 ----------------------------------- config/nvim/init.lua | 3 +- config/qutebrowser/config.py | 2 + config/xmonad/xmonad.hs | 2 +- install | 15 ++++--- 7 files changed, 175 insertions(+), 89 deletions(-) create mode 100644 config/alacritty/alacritty.darwin.yml create mode 100644 config/alacritty/alacritty.linux.yml delete mode 100644 config/alacritty/alacritty.yml diff --git a/config/alacritty/alacritty.darwin.yml b/config/alacritty/alacritty.darwin.yml new file mode 100644 index 0000000..d05964a --- /dev/null +++ b/config/alacritty/alacritty.darwin.yml @@ -0,0 +1,81 @@ +############# +# alacritty # +############# + +# font +font: + size: 12 + offset: + x: 0 + y: 0 + normal: + family: Fira Code + style: Regular + italic: + family: Fira Code + style: Italic + bold: + family: Fira Code + style: Bold + + +key_bindings: + - { key: J, mods: Command, chars: "\e[B" } + - { key: K, mods: Command, chars: "\e[A" } + - { key: J, mods: Command|Shift, action: ScrollHalfPageDown } + - { key: K, mods: Command|Shift, action: ScrollHalfPageUp } + - { key: Return, mods: Command, action: ToggleSimpleFullScreen } + +# gruvbox_dark: https://github.com/eendroroy/alacritty-theme/blob/master/schemes.yaml +colors: + primary: + # hard contrast: background = '0x1d2021' + background: '0x282828' + # soft contrast: background = '0x32302f' + foreground: '0xebdbb2' + normal: + black: '0x282828' + red: '0xcc241d' + green: '0x98971a' + yellow: '0xd79921' + blue: '0x458588' + magenta: '0xb16286' + cyan: '0x689d6a' + white: '0xa89984' + bright: + black: '0x928374' + red: '0xfb4934' + green: '0xb8bb26' + yellow: '0xfabd2f' + blue: '0x83a598' + magenta: '0xd3869b' + cyan: '0x8ec07c' + white: '0xebdbb2' + + +# # colorscheme (Dracula) +# colors: +# # Default colors +# primary: +# background: '#282a36' +# foreground: '#f8f8f2' +# # Normal colors +# normal: +# black: '#000000' +# red: '#ff5555' +# green: '#50fa7b' +# yellow: '#f1fa8c' +# blue: '#caa9fa' +# magenta: '#ff79c6' +# cyan: '#8be9fd' +# white: '#bfbfbf' +# # Bright colors +# bright: +# black: '#575b70' +# red: '#ff6e67' +# green: '#5af78e' +# yellow: '#f4f99d' +# blue: '#caa9fa' +# magenta: '#ff92d0' +# cyan: '#9aedfe' +# white: '#e6e6e6' diff --git a/config/alacritty/alacritty.linux.yml b/config/alacritty/alacritty.linux.yml new file mode 100644 index 0000000..6efe9dd --- /dev/null +++ b/config/alacritty/alacritty.linux.yml @@ -0,0 +1,80 @@ +############# +# alacritty # +############# + +# font +font: + size: 8.0 + offset: + x: 0 + y: 0 + normal: + family: Fira Code + style: Regular + italic: + style: Italic + bold: + style: Bold + use_thin_strokes: false + + +key_bindings: + - { key: J, mods: Alt, chars: "\e[B" } + - { key: K, mods: Alt, chars: "\e[A" } + - { key: J, mods: Alt|Shift, action: ScrollHalfPageDown } + - { key: K, mods: Alt|Shift, action: ScrollHalfPageUp } + + +# gruvbox_dark: https://github.com/eendroroy/alacritty-theme/blob/master/schemes.yaml +colors: + primary: + # hard contrast: background = '0x1d2021' + background: '0x282828' + # soft contrast: background = '0x32302f' + foreground: '0xebdbb2' + normal: + black: '0x282828' + red: '0xcc241d' + green: '0x98971a' + yellow: '0xd79921' + blue: '0x458588' + magenta: '0xb16286' + cyan: '0x689d6a' + white: '0xa89984' + bright: + black: '0x928374' + red: '0xfb4934' + green: '0xb8bb26' + yellow: '0xfabd2f' + blue: '0x83a598' + magenta: '0xd3869b' + cyan: '0x8ec07c' + white: '0xebdbb2' + + +# # colorscheme (Dracula) +# colors: +# # Default colors +# primary: +# background: '#282a36' +# foreground: '#f8f8f2' +# # Normal colors +# normal: +# black: '#000000' +# red: '#ff5555' +# green: '#50fa7b' +# yellow: '#f1fa8c' +# blue: '#caa9fa' +# magenta: '#ff79c6' +# cyan: '#8be9fd' +# white: '#bfbfbf' +# # Bright colors +# bright: +# black: '#575b70' +# red: '#ff6e67' +# green: '#5af78e' +# yellow: '#f4f99d' +# blue: '#caa9fa' +# magenta: '#ff92d0' +# cyan: '#9aedfe' +# white: '#e6e6e6' diff --git a/config/alacritty/alacritty.yml b/config/alacritty/alacritty.yml deleted file mode 100644 index d05964a..0000000 --- a/config/alacritty/alacritty.yml +++ /dev/null @@ -1,81 +0,0 @@ -############# -# alacritty # -############# - -# font -font: - size: 12 - offset: - x: 0 - y: 0 - normal: - family: Fira Code - style: Regular - italic: - family: Fira Code - style: Italic - bold: - family: Fira Code - style: Bold - - -key_bindings: - - { key: J, mods: Command, chars: "\e[B" } - - { key: K, mods: Command, chars: "\e[A" } - - { key: J, mods: Command|Shift, action: ScrollHalfPageDown } - - { key: K, mods: Command|Shift, action: ScrollHalfPageUp } - - { key: Return, mods: Command, action: ToggleSimpleFullScreen } - -# gruvbox_dark: https://github.com/eendroroy/alacritty-theme/blob/master/schemes.yaml -colors: - primary: - # hard contrast: background = '0x1d2021' - background: '0x282828' - # soft contrast: background = '0x32302f' - foreground: '0xebdbb2' - normal: - black: '0x282828' - red: '0xcc241d' - green: '0x98971a' - yellow: '0xd79921' - blue: '0x458588' - magenta: '0xb16286' - cyan: '0x689d6a' - white: '0xa89984' - bright: - black: '0x928374' - red: '0xfb4934' - green: '0xb8bb26' - yellow: '0xfabd2f' - blue: '0x83a598' - magenta: '0xd3869b' - cyan: '0x8ec07c' - white: '0xebdbb2' - - -# # colorscheme (Dracula) -# colors: -# # Default colors -# primary: -# background: '#282a36' -# foreground: '#f8f8f2' -# # Normal colors -# normal: -# black: '#000000' -# red: '#ff5555' -# green: '#50fa7b' -# yellow: '#f1fa8c' -# blue: '#caa9fa' -# magenta: '#ff79c6' -# cyan: '#8be9fd' -# white: '#bfbfbf' -# # Bright colors -# bright: -# black: '#575b70' -# red: '#ff6e67' -# green: '#5af78e' -# yellow: '#f4f99d' -# blue: '#caa9fa' -# magenta: '#ff92d0' -# cyan: '#9aedfe' -# white: '#e6e6e6' diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 9634562..3e5b52b 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -71,7 +71,6 @@ require('telescope').setup { require('lualine').setup { options = { theme = 'gruvbox', - icons_enabled = false, section_separators = '', component_separators = '' } @@ -97,6 +96,6 @@ require('nvim-treesitter.configs').setup { require('nvim_comment').setup() -require('lspconfig').clangd.setup {} +-- require('lspconfig').clangd.setup {} require('mappings') diff --git a/config/qutebrowser/config.py b/config/qutebrowser/config.py index d27a498..b86c540 100644 --- a/config/qutebrowser/config.py +++ b/config/qutebrowser/config.py @@ -433,3 +433,5 @@ c.colors.tabs.selected.even.bg = base05 # Background color for webpages if unset (or empty to use the theme"s # color). c.colors.webpage.bg = base00 + +# vim:TSBufDisable highlight diff --git a/config/xmonad/xmonad.hs b/config/xmonad/xmonad.hs index b0f47a6..a94df43 100644 --- a/config/xmonad/xmonad.hs +++ b/config/xmonad/xmonad.hs @@ -22,7 +22,7 @@ import XMonad.Hooks.InsertPosition (Focus (..), Position (..), insertPosition) -myTerminal = "st" +myTerminal = "alacritty" -- xmonad :: XConfig -> IO () -- https://hackage.haskell.org/package/xmonad-0.15/docs/XMonad-Core.html#t:XConfig diff --git a/install b/install index 4a2fb5a..fa0c195 100755 --- a/install +++ b/install @@ -27,7 +27,7 @@ mkdir -pv "$XDG_CONFIG_HOME" mkdir -pv "$XDG_DATA_HOME" mkdir -pv "$XDG_CACHE_HOME" # xmonad uses ~/.xmonad if those directories don't already exists -if [ $(uname) = Linux ] +if [ "$(uname)" = Linux ] then mkdir -pv "$XMONAD_CONFIG_HOME" mkdir -pv "$XMONAD_DATA_HOME" @@ -40,10 +40,13 @@ link_home_files() { rice_dir="$1" dest_dir="$2" paths=$(mktemp) + platform="$(uname | tr '[:upper:]' '[:lower:]')" + other_platform="$([ "$platform" = 'linux' ] && echo darwin || echo linux)" # generate a file with the file path in this repo and the link for the real path # each line is in the format: TARGET LINKNAME find "$rice_dir" -type f | - sed -e 'p' -e 's:^'"$rice_dir"':'"$dest_dir"':' | + sed "/\.$other_platform\./ d" | + sed -e 'p' -e "s:^$rice_dir:$dest_dir:" -e "s/\.$platform\././" | awk '{ if (NR % 2 == 1) { print "'"$(pwd)"'" "/" $0 } else print }' | xargs -L 2 > "$paths" < "$paths" cut -d ' ' -f 2 | xargs -L 1 dirname | xargs -L 1 mkdir -pv @@ -72,12 +75,13 @@ echo '---------------------------- INSTALL VIM PLUG ---------------------------- PLUGFILE="$XDG_DATA_HOME/vim/autoload/plug.vim" PLUGURL='https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' [ ! -f "$PLUGFILE" ] && curl -fLo "$PLUGFILE" --create-dirs "$PLUGURL" -vim -c "PlugInstall" -c "qa" +vim -c 'PlugInstall' -c 'qa' +echo '---------------------------- INSTALL NVIM PACKER -------------------------' PACKERDIR="$XDG_DATA_HOME/nvim/site/pack/packer/start/packer.nvim" PACKERURL='https://github.com/wbthomason/packer.nvim' [ ! -d "$PACKERDIR" ] && git clone --depth 1 "$PACKERURL" "$PACKERDIR" -vim -c "PackerInstall" -c "qa" +nvim -c 'PackerInstall' -c 'PackerUpdate' -c "qa" ############################################################################### # zsh pluggins @@ -100,7 +104,7 @@ parallel_start update_zsh_plugin 'https://github.com/zsh-users/zsh-syntax-highli parallel_start update_zsh_plugin 'https://github.com/MichaelAquilina/zsh-you-should-use' parallel_wait -[ $(uname) = Darwin ] && exit +[ "$(uname)" = Darwin ] && exit ############################################################################### # Linux specific @@ -116,6 +120,7 @@ if [ "$(cat /etc/hostname)" = 'charleslaptopcarbon' ] then cat crontab/user.crontab crontab/laptop.crontab | crontab - elif [ "$(cat /etc/hostname)" = 'cacharle-main' ] +then crontab crontab/user.crontab fi -- cgit