Compare commits

..

3 Commits

35 changed files with 497 additions and 2816 deletions

View File

@ -1,36 +0,0 @@
#! /bin/sh
xdo kill $(xdo id -N Polybar)
i=0
monitors=$(bspc query -M --names)
for monitor in $monitors; do
MONITOR="$monitor" polybar panel &
i=$((i + 1))
done
if [ $i -eq 1 ]; then
bspc monitor -d 1 2 3 4 5 6 7 8 9 0
else
monitor1=$(echo $monitors | cut -d ' ' -f 1)
monitor2=$(echo $monitors | cut -d ' ' -f 2)
bspc monitor "$monitor2" -d 1 2 3 4 5 6 7 8 9
bspc monitor "$monitor1" -d 0
bspc monitor "$monitor1" -s "$monitor2"
bspc monitor "$monitor2" -f
fi
bspc config border_width 4
bspc config window_gap 12
sh ~/.config/bspwm/commands.sh theme --set
bspc config split_ratio 0.50
bspc config single_monocle false
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config pointer_follows_focus true
bspc config pointer_follows_monitor true
bspc config focus_follows_pointer true
bspc rule -a Gimp desktop='^8' state=floating follow=on
bspc rule -a jetbrains-studio:sun-awt-X11-XWindowPeer manage=off

View File

@ -1,94 +0,0 @@
#!/bin/sh
THEMES_PATH=~/.config/bspwm/themes
CURRENT_THEME_PATH="${THEMES_PATH}/theme.sh"
DEFAULT_THEME=lupan-dark
FONT='Iosevka Slab Light-12'
BAR_FONT="${FONT};5"
CMD="$1"
shift
# Determine current theme
THEME=
if [ -e "${CURRENT_THEME_PATH}" ]; then
. "${CURRENT_THEME_PATH}"
fi
THEME="${THEME:-$DEFAULT_THEME}"
list_themes() {
( cd "$THEMES_PATH" && ls *-theme.sh | sed 's/-theme.sh$//' | sort )
}
# Select next or named theme
if [ "$CMD" = theme -a "$1" = --next ]; then
NEXT=$(list_themes | grep -A 1 "^${THEME}\$" | tail -1)
if [ "$NEXT" = "$THEME" ]; then
THEME=$(list_themes | head -1)
elif [ "$THEME" = "" ]; then
THEME="${DEFAULT_THEME}"
else
THEME="$NEXT"
fi
elif [ "$CMD" = theme -a "$1" != --set ]; then
if [ "$1" = "" ]; then
exit
elif [ -e "${THEMES_PATH}/$1-theme.sh" ]; then
THEME="$1"
else
THEME="${DEFAULT_THEME}"
fi
fi
# Load theme
THEME_PATH="${THEMES_PATH}/${THEME}-theme.sh"
if [ -e "${THEME_PATH}" ]; then
. "${THEME_PATH}"
else
. "${THEMES_PATH}/${DEFAULT_THEME}-theme.sh"
fi
dmenu() {
command dmenu -nb ${BAR_BG} -nf ${BAR_FG} -sb ${BAR_ACTIVE} -sf ${BAR_FG} -fn "${FONT}" $@
}
dmenu_run() {
command dmenu_run -nb ${BAR_BG} -nf ${BAR_FG} -sb ${BAR_ACTIVE} -sf ${BAR_FG} -fn "${FONT}" $@
}
set_theme() {
echo "THEME=${THEME}" > "${CURRENT_THEME_PATH}"
xrdb -merge <<EOF
polybar.background: ${BAR_BG}
polybar.foreground: ${BAR_FG}
polybar.active: ${BAR_ACTIVE}
polybar.urgent: ${BAR_URGENT}
polybar.empty: ${BAR_EMPTY}
polybar.font: ${BAR_FONT}
EOF
polybar-msg cmd restart
xsetroot -solid "${ROOT_BG}"
bspc config normal_border_color "${NORMAL_BORDER}"
bspc config focused_border_color "${FOCUS_BORDER}"
bspc config presel_feedback_color "${FOCUS_BORDER}"
sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml
sed -i -E "s#(Net/ThemeName) .*#\1 \"${GTK_THEME}\"#" ~/.config/xsettingsd/xsettingsd.conf
pkill -HUP -x xsettingsd
emacsclient --eval "(my-select-theme '${EMACS_THEME})"
}
case "$CMD" in
theme)
set_theme
;;
dmenu|dmenu_run)
"$CMD" "$@"
;;
dmenu_window)
bspc node -f $(xtitle -f '%u %s\n' $(bspc query -N -n .window) \
| dmenu -l 20 -i -p Window: "$@" | cut -f 1 -d ' ')
;;
dmenu_theme)
sh "$0" theme $(list_themes | dmenu -p Theme: "$@")
esac

View File

@ -1,11 +0,0 @@
ROOT_BG=#4c4c4c
BAR_BG=#394d5f
BAR_FG=#9fb3c5
BAR_ACTIVE=#4c677f
BAR_URGENT=#7f4c4c
BAR_EMPTY=#767f88
NORMAL_BORDER=#767f88
FOCUS_BORDER=#9fb3c5
ALACRITTY_THEME=lupan-dark-blue
EMACS_THEME=lupan-dark-blue
GTK_THEME=Materia-dark

View File

@ -1,11 +0,0 @@
ROOT_BG=#4c4c4c
BAR_BG=#394c5f
BAR_FG=#9fb2c5
BAR_ACTIVE=#4c657f
BAR_URGENT=#7f4c4c
BAR_EMPTY=#767f88
NORMAL_BORDER=#767f88
FOCUS_BORDER=#4c657f
ALACRITTY_THEME=lupan-dark-gray
EMACS_THEME=lupan-dark-gray
GTK_THEME=Materia-dark

View File

@ -1,11 +0,0 @@
ROOT_BG=#4c4c4c
BAR_BG=#395f58
BAR_FG=#9fc5be
BAR_ACTIVE=#4c7f75
BAR_URGENT=#7f4c4c
BAR_EMPTY=#768885
NORMAL_BORDER=#768885
FOCUS_BORDER=#9fc5be
ALACRITTY_THEME=lupan-dark
EMACS_THEME=lupan-dark
GTK_THEME=Materia-dark

View File

@ -1,11 +0,0 @@
ROOT_BG=#e5e5e5
BAR_BG=#d8e0b7
BAR_FG=#5a6335
BAR_ACTIVE=#ebefdb
BAR_URGENT=#e0b7b7
BAR_EMPTY=#b0b0b0
NORMAL_BORDER=#b0b0b0
FOCUS_BORDER=#97a559
ALACRITTY_THEME=lupan-light
EMACS_THEME=lupan-light
GTK_THEME=Materia-light

View File

@ -1,11 +0,0 @@
ROOT_BG=#212121
BAR_BG=#455a64
BAR_FG=#f2f6e1
BAR_ACTIVE=#78909c
BAR_URGENT=#ef5350
BAR_EMPTY=#757575
NORMAL_BORDER=#757575
FOCUS_BORDER=#78909c
ALACRITTY_THEME=lupan-material-dark
EMACS_THEME=lupan-material-dark
GTK_THEME=Materia-dark

View File

@ -1,11 +0,0 @@
ROOT_BG=#fafafa
BAR_BG=#cfd8dc
BAR_FG=#424242
BAR_ACTIVE=#eceff1
BAR_URGENT=#ef5350
BAR_EMPTY=#bdbdbd
NORMAL_BORDER=#bdbdbd
FOCUS_BORDER=#b0bec5
ALACRITTY_THEME=lupan-material-light
EMACS_THEME=lupan-material-light
GTK_THEME=Materia-light

View File

@ -1,65 +0,0 @@
[colors]
background = ${xrdb:polybar.background:#1a343a}
foreground = ${xrdb:polybar.foreground:#f2f6e1}
active = ${xrdb:polybar.active:#3585ce}
urgent = ${xrdb:polybar.urgent:#9b0640}
empty = ${xrdb:polybar.empty:#808080}
[bar/panel]
monitor = ${env:MONITOR:}
dpi = ${xrdb:Xft.dpi:160}
modules-left = bspwm xwindow
modules-right = mpd battery date
wm-restack = bspwm
enable-ipc = true
font-0 = ${xrdb:polybar.font:Iosevka-13.5;5}
height = ${xrdb:polybar.height:35}
background = ${colors.background}
foreground = ${colors.foreground}
padding-left = 2
padding-right = 2
module-margin-left = 1
module-margin-right = 1
line-size = 0
[module/bspwm]
type = internal/bspwm
label-focused = %name%
label-occupied = %name%
label-urgent = %name%
label-empty = %name%
label-focused-padding = 1
label-occupied-padding = 1
label-urgent-padding = 1
label-empty-padding = 1
label-focused-background = ${colors.active}
label-urgent-background = ${colors.urgent}
label-empty-foreground = ${colors.empty}
format = <label-state> <label-mode>
label-locked = l
label-marked = m
label-private = p
label-sticky = s
[module/xwindow]
type = internal/xwindow
label = %title%
[module/mpd]
type = internal/mpd
format-online = <label-song>
label-song-maxlen = 70
label-song-ellipsis = true
[module/battery]
type = internal/battery
battery = BAT1
adapter = ACAD
full-at = 98
format-charging-foreground = ${colors.empty}
format-full-foreground = ${colors.empty}
[module/date]
type = internal/date
time = %H:%M
label = %time%

View File

@ -1,169 +0,0 @@
#
# wm independent hotkeys
#
# terminal emulator
super + Return
alacritty
# program launcher
super + @space
sh ~/.config/bspwm/commands.sh dmenu_run
# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd
super + e
emacsclient -n -c
super + semicolon ; {e,f,t}
{emacsclient -n -c,firefox,thunderbird}
super + semicolon ; shift + {h,l,s}
{systemctl hibernate,slock,systemctl suspend}
super + {_,shift + }F6
sh ~/.config/bspwm/commands.sh {theme --next,dmenu_theme}
XF86AudioPlay
mpc toggle
XF86Audio{Lower,Raise}Volume
pamixer -{d,i} 5
XF86AudioMute
pamixer -t
XF86MonBrightness{Down,Up}
xbacklight -{dec,inc} 3
#
# bspwm hotkeys
#
# quit/restart bspwm
super + alt + {q,r}
bspc {quit,wm -r}
# close and kill
super + {_,shift + }w
bspc node -{c,k}
# alternate between the tiled and monocle layout
super + m
bspc desktop -l next
# send the newest marked node to the newest preselected node
super + y
bspc node newest.marked.local -n newest.!automatic.local
# swap the current node and the biggest node on the same desktop
super + g
bspc node -s biggest.tiled.local
#
# state/flags
#
# set the window state
super + {t,shift + t,s,f}
bspc node -t {tiled,pseudo_tiled,floating,'~fullscreen'}
# set the node flags
super + ctrl + {m,x,y,z}
bspc node -g {marked,locked,sticky,private}
#
# focus/swap
#
# focus the node in the given direction
super + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# focus the node for the given path jump
super + {p,b,comma,period}
bspc node -f @{parent,brother,first,second}
# focus the next/previous node in the current desktop
super + {_,shift + }c
bspc node -f {next,prev}.local
# focus the next/previous desktop in the current monitor
super + bracket{left,right}
bspc desktop -f {prev,next}.local
# focus the last node/desktop
super + {grave,Tab}
bspc {node,desktop} -f last
# focus the older or newer node in the focus history
super + {o,i}
bspc wm -h off; \
bspc node {older,newer} -f; \
bspc wm -h on
# focus or send to the given desktop
super + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
# focus window by title
super + shift + @space
sh ~/.config/bspwm/commands.sh dmenu_window
#
# preselect
#
# preselect the direction
super + ctrl + {h,j,k,l}
bspc node -p {west,south,north,east}
# preselect the ratio
super + ctrl + {1-9}
bspc node -o 0.{1-9}
# cancel the preselection for the focused node
super + ctrl + space
bspc node -p cancel
# cancel the preselection for the focused desktop
super + ctrl + shift + space
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
#
# move/resize
#
# expand a window by moving one of its side outward
super + alt + {h,j,k,l}
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
# contract a window by moving one of its side inward
super + alt + shift + {h,j,k,l}
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
# move a floating window
super + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
#
# balance, equlize, rotate, and splitting ratio
#
# balance whole desktop or selected subtree
super + shift + b
if bspc query -N -n 'focused.leaf'; then bspc node @/ -B; else bspc node -B; fi
# equlize whole desktop or selected subtree
super + shift + e
if bspc query -N -n 'focused.leaf'; then bspc node @/ -E; else bspc node -E; fi
# rotate whole desktop or selected subtree
super + {_, ctrl + , shift + }r
A={90,180,270}; if bspc query -N -n 'focused.leaf'; then bspc node @/ -R $A; else bspc node -R $A; fi
# splitting ratio
super + alt + {1-9}
R={1-9}; if bspc query -N -n 'focused.leaf'; then bspc node @/ -r 0.$R; else bspc node -r 0.$R; fi

View File

@ -1,189 +0,0 @@
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Iosevka 30px
set $dmenu_font "Iosevka:pixelsize=30"
set $dmenu_colors -nb '#1a343a' -nf '#a0a0a0' -sb '#3585ce' -sf '#e0e0e0'
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 3
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 3
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Shift+Return exec alacritty
# start new Emacs frame
bindsym $mod+e exec "emacsclient -n -c"
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+p exec dmenu_run -fn $dmenu_font $dmenu_colors
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+Ctrl+h split h
# split in vertical orientation
bindsym $mod+Ctrl+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+Ctrl+s layout stacking
bindsym $mod+Ctrl+w layout tabbed
bindsym $mod+Ctrl+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+Ctrl+a focus parent
# focus the child container
bindsym $mod+Ctrl+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
bindsym $mod+Tab workspace back_and_forth
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
bindsym $mod+Shift+Tab move container to workspace back_and_forth
# reload the configuration file
bindsym $mod+Ctrl+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Ctrl+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Ctrl+End exec "i3-nagbar -t warning -m 'Exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym h resize shrink width 10 px or 2 ppt
bindsym j resize grow height 10 px or 2 ppt
bindsym k resize shrink height 10 px or 2 ppt
bindsym l resize grow width 10 px or 2 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 2 ppt
bindsym Down resize grow height 10 px or 2 ppt
bindsym Up resize shrink height 10 px or 2 ppt
bindsym Right resize grow width 10 px or 2 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym Ctrl+g mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
set $mode_cmd [c st] [F firefox] [s-h hibernate] [s-l lock] [s-s suspend]
mode "$mode_cmd" {
bindsym c exec st; mode "default"
bindsym Shift+f exec "firefox"; mode "default"
bindsym --release $mod+h exec "systemctl hibernate"; mode "default"
bindsym --release $mod+l exec "slock"; mode "default"
bindsym --release $mod+s exec "systemctl suspend"; mode "default"
bindsym Escape mode "default"
bindsym Ctrl+g mode "default"
}
bindsym $mod+semicolon mode "$mode_cmd"
client.focused #29a6da #3585ce #e0e0e0 #6c6aef #3585ce
client.focused_inactive #333333 #5f676a #e0e0e0 #484e50 #5f676a
client.unfocused #333333 #2a5465 #a0a0a0 #292d2e #1a343a
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
position top
status_command i3status
colors {
background #1a343a
inactive_workspace #505050 #1a343a #808080
focused_workspace #29a6da #3585ce #e0e0e0
}
}

View File

@ -1,16 +0,0 @@
general {
output_format = "i3bar"
}
order += "volume master"
order += "tztime local"
volume master {
format = " ♪: %volume "
format_muted = " ♪: muted (%volume) "
device = "pulse:0"
}
tztime local {
format = " %H:%M "
}

965
lupan-wm/Cargo.lock generated
View File

@ -1,965 +0,0 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "anyhow"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800"
[[package]]
name = "anymap"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344"
[[package]]
name = "atty"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi",
"libc",
"winapi",
]
[[package]]
name = "autocfg"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "bitflags"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "cairo-rs"
version = "0.15.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc"
dependencies = [
"bitflags",
"cairo-sys-rs",
"glib",
"libc",
"thiserror",
]
[[package]]
name = "cairo-sys-rs"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8"
dependencies = [
"glib-sys",
"libc",
"system-deps",
]
[[package]]
name = "cfg-expr"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0357a6402b295ca3a86bc148e84df46c02e41f41fef186bda662557ef6328aa"
dependencies = [
"smallvec",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
dependencies = [
"libc",
"num-integer",
"num-traits",
"time",
"winapi",
]
[[package]]
name = "clap"
version = "3.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6f34b09b9ee8c7c7b400fe2f8df39cafc9538b03d6ba7f4ae13e4cb90bfbb7d"
dependencies = [
"atty",
"bitflags",
"clap_derive",
"indexmap",
"lazy_static",
"os_str_bytes",
"strsim",
"termcolor",
"textwrap",
]
[[package]]
name = "clap_derive"
version = "3.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41a0645a430ec9136d2d701e54a95d557de12649a9dd7109ced3187e648ac824"
dependencies = [
"heck 0.4.0",
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "futures-channel"
version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5"
dependencies = [
"futures-core",
]
[[package]]
name = "futures-core"
version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608"
[[package]]
name = "futures-executor"
version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e"
dependencies = [
"futures-core",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-task"
version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366"
[[package]]
name = "futures-util"
version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1"
dependencies = [
"futures-core",
"futures-task",
"pin-project-lite",
"pin-utils",
"slab",
]
[[package]]
name = "gethostname"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e"
dependencies = [
"libc",
"winapi",
]
[[package]]
name = "glib"
version = "0.15.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d"
dependencies = [
"bitflags",
"futures-channel",
"futures-core",
"futures-executor",
"futures-task",
"glib-macros",
"glib-sys",
"gobject-sys",
"libc",
"once_cell",
"smallvec",
"thiserror",
]
[[package]]
name = "glib-macros"
version = "0.15.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25a68131a662b04931e71891fb14aaf65ee4b44d08e8abc10f49e77418c86c64"
dependencies = [
"anyhow",
"heck 0.4.0",
"proc-macro-crate",
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "glib-sys"
version = "0.15.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4"
dependencies = [
"libc",
"system-deps",
]
[[package]]
name = "gobject-sys"
version = "0.15.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a"
dependencies = [
"glib-sys",
"libc",
"system-deps",
]
[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "heck"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c"
dependencies = [
"unicode-segmentation",
]
[[package]]
name = "heck"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
[[package]]
name = "hermit-abi"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
"libc",
]
[[package]]
name = "indexmap"
version = "1.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
dependencies = [
"autocfg",
"hashbrown",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.139"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
[[package]]
name = "log"
version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [
"cfg-if",
]
[[package]]
name = "lupan-wm"
version = "0.1.1"
dependencies = [
"clap",
"penrose",
"penrose_ui",
"simplelog",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "matchers"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
dependencies = [
"regex-automata",
]
[[package]]
name = "memchr"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
[[package]]
name = "memoffset"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
dependencies = [
"autocfg",
]
[[package]]
name = "nix"
version = "0.24.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069"
dependencies = [
"bitflags",
"cfg-if",
"libc",
"memoffset",
]
[[package]]
name = "nix"
version = "0.25.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4"
dependencies = [
"autocfg",
"bitflags",
"cfg-if",
"libc",
"memoffset",
"pin-utils",
]
[[package]]
name = "nom8"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8"
dependencies = [
"memchr",
]
[[package]]
name = "nu-ansi-term"
version = "0.46.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
dependencies = [
"overload",
"winapi",
]
[[package]]
name = "num-integer"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
dependencies = [
"autocfg",
"num-traits",
]
[[package]]
name = "num-traits"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
dependencies = [
"autocfg",
]
[[package]]
name = "once_cell"
version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]]
name = "os_str_bytes"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"
dependencies = [
"memchr",
]
[[package]]
name = "overload"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
[[package]]
name = "pango"
version = "0.15.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f"
dependencies = [
"bitflags",
"glib",
"libc",
"once_cell",
"pango-sys",
]
[[package]]
name = "pango-sys"
version = "0.15.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa"
dependencies = [
"glib-sys",
"gobject-sys",
"libc",
"system-deps",
]
[[package]]
name = "pangocairo"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7876a45c1f1d1a75a2601dc6d9ef2cb5a8be0e3d76f909d82450759929035366"
dependencies = [
"bitflags",
"cairo-rs",
"glib",
"libc",
"pango",
"pangocairo-sys",
]
[[package]]
name = "pangocairo-sys"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78cf746594916c81d5f739af9335c5f55a1f4606d80b3e1d821f18cf95a29494"
dependencies = [
"cairo-sys-rs",
"glib-sys",
"libc",
"pango-sys",
"system-deps",
]
[[package]]
name = "penrose"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e93c99e05bb9926a036cd391570dd142dc8d6522edc7b290c9e86beacf7e799"
dependencies = [
"anymap",
"bitflags",
"nix 0.25.1",
"penrose_keysyms",
"strum 0.24.1",
"strum_macros 0.24.3",
"thiserror",
"tracing",
"x11rb",
]
[[package]]
name = "penrose_keysyms"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a574df0fe3d7e0bb1fd297dd722d8aea8ea33a734d862451509814062bec2d6"
dependencies = [
"strum 0.20.0",
"strum_macros 0.20.1",
]
[[package]]
name = "penrose_ui"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "540c877ce9894a5c23a4aa9a21f2a061c22de530e47bbc4ac548e7a2acb30b7d"
dependencies = [
"cairo-rs",
"pango",
"pangocairo",
"penrose",
"thiserror",
"tracing",
"x11rb",
]
[[package]]
name = "pin-project-lite"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"
[[package]]
name = "pin-utils"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "pkg-config"
version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"
[[package]]
name = "proc-macro-crate"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66618389e4ec1c7afe67d51a9bf34ff9236480f8d51e7489b7d5ab0303c13f34"
dependencies = [
"once_cell",
"toml_edit",
]
[[package]]
name = "proc-macro-error"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote",
"syn",
"version_check",
]
[[package]]
name = "proc-macro-error-attr"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2",
"quote",
"version_check",
]
[[package]]
name = "proc-macro2"
version = "1.0.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
dependencies = [
"proc-macro2",
]
[[package]]
name = "regex"
version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
dependencies = [
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
dependencies = [
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.6.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
[[package]]
name = "rustversion"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
[[package]]
name = "serde"
version = "1.0.152"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
[[package]]
name = "sharded-slab"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31"
dependencies = [
"lazy_static",
]
[[package]]
name = "simplelog"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b2736f58087298a448859961d3f4a0850b832e72619d75adc69da7993c2cd3c"
dependencies = [
"chrono",
"log",
"termcolor",
]
[[package]]
name = "slab"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef"
dependencies = [
"autocfg",
]
[[package]]
name = "smallvec"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
[[package]]
name = "strsim"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "strum"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5c"
dependencies = [
"strum_macros 0.20.1",
]
[[package]]
name = "strum"
version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f"
dependencies = [
"strum_macros 0.24.3",
]
[[package]]
name = "strum_macros"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149"
dependencies = [
"heck 0.3.3",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "strum_macros"
version = "0.24.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59"
dependencies = [
"heck 0.4.0",
"proc-macro2",
"quote",
"rustversion",
"syn",
]
[[package]]
name = "syn"
version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "system-deps"
version = "6.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2955b1fe31e1fa2fbd1976b71cc69a606d7d4da16f6de3333d0c92d51419aeff"
dependencies = [
"cfg-expr",
"heck 0.4.0",
"pkg-config",
"toml",
"version-compare",
]
[[package]]
name = "termcolor"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
dependencies = [
"winapi-util",
]
[[package]]
name = "textwrap"
version = "0.14.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80"
[[package]]
name = "thiserror"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "thread_local"
version = "1.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152"
dependencies = [
"cfg-if",
"once_cell",
]
[[package]]
name = "time"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
dependencies = [
"libc",
"wasi",
"winapi",
]
[[package]]
name = "toml"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
dependencies = [
"serde",
]
[[package]]
name = "toml_datetime"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5"
[[package]]
name = "toml_edit"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56c59d8dd7d0dcbc6428bf7aa2f0e823e26e43b3c9aca15bbc9475d23e5fa12b"
dependencies = [
"indexmap",
"nom8",
"toml_datetime",
]
[[package]]
name = "tracing"
version = "0.1.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
dependencies = [
"cfg-if",
"log",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
]
[[package]]
name = "tracing-attributes"
version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "tracing-core"
version = "0.1.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a"
dependencies = [
"once_cell",
"valuable",
]
[[package]]
name = "tracing-log"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922"
dependencies = [
"lazy_static",
"log",
"tracing-core",
]
[[package]]
name = "tracing-subscriber"
version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70"
dependencies = [
"matchers",
"nu-ansi-term",
"once_cell",
"regex",
"sharded-slab",
"smallvec",
"thread_local",
"tracing",
"tracing-core",
"tracing-log",
]
[[package]]
name = "unicode-ident"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
[[package]]
name = "unicode-segmentation"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b"
[[package]]
name = "valuable"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
[[package]]
name = "version-compare"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29"
[[package]]
name = "version_check"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
[[package]]
name = "wasi"
version = "0.10.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
"winapi",
]
[[package]]
name = "winapi-wsapoll"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e"
dependencies = [
"winapi",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "x11rb"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "592b4883219f345e712b3209c62654ebda0bb50887f330cbd018d0f654bfd507"
dependencies = [
"gethostname",
"libc",
"nix 0.24.3",
"winapi",
"winapi-wsapoll",
"x11rb-protocol",
]
[[package]]
name = "x11rb-protocol"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56b245751c0ac9db0e006dc812031482784e434630205a93c73cfefcaabeac67"
dependencies = [
"nix 0.24.3",
]

View File

@ -1,12 +0,0 @@
[package]
name = "lupan-wm"
version = "0.1.1"
edition = "2021"
[dependencies]
clap = { version = "3.0.5", features = ["derive"] }
penrose = "0.3.1"
penrose_ui = "0.1.1"
simplelog = "0.8"
tracing = { version = "0.1.37", features = ["attributes", "log"] }
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }

View File

@ -1,184 +0,0 @@
use clap::Parser;
use penrose::{
builtin::{
actions::{exit, log_current_state, modify_with, send_layout_message, spawn, key_handler},
layout::{
messages::{ExpandMain, IncMain, ShrinkMain},
transformers::{Gaps, ReserveTop},
MainAndStack, Monocle,
},
},
core::{
bindings::{parse_keybindings_with_xmodmap, KeyEventHandler},
layout::LayoutStack,
Config, WindowManager,
},
extensions::{hooks::add_ewmh_hooks, actions::focus_or_spawn},
extensions::actions::toggle_fullscreen,
map, stack,
x11rb::RustConn,
Result,
util
};
use penrose_ui::{bar::Position, core::TextStyle, status_bar};
use std::collections::HashMap;
use tracing_subscriber::{self, prelude::*};
const FONT: &str = "Iosevka Slab Light";
const FONT_SIZE: i32 = 20;
const BLACK: u32 = 0x282828ff;
const WHITE: u32 = 0x7dd3fcff;
const GREY: u32 = 0x94a3b8ff;
const BLUE: u32 = 0x0c4a6eff;
const FOCUSED_BORDER: u32 = 0xd97706ff;
const NORMAL_BORDER: u32 = 0x64748ff;
const MAX_MAIN: u32 = 1;
const RATIO: f32 = 0.6;
const RATIO_STEP: f32 = 0.05;
const OUTER_PX: u32 = 5;
const INNER_PX: u32 = 5;
const TERMINAL: &str = "alacritty";
const EDITOR: &str = "emacsclient -c -n";
const SUSPEND: &str = "systemctl suspend";
const LOCK: &str = "slock";
const SET_THEME: &str = "lupan-set-theme";
const DMENU_ARGS: &[&str] = &["-fn", "Iosevka Slab Light"];
fn raw_key_bindings() -> HashMap<String, Box<dyn KeyEventHandler<RustConn>>> {
let mut theme = "dark";
let mut raw_bindings = map! {
map_keys: |k: &str| k.to_owned();
"M-j" => modify_with(|cs| cs.focus_down()),
"M-k" => modify_with(|cs| cs.focus_up()),
"M-S-j" => modify_with(|cs| cs.swap_down()),
"M-S-k" => modify_with(|cs| cs.swap_up()),
"M-S-c" => modify_with(|cs| cs.kill_focused()),
"M-a" => modify_with(|cs| cs.toggle_tag()),
"M-f" => toggle_fullscreen(),
"M-Return" => modify_with(|cs| cs.swap_focus_and_head()),
"M-m" => modify_with(|cs| cs.focus_head()),
"M-bracketright" => modify_with(|cs| cs.next_screen()),
"M-bracketleft" => modify_with(|cs| cs.previous_screen()),
"M-S-bracketright" => modify_with(|cs| {
let current_tag = cs.current_tag().to_string();
cs.next_screen();
cs.pull_tag_to_screen(current_tag);
}),
"M-S-bracketleft" => modify_with(|cs| {
let current_tag = cs.current_tag().to_string();
cs.previous_screen();
cs.pull_tag_to_screen(current_tag);
}),
"M-grave" => modify_with(|cs| cs.next_layout()),
"M-S-grave" => modify_with(|cs| cs.previous_layout()),
"M-comma" => send_layout_message(|| IncMain(1)),
"M-period" => send_layout_message(|| IncMain(-1)),
"M-l" => send_layout_message(|| ExpandMain),
"M-h" => send_layout_message(|| ShrinkMain),
"M-p" => key_handler(move |_, _| util::spawn_with_args("dmenu_run", DMENU_ARGS)),
"M-S-p" => spawn("rofi -theme Arc-Dark -show combi"),
"M-S-e" => spawn(EDITOR),
"M-S-s" => log_current_state(),
"M-S-Return" => spawn(TERMINAL),
"C-M-f" => focus_or_spawn("firefox", "firefox"),
"C-M-l" => spawn(LOCK),
"C-M-s" => spawn(SUSPEND),
"C-M-t" => focus_or_spawn("thunderbird", "thunderbird"),
"M-S-q" => exit(),
"M-i" => modify_with(|cs| cs.current_tag().parse::<i32>().map_or((), |i| cs.focus_tag((i - 1).to_string()))),
"M-o" => modify_with(|cs| cs.current_tag().parse::<i32>().map_or((), |i| cs.focus_tag((i + 1).to_string()))),
"M-S-i" => modify_with(|cs| cs.current_tag().parse::<i32>().map_or((), |i| cs.move_focused_to_tag((i - 1).to_string()))),
"M-S-o" => modify_with(|cs| cs.current_tag().parse::<i32>().map_or((), |i| cs.move_focused_to_tag((i + 1).to_string()))),
"M-C-i" => modify_with(|cs| cs.current_tag().parse::<i32>().map_or((), |i| cs.pull_tag_to_screen((i - 1).to_string()))),
"M-C-o" => modify_with(|cs| cs.current_tag().parse::<i32>().map_or((), |i| cs.pull_tag_to_screen((i + 1).to_string()))),
// Switch theme
"M-S-F6" => key_handler(move |_, _| {
theme = if theme == "dark" { "light" } else { "dark" };
util::spawn(format!("{} {}", SET_THEME, theme))
}),
};
for tag in &["1", "2", "3", "4", "5", "6", "7", "8", "9"] {
raw_bindings.extend([
(
format!("M-{tag}"),
modify_with(move |client_set| client_set.focus_tag(tag)),
),
(
format!("M-S-{tag}"),
modify_with(move |client_set| client_set.move_focused_to_tag(tag)),
),
(
format!("M-C-{tag}"),
modify_with(move |client_set| client_set.pull_tag_to_screen(tag)),
),
]);
}
raw_bindings
}
fn layouts(bar_height_px: u32) -> LayoutStack {
stack!(
MainAndStack::side(MAX_MAIN, RATIO, RATIO_STEP),
MainAndStack::side_mirrored(MAX_MAIN, RATIO, RATIO_STEP),
MainAndStack::bottom(MAX_MAIN, RATIO, RATIO_STEP),
Monocle::boxed()
)
.map(|layout| ReserveTop::wrap(Gaps::wrap(layout, OUTER_PX, INNER_PX), bar_height_px))
}
#[derive(Parser, Debug)]
#[clap(about, version, author)]
struct Args {
/// Font name
#[clap(short, long, default_value_t = FONT.to_string())]
font: String,
/// Font size
#[clap(short = 's', long, default_value_t = FONT_SIZE)]
font_size: i32,
}
fn main() -> Result<()> {
let args = Args::parse();
tracing_subscriber::fmt()
.with_env_filter("debug")
.finish()
.init();
let bar_height_px = 2 * args.font_size as u32;
let config = add_ewmh_hooks(Config {
default_layouts: layouts(bar_height_px),
normal_border: NORMAL_BORDER.into(),
focused_border: FOCUSED_BORDER.into(),
..Config::default()
});
let conn = RustConn::new()?;
let key_bindings = parse_keybindings_with_xmodmap(raw_key_bindings())?;
let style = TextStyle {
font: FONT.to_string(),
point_size: args.font_size,
fg: WHITE.into(),
bg: Some(BLACK.into()),
padding: (2.0, 2.0),
};
let bar = status_bar(bar_height_px, &style, BLUE, GREY, Position::Top).unwrap();
let wm = bar.add_to(WindowManager::new(
config,
key_bindings,
HashMap::new(),
conn,
)?);
wm.run()
}

View File

@ -0,0 +1,122 @@
-- [[ Configure LSP ]]
-- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr)
local nmap = function(keys, func, desc)
if desc then
desc = 'LSP: ' .. desc
end
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
end
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
-- See `:help K` for why this keymap
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
-- Lesser used LSP functionality
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
nmap('<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, '[W]orkspace [L]ist Folders')
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, { desc = 'Format current buffer with LSP' })
end
-- Enable the following language servers. They will automatically be installed.
local servers = {
clangd = {},
gopls = {},
-- pyright = {},
rust_analyzer = {},
tsserver = {},
lua_ls = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
}
-- Setup neovim lua configuration
require('neodev').setup()
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
-- Ensure the servers above are installed
local mason_lspconfig = require 'mason-lspconfig'
mason_lspconfig.setup {
ensure_installed = vim.tbl_keys(servers),
}
mason_lspconfig.setup_handlers {
function(server_name)
require('lspconfig')[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
}
end,
}
-- [[ Configure nvim-cmp ]]
-- See `:help cmp`
local cmp = require 'cmp'
local luasnip = require 'luasnip'
require('luasnip.loaders.from_vscode').lazy_load()
luasnip.config.setup {}
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert {
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
},
}

View File

@ -0,0 +1,20 @@
pcall(require('telescope').load_extension, 'fzf')
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader><space>', builtin.buffers, { desc = '[ ] Find existing buffers' })
vim.keymap.set('n', '<leader>?', builtin.oldfiles, { desc = '[?] Find recently opened buffers' })
vim.keymap.set('n', '<leader>/', function()
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown { previewer = false })
end, { desc = '[?] Find recently opened buffers' })
vim.keymap.set('n', '<leader>gf', builtin.git_files, { desc = '[G]it [f]iles' })
vim.keymap.set('n', '<leader>gs', builtin.git_status, { desc = '[G]it [s]tatus' })
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = '[F]ind [f]iles' })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = '[F]ind [g]rep' })
vim.keymap.set('n', '<leader>fw', builtin.grep_string, { desc = '[F]ind [w]ord' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = '[F]ind [h]elp (tags)' })
vim.keymap.set('n', '<leader>fd', builtin.diagnostics, { desc = '[F]ind [d]iagnostics' })
vim.keymap.set('n', '<leader>fF', function()
builtin.find_files { hidden = true }
end, { desc = '[F]find [F]iles (with hidden)' })

View File

@ -0,0 +1,30 @@
print('lsp')
local lsp = require('lsp-zero').preset({})
lsp.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings
-- to learn the available actions
lsp.default_keymaps({buffer = bufnr})
end)
lsp.setup()
-- You need to setup `cmp` after lsp-zero
local cmp = require('cmp')
local cmp_action = require('lsp-zero').cmp_action()
cmp.setup({
mapping = {
-- `Enter` key to confirm completion
-- ['<CR>'] = cmp.mapping.confirm({select = false}),
-- Ctrl+Space to trigger completion menu
['<C-Space>'] = cmp.mapping.complete(),
-- Navigate between snippet placeholder
['<C-f>'] = cmp_action.luasnip_jump_forward(),
['<C-b>'] = cmp_action.luasnip_jump_backward(),
}
})

View File

@ -0,0 +1,70 @@
local org = require('orgmode')
org.setup_ts_grammar()
require('nvim-treesitter.configs').setup {
ensure_installed = { 'c', 'cpp', 'go', 'haskell', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' },
auto_install = false,
highlight = {
enable = true,
additional_vim_regex_highlighting = { 'org' },
},
ensure_installed = { 'org' }, -- Or run :TSUpdate org
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
scope_incremental = '<c-s>',
node_decremental = '<C-p>',
},
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
swap = {
enable = true,
swap_next = {
['<leader>a'] = '@parameter.inner',
},
swap_previous = {
['<leader>A'] = '@parameter.inner',
},
},
},
}
org.setup({
org_agenda_files = { '~/org/*.org' },
org_default_notes_file = '~/org/capture.org',
})

View File

@ -0,0 +1 @@
vim.keymap.set('n', '<leader>gg', ':Git grep ')

View File

@ -1,518 +1 @@
-- Set <space> as the leader key (must be before plugins)
-- See `:help mapleader`
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Disable netrw: suggested for neovim-tree
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- Install package manager (`:help lazy.nvim.txt`)
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
}
end
vim.opt.rtp:prepend(lazypath)
-- Install and configure packages
require('lazy').setup({
-- Git related plugins
'tpope/vim-fugitive',
'tpope/vim-rhubarb',
-- Detect tabstop and shiftwidth automatically
'tpope/vim-sleuth',
{
-- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
dependencies = {
-- Automatically install LSPs to stdpath for neovim
{ 'williamboman/mason.nvim', config = true },
'williamboman/mason-lspconfig.nvim',
-- Useful status updates for LSP
{ 'j-hui/fidget.nvim', tag = 'legacy', opts = {} },
-- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim',
},
},
{
-- Autocompletion
'hrsh7th/nvim-cmp',
dependencies = {
-- Snippet Engine & its associated nvim-cmp source
'L3MON4D3/LuaSnip',
'saadparwaiz1/cmp_luasnip',
-- Adds LSP completion capabilities
'hrsh7th/cmp-nvim-lsp',
-- Adds a number of user-friendly snippets
'rafamadriz/friendly-snippets',
},
},
-- Useful plugin to show you pending keybinds.
{ 'folke/which-key.nvim', opts = {} },
{
-- Adds git releated signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
opts = {
-- See `:help gitsigns.txt`
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
on_attach = function(bufnr)
vim.keymap.set('n', '<leader>gp', require('gitsigns').prev_hunk,
{ buffer = bufnr, desc = '[G]o to [P]revious Hunk' })
vim.keymap.set('n', '<leader>gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' })
vim.keymap.set('n', '<leader>ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' })
vim.keymap.set('n', '<leader>sh', require('gitsigns').stage_hunk, { buffer = bufnr, desc = '[S]tage [H]unk' })
end,
},
},
{
"folke/tokyonight.nvim",
priority = 1000,
config = function()
vim.cmd.colorscheme 'tokyonight'
end
},
{
-- Set lualine as statusline
'nvim-lualine/lualine.nvim',
-- See `:help lualine.txt`
opts = {
options = {
icons_enabled = false,
theme = 'tokyonight',
component_separators = '|',
section_separators = '',
},
},
},
{
-- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help indent_blankline.txt`
opts = {
char = '',
show_trailing_blankline_indent = false,
},
},
-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} },
-- Fuzzy Finder (files, lsp, etc)
{ 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } },
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
-- Only load if `make` is available. Make sure you have the system
-- requirements installed.
{
'nvim-telescope/telescope-fzf-native.nvim',
-- NOTE: If you are having trouble with this installation,
-- refer to the README for telescope-fzf-native for more instructions.
build = 'make',
cond = function()
return vim.fn.executable 'make' == 1
end,
},
{
-- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
},
build = ':TSUpdate',
},
{
'nvim-tree/nvim-tree.lua',
dependencies = {
'nvim-tree/nvim-web-devicons'
},
opts = {
hijack_cursor = true,
view = {
width = 40,
},
},
},
'nvim-orgmode/orgmode',
'norcalli/nvim-colorizer.lua',
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end
},
{
'akinsho/toggleterm.nvim',
version = "*",
opts = {
direction = "float",
open_mapping = [[<C-\>]],
}
}
-- See: https://github.com/folke/lazy.nvim#-structuring-your-plugins
-- { import = 'custom.plugins' },
}, {})
-- [[ Org mode ]]
local org = require('orgmode')
org.setup_ts_grammar()
require('nvim-treesitter.configs').setup {
-- If TS highlights are not enabled at all, or disabled via `disable` prop,
-- highlighting will fallback to default Vim syntax highlighting
highlight = {
enable = true,
-- Required for spellcheck, some LaTex highlights and
-- code block highlights that do not have ts grammar
additional_vim_regex_highlighting = { 'org' },
},
ensure_installed = { 'org' }, -- Or run :TSUpdate org
}
org.setup({
org_agenda_files = { '~/org/*.org' },
org_default_notes_file = '~/org/capture.org',
})
-- [[ Setting options ]]
-- See `:help vim.o`
-- Set highlight on search
vim.o.hlsearch = false
-- Make line numbers default
vim.wo.number = true
-- Enable mouse mode
vim.o.mouse = 'a'
-- Sync clipboard between OS and Neovim.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.o.clipboard = 'unnamedplus'
-- Enable break indent
vim.o.breakindent = true
-- Save undo history
vim.o.undofile = true
-- Case-insensitive searching UNLESS \C or capital in search
vim.o.ignorecase = true
vim.o.smartcase = true
-- Keep signcolumn on by default
vim.wo.signcolumn = 'yes'
-- Decrease update time
vim.o.updatetime = 250
vim.o.timeoutlen = 300
-- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noselect'
-- NOTE: You should make sure your terminal supports this
vim.o.termguicolors = true
-- [[ Basic Keymaps ]]
-- Keymaps for better default experience
-- See `:help vim.keymap.set()`
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
-- Remap for dealing with word wrap
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
vim.keymap.set("n", "<leader>tt", ":NvimTreeToggle<cr>", { desc = "[T]oggle Nvim [T]ree" })
vim.keymap.set("n", "<leader>ct", ":ColorizerToggle<cr>", { desc = "[C]olorizer [T]oggle" })
-- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = '*',
})
-- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()`
require('telescope').setup {
defaults = {
mappings = {
i = {
['<C-u>'] = false,
['<C-d>'] = false,
},
},
},
}
-- Enable telescope fzf native, if installed
pcall(require('telescope').load_extension, 'fzf')
-- See `:help telescope.builtin`
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' })
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to telescope to change theme, layout, etc.
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
winblend = 10,
previewer = false,
})
end, { desc = '[/] Fuzzily search in current buffer' })
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
-- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' },
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
scope_incremental = '<c-s>',
node_decremental = '<M-space>',
},
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
swap = {
enable = true,
swap_next = {
['<leader>a'] = '@parameter.inner',
},
swap_previous = {
['<leader>A'] = '@parameter.inner',
},
},
},
}
-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
-- [[ Configure LSP ]]
-- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr)
local nmap = function(keys, func, desc)
if desc then
desc = 'LSP: ' .. desc
end
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
end
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
-- See `:help K` for why this keymap
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
-- Lesser used LSP functionality
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
nmap('<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, '[W]orkspace [L]ist Folders')
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, { desc = 'Format current buffer with LSP' })
end
-- Enable the following language servers
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
--
-- Add any additional override configuration in the following tables. They will be passed to
-- the `settings` field of the server config. You must look up that documentation yourself.
local servers = {
clangd = {},
gopls = {},
-- pyright = {},
rust_analyzer = {},
tsserver = {},
lua_ls = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
}
-- Setup neovim lua configuration
require('neodev').setup()
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
-- Ensure the servers above are installed
local mason_lspconfig = require 'mason-lspconfig'
mason_lspconfig.setup {
ensure_installed = vim.tbl_keys(servers),
}
mason_lspconfig.setup_handlers {
function(server_name)
require('lspconfig')[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
}
end,
}
-- [[ Configure nvim-cmp ]]
-- See `:help cmp`
local cmp = require 'cmp'
local luasnip = require 'luasnip'
require('luasnip.loaders.from_vscode').lazy_load()
luasnip.config.setup {}
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert {
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {},
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
},
}
vim.cmd('autocmd BufWritePre *.go :Format')
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
require("lupan")

View File

@ -0,0 +1,13 @@
-- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = '*',
})
vim.cmd('autocmd BufWritePre *.go :Format')
vim.cmd('autocmd BufWritePre *.lua :Format')

View File

@ -0,0 +1,5 @@
require("lupan.remap")
require("lupan.lazy")
require("lupan.options")
require("lupan.autocmd")
require("lupan.plugins")

View File

@ -0,0 +1,13 @@
-- Install package manager (`:help lazy.nvim.txt`)
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable',
lazypath,
}
end
vim.opt.rtp:prepend(lazypath)

View File

@ -0,0 +1,41 @@
-- See `:help vim.o`
-- Set highlight on search
vim.o.hlsearch = false
-- Make line numbers default
vim.wo.number = true
vim.wo.relativenumber = true
-- Enable mouse mode
vim.o.mouse = 'a'
-- Sync clipboard between OS and Neovim.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.o.clipboard = 'unnamedplus'
-- Enable break indent
vim.o.breakindent = true
-- Save undo history
vim.o.undofile = true
-- Case-insensitive searching UNLESS \C or capital in search
vim.o.ignorecase = true
vim.o.smartcase = true
-- Keep signcolumn on by default
vim.wo.signcolumn = 'yes'
-- Decrease update time
vim.o.updatetime = 250
vim.o.timeoutlen = 300
-- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noselect'
-- NOTE: You should make sure your terminal supports this
vim.o.termguicolors = true
vim.o.scrolloff = 8

View File

@ -0,0 +1,144 @@
require('lazy').setup({
-- Fuzzy finder
{
'nvim-telescope/telescope.nvim',
branch = '0.1.x',
dependencies = {
'nvim-lua/plenary.nvim' }
},
-- Colorscheme
{
'neanias/everforest-nvim',
priority = 1000,
lazy = false,
config = function()
require("everforest").setup({
background = 'hard',
})
vim.cmd.colorscheme 'everforest'
end
},
{
'nvim-treesitter/nvim-treesitter',
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
'nvim-orgmode/orgmode', -- as configured together
},
build =
':TSUpdate'
},
{
-- Statusline (see `:help lualine.txt`)
'nvim-lualine/lualine.nvim',
opts = {
options = {
icons_enabled = false,
theme = 'everforest',
component_separators = '|',
section_separators = '',
},
},
},
{
-- Indentation guides (see `:help indent_blankline.txt`)
'lukas-reineke/indent-blankline.nvim',
opts = {
char = '',
show_trailing_blankline_indent = false,
},
},
-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} },
'norcalli/nvim-colorizer.lua',
-- Undo browsing
'mbbill/undotree',
-- Git
'tpope/vim-fugitive',
-- Tabstops autodetected
'tpope/vim-sleuth',
{
-- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
dependencies = {
-- Automatically install LSPs to stdpath for neovim
{ 'williamboman/mason.nvim', config = true },
'williamboman/mason-lspconfig.nvim',
-- Useful status updates for LSP
{ 'j-hui/fidget.nvim', tag = 'legacy', opts = {} },
-- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim',
},
},
{
-- Autocompletion
'hrsh7th/nvim-cmp',
dependencies = {
-- Snippet Engine & its associated nvim-cmp source
'L3MON4D3/LuaSnip',
'saadparwaiz1/cmp_luasnip',
-- Adds LSP completion capabilities
'hrsh7th/cmp-nvim-lsp',
-- Adds a number of user-friendly snippets
'rafamadriz/friendly-snippets',
},
},
-- Show pending keybinds
{ 'folke/which-key.nvim', opts = {} },
{
-- Adds git releated signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
opts = {
-- See `:help gitsigns.txt`
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
on_attach = function(bufnr)
vim.keymap.set('n', '<leader>gp', require('gitsigns').prev_hunk,
{ buffer = bufnr, desc = '[G]o to [P]revious Hunk' })
vim.keymap.set('n', '<leader>gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' })
vim.keymap.set('n', '<leader>ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' })
vim.keymap.set('n', '<leader>sh', require('gitsigns').stage_hunk, { buffer = bufnr, desc = '[S]tage [H]unk' })
end,
},
},
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({})
end
},
{
'akinsho/toggleterm.nvim',
version = "*",
opts = {
direction = "float",
open_mapping = [[<C-\>]],
}
}
})

View File

@ -0,0 +1,29 @@
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.keymap.set('v', '<Space>', '<Nop>', { silent = true })
-- Remap for dealing with word wrap
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
vim.keymap.set("n", "<leader>dd", ":Explore<cr>", { desc = "[D]isplay [d]irectory" })
vim.keymap.set("n", "<leader>ct", ":ColorizerToggle<cr>", { desc = "[C]olorizer [t]oggle" })
vim.keymap.set("n", "<leader>ut", ":UndotreeToggle<cr>", { desc = "[U]undotree [t]oggle" })
-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
vim.keymap.set('n', '<leader>N', ':bn<cr>', { desc = '[N]ext buffer' })
vim.keymap.set('n', '<leader>P', ':bp<cr>', { desc = '[P]revious buffer' })
vim.keymap.set('n', '<leader>tc', ':tabnew<cr>', { desc = '[T]ab [c]reate' })
vim.keymap.set('n', '<leader>ts', ':tab split<cr>', { desc = '[T]ab [s]plit' })
vim.keymap.set('n', '<leader>tn', ':tabnext<cr>', { desc = '[T]ab [n]ext' })
vim.keymap.set('n', '<leader>tp', ':tabprevious<cr>', { desc = '[T]ab [p]revious' })
vim.keymap.set('v', 'J', ":m '>+1<cr>gv=gv", { desc = "Move lines down" })
vim.keymap.set('v', 'K', ":m '<-2<cr>gv=gv", { desc = "Move lines up" })

View File

@ -62,6 +62,7 @@ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont,
static const char *termcmd[] = { "st", NULL };
static const char *lockcmd[] = { "slock", NULL };
static const char *suspendcmd[] = { "systemctl", "suspend", NULL };
static const char *toggletheme[] = { "lupan-set-theme", "toggle", NULL };
static const Key keys[] = {
/* modifier key function argument */
@ -69,6 +70,7 @@ static const Key keys[] = {
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY|ControlMask|ShiftMask, XK_l, spawn, {.v = lockcmd } },
{ MODKEY|ControlMask|ShiftMask, XK_s, spawn, {.v = suspendcmd } },
{ MODKEY|ShiftMask, XK_F6, spawn, {.v = toggletheme } },
{ MODKEY|ControlMask, XK_b, togglebar, {0} },
{ MODKEY|ControlMask, XK_j, focusstack, {.i = +1 } },
{ MODKEY|ControlMask, XK_k, focusstack, {.i = -1 } },

View File

@ -1,40 +0,0 @@
# Selected colors from https://windicss.org/utilities/colors.html
colors = {
"sky": {
50: "#f0f9ff",
100: "#e0f2fe",
200: "#bae6fd",
300: "#7dd3fc",
400: "#38bdf8",
500: "#0ea5e9",
600: "#0284c7",
700: "#0369a1",
800: "#075985",
900: "#0c4a6e",
},
"indigo": {
50: "#eef2ff",
100: "#e0e7ff",
200: "#c7d2fe",
300: "#a5b4fc",
400: "#818cf8",
500: "#6366f1",
600: "#4f46e5",
700: "#4338ca",
800: "#3730a3",
900: "#312e81",
},
"blue-gray": {
50: "#f8fafc",
100: "#f1f5f9",
200: "#e2e8f0",
300: "#cbd5e1",
400: "#94a3b8",
500: "#64748b",
600: "#475569",
700: "#334155",
800: "#1e293b",
900: "#0f172a",
}
}

View File

@ -1,177 +0,0 @@
from libqtile import bar, layout, qtile, widget
from libqtile.config import DropDown, Group, Key, KeyChord, ScratchPad, Screen
from libqtile.lazy import lazy
from monitors import list_monitors
from themes import apply_theme, subtheme, theme, toggle_theme
mod = "mod4"
terminal = "alacritty"
hdpi_sizes = dict(size=46, fontsize=26)
hd_sizes = dict(size=32, fontsize=18)
def sizes(monitor):
hdpi = monitor is None or max(monitor.width, monitor.height) > 2000
return hdpi_sizes if hdpi else hd_sizes
widget_defaults = dict(
font="Iosevka Slab Light",
fontsize=hdpi_sizes["fontsize"],
padding=5,
foreground=theme["foreground"],
)
keys = []
group_names = "1234567890"
groups = [Group(name) for name in group_names]
keys.extend([Key([mod], name, lazy.group[name].toscreen(toggle=False), desc=f"Switch to group {name}") for name in group_names])
keys.extend([Key([mod, "shift"], name, lazy.window.togroup(name), desc=f"Move window to group {name}") for name in group_names])
groups.append(
ScratchPad("scratchpad", [
DropDown("term", terminal),
DropDown("thunar", "thunar", on_focus_lost_hide=False),
DropDown("qtile shell", [terminal, '-e', 'qtile', 'shell']),
])
)
keys.extend([
Key([mod], "F1", lazy.group["scratchpad"].dropdown_toggle("term")),
Key([mod], "F2", lazy.group["scratchpad"].dropdown_toggle("thunar")),
Key([mod], "F3", lazy.group["scratchpad"].dropdown_toggle("qtile shell")),
])
floating_layout = layout.Floating(float_rules=[*layout.Floating.default_float_rules],
**subtheme("border_width", "margin", "border_focus", "border_normal"))
layouts = [
layout.Max(),
layout.Columns(**subtheme("border_width", "margin", "border_focus", "border_normal")),
layout.MonadTall(**subtheme("border_width", "margin", "border_focus", "border_normal")),
layout.MonadWide(**subtheme("border_width", "margin", "border_focus", "border_normal")),
layout.Matrix(**subtheme("border_width", "margin", "border_focus", "border_normal")),
layout.Zoomy(columnwidth=200, **subtheme("border_width", "margin", "border_focus", "border_normal")),
]
monitors = {i: m for i, m in enumerate(list_monitors())}
def createBar(monitor=None):
s = sizes(monitor)
return bar.Bar([
widget.Spacer(10),
widget.CurrentLayout(fmt="[{:3.3}]", fontsize=s["fontsize"]),
widget.Spacer(10),
widget.GroupBox(highlight_method='line',
fontsize=s["fontsize"],
margin_y=6,
borderwidth=5,
active=theme["foreground"],
highlight_color=theme["background"],
**subtheme("inactive", "this_current_screen_border", "this_screen_border",
"other_current_screen_border", "other_screen_border")),
widget.Spacer(5),
widget.WindowCount(text_format="({num})", fontsize=s["fontsize"], foreground=theme["inactive"]),
widget.Spacer(10),
widget.WindowName(fontsize=s["fontsize"]),
widget.Spacer(),
widget.WidgetBox(
text_open="",
text_closed="",
widgets=[
widget.Spacer(10),
widget.NetGraph(border_color=theme["inactive"], graph_color=theme["foreground"]),
widget.Spacer(10),
widget.HDDBusyGraph(border_color=theme["inactive"], graph_color=theme["foreground"]),
widget.Spacer(10),
widget.CPUGraph(border_color=theme["inactive"], graph_color=theme["foreground"]),
widget.Spacer(10),
widget.ThermalSensor(fontsize=s["fontsize"]),
]),
widget.Spacer(10),
widget.PulseVolume(fontsize=s["fontsize"]),
widget.Spacer(10),
widget.Clock(fontsize=s["fontsize"]),
widget.Spacer(10),
], s["size"], background=theme["background"])
screens = [Screen(top=createBar(monitors.get(i))) for i in range(4)]
#fake_screens = [Screen(top=createBar(), x=x, y=y, width=1920, height=1080) for x, y in [(0, 0), (1920, 0), (0, 1080), (1920, 1080)]]
keys.extend([
Key([mod, "shift"], "Return", lazy.spawn(terminal), desc="Run terminal "),
Key([mod, "control"], "n", lazy.spawn("emacsclient -n -c"), desc="Open new Emacs frame"),
Key([mod], "p", lazy.spawn(["rofi", "-theme", theme["rofi_theme"], "-kb-row-tab", "", "-show", "run"]),
desc="Run command"),
Key([mod, "shift"], "p", lazy.spawn(["rofi", "-theme", theme["rofi_theme"], "-kb-row-tab", "", "-show", "combi"]),
desc="Run rofi combi"),
Key([mod], "Tab", lazy.next_layout(), desc="Next layout"),
Key([mod, "shift"], "m", lazy.to_layout_index(0), desc="Switch to Max layout"),
Key([mod, "shift"], "c", lazy.to_layout_index(1), desc="Switch to Columns layout"),
Key([mod, "shift"], "t", lazy.to_layout_index(2), desc="Switch to MonadTall layout"),
Key([mod, "shift"], "w", lazy.to_layout_index(3), desc="Switch to MonadWide layout"),
Key([mod, "shift"], "r", lazy.to_layout_index(4), desc="Switch to Matrix layout"),
Key([mod, "shift"], "z", lazy.to_layout_index(5), desc="Switch to Zoomy layout"),
Key([mod], "a", lazy.screen.toggle_group(), desc="Toggle between current and previous group"),
Key([mod], "h", lazy.layout.left(), desc="Focus window on the left of current one"),
Key([mod], "j", lazy.layout.down(), desc="Focus window below of current one"),
Key([mod], "k", lazy.layout.up(), desc="Focus window above of current one"),
Key([mod], "l", lazy.layout.right(), desc="Focus window on the right of current one"),
Key([mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Shuffle current window with the one on the left"),
Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Shuffle current window with the one below"),
Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Shuffle current window with the one above"),
Key([mod, "shift"], "l", lazy.layout.shuffle_right(), desc="Shuffle current window with the one on the right"),
Key([mod, "control"], "h", lazy.layout.grow_left(), desc="Grow current window on its left"),
Key([mod, "control"], "j", lazy.layout.grow_down(), desc="Grow current window on its bottom"),
Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow current window on its top"),
Key([mod, "control"], "l", lazy.layout.grow_right(), desc="Grow current window on its right"),
Key([mod], "Return", lazy.layout.toggle_split(), desc="Toggle split"),
Key([mod, "shift", "control"], "h", lazy.layout.swap_column_left(), desc="Swap column left"),
Key([mod, "shift", "control"], "l", lazy.layout.swap_column_right(), desc="Swap column right"),
Key([mod], "g", lazy.layout.grow(), desc="Grow focused window in monad mode"),
Key([mod], "s", lazy.layout.shrink(), desc="Shrink focused window in monad mode"),
Key([mod], "r", lazy.layout.reset(), desc="Reset main area size"),
Key([mod], "u", lazy.layout.flip(), desc="Flip side of secondary windows"),
Key([mod], "m", lazy.layout.maximize(), desc="Maximize/minimize focused window in monad mode"),
Key([mod], "i", lazy.screen.prev_group(), desc="Switch to prev group"),
Key([mod], "o", lazy.screen.next_group(), desc="Switch to next group"),
Key([mod, "control"], "i", lazy.prev_screen(), desc="Switch to prev screen"),
Key([mod, "control"], "o", lazy.next_screen(), desc="Switch to next screen"),
Key([mod], "x", lazy.window.kill(), desc="Kill focused window"),
Key([mod], "t", lazy.window.toggle_floating(), desc="Toggle window floating"),
Key([mod], "e", lazy.window.toggle_maximize(), desc="Toggle window maximize"),
Key([mod], "n", lazy.layout.normalize(), desc="Normalize layout"),
Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle window fullscreen"),
Key([mod], "y", lazy.window.toggle_minimize(), desc="Minimize focused window in monad mode"),
Key([mod, "shift"], "F6", toggle_theme, desc="Kill focused window"),
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 5%-")),
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set 5%+")),
Key([], "XF86AudioLowerVolume", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -10%")),
Key([], "XF86AudioRaiseVolume", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +10%")),
Key([], "XF86AudioMute", lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")),
KeyChord([mod], "semicolon", [
Key([], "f", lazy.spawn("firefox"), desc="Open Firefox"),
Key([], "n", lazy.spawn("emacsclient -n -c"), desc="Open new Emacs frame"),
Key([], "p", lazy.spawn("pavucontrol"), desc="Open pavucontrol mixer"),
Key([], "t", lazy.spawn("thunderbird"), desc="Open Thunderbird"),
Key(["shift"], "h", lazy.spawn("systemctl hibernate")),
Key(["shift"], "l", lazy.spawn("slock")),
Key(["shift"], "s", lazy.spawn("systemctl suspend")),
]),
Key([mod, "shift"], "q", lazy.shutdown(), desc="Quit qtile"),
Key([mod], "q", lazy.restart(), desc="Restart qtile"),
])
keys.extend([Key([mod, "control"], str(i + 1), lazy.to_screen(i), desc=f"Switch to screen {i}") for i in range(len(screens))])
cursor_warp = True

View File

@ -1,13 +0,0 @@
import re
import subprocess
from collections import namedtuple
Monitor = namedtuple('Monitor', ["name", "width", "height"])
monitor_line = re.compile(r"^ *[0-9]+: +[+*]*([-A-Za-z0-9]+) +([0-9]+)/([0-9]+)x([0-9]+)/([0-9]+)\+([0-9]+)\+([0-9]+) +([-A-Za-z0-9]+)")
def list_monitors():
p = subprocess.run(["xrandr", "--listmonitors"], capture_output=True, encoding='UTF-8')
return [Monitor(name=m.group(1), width=int(m.group(2)), height=int(m.group(4)))
for m in map(monitor_line.match, p.stdout.split('\n'))
if m is not None]

View File

@ -1,70 +0,0 @@
import os
from colors import colors
from libqtile.lazy import lazy
from libqtile import hook, qtile
theme_file = os.path.join(os.path.dirname(__file__), "theme.txt")
def write_theme(name):
with open(theme_file, "w") as f:
f.write(name)
def read_theme(file_name):
try:
with open(file_name) as f:
return f.read().strip()
except FileNotFoundError:
return "dark"
is_dark = read_theme(theme_file) == "dark"
def light_dark(light, dark):
return dark if is_dark else light
@lazy.function
def toggle_theme(qtile):
write_theme(light_dark("dark", "light"))
qtile.restart()
background = light_dark([colors["sky"][600], colors["sky"][700]],
[colors["sky"][800], colors["sky"][900]])
def get_theme():
return dict(
border_width=4,
margin=4,
root_background=light_dark(colors["blue-gray"][300], colors["blue-gray"][800]),
background=background,
foreground=light_dark(colors["blue-gray"][100], colors["blue-gray"][400]),
inactive=light_dark(colors["sky"][100], colors["blue-gray"][500]),
this_current_screen_border=light_dark(colors["sky"][400], colors["indigo"][400]),
this_screen_border=light_dark(colors["blue-gray"][400], colors["blue-gray"][500]),
other_current_screen_border=background,
other_screen_border=background,
border_focus=light_dark(colors["sky"][400], colors["indigo"][600]),
border_normal=light_dark(colors["blue-gray"][600], colors["blue-gray"][700]),
alacritty_theme=light_dark("gogh-nord-light", "gogh-tin"),
emacs_theme=light_dark("solarized-light", "solarized-dark"),
gtk_theme=light_dark("Materia-light", "Materia-dark"),
rofi_theme=light_dark("Arc", "Arc-Dark"),
)
theme = get_theme()
def subtheme(*names):
return {name: theme[name] for name in names}
def apply_theme(qtile):
qtile.cmd_spawn(["xsetroot", "-solid", theme["root_background"]])
qtile.cmd_spawn(["sed", "-i", f"s/^colors: [*].*/colors: *{theme['alacritty_theme']}/",
os.path.expanduser("~/.config/alacritty/alacritty.yml")])
qtile.cmd_spawn(["emacsclient", "--eval", f"(my-select-theme '{theme['emacs_theme']})"])
qtile.cmd_spawn(["sed", "-i", "-E", f"s#(Net/ThemeName) .*#\\1 \"{theme['gtk_theme']}\"#",
os.path.expanduser("~/.config/xsettingsd/xsettingsd.conf")])
qtile.cmd_spawn(["pkill", "-HUP", "-x", "xsettingsd"])
@hook.subscribe.startup
def func():
apply_theme(qtile)

View File

@ -1,79 +0,0 @@
# Workspace
warp_pointer = 1
workspace_limit = 22
# Windows
border_width = 3
color_focus = rgb:0e/74/90
#rgb:26/8b/d2
# rgb:6b/a8/a2
# rgb:2a/a1/98
#
color_unfocus = rgb:00/46/4a
#64/74/8b
tile_gap = 3
# Bar
bar_border[1] = rgb:4a/4a/4a
# rgb:0e/74/90
bar_color[1] = rgb:0c/4a/6e
#rgb:07/36/42
bar_font = Iosevka Slab Light:style=Regular:size=12:antialias=true
bar_font_color[1] = rgb:83/94/96
bar_font_color_selected[1] = black
bar_format = +< +N:+I +S +< %a %R +< +W
bar_border_width = 7
# Launch at start
autorun = ws[9]:firefox
# Programs
program[brightness_dec] = brightnessctl set 5%-
program[brightness_inc] = brightnessctl set 5%+
program[emacs] = emacs
program[emacsclient] = emacsclient -n -c
program[lock] = slock
program[mixer] = pavucontrol
program[suspend] = systemctl suspend
program[term] = alacritty
program[term2] = st
program[theme_dark] = lupan-set-theme dark
program[theme_faff] = lupan-set-theme faff
program[theme_light] = lupan-set-theme light
program[volume_dec] = pactl set-sink-volume @DEFAULT_SINK@ -10%
program[volume_inc] = pactl set-sink-volume @DEFAULT_SINK@ +10%
program[volume_mute] = pactl set-sink-mute @DEFAULT_SINK@ toggle
# Key bindings
modkey = Mod4
bind[brightness_dec] = XF86MonBrightnessDown
bind[brightness_inc] = XF86MonBrightnessUp
bind[emacs] = MOD+Shift+n
bind[emacsclient] = MOD+n
bind[mixer] = MOD+Control+p
bind[suspend] = MOD+Control+s
bind[term2] = MOD+Control+Return
bind[theme_dark] = MOD+Control+d
bind[theme_faff] = MOD+Control+f
bind[theme_light] = MOD+Control+l
bind[volume_dec] = XF86AudioLowerVolume
bind[volume_inc] = XF86AudioRaiseVolume
bind[volume_mute] = XF86AudioMute
bind[ws_prev] = MOD+i
bind[ws_next] = MOD+o
bind[mvrg_prev] = MOD+Shift+i
bind[mvrg_next] = MOD+Shift+o
bind[rg_prev] = MOD+Control+i
bind[rg_next] = MOD+Control+o

View File

@ -1,119 +0,0 @@
(in-package :stumpwm)
(set-prefix-key (kbd "s-s"))
(set-font "-xos4-terminus-medium-r-normal--32-320-72-72-c-160-iso10646-1")
(setf *mouse-focus-policy* :sloppy
*message-window-gravity* :center
*input-window-gravity* :center
*window-border-style* :thin
*time-modeline-string* "%k:%M"
*screen-mode-line-format* "[^B%n^b] %W^>%d")
(when *initializing*
(setf (group-name (current-group)) "1")
(mapc #'gnewbg '("2" "3" "4" "5" "6" "7" "8" "9"))
(gnewbg-float "0"))
(loop for name in '("1" "2" "3" "4" "5" "6" "7" "8" "9" "0")
for shift in '("!" "@" "#" "$" "%" "^" "&" "*" "(" ")")
do (define-key *top-map* (kbd (concat "s-" name)) (concat "gselect " name))
(define-key *top-map* (kbd (concat "s-" shift)) (concat "gmove " name)))
(define-key *root-map* (kbd "c") "exec alacritty")
(define-key *root-map* (kbd "V") "vsplit")
(define-key *root-map* (kbd "e") "exec emacsclient -n -c -a ''")
(define-key *root-map* (kbd "M-e") "emacs")
(define-key *root-map* (kbd "s-l") "exec slock")
(define-key *top-map* (kbd "s-q") "restart-soft")
(define-key *top-map* (kbd "s-Q") "quit-confirm")
(define-key *top-map* (kbd "s-S-RET") "exec alacritty")
(define-key *top-map* (kbd "s-S-F6") "toggle-theme")
(define-key *top-map* (kbd "s-a") "gother")
(define-key *top-map* (kbd "s-b") "mode-line")
(define-key *top-map* (kbd "s-f") "fullscreen")
(define-key *top-map* (kbd "s-i") "gprev")
(define-key *top-map* (kbd "s-o") "gnext")
(define-key *top-map* (kbd "s-I") "gprev-with-window")
(define-key *top-map* (kbd "s-O") "gnext-with-window")
(define-key *top-map* (kbd "s-p") "exec")
(define-key *top-map* (kbd "s-P") "exec rofi -theme Arc-Dark -show combi")
(define-key *top-map* (kbd "s-j") "move-focus down")
(define-key *top-map* (kbd "s-k") "move-focus up")
(define-key *top-map* (kbd "s-h") "move-focus left")
(define-key *top-map* (kbd "s-l") "move-focus right")
(define-key *top-map* (kbd "s-J") "move-window down")
(define-key *top-map* (kbd "s-K") "move-window up")
(define-key *top-map* (kbd "s-H") "move-window left")
(define-key *top-map* (kbd "s-L") "move-window right")
(define-key *top-map* (kbd "s-w") "select-head 0")
(define-key *top-map* (kbd "s-e") "select-head 1")
(define-key *top-map* (kbd "s-r") "select-head 2")
(defpackage :my-stumpwm-config
(:use :cl))
(in-package :my-stumpwm-config)
(stumpwm:defcommand select-head (num) (:rest)
(let ((head (nth (parse-integer num) (stumpwm:screen-heads (stumpwm:current-screen)))))
(stumpwm::focus-frame (stumpwm:current-group)
(car (stumpwm::head-frames (stumpwm:current-group) head)))))
(load "~/quicklisp/setup.lisp")
(ql:quickload :slynk)
(stumpwm:defcommand slynk () ()
(let ((port 4005))
(slynk:create-server :dont-close t :port port)
(stumpwm:echo-string (stumpwm:current-screen) (format nil "Slynk started at port ~D" port))))
(stumpwm:load-module :stumpwm-base16)
(when stumpwm:*initializing*
(stumpwm-base16:load-theme "espresso"))
(dolist (head (stumpwm:screen-heads (stumpwm:current-screen)))
(stumpwm:enable-mode-line (stumpwm:current-screen) head t))
(defparameter *themes* '(:dark (:stumpwm "espresso"
:emacs "dark"
:alacritty "dark"
:gtk "Materia-dark")
:light (:stumpwm "nova"
:emacs "light"
:alacritty "light"
:gtk "Materia-light")))
(defparameter *themes-order* '(:dark :light :light :dark))
(defparameter *theme* :light)
(stumpwm:defcommand toggle-theme () ()
(setf *theme* (getf *themes-order* *theme*))
(let ((theme (getf *themes* *theme*)))
(stumpwm-base16:load-theme (getf theme :stumpwm))
(dolist (head (stumpwm:screen-heads (stumpwm:current-screen)))
(stumpwm:toggle-mode-line (stumpwm:current-screen) head)
(stumpwm:toggle-mode-line (stumpwm:current-screen) head))
(mapc #'stumpwm:run-shell-command
(list (concatenate 'string
"sed -i -E 's#Net/ThemeName .*#Net/ThemeName \""
(getf theme :gtk)
"\"#' ~/.config/xsettingsd/xsettingsd.conf")
"pkill -HUP -x xsettingsd; "
(concatenate 'string
"sed -i 's/^colors: [*].*/colors: *"
(getf theme :alacritty)
"/' ~/.config/alacritty/alacritty.yml; ")
(concatenate 'string
"emacsclient --eval \"(my-select-theme '"
(getf theme :emacs)
")\"")))))
(if stumpwm:*initializing*
(toggle-theme))

View File

@ -2,10 +2,12 @@
THEME="$1"
if [ "$THEME" = "toggle" ] && grep Materia-dark ~/.config/xsettingsd/xsettingsd.conf > /dev/null; then
THEME=light
else
THEME=dark
if [ "$THEME" = "toggle" ]; then
if grep Materia-dark ~/.config/xsettingsd/xsettingsd.conf > /dev/null; then
THEME=light
else
THEME=dark
fi
fi
if [ "$THEME" = dark ]; then