vi-like input, theme toggle, Makefile and update README

This commit is contained in:
Łukasz Pankowski 2023-08-03 07:10:12 +02:00
parent b9f9311e8c
commit cbf8c1cd3d
9 changed files with 92 additions and 84 deletions

2
.gitignore vendored
View File

@ -7,3 +7,5 @@ lupan-clock/lupan-clock
lupan-wm/target
*~
__pycache__
/dwm
/st

45
Makefile Normal file
View File

@ -0,0 +1,45 @@
all:
@echo "run: make clone build install"
clone: ~/.local/share/zap dwm st
build: build-dwm build-st build-lupan-clock
install: install-dwm install-st install-lupan-clock install-other
~/.local/share/zap:
mkdir -p ~/.local/share
cd ~/.local/share && \
git clone https://github.com/zap-zsh/zap.git --branch=release-v1
dwm:
git clone https://git.suckless.org/dwm
cp -i patches/dwm/config.h dwm/
build-dwm:
make -C dwm
install-dwm:
make -C dwm install PREFIX="${HOME}/.local"
st:
git clone https://git.suckless.org/st
cd st && \
git remote add lupan.pl https://gitea.lupan.pl/lupan/st.git && \
git fetch lupan.pl && \
git checkout -b patched --track lupan.pl/patched
build-st:
make -C st
install-st:
make -C st install PREFIX="${HOME}/.local"
build-lupan-clock:
make -C lupan-clock
install-lupan-clock:
make -C lupan-clock install PREFIX="${HOME}/.local"
install-other:
stow -Rv shell tmux xsession nvim

View File

@ -1,29 +1,6 @@
Lupan's config files
====================
Screenshots
-----------
Short answer: [screenshots here](https://lupan.pl/lupan-themes/).
My configuration allows to switch between my 6 themes using a shell
script bound to a key stroke (`super + F6` for switching themes in a
cycle and `super + shift + F6` for selecting one with `dmenu`). The
theme is applied to *bspwm*, *Polybar*, *Alacritty*, *Emacs*, and
*Gtk3* (with support for reloading themes in active *Gtk3*
applications, but I currently use only two *Gtk3* themes: one dark and
one light).
You can see the screenshots of my whole workspace with each of the
themes applied on the page describing [my Emacs
themes](https://lupan.pl/lupan-themes/). For the Emacs theme
reloading I use simple helper Emacs function `my-select-theme`
available from [Toggle between dark and light themes with a
key](https://lupan.pl/dotemacs/#toggle-between-dark-and-light-themes-with-a-key)
section of my Emacs config (also available in corresponding [GitHub
repo](https://github.com/lukpank/.emacs.d).
Installation
------------
@ -34,21 +11,16 @@ that you have required programs in your `PATH` with
$ sh check_dependencies.sh
```
For [qtile](http://www.qtile.org/) configuration run
Install font `ttf-firacode-nerd` (https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/FiraCode.zip).
Install `st`, `dwm`, `lupan-clock`, and config files with
```
$ stow -v alacritty xsession qtile music shell tmux
$ make clone build install
```
For [bspwm](https://github.com/baskerville/bspwm) configuration run
Change to `zsh` as your login shell with
```
$ stow -v alacritty xsession bspwm music shell tmux
```
but if you want [i3](https://i3wm.org/) config (left as a fallback)
instead of *qtile* or *bspwm* then *also* run
```
$ stow -v i3
$ chsh -s /usr/bin/zsh
```

View File

@ -1,63 +1,37 @@
#!/bin/sh
echo '# qtile:'
echo '# required:'
for CMD in \
alacritty \
qtile \
emacsclient \
zsh \
git \
cc \
make \
setxkbmap \
slock \
systemctl \
xmodmap \
xrandr \
xrdb \
xset \
xsetroot \
hsetroot \
xsettingsd \
rofi; do
which "$CMD"
done
echo -e '\n# bspwm:'
for CMD in \
alacritty \
bspc \
bspwm \
sed \
pkill \
dmenu \
dmenu_run \
emacsclient \
pkill \
polybar \
polybar-msg \
sed \
setxkbmap \
slock \
sxhkd \
systemctl \
xargs \
xdo \
xmodmap \
xrandr \
xrdb \
xsetroot \
xsettingsd \
xtitle \
xss-lock; do
xss-lock \
exa \
fzf \
; do
which "$CMD"
done
echo -e '\n# bspwm (optional):'
echo -e '\n# optional:'
for CMD in \
firefox \
mpc \
mpd \
pamixer \
sx \
thunderbird \
picom \
compton \
xbacklight; do
which "$CMD"
done
echo -e '\n# shell:'
for CMD in emacsclient zsh; do
which "$CMD"
done

View File

@ -1,2 +1,8 @@
PREFIX = /usr/local
lupan-clock: lupan-clock.c
${CC} -o $@ $< -lX11 -Wall
install:
mkdir -p ${DESTDIR}${PREFIX}/bin
cp -f lupan-clock ${DESTDIR}${PREFIX}/bin

1
shell/.haskeline Normal file
View File

@ -0,0 +1 @@
editMode: Vi

5
shell/.inputrc Normal file
View File

@ -0,0 +1,5 @@
set editing-mode vi
set show-mode-in-prompt on
set vi-ins-mode-string \1\e[6 q\2
set vi-cmd-mode-string \1\e[2 q\2

View File

@ -8,8 +8,8 @@
# for ssh logins, install and configure the libpam-umask package.
#umask 022
export EDITOR=emacsclient
export VISUAL=emacsclient
export EDITOR=nvim
export VISUAL=nvim
# if running bash
if [ -n "$BASH_VERSION" ]; then

View File

@ -2,23 +2,26 @@
THEME="$1"
if [ "$THEME" = "toggle" ] && grep Materia-dark ~/.config/xsettingsd/xsettingsd.conf > /dev/null; then
THEME=light
else
THEME=dark
fi
if [ "$THEME" = dark ]; then
BGCOLOR=#4a4a4a
GTK_THEME=Materia-dark
elif [ "$THEME" = light ]; then
BGCOLOR=#dde1e3
GTK_THEME=Materia-light
elif [ "$THEME" = faff ]; then
BGCOLOR=#4a4a4a
BGCOLOR=#cacaca
GTK_THEME=Materia-light
else
echo "error: unknown theme: should be either dark, light or faff" >&2
echo "error: unknown theme: should be either dark, light or toggle" >&2
exit 1
fi
# Background color
if [ ! -x ~/.fehbg ]; then
xsetroot -solid "$BGCOLOR"
hsetroot -solid "$BGCOLOR"
fi
# Alacritty