Commit f0cd4b0b authored by Joris's avatar Joris

Use alacritty and add night mode switch

parent 8342dda6
#!/usr/bin/env bash
ALACRITTY_CONFIG=~/.config/alacritty/alacritty.yml
NVIM_CONFIG=~/.config/nvim/init.vim
XRESOURCES=~/.config/Xresources
MATCH_LIGHT=$(cat "$ALACRITTY_CONFIG" | grep "colors: \*light")
if [ -n "$MATCH_LIGHT" ]; then
# Switching to dark mode
sed -i 's/^colors: \*light$/colors: \*dark/' "$ALACRITTY_CONFIG"
sed -i 's/^set background=light$/set background=dark/' "$NVIM_CONFIG"
hsetroot -solid "#002b36"
# # Xresources
#
# sed -i "s/^! #define S_base03 #002b36$/#define S_base03 #002b36/" "$XRESOURCES"
# sed -i "s/^! #define S_base02 #073642$/#define S_base02 #073642/" "$XRESOURCES"
# sed -i "s/^! #define S_base01 #586e75$/#define S_base01 #586e75/" "$XRESOURCES"
# sed -i "s/^! #define S_base00 #657b83$/#define S_base00 #657b83/" "$XRESOURCES"
# sed -i "s/^! #define S_base0 #839496$/#define S_base0 #839496/" "$XRESOURCES"
# sed -i "s/^! #define S_base1 #93a1a1$/#define S_base1 #93a1a1/" "$XRESOURCES"
# sed -i "s/^! #define S_base2 #eee8d5$/#define S_base2 #eee8d5/" "$XRESOURCES"
# sed -i "s/^! #define S_base3 #fdf6e3$/#define S_base3 #fdf6e3/" "$XRESOURCES"
#
# sed -i "s/^#define S_base03 #fdf6e3$/! #define S_base03 #fdf6e3/" "$XRESOURCES"
# sed -i "s/^#define S_base02 #eee8d5$/! #define S_base02 #eee8d5/" "$XRESOURCES"
# sed -i "s/^#define S_base01 #93a1a1$/! #define S_base01 #93a1a1/" "$XRESOURCES"
# sed -i "s/^#define S_base00 #839496$/! #define S_base00 #839496/" "$XRESOURCES"
# sed -i "s/^#define S_base0 #657b83$/! #define S_base0 #657b83/" "$XRESOURCES"
# sed -i "s/^#define S_base1 #586e75$/! #define S_base1 #586e75/" "$XRESOURCES"
# sed -i "s/^#define S_base2 #073642$/! #define S_base2 #073642/" "$XRESOURCES"
# sed -i "s/^#define S_base3 #002b36$/! #define S_base3 #002b36/" "$XRESOURCES"
else
# Switching to light mode
sed -i 's/colors: \*dark/colors: \*light/' "$ALACRITTY_CONFIG"
sed -i 's/^set background=dark$/set background=light/' "$NVIM_CONFIG"
hsetroot -solid "#FDF6E3"
# # Xresources
#
# sed -i "s/^#define S_base03 #002b36$/! #define S_base03 #002b36/" "$XRESOURCES"
# sed -i "s/^#define S_base02 #073642$/! #define S_base02 #073642/" "$XRESOURCES"
# sed -i "s/^#define S_base01 #586e75$/! #define S_base01 #586e75/" "$XRESOURCES"
# sed -i "s/^#define S_base00 #657b83$/! #define S_base00 #657b83/" "$XRESOURCES"
# sed -i "s/^#define S_base0 #839496$/! #define S_base0 #839496/" "$XRESOURCES"
# sed -i "s/^#define S_base1 #93a1a1$/! #define S_base1 #93a1a1/" "$XRESOURCES"
# sed -i "s/^#define S_base2 #eee8d5$/! #define S_base2 #eee8d5/" "$XRESOURCES"
# sed -i "s/^#define S_base3 #fdf6e3$/! #define S_base3 #fdf6e3/" "$XRESOURCES"
#
# sed -i "s/^! #define S_base03 #fdf6e3$/#define S_base03 #fdf6e3/" "$XRESOURCES"
# sed -i "s/^! #define S_base02 #eee8d5$/#define S_base02 #eee8d5/" "$XRESOURCES"
# sed -i "s/^! #define S_base01 #93a1a1$/#define S_base01 #93a1a1/" "$XRESOURCES"
# sed -i "s/^! #define S_base00 #839496$/#define S_base00 #839496/" "$XRESOURCES"
# sed -i "s/^! #define S_base0 #657b83$/#define S_base0 #657b83/" "$XRESOURCES"
# sed -i "s/^! #define S_base1 #586e75$/#define S_base1 #586e75/" "$XRESOURCES"
# sed -i "s/^! #define S_base2 #073642$/#define S_base2 #073642/" "$XRESOURCES"
# sed -i "s/^! #define S_base3 #002b36$/#define S_base3 #002b36/" "$XRESOURCES"
fi
# xrdb "$XRESOURCES"
......@@ -5,15 +5,18 @@ urxvt*font: xft:Inconsolata:size=13
! urxvt*font: xft:Hasklig:size=10
! urxvt*font: xft:Fira Code:size=11
urxvt*intensityStyles: false
urxvt*perl-ext-common: font-size
urxvt*keysym.C-minus: perl:font-size:decrease
urxvt*keysym.C-plus: perl:font-size:increase
urxvt*font-size.step: 4
urxvt.perl-ext: default,url-select
urxvt.keysym.C-i: perl:url-select:select_next
urxvt.url-select.launcher: qutebrowser
urxvt.url-select.underline: true
! Extensions
urxvt.perl-ext: default,url-select
urxvt.perl-ext-common: font-size
urxvt*font-size.step: 4
urxvt.keysym.C-i: perl:url-select:select_next
urxvt.keysym.C-minus: perl:font-size:decrease
urxvt.keysym.C-plus: perl:font-size:increase
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
......@@ -33,25 +36,25 @@ Xft.hintstyle: hintlight
! Dark
! #define S_base03 #002b36
! #define S_base02 #073642
! #define S_base01 #586e75
! #define S_base00 #657b83
! #define S_base0 #839496
! #define S_base1 #93a1a1
! #define S_base2 #eee8d5
! #define S_base3 #fdf6e3
! #define S_base03 #002b36
! #define S_base02 #073642
! #define S_base01 #586e75
! #define S_base00 #657b83
! #define S_base0 #839496
! #define S_base1 #93a1a1
! #define S_base2 #eee8d5
! #define S_base3 #fdf6e3
! Light
#define S_base03 #fdf6e3
#define S_base02 #eee8d5
#define S_base01 #93a1a1
#define S_base00 #839496
#define S_base0 #657b83
#define S_base1 #586e75
#define S_base2 #073642
#define S_base3 #002b36
#define S_base03 #fdf6e3
#define S_base02 #eee8d5
#define S_base01 #93a1a1
#define S_base00 #839496
#define S_base0 #657b83
#define S_base1 #586e75
#define S_base2 #073642
#define S_base3 #002b36
urxvt*background: S_base03
urxvt*foreground: S_base0
......
......@@ -11,8 +11,8 @@ exec_always --no-startup-id xrandr --output eDP-1 --same-as HDMI-2
# Constants
set $mod Mod1
set $term urxvt
set $termCommand urxvt -e fish --command
set $term alacritty
set $termCommand alacritty -e fish --command
set $up s
set $down t
set $left c
......@@ -184,12 +184,13 @@ mode $mode_download {
bindsym Return mode "default"
}
set $mode_swap "(t)ouchpad (r)esolution (m)icro (a)larm"
set $mode_swap "(t)ouchpad (r)esolution (m)icro (a)larm (c)olors"
mode $mode_swap {
bindsym t exec --no-startup-id "~/.bin/touchpad"; mode "default"
bindsym r exec --no-startup-id "~/.bin/swap-resolution"; mode "default"
bindsym m exec --no-startup-id "~/.bin/swap-micro"; mode "default"
bindsym a exec --no-startup-id "~/.bin/alarm-stop"; mode "default"
bindsym c exec --no-startup-id "~/.bin/switch-term-colors"; mode "default"
bindsym Escape mode "default"
bindsym Return mode "default"
......
......@@ -3,8 +3,8 @@
noremap c h
noremap r l
" {ts} = « haut / bas »
noremap t gj
noremap s gk
noremap t j
noremap s k
" {CR} = « haut / bas de l'écran »
noremap C H
noremap R L
......
......@@ -55,9 +55,14 @@ set nojoinspaces
set smartindent
" Colors
set background=dark
set background=light
colorscheme NeoSolarized
" Source vim configuration upon save
augroup vimrc
autocmd! BufWritePost $MYVIMRC source $MYVIMRC
augroup END
" Numbering
set number relativenumber
......@@ -150,6 +155,7 @@ nnoremap <silent> <Leader>n :nohlsearch<return>
nnoremap <silent> <Leader>t :NERDTreeFind<return>
nnoremap <silent> <Leader>r :so $MYVIMRC<return>
nnoremap <silent> <Leader>r :e<return> " Reload the current buffer
nnoremap <silent> <Leader><Leader> :so $MYVIMRC<return>
" Search
......
......@@ -48,7 +48,7 @@ set show_hidden_bookmarks true
# Which colorscheme to use? These colorschemes are available by default:
# default, jungle, snow
set colorscheme jungle
set colorscheme default
# Preview files on the rightmost column?
# And collapse (shrink) the last column if there is nothing to preview?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment