Compare commits
33 Commits
977e27cdf8
...
73d76e8cee
| Author | SHA1 | Date | |
|---|---|---|---|
| 73d76e8cee | |||
| e0f22f25cf | |||
| f76cac70eb | |||
| 270338f6d3 | |||
| 9edf260607 | |||
| 512599d8d7 | |||
| 7f28c1c13f | |||
| e1869dcbc3 | |||
| f5ea4d4c13 | |||
| c3580ea62a | |||
| edb02ef94b | |||
| 53b29759e8 | |||
| a95d62b7e8 | |||
| bf90b5fbe9 | |||
| 9edbed2349 | |||
| 95fc836b55 | |||
| 51457299a9 | |||
| ad532f260f | |||
| 5ffcbbffcc | |||
| 0794c045fb | |||
| 7fcc30a7c7 | |||
| 8a4b46d38d | |||
| 1c36fc4f5d | |||
| ff8b03f04d | |||
| ec87546913 | |||
| a1f90c79d6 | |||
| 399fae9c2b | |||
| 9538406245 | |||
| 90e7cbe7c6 | |||
| fd727586f9 | |||
| 1c42f46fbc | |||
| 86027c1564 | |||
| 78d758b8fb |
@@ -16,7 +16,7 @@ theme.bg_minimize = "#454f54" -- hsl(200 10% 30%)
|
||||
theme.bg_systray = theme.bg_normal
|
||||
theme.tasklist_bg_focus = "#1c3b4a" -- hsl(200 45% 20%)
|
||||
|
||||
theme.fg_normal = "#73848c" -- hsl(200 10% 50%)
|
||||
theme.fg_normal = "#8f9ca3" -- hsl(200 10% 60%)
|
||||
theme.fg_focus = "#abb5ba" -- hsl(200 10% 70%)
|
||||
theme.fg_urgent = theme.bg_focus
|
||||
theme.fg_minimize = theme.fg_normal
|
||||
|
||||
@@ -16,7 +16,7 @@ theme.bg_minimize = "#8596ad" -- hsl(214 20% 60%)
|
||||
theme.bg_systray = theme.bg_normal
|
||||
theme.tasklist_bg_focus = "#a6c7f2" -- hsl(214 75% 80%)
|
||||
|
||||
theme.fg_normal = "#a9bcd6" -- hsl(214 35% 75%)
|
||||
theme.fg_normal = "#8f9ca3" -- hsl(200 10% 60%)
|
||||
theme.fg_focus = "#454b54" -- hsl(214 10% 30%)
|
||||
theme.fg_urgent = "#70675c" -- hsl(34 10% 40%)
|
||||
theme.fg_minimize = "#70675c" -- hsl(34 10% 40%)
|
||||
|
||||
@@ -16,7 +16,17 @@ tn() {
|
||||
if [ $# -eq 0 ]; then
|
||||
tmux new
|
||||
else
|
||||
tmux new -s "$@"
|
||||
tmux new -A -s "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
tni() {
|
||||
DIR=$(zoxide query -l | vis-menu -p 'Dir:' -l 10)
|
||||
if [ -n "$DIR" ]; then
|
||||
NAME=$(echo | vis-menu -p 'Session name:' $(basename $DIR))
|
||||
if [ -n "$DIR" ]; then
|
||||
tmux new -A -s "$NAME" -c "$DIR"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -28,6 +38,13 @@ ta() {
|
||||
fi
|
||||
}
|
||||
|
||||
tai() {
|
||||
NAME=$(tmux ls | vis-menu -p 'Session:' -l 10 | cut -d: -f1)
|
||||
if [ -n "$NAME" ]; then
|
||||
tmux attach -t "$NAME"
|
||||
fi
|
||||
}
|
||||
|
||||
vf() {
|
||||
vis "+fzf-files auto-files '$1'"
|
||||
}
|
||||
|
||||
@@ -35,5 +35,7 @@ if [[ -z "$DISPLAY" && -z "$WAYLAND_DISPLAY" && "$XDG_VTNR" -eq 1 ]]; then
|
||||
exec river
|
||||
elif which /usr/bin/sx > /dev/null; then
|
||||
exec /usr/bin/sx ~/.xsession
|
||||
elif which /usr/bin/startx > /dev/null; then
|
||||
exec /usr/bin/startx
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/home/lupan/dotfiles/Makefile:23:22: (PREFIX): make -C dwm install PREFIX="${HOME}/.local"
|
||||
/home/lupan/dotfiles/Makefile:41:15: (clock): install-lupan-clock:
|
||||
@@ -118,7 +118,7 @@ end)
|
||||
local function search(cmd, action)
|
||||
if action == nil then
|
||||
action = function(out)
|
||||
if (out:find('\n') or #s) == #s then
|
||||
if (out:find('\n') or #out) == #out then
|
||||
open_file_pos(out, 'e')
|
||||
else
|
||||
vis:message(out)
|
||||
@@ -274,6 +274,8 @@ vis.events.subscribe(vis.events.INIT, function()
|
||||
|
||||
vis:map(vis.modes.NORMAL, ' s', '<vis-prompt-show>fzf-files auto-search<Enter>', 'fzf: search')
|
||||
vis:map(vis.modes.NORMAL, ' f', '<vis-prompt-show>fzf-files auto-files<Enter>', 'fzf: files')
|
||||
vis:map(vis.modes.NORMAL, ' S', '<vis-prompt-show>fzf-files search<Enter>', 'fzf: search with rg')
|
||||
vis:map(vis.modes.NORMAL, ' F', '<vis-prompt-show>fzf-files files<Enter>', 'fzf: files with fd')
|
||||
|
||||
vis:map(vis.modes.NORMAL, ' /', function()
|
||||
search(fzf_reload(ripgrep .. ' --with-filename {q} ' .. escape_and_quoted(vis.win.file.path)))
|
||||
@@ -341,16 +343,23 @@ vis.events.subscribe(vis.events.INIT, function()
|
||||
end
|
||||
end, 'lf file manager in current file directory')
|
||||
|
||||
vis:map(vis.modes.NORMAL, ' ma', add_global_mark, 'global marks: add')
|
||||
vis:map(vis.modes.NORMAL, ' m', add_global_mark, 'global marks: add')
|
||||
|
||||
vis:map(vis.modes.NORMAL, ' mj', function()
|
||||
vis:map(vis.modes.NORMAL, ' M', function()
|
||||
search('cat ~/.config/vis/global-marks.txt | fzf --tac')
|
||||
end, 'global marks: jump')
|
||||
|
||||
vis:map(vis.modes.NORMAL, ' me', function()
|
||||
vis:map(vis.modes.NORMAL, ' em', function()
|
||||
vis:command('o ~/.config/vis/global-marks.txt')
|
||||
end, 'global marks: edit')
|
||||
|
||||
vis:map(vis.modes.NORMAL, ' n', function()
|
||||
vis:command('o ~/notes/notes.md')
|
||||
end, 'add note')
|
||||
|
||||
vis:map(vis.modes.NORMAL, ' N', function()
|
||||
search(fzf_reload(ripgrep .. ' --with-filename {q} ~/notes'))
|
||||
end, 'search notes')
|
||||
|
||||
vis:map(vis.modes.NORMAL, ' td', function()
|
||||
vis:command('set theme lupan-dark')
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||
THEME="$1"
|
||||
|
||||
XSET=$(readlink -e ~/.config/xsettingsd/xsettingsd.conf)
|
||||
if [ "$THEME" = "toggle" ]; then
|
||||
if grep Materia-dark ~/.config/xsettingsd/xsettingsd.conf > /dev/null; then
|
||||
if grep Materia-dark "$XSET" > /dev/null; then
|
||||
THEME=light
|
||||
else
|
||||
THEME=dark
|
||||
@@ -19,22 +20,25 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f ~/.Xresources ]; then
|
||||
XRES=$(readlink -e ~/.Xresources)
|
||||
if [ -n "$XRES" ]; then
|
||||
if [ "$THEME" = dark ]; then
|
||||
sed -i 's/^#undef THEME_DARK/#define THEME_DARK/' ~/.Xresources
|
||||
sed -i 's/^#undef THEME_DARK/#define THEME_DARK/' "$XRES"
|
||||
elif [ "$THEME" = light ]; then
|
||||
sed -i 's/^#define THEME_DARK/#undef THEME_DARK/' ~/.Xresources
|
||||
sed -i 's/^#define THEME_DARK/#undef THEME_DARK/' "$XRES"
|
||||
fi
|
||||
xrdb -merge ~/.Xresources
|
||||
xrdb -merge "$XRES"
|
||||
killall -USR1 st
|
||||
fi
|
||||
|
||||
# Alacritty
|
||||
if [ -f ~/.config/alacritty/alacritty.yml ]; then
|
||||
sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml
|
||||
AYML=$(readlink -e ~/.config/alacritty/alacritty.yml)
|
||||
if [ -n "$AYML" ]; then
|
||||
sed -i "s/^colors: [*].*/colors: *$THEME/" "$AYML"
|
||||
fi
|
||||
if [ -f ~/.config/alacritty/alacritty.toml ]; then
|
||||
sed -i "s#^import =.*#import = [\"~/.config/alacritty/$THEME.toml\"]#" ~/.config/alacritty/alacritty.toml
|
||||
ATOML=$(readlink -e ~/.config/alacritty/alacritty.toml)
|
||||
if [ -f "$ATOML" ]; then
|
||||
sed -i "s#^import =.*#import = [\"~/.config/alacritty/$THEME.toml\"]#" "$ATOML"
|
||||
fi
|
||||
|
||||
if [ "$THEME" = dark ]; then
|
||||
@@ -44,13 +48,14 @@ elif [ "$THEME" = light ]; then
|
||||
fi
|
||||
|
||||
# GTK
|
||||
if [ -f ~/.config/xsettingsd/xsettingsd.conf ]; then
|
||||
sed -i -E "s#(Net/ThemeName) .*#\\1 \"${GTK_THEME}\"#" ~/.config/xsettingsd/xsettingsd.conf
|
||||
if [ -n "$XSET" ]; then
|
||||
sed -i -E "s#(Net/ThemeName) .*#\\1 \"${GTK_THEME}\"#" "$XSET"
|
||||
pkill -HUP -x xsettingsd
|
||||
gsettings set org.gnome.desktop.interface gtk-theme "${GTK_THEME}"
|
||||
fi
|
||||
|
||||
# waybar
|
||||
if [ -f ~/.config/waybar/style.css ]; then
|
||||
sed -i -E "s#file:///.*/(light|dark)[.]css#file://$HOME/.config/waybar/$THEME.css#" ~/.config/waybar/style.css
|
||||
WCSS=$(readlink -e ~/.config/waybar/style.css)
|
||||
if [ -f "$WCSS" ]; then
|
||||
sed -i -E "s#file:///.*/(light|dark)[.]css#file://$HOME/.config/waybar/$THEME.css#" "$WCSS"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user