Compare commits
1 Commits
wip
...
ddc98c747c
| Author | SHA1 | Date | |
|---|---|---|---|
| ddc98c747c |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,13 +1,8 @@
|
||||
bspwm/.config/bspwm/themes/theme.sh
|
||||
shell/.config/zsh/plugins/zsh-autosuggestions
|
||||
shell/.config/zsh/plugins/zsh-syntax-highlighting
|
||||
shell/.config/zsh/plugins/zsh-vi-mode
|
||||
qtile/.config/qtile/theme.txt
|
||||
lupan-clock/lupan-clock
|
||||
lupan-wm/target
|
||||
*~
|
||||
__pycache__
|
||||
/dwm
|
||||
/st
|
||||
/vis/.config/vis/plugins/
|
||||
/tools/.local/bin/
|
||||
|
||||
51
Makefile
51
Makefile
@@ -1,51 +0,0 @@
|
||||
all:
|
||||
@echo "run: make clone build install"
|
||||
|
||||
clone: dwm st
|
||||
|
||||
build: build-dwm build-st build-lupan-clock
|
||||
|
||||
install: install-dwm install-st install-lupan-clock install-other
|
||||
|
||||
~/.local/share/zap:
|
||||
mkdir -p ~/.local/share
|
||||
cd ~/.local/share && \
|
||||
git clone https://github.com/zap-zsh/zap.git --branch=release-v1
|
||||
|
||||
dwm:
|
||||
git clone https://git.suckless.org/dwm
|
||||
cd dwm && \
|
||||
git remote add lupan.pl https://gitea.lupan.pl/lupan/dwm.git && \
|
||||
git fetch lupan.pl && \
|
||||
git checkout -b wip --track lupan.pl/wip
|
||||
|
||||
build-dwm:
|
||||
make -C dwm
|
||||
|
||||
install-dwm:
|
||||
make -C dwm install PREFIX="${HOME}/.local/stow/dwm"
|
||||
stow -d ~/.local/stow dwm
|
||||
|
||||
st:
|
||||
git clone https://git.suckless.org/st
|
||||
cd st && \
|
||||
git remote add lupan.pl https://gitea.lupan.pl/lupan/st.git && \
|
||||
git fetch lupan.pl && \
|
||||
git checkout -b patched-4 --track lupan.pl/patched-4
|
||||
|
||||
build-st:
|
||||
make -C st
|
||||
|
||||
install-st:
|
||||
make -C st install PREFIX="${HOME}/.local/stow/st"
|
||||
stow -d ~/.local/stow st
|
||||
|
||||
build-lupan-clock:
|
||||
make -C lupan-clock
|
||||
|
||||
install-lupan-clock:
|
||||
make -C lupan-clock install PREFIX="${HOME}/.local/stow/lupan-clock"
|
||||
stow -d ~/.local/stow lupan-clock
|
||||
|
||||
install-other:
|
||||
stow -Rv lazygit shell tmux nvim vis xsession
|
||||
63
README.md
63
README.md
@@ -1,55 +1,54 @@
|
||||
Lupan's config files
|
||||
====================
|
||||
|
||||
Screenshots
|
||||
-----------
|
||||
|
||||
Short answer: [screenshots here](https://lupan.pl/lupan-themes/).
|
||||
|
||||
My configuration allows to switch between my 6 themes using a shell
|
||||
script bound to a key stroke (`super + F6` for switching themes in a
|
||||
cycle and `super + shift + F6` for selecting one with `dmenu`). The
|
||||
theme is applied to *bspwm*, *Polybar*, *Alacritty*, *Emacs*, and
|
||||
*Gtk3* (with support for reloading themes in active *Gtk3*
|
||||
applications, but I currently use only two *Gtk3* themes: one dark and
|
||||
one light).
|
||||
|
||||
You can see the screenshots of my whole workspace with each of the
|
||||
themes applied on the page describing [my Emacs
|
||||
themes](https://lupan.pl/lupan-themes/). For the Emacs theme
|
||||
reloading I use simple helper Emacs function `my-select-theme`
|
||||
available from [Toggle between dark and light themes with a
|
||||
key](https://lupan.pl/dotemacs/#toggle-between-dark-and-light-themes-with-a-key)
|
||||
section of my Emacs config (also available in corresponding [GitHub
|
||||
repo](https://github.com/lukpank/.emacs.d).
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Install Hyprland
|
||||
----------------
|
||||
|
||||
To reproduce my environment clone this repo into `~/dotfiles` and check
|
||||
that you have required programs in your `PATH` with
|
||||
|
||||
```
|
||||
$ sh check_dependencies.sh hypr
|
||||
$ sh check_dependencies.sh
|
||||
```
|
||||
|
||||
Install font `ttf-firacode-nerd` (https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/FiraCode.zip).
|
||||
|
||||
Install proper configurations with
|
||||
For [qtile](http://www.qtile.org/) configuration run
|
||||
|
||||
```
|
||||
$ stow shell hyprland alacritty xsession nvim yazi
|
||||
$ stow -v alacritty xsession qtile music shell tmux
|
||||
```
|
||||
|
||||
Where `xsession` is just to install `lupan-set-theme` script, `nvim` and `yazi` may be skipped if you do not use them.
|
||||
|
||||
Change to `zsh` as your login shell with
|
||||
For [bspwm](https://github.com/baskerville/bspwm) configuration run
|
||||
|
||||
```
|
||||
$ chsh -s /usr/bin/zsh
|
||||
$ stow -v alacritty xsession bspwm music shell tmux
|
||||
```
|
||||
|
||||
Install DWM (old)
|
||||
-----------------
|
||||
|
||||
To reproduce my environment clone this repo into `~/dotfiles` and check
|
||||
that you have required programs in your `PATH` with
|
||||
but if you want [i3](https://i3wm.org/) config (left as a fallback)
|
||||
instead of *qtile* or *bspwm* then *also* run
|
||||
|
||||
```
|
||||
$ sh check_dependencies.sh dwm
|
||||
```
|
||||
|
||||
Install font `ttf-firacode-nerd` (https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/FiraCode.zip).
|
||||
|
||||
Install `st`, `dwm`, `lupan-clock`, and config files with
|
||||
|
||||
```
|
||||
$ make clone build install
|
||||
```
|
||||
|
||||
Change to `zsh` as your login shell with
|
||||
|
||||
```
|
||||
$ chsh -s /usr/bin/zsh
|
||||
$ stow -v i3
|
||||
```
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
[colors]
|
||||
draw_bold_text_with_bright_colors = false
|
||||
|
||||
[env]
|
||||
TERM = "xterm-256color"
|
||||
|
||||
[font]
|
||||
size = 10
|
||||
|
||||
[font.bold]
|
||||
family = "Fira Code Nerd Font"
|
||||
|
||||
[font.normal]
|
||||
family = "Fira Code Nerd Font"
|
||||
|
||||
[general]
|
||||
import = ["~/.config/alacritty/dark.toml"]
|
||||
126
alacritty/.config/alacritty/alacritty.yml
Normal file
126
alacritty/.config/alacritty/alacritty.yml
Normal file
@@ -0,0 +1,126 @@
|
||||
# See: /usr/share/doc/alacritty/example/alacritty.yml
|
||||
|
||||
env:
|
||||
TERM: xterm-256color
|
||||
|
||||
# (format t "~A" (cl-base16:apply-scheme (merge-pathnames "schemes/mexico-light/mexico-light.yaml" cl-base16:*source-dir*) "alacritty" "default"))
|
||||
# (format t "~A" (cl-base16:apply-scheme (merge-pathnames "schemes/mexico-light/mexico-light.yaml" cl-base16:*source-dir*) "alacritty" "default"))
|
||||
|
||||
# Base16 Espresso - alacritty color config
|
||||
# Unknown. Maintained by Alex Mirrington (https://github.com/alexmirrington)
|
||||
colors-dark: &dark
|
||||
# Default colors
|
||||
primary:
|
||||
background: '0x2d2d2d'
|
||||
foreground: '0xcccccc'
|
||||
|
||||
# Colors the cursor will use if `custom_cursor_colors` is true
|
||||
cursor:
|
||||
text: '0x2d2d2d'
|
||||
cursor: '0xcccccc'
|
||||
|
||||
# Normal colors
|
||||
normal:
|
||||
black: '0x2d2d2d'
|
||||
red: '0xd25252'
|
||||
green: '0xa5c261'
|
||||
yellow: '0xffc66d'
|
||||
blue: '0x6c99bb'
|
||||
magenta: '0xd197d9'
|
||||
cyan: '0xbed6ff'
|
||||
white: '0xcccccc'
|
||||
|
||||
# Bright colors
|
||||
bright:
|
||||
black: '0x777777'
|
||||
red: '0xf9a959'
|
||||
green: '0x393939'
|
||||
yellow: '0x515151'
|
||||
blue: '0xb4b7b4'
|
||||
magenta: '0xe0e0e0'
|
||||
cyan: '0xf97394'
|
||||
white: '0xffffff'
|
||||
|
||||
colors1:
|
||||
# Default colors
|
||||
primary:
|
||||
background: '0x3C4C55'
|
||||
foreground: '0xC5D4DD'
|
||||
|
||||
# Colors the cursor will use if `custom_cursor_colors` is true
|
||||
cursor:
|
||||
text: '0x3C4C55'
|
||||
cursor: '0xC5D4DD'
|
||||
|
||||
# Normal colors
|
||||
normal:
|
||||
black: '0x3C4C55'
|
||||
red: '0x83AFE5'
|
||||
green: '0x7FC1CA'
|
||||
yellow: '0xA8CE93'
|
||||
blue: '0x83AFE5'
|
||||
magenta: '0x9A93E1'
|
||||
cyan: '0xF2C38F'
|
||||
white: '0xC5D4DD'
|
||||
|
||||
# Bright colors
|
||||
bright:
|
||||
black: '0x899BA6'
|
||||
red: '0x7FC1CA'
|
||||
green: '0x556873'
|
||||
yellow: '0x6A7D89'
|
||||
blue: '0x899BA6'
|
||||
magenta: '0x899BA6'
|
||||
cyan: '0xF2C38F'
|
||||
white: '0x556873'
|
||||
|
||||
# Base16 Mexico Light - alacritty color config
|
||||
# Sheldon Johnson
|
||||
colors-light: &light
|
||||
# Default colors
|
||||
primary:
|
||||
background: '0xf8f8f8'
|
||||
foreground: '0x383838'
|
||||
|
||||
# Colors the cursor will use if `custom_cursor_colors` is true
|
||||
cursor:
|
||||
text: '0xf8f8f8'
|
||||
cursor: '0x383838'
|
||||
|
||||
# Normal colors
|
||||
normal:
|
||||
black: '0xf8f8f8'
|
||||
red: '0xab4642'
|
||||
green: '0x538947'
|
||||
yellow: '0xf79a0e'
|
||||
blue: '0x7cafc2'
|
||||
magenta: '0x96609e'
|
||||
cyan: '0x4b8093'
|
||||
white: '0x383838'
|
||||
|
||||
# Bright colors
|
||||
bright:
|
||||
black: '0xb8b8b8'
|
||||
red: '0xdc9656'
|
||||
green: '0xe8e8e8'
|
||||
yellow: '0xd8d8d8'
|
||||
blue: '0x585858'
|
||||
magenta: '0x282828'
|
||||
cyan: '0xa16946'
|
||||
white: '0x181818'
|
||||
|
||||
draw_bold_text_with_bright_colors: false
|
||||
|
||||
colors: *dark
|
||||
|
||||
font:
|
||||
size: 12
|
||||
normal:
|
||||
family: Iosevka Fixed Slab
|
||||
bold:
|
||||
family: Iosevka Fixed Slab heavy
|
||||
|
||||
key_bindings:
|
||||
- key: F6
|
||||
mods: Control|Shift
|
||||
command: { program: "/bin/sh", args: ["-c", "~/.config/alacritty/set_theme.sh --next"] }
|
||||
@@ -1,31 +0,0 @@
|
||||
# https://github.com/alacritty/alacritty-theme/blob/master/themes/nordic.toml
|
||||
|
||||
# Colors (Nordic)
|
||||
|
||||
[colors.primary]
|
||||
background = '#242933'
|
||||
foreground = '#BBBDAF'
|
||||
|
||||
[colors.normal]
|
||||
black = '#191C1D'
|
||||
red = '#BD6062'
|
||||
green = '#A3D6A9'
|
||||
yellow = '#F0DFAF'
|
||||
blue = '#8FB4D8'
|
||||
magenta = '#C7A9D9'
|
||||
cyan = '#B6D7A8'
|
||||
white = '#BDC5BD'
|
||||
|
||||
[colors.bright]
|
||||
black = '#727C7C'
|
||||
red = '#D18FAF'
|
||||
green = '#B7CEB0'
|
||||
yellow = '#BCBCBC'
|
||||
blue = '#E0CF9F'
|
||||
magenta = '#C7A9D9'
|
||||
cyan = '#BBDA97'
|
||||
white = '#BDC5BD'
|
||||
|
||||
[colors.selection]
|
||||
text = '#000000'
|
||||
background = '#F0DFAF'
|
||||
@@ -1,35 +0,0 @@
|
||||
# https://github.com/alacritty/alacritty-theme/blob/master/themes/night_owlish_light.toml
|
||||
|
||||
# Colors (Night Owlish Light)
|
||||
|
||||
[colors.primary]
|
||||
background = '#ffffff'
|
||||
foreground = '#403f53'
|
||||
|
||||
[colors.normal]
|
||||
black = '#011627'
|
||||
red = '#d3423e'
|
||||
green = '#2aa298'
|
||||
yellow = '#daaa01'
|
||||
blue = '#4876d6'
|
||||
magenta = '#403f53'
|
||||
cyan = '#08916a'
|
||||
white = '#7a8181'
|
||||
|
||||
[colors.bright]
|
||||
black = '#7a8181'
|
||||
red = '#f76e6e'
|
||||
green = '#49d0c5'
|
||||
yellow = '#dac26b'
|
||||
blue = '#5ca7e4'
|
||||
magenta = '#697098'
|
||||
cyan = '#00c990'
|
||||
white = '#989fb1'
|
||||
|
||||
[colors.cursor]
|
||||
cursor = '#403f53'
|
||||
text = '#fbfbfb'
|
||||
|
||||
[colors.selection]
|
||||
background = '#f2f2f2'
|
||||
text = '#403f53'
|
||||
30
alacritty/.config/alacritty/set_theme.sh
Executable file
30
alacritty/.config/alacritty/set_theme.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
lupan-dark|lupan-dark-blue|lupan-dark-gray|lupan-light|lupan-material-dark|lupan-material-light)
|
||||
sed -i "s/^colors: [*].*/colors: *$1/" ~/.config/alacritty/alacritty.yml
|
||||
;;
|
||||
--next)
|
||||
case $(grep colors: ~/.config/alacritty/alacritty.yml) in
|
||||
'colors: *lupan-dark')
|
||||
THEME=lupan-dark-blue
|
||||
;;
|
||||
'colors: *lupan-dark-blue')
|
||||
THEME=lupan-dark-gray
|
||||
;;
|
||||
'colors: *lupan-dark-gray')
|
||||
THEME=lupan-light
|
||||
;;
|
||||
'colors: *lupan-light')
|
||||
THEME=lupan-material-dark
|
||||
;;
|
||||
'colors: *lupan-material-dark')
|
||||
THEME=lupan-material-light
|
||||
;;
|
||||
*)
|
||||
THEME=lupan-dark
|
||||
;;
|
||||
esac
|
||||
sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml
|
||||
;;
|
||||
esac
|
||||
@@ -1,592 +0,0 @@
|
||||
-- If LuaRocks is installed, make sure that packages installed through it are
|
||||
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
|
||||
pcall(require, "luarocks.loader")
|
||||
|
||||
-- Standard awesome library
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
require("awful.autofocus")
|
||||
-- Widget and layout library
|
||||
local wibox = require("wibox")
|
||||
-- Theme handling library
|
||||
local beautiful = require("beautiful")
|
||||
-- Notification library
|
||||
local naughty = require("naughty")
|
||||
local menubar = require("menubar")
|
||||
local hotkeys_popup = require("awful.hotkeys_popup")
|
||||
-- Enable hotkeys help widget for VIM and other apps
|
||||
-- when client with a matching name is opened:
|
||||
require("awful.hotkeys_popup.keys")
|
||||
|
||||
---@diagnostic disable: undefined-global
|
||||
|
||||
-- {{{ Error handling
|
||||
-- Check if awesome encountered an error during startup and fell back to
|
||||
-- another config (This code will only ever execute for the fallback config)
|
||||
if awesome.startup_errors then
|
||||
naughty.notify({
|
||||
preset = naughty.config.presets.critical,
|
||||
title = "Oops, there were errors during startup!",
|
||||
text = awesome.startup_errors
|
||||
})
|
||||
end
|
||||
|
||||
-- Handle runtime errors after startup
|
||||
do
|
||||
local in_error = false
|
||||
awesome.connect_signal("debug::error", function(err)
|
||||
-- Make sure we don't go into an endless error loop
|
||||
if in_error then return end
|
||||
in_error = true
|
||||
|
||||
naughty.notify({
|
||||
preset = naughty.config.presets.critical,
|
||||
title = "Oops, an error happened!",
|
||||
text = tostring(err)
|
||||
})
|
||||
in_error = false
|
||||
end)
|
||||
end
|
||||
-- }}}
|
||||
|
||||
-- {{{ Variable definitions
|
||||
-- Themes define colours, icons, font and wallpapers.
|
||||
|
||||
local function read_theme()
|
||||
local theme = "theme_dark.lua"
|
||||
local f = io.open(os.getenv('HOME') .. '/.config/alacritty/alacritty.toml')
|
||||
if f then
|
||||
if string.find(f:read('*all'), 'light') then
|
||||
theme = 'theme_light.lua'
|
||||
end
|
||||
f:close()
|
||||
return theme
|
||||
end
|
||||
end
|
||||
|
||||
local theme = read_theme()
|
||||
beautiful.init(gears.filesystem.get_configuration_dir() .. theme)
|
||||
|
||||
local function set_wallpaper(s)
|
||||
gears.wallpaper.set(beautiful.bg_wallpaper)
|
||||
end
|
||||
|
||||
local function switch_theme()
|
||||
if theme == "theme_dark.lua" then
|
||||
theme = "theme_light.lua"
|
||||
awful.spawn("lupan-set-theme light")
|
||||
else
|
||||
theme = "theme_dark.lua"
|
||||
awful.spawn("lupan-set-theme dark")
|
||||
end
|
||||
beautiful.init(gears.filesystem.get_configuration_dir() .. theme)
|
||||
set_wallpaper()
|
||||
for s in screen do
|
||||
awful.tag.viewtoggle(s.tags[1])
|
||||
awful.tag.viewtoggle(s.tags[1])
|
||||
end
|
||||
end
|
||||
|
||||
-- This is used later as the default terminal and editor to run.
|
||||
local terminal = "st"
|
||||
|
||||
-- Default modkey.
|
||||
local modkey = "Mod4"
|
||||
|
||||
-- Table of layouts to cover with awful.layout.inc, order matters.
|
||||
awful.layout.layouts = {
|
||||
awful.layout.suit.tile,
|
||||
awful.layout.suit.tile.left,
|
||||
awful.layout.suit.tile.bottom,
|
||||
awful.layout.suit.tile.top,
|
||||
awful.layout.suit.fair,
|
||||
awful.layout.suit.fair.horizontal,
|
||||
awful.layout.suit.spiral.dwindle,
|
||||
awful.layout.suit.max,
|
||||
awful.layout.suit.max.fullscreen,
|
||||
awful.layout.suit.magnifier,
|
||||
awful.layout.suit.corner.nw,
|
||||
awful.layout.suit.floating,
|
||||
-- awful.layout.suit.corner.ne,
|
||||
-- awful.layout.suit.corner.sw,
|
||||
-- awful.layout.suit.corner.se,
|
||||
}
|
||||
-- }}}
|
||||
|
||||
-- {{{ Menu
|
||||
-- Menubar configuration
|
||||
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
|
||||
-- }}}
|
||||
|
||||
-- Keyboard map indicator and switcher
|
||||
local mykeyboardlayout = awful.widget.keyboardlayout()
|
||||
|
||||
-- {{{ Wibar
|
||||
-- Create a textclock widget
|
||||
local mytextclock = wibox.widget.textclock('%H:%M ')
|
||||
|
||||
-- Create a wibox for each screen and add it
|
||||
local taglist_buttons = gears.table.join(
|
||||
awful.button({}, 1, function(t) t:view_only() end),
|
||||
awful.button({ modkey }, 1, function(t)
|
||||
if client.focus then
|
||||
client.focus:move_to_tag(t)
|
||||
end
|
||||
end),
|
||||
awful.button({}, 3, awful.tag.viewtoggle),
|
||||
awful.button({ modkey }, 3, function(t)
|
||||
if client.focus then
|
||||
client.focus:toggle_tag(t)
|
||||
end
|
||||
end),
|
||||
awful.button({}, 4, function(t) awful.tag.viewnext(t.screen) end),
|
||||
awful.button({}, 5, function(t) awful.tag.viewprev(t.screen) end)
|
||||
)
|
||||
|
||||
local tasklist_buttons = gears.table.join(
|
||||
awful.button({}, 1, function(c)
|
||||
if c == client.focus then
|
||||
c.minimized = true
|
||||
else
|
||||
c:emit_signal(
|
||||
"request::activate",
|
||||
"tasklist",
|
||||
{ raise = true }
|
||||
)
|
||||
end
|
||||
end),
|
||||
awful.button({}, 3, function()
|
||||
awful.menu.client_list({ theme = { width = 250 } })
|
||||
end),
|
||||
awful.button({}, 4, function()
|
||||
awful.client.focus.byidx(1)
|
||||
end),
|
||||
awful.button({}, 5, function()
|
||||
awful.client.focus.byidx(-1)
|
||||
end))
|
||||
|
||||
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
|
||||
screen.connect_signal("property::geometry", set_wallpaper)
|
||||
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
-- Wallpaper
|
||||
set_wallpaper(s)
|
||||
|
||||
-- Each screen has its own tag table.
|
||||
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
|
||||
|
||||
-- Create a promptbox for each screen
|
||||
s.mypromptbox = awful.widget.prompt()
|
||||
-- Create an imagebox widget which will contain an icon indicating which layout we're using.
|
||||
-- We need one layoutbox per screen.
|
||||
s.mylayoutbox = awful.widget.layoutbox(s)
|
||||
s.mylayoutbox:buttons(gears.table.join(
|
||||
awful.button({}, 1, function() awful.layout.inc(1) end),
|
||||
awful.button({}, 3, function() awful.layout.inc(-1) end),
|
||||
awful.button({}, 4, function() awful.layout.inc(1) end),
|
||||
awful.button({}, 5, function() awful.layout.inc(-1) end)))
|
||||
-- Create a taglist widget
|
||||
s.mytaglist = awful.widget.taglist {
|
||||
screen = s,
|
||||
filter = awful.widget.taglist.filter.all,
|
||||
buttons = taglist_buttons
|
||||
}
|
||||
|
||||
-- Create a tasklist widget
|
||||
s.mytasklist = awful.widget.tasklist {
|
||||
screen = s,
|
||||
filter = awful.widget.tasklist.filter.currenttags,
|
||||
buttons = tasklist_buttons
|
||||
}
|
||||
|
||||
-- Create the wibox
|
||||
s.mywibox = awful.wibar({ position = "top", screen = s })
|
||||
|
||||
-- Add widgets to the wibox
|
||||
s.mywibox:setup {
|
||||
layout = wibox.layout.align.horizontal,
|
||||
{ -- Left widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
s.mytaglist,
|
||||
s.mypromptbox,
|
||||
},
|
||||
s.mytasklist, -- Middle widget
|
||||
{ -- Right widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
mykeyboardlayout,
|
||||
wibox.widget.systray(),
|
||||
mytextclock,
|
||||
s.mylayoutbox,
|
||||
},
|
||||
}
|
||||
end)
|
||||
-- }}}
|
||||
|
||||
local function layout_menu()
|
||||
local layouts = {}
|
||||
for i, layout in pairs(awful.layout.layouts) do
|
||||
layouts[i] =
|
||||
{ layout.name,
|
||||
function()
|
||||
awful.layout.set(layout)
|
||||
end,
|
||||
beautiful["layout_" .. layout.name],
|
||||
}
|
||||
end
|
||||
awful.menu(layouts):show()
|
||||
end
|
||||
|
||||
local function focus_nth_window (n)
|
||||
local cc = {}
|
||||
for _, c in ipairs(client.get()) do
|
||||
if awful.widget.tasklist.filter.currenttags(c, mouse.screen) then cc[#cc + 1] = c end
|
||||
end
|
||||
local new_focused = cc[n]
|
||||
if new_focused then client.focus = new_focused; new_focused:raise() end
|
||||
end
|
||||
|
||||
-- {{{ Key bindings
|
||||
local globalkeys = gears.table.join(
|
||||
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
|
||||
{ description = "show help", group = "awesome" }),
|
||||
awful.key({ modkey, }, "Left", awful.tag.viewprev,
|
||||
{ description = "view previous", group = "tag" }),
|
||||
awful.key({ modkey, }, "Right", awful.tag.viewnext,
|
||||
{ description = "view next", group = "tag" }),
|
||||
awful.key({ modkey, }, "Tab", awful.tag.history.restore,
|
||||
{ description = "go back", group = "tag" }),
|
||||
|
||||
awful.key({ modkey, }, "j",
|
||||
function()
|
||||
awful.client.focus.byidx(1)
|
||||
end,
|
||||
{ description = "focus next by index", group = "client" }
|
||||
),
|
||||
awful.key({ modkey, }, "k",
|
||||
function()
|
||||
awful.client.focus.byidx(-1)
|
||||
end,
|
||||
{ description = "focus previous by index", group = "client" }
|
||||
),
|
||||
|
||||
-- Layout manipulation
|
||||
awful.key({ modkey, "Shift" }, "j", function() awful.client.swap.byidx(1) end,
|
||||
{ description = "swap with next client by index", group = "client" }),
|
||||
awful.key({ modkey, "Shift" }, "k", function() awful.client.swap.byidx(-1) end,
|
||||
{ description = "swap with previous client by index", group = "client" }),
|
||||
awful.key({ modkey, }, ".", function() awful.screen.focus_relative(1) end,
|
||||
{ description = "focus the next screen", group = "screen" }),
|
||||
awful.key({ modkey, }, ",", function() awful.screen.focus_relative(-1) end,
|
||||
{ description = "focus the previous screen", group = "screen" }),
|
||||
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
|
||||
{ description = "jump to urgent client", group = "client" }),
|
||||
awful.key({ modkey, }, "a",
|
||||
function()
|
||||
awful.client.focus.history.previous()
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end,
|
||||
{ description = "go back", group = "client" }),
|
||||
|
||||
-- Standard program
|
||||
awful.key({ modkey, "Shift" }, "Return", function() awful.spawn(terminal) end,
|
||||
{ description = "open a terminal", group = "launcher" }),
|
||||
awful.key({ modkey, "Control", "Shift" }, "l", function() awful.spawn("slock") end,
|
||||
{ description = "open a terminal", group = "launcher" }),
|
||||
awful.key({ modkey, "Control", "Shift" }, "s", function() awful.spawn("systemctl suspend") end,
|
||||
{ description = "open a terminal", group = "launcher" }),
|
||||
awful.key({ modkey, "Shift" }, "F6", switch_theme,
|
||||
{ description = "switch theme", group = "launcher" }),
|
||||
awful.key({ modkey, }, "q", awesome.restart,
|
||||
{ description = "reload awesome", group = "awesome" }),
|
||||
awful.key({ modkey, "Control", "Shift" }, "q", awesome.quit,
|
||||
{ description = "quit awesome", group = "awesome" }),
|
||||
awful.key({ modkey, }, "l", function() awful.tag.incmwfact(0.05) end,
|
||||
{ description = "increase master width factor", group = "layout" }),
|
||||
awful.key({ modkey, }, "h", function() awful.tag.incmwfact(-0.05) end,
|
||||
{ description = "decrease master width factor", group = "layout" }),
|
||||
awful.key({ modkey, "Shift" }, "h", function() awful.tag.incnmaster(1, nil, true) end,
|
||||
{ description = "increase the number of master clients", group = "layout" }),
|
||||
awful.key({ modkey, "Shift" }, "l", function() awful.tag.incnmaster(-1, nil, true) end,
|
||||
{ description = "decrease the number of master clients", group = "layout" }),
|
||||
awful.key({ modkey, }, "i", function() awful.tag.incncol(1, nil, true) end,
|
||||
{ description = "increase the number of columns", group = "layout" }),
|
||||
awful.key({ modkey, }, "d", function() awful.tag.incncol(-1, nil, true) end,
|
||||
{ description = "decrease the number of columns", group = "layout" }),
|
||||
awful.key({ modkey, }, "space", function() awful.layout.inc(1) end,
|
||||
{ description = "select next", group = "layout" }),
|
||||
awful.key({ modkey, "Shift" }, "space", function() awful.layout.inc(-1) end,
|
||||
{ description = "select previous", group = "layout" }),
|
||||
awful.key({ modkey, "Control", "Shift", }, "space", layout_menu,
|
||||
{ description = "select layout from menu", group = "layout" }),
|
||||
awful.key({ modkey, "Control" }, "n",
|
||||
function()
|
||||
local c = awful.client.restore()
|
||||
-- Focus restored client
|
||||
if c then
|
||||
c:emit_signal(
|
||||
"request::activate", "key.unminimize", { raise = true }
|
||||
)
|
||||
end
|
||||
end,
|
||||
{ description = "restore minimized", group = "client" }),
|
||||
|
||||
-- Prompt
|
||||
awful.key({ modkey, }, "r", function() awful.screen.focused().mypromptbox:run() end,
|
||||
{ description = "run prompt", group = "launcher" }),
|
||||
|
||||
awful.key({ modkey, }, "x",
|
||||
function()
|
||||
awful.prompt.run {
|
||||
prompt = "Run Lua code: ",
|
||||
textbox = awful.screen.focused().mypromptbox.widget,
|
||||
exe_callback = awful.util.eval,
|
||||
history_path = awful.util.get_cache_dir() .. "/history_eval"
|
||||
}
|
||||
end,
|
||||
{ description = "lua execute prompt", group = "awesome" }),
|
||||
-- Menubar
|
||||
awful.key({ modkey }, "p", function() awful.spawn("dmenu_run -fn 'FiraCode Nerd Font Ret:size=10'") end,
|
||||
{ description = "run command", group = "launcher" })
|
||||
)
|
||||
|
||||
local clientkeys = gears.table.join(
|
||||
awful.key({ modkey, }, "f",
|
||||
function(c)
|
||||
c.fullscreen = not c.fullscreen
|
||||
c:raise()
|
||||
end,
|
||||
{ description = "toggle fullscreen", group = "client" }),
|
||||
awful.key({ modkey, "Shift" }, "c", function(c) c:kill() end,
|
||||
{ description = "close", group = "client" }),
|
||||
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle,
|
||||
{ description = "toggle floating", group = "client" }),
|
||||
awful.key({ modkey, }, "Return", function(c) c:swap(awful.client.getmaster()) end,
|
||||
{ description = "move to master", group = "client" }),
|
||||
awful.key({ modkey, "Shift" }, ".", function(c) c:move_to_screen() end,
|
||||
{ description = "move to screen", group = "client" }),
|
||||
awful.key({ modkey, }, "t", function(c) c.ontop = not c.ontop end,
|
||||
{ description = "toggle keep on top", group = "client" }),
|
||||
awful.key({ modkey, }, "n",
|
||||
function(c)
|
||||
-- The client currently has the input focus, so it cannot be
|
||||
-- minimized, since minimized clients can't have the focus.
|
||||
c.minimized = true
|
||||
end,
|
||||
{ description = "minimize", group = "client" }),
|
||||
awful.key({ modkey, }, "m",
|
||||
function(c)
|
||||
if awful.layout.getname() == "max" then
|
||||
awful.layout.set(awful.layout.suit.tile)
|
||||
else
|
||||
awful.layout.set(awful.layout.suit.max)
|
||||
end
|
||||
end,
|
||||
{ description = "(un)maximize", group = "client" }),
|
||||
awful.key({ modkey, }, "v",
|
||||
function(c)
|
||||
c.maximized_vertical = not c.maximized_vertical
|
||||
c:raise()
|
||||
end,
|
||||
{ description = "(un)maximize vertically", group = "client" }),
|
||||
awful.key({ modkey, }, "b",
|
||||
function(c)
|
||||
c.maximized_horizontal = not c.maximized_horizontal
|
||||
c:raise()
|
||||
end,
|
||||
{ description = "(un)maximize horizontally", group = "client" })
|
||||
)
|
||||
|
||||
-- Bind all key numbers to tags.
|
||||
-- Be careful: we use keycodes to make it work on any keyboard layout.
|
||||
-- This should map on the top row of your keyboard, usually 1 to 9.
|
||||
for i = 1, 9 do
|
||||
globalkeys = gears.table.join(globalkeys,
|
||||
-- View tag only.
|
||||
awful.key({ modkey }, "#" .. i + 9,
|
||||
function()
|
||||
local screen = awful.screen.focused()
|
||||
local tag = screen.tags[i]
|
||||
if tag then
|
||||
tag:view_only()
|
||||
end
|
||||
end,
|
||||
{ description = "view tag #" .. i, group = "tag" }),
|
||||
-- Toggle tag display.
|
||||
awful.key({ modkey, "Control" }, "#" .. i + 9,
|
||||
function()
|
||||
local screen = awful.screen.focused()
|
||||
local tag = screen.tags[i]
|
||||
if tag then
|
||||
awful.tag.viewtoggle(tag)
|
||||
end
|
||||
end,
|
||||
{ description = "toggle tag #" .. i, group = "tag" }),
|
||||
-- Move client to tag.
|
||||
awful.key({ modkey, "Shift" }, "#" .. i + 9,
|
||||
function()
|
||||
if client.focus then
|
||||
local tag = client.focus.screen.tags[i]
|
||||
if tag then
|
||||
client.focus:move_to_tag(tag)
|
||||
end
|
||||
end
|
||||
end,
|
||||
{ description = "move focused client to tag #" .. i, group = "tag" }),
|
||||
-- Toggle tag on focused client.
|
||||
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
|
||||
function()
|
||||
if client.focus then
|
||||
local tag = client.focus.screen.tags[i]
|
||||
if tag then
|
||||
client.focus:toggle_tag(tag)
|
||||
end
|
||||
end
|
||||
end,
|
||||
{ description = "toggle focused client on tag #" .. i, group = "tag" }),
|
||||
--- Focus nth window
|
||||
awful.key({ "Control" }, "#" .. i + 9,
|
||||
function() focus_nth_window(i) end,
|
||||
{ description = "focus window index #" .. i, group = "client" })
|
||||
)
|
||||
end
|
||||
|
||||
local clientbuttons = gears.table.join(
|
||||
awful.button({}, 1, function(c)
|
||||
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
||||
end),
|
||||
awful.button({ modkey }, 1, function(c)
|
||||
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
||||
awful.mouse.client.move(c)
|
||||
end),
|
||||
awful.button({ modkey }, 3, function(c)
|
||||
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
||||
awful.mouse.client.resize(c)
|
||||
end)
|
||||
)
|
||||
|
||||
-- Set keys
|
||||
root.keys(globalkeys)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Rules
|
||||
-- Rules to apply to new clients (through the "manage" signal).
|
||||
awful.rules.rules = {
|
||||
-- All clients will match this rule.
|
||||
{
|
||||
rule = {},
|
||||
properties = {
|
||||
border_width = beautiful.border_width,
|
||||
border_color = beautiful.border_normal,
|
||||
focus = awful.client.focus.filter,
|
||||
raise = true,
|
||||
keys = clientkeys,
|
||||
buttons = clientbuttons,
|
||||
screen = awful.screen.preferred,
|
||||
placement = awful.placement.no_overlap + awful.placement.no_offscreen,
|
||||
size_hints_honor = false,
|
||||
}
|
||||
},
|
||||
|
||||
-- Floating clients.
|
||||
{
|
||||
rule_any = {
|
||||
instance = {
|
||||
"DTA", -- Firefox addon DownThemAll.
|
||||
"copyq", -- Includes session name in class.
|
||||
"pinentry",
|
||||
},
|
||||
class = {
|
||||
"Arandr",
|
||||
"Blueman-manager",
|
||||
"Gpick",
|
||||
"Kruler",
|
||||
"MessageWin", -- kalarm.
|
||||
"Sxiv",
|
||||
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
|
||||
"Wpa_gui",
|
||||
"veromix",
|
||||
"xtightvncviewer" },
|
||||
|
||||
-- Note that the name property shown in xprop might be set slightly after creation of the client
|
||||
-- and the name shown there might not match defined rules here.
|
||||
name = {
|
||||
"Event Tester", -- xev.
|
||||
},
|
||||
role = {
|
||||
"AlarmWindow", -- Thunderbird's calendar.
|
||||
"ConfigManager", -- Thunderbird's about:config.
|
||||
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
|
||||
}
|
||||
},
|
||||
properties = { floating = true }
|
||||
},
|
||||
|
||||
-- Add titlebars to normal clients and dialogs
|
||||
{
|
||||
rule_any = { type = { "normal", "dialog" }
|
||||
},
|
||||
properties = { titlebars_enabled = true }
|
||||
},
|
||||
|
||||
-- Set Firefox to always map on the tag named "2" on screen 1.
|
||||
-- { rule = { class = "Firefox" },
|
||||
-- properties = { screen = 1, tag = "2" } },
|
||||
}
|
||||
-- }}}
|
||||
|
||||
-- {{{ Signals
|
||||
|
||||
local function set_border_width(c)
|
||||
local t = awful.screen.focused().selected_tag
|
||||
if #t:clients() == 1 or t.layout.name == 'max' then
|
||||
c = c or client.focus
|
||||
c.border_width = 0
|
||||
else
|
||||
for _, cl in ipairs(t:clients()) do
|
||||
cl.border_width = beautiful.border_width
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Signal function to execute when a new client appears.
|
||||
client.connect_signal("manage", function(c)
|
||||
-- Set the windows at the slave,
|
||||
-- i.e. put it at the end of others instead of setting it master.
|
||||
-- if not awesome.startup then awful.client.setslave(c) end
|
||||
|
||||
if awesome.startup
|
||||
and not c.size_hints.user_position
|
||||
and not c.size_hints.program_position then
|
||||
-- Prevent clients from being unreachable after screen count changes.
|
||||
awful.placement.no_offscreen(c)
|
||||
end
|
||||
set_border_width(c)
|
||||
end)
|
||||
|
||||
-- Enable sloppy focus, so that focus follows mouse.
|
||||
client.connect_signal("mouse::enter", function(c)
|
||||
c:emit_signal("request::activate", "mouse_enter", { raise = false })
|
||||
end)
|
||||
|
||||
-- local function set_border(c)
|
||||
-- local s = awful.screen.focused()
|
||||
-- if c.maximized
|
||||
-- or (#s.tiled_clients == 1 and not c.floating)
|
||||
-- or (s.selected_tag and s.selected_tag.layout.name == 'max')
|
||||
-- then
|
||||
-- c.border_width = 0
|
||||
-- else
|
||||
-- c.border_width = beautiful.border_width
|
||||
-- end
|
||||
-- end
|
||||
|
||||
client.connect_signal("focus", function(c)
|
||||
c.border_color = beautiful.border_focus
|
||||
set_border_width(c)
|
||||
end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal; end)
|
||||
tag.connect_signal("property::layout", function() set_border_width(nil) end)
|
||||
|
||||
-- }}}
|
||||
@@ -1,57 +0,0 @@
|
||||
local themes_path = require("gears.filesystem").get_themes_dir()
|
||||
|
||||
local xresources = require("beautiful.xresources")
|
||||
local dpi = xresources.apply_dpi
|
||||
|
||||
local theme = {}
|
||||
|
||||
theme.font = "Fira Code Nerd Font 10"
|
||||
theme.tasklist_disable_icon = true
|
||||
theme.wibar_height = 30
|
||||
|
||||
theme.bg_normal = "#111c22" -- hsl(200 35% 10%)
|
||||
theme.bg_focus = "#316781" -- hsl(200 45% 35%)
|
||||
theme.bg_urgent = "#814c31" -- hsl(20 45% 35%)
|
||||
theme.bg_minimize = "#454f54" -- hsl(200 10% 30%)
|
||||
theme.bg_systray = theme.bg_normal
|
||||
theme.tasklist_bg_focus = "#1c3b4a" -- hsl(200 45% 20%)
|
||||
|
||||
theme.fg_normal = "#8f9ca3" -- hsl(200 10% 60%)
|
||||
theme.fg_focus = "#abb5ba" -- hsl(200 10% 70%)
|
||||
theme.fg_urgent = theme.bg_focus
|
||||
theme.fg_minimize = theme.fg_normal
|
||||
theme.taglist_fg_empty = "#454f54" -- hsl(200 10% 30%)
|
||||
|
||||
theme.gap_single_client = false
|
||||
theme.useless_gap = dpi(1)
|
||||
theme.border_width = dpi(2)
|
||||
theme.border_normal = "#73848c" -- hsl(200 10% 50%)
|
||||
theme.border_focus = "#b25e34" -- hsl(20 55% 45%)
|
||||
theme.border_marked = "#3488b2" -- hsl(200 55% 45%)
|
||||
|
||||
theme.bg_wallpaper = "#454f54" -- hsl(200 10% 30%)
|
||||
|
||||
theme.hotkeys_font = theme.font
|
||||
theme.hotkeys_description_font = theme.font
|
||||
theme.hotkeys_bg = theme.bg_minimize
|
||||
theme.hotkeys_modifiers_fg = theme.border_focus
|
||||
|
||||
-- You can use your own layout icons like this:
|
||||
theme.layout_fairh = themes_path .. "default/layouts/fairhw.png"
|
||||
theme.layout_fairv = themes_path .. "default/layouts/fairvw.png"
|
||||
theme.layout_floating = themes_path .. "default/layouts/floatingw.png"
|
||||
theme.layout_magnifier = themes_path .. "default/layouts/magnifierw.png"
|
||||
theme.layout_max = themes_path .. "default/layouts/maxw.png"
|
||||
theme.layout_fullscreen = themes_path .. "default/layouts/fullscreenw.png"
|
||||
theme.layout_tilebottom = themes_path .. "default/layouts/tilebottomw.png"
|
||||
theme.layout_tileleft = themes_path .. "default/layouts/tileleftw.png"
|
||||
theme.layout_tile = themes_path .. "default/layouts/tilew.png"
|
||||
theme.layout_tiletop = themes_path .. "default/layouts/tiletopw.png"
|
||||
theme.layout_spiral = themes_path .. "default/layouts/spiralw.png"
|
||||
theme.layout_dwindle = themes_path .. "default/layouts/dwindlew.png"
|
||||
theme.layout_cornernw = themes_path .. "default/layouts/cornernww.png"
|
||||
theme.layout_cornerne = themes_path .. "default/layouts/cornernew.png"
|
||||
theme.layout_cornersw = themes_path .. "default/layouts/cornersww.png"
|
||||
theme.layout_cornerse = themes_path .. "default/layouts/cornersew.png"
|
||||
|
||||
return theme
|
||||
@@ -1,57 +0,0 @@
|
||||
local themes_path = require("gears.filesystem").get_themes_dir()
|
||||
|
||||
local xresources = require("beautiful.xresources")
|
||||
local dpi = xresources.apply_dpi
|
||||
|
||||
local theme = {}
|
||||
|
||||
theme.font = "Fira Code Nerd Font 10"
|
||||
theme.tasklist_disable_icon = true
|
||||
theme.wibar_height = 30
|
||||
|
||||
theme.bg_normal = "#111c22" -- hsl(200 35% 10%)
|
||||
theme.bg_focus = "#d0e3fb" -- hsl(214 85% 90%)
|
||||
theme.bg_urgent = "#f2d1a6" -- hsl(34 75% 80%)
|
||||
theme.bg_minimize = "#8596ad" -- hsl(214 20% 60%)
|
||||
theme.bg_systray = theme.bg_normal
|
||||
theme.tasklist_bg_focus = "#a6c7f2" -- hsl(214 75% 80%)
|
||||
|
||||
theme.fg_normal = "#8f9ca3" -- hsl(200 10% 60%)
|
||||
theme.fg_focus = "#454b54" -- hsl(214 10% 30%)
|
||||
theme.fg_urgent = "#70675c" -- hsl(34 10% 40%)
|
||||
theme.fg_minimize = "#70675c" -- hsl(34 10% 40%)
|
||||
theme.taglist_fg_empty = theme.fg_minimize
|
||||
|
||||
theme.gap_single_client = false
|
||||
theme.useless_gap = dpi(1)
|
||||
theme.border_width = dpi(2)
|
||||
theme.border_normal = theme.bg_minimize
|
||||
theme.border_focus = "#df8c20" -- hsl(34 75% 50%)
|
||||
theme.border_marked = "#2073df" -- hsl(214 75% 50%)
|
||||
|
||||
theme.bg_wallpaper = theme.fg_normal
|
||||
|
||||
theme.hotkeys_font = theme.font
|
||||
theme.hotkeys_description_font = theme.font
|
||||
theme.hotkeys_bg = theme.border_normal
|
||||
theme.hotkeys_modifiers_fg = theme.bg_focus
|
||||
|
||||
-- You can use your own layout icons like this:
|
||||
theme.layout_fairh = themes_path .. "default/layouts/fairhw.png"
|
||||
theme.layout_fairv = themes_path .. "default/layouts/fairvw.png"
|
||||
theme.layout_floating = themes_path .. "default/layouts/floatingw.png"
|
||||
theme.layout_magnifier = themes_path .. "default/layouts/magnifierw.png"
|
||||
theme.layout_max = themes_path .. "default/layouts/maxw.png"
|
||||
theme.layout_fullscreen = themes_path .. "default/layouts/fullscreenw.png"
|
||||
theme.layout_tilebottom = themes_path .. "default/layouts/tilebottomw.png"
|
||||
theme.layout_tileleft = themes_path .. "default/layouts/tileleftw.png"
|
||||
theme.layout_tile = themes_path .. "default/layouts/tilew.png"
|
||||
theme.layout_tiletop = themes_path .. "default/layouts/tiletopw.png"
|
||||
theme.layout_spiral = themes_path .. "default/layouts/spiralw.png"
|
||||
theme.layout_dwindle = themes_path .. "default/layouts/dwindlew.png"
|
||||
theme.layout_cornernw = themes_path .. "default/layouts/cornernww.png"
|
||||
theme.layout_cornerne = themes_path .. "default/layouts/cornernew.png"
|
||||
theme.layout_cornersw = themes_path .. "default/layouts/cornersww.png"
|
||||
theme.layout_cornerse = themes_path .. "default/layouts/cornersew.png"
|
||||
|
||||
return theme
|
||||
36
bspwm/.config/bspwm/bspwmrc
Executable file
36
bspwm/.config/bspwm/bspwmrc
Executable file
@@ -0,0 +1,36 @@
|
||||
#! /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
|
||||
94
bspwm/.config/bspwm/commands.sh
Normal file
94
bspwm/.config/bspwm/commands.sh
Normal file
@@ -0,0 +1,94 @@
|
||||
#!/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
|
||||
11
bspwm/.config/bspwm/themes/lupan-dark-blue-theme.sh
Normal file
11
bspwm/.config/bspwm/themes/lupan-dark-blue-theme.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
11
bspwm/.config/bspwm/themes/lupan-dark-gray-theme.sh
Normal file
11
bspwm/.config/bspwm/themes/lupan-dark-gray-theme.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
11
bspwm/.config/bspwm/themes/lupan-dark-theme.sh
Normal file
11
bspwm/.config/bspwm/themes/lupan-dark-theme.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
11
bspwm/.config/bspwm/themes/lupan-light-theme.sh
Normal file
11
bspwm/.config/bspwm/themes/lupan-light-theme.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
11
bspwm/.config/bspwm/themes/lupan-material-dark-theme.sh
Normal file
11
bspwm/.config/bspwm/themes/lupan-material-dark-theme.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
11
bspwm/.config/bspwm/themes/lupan-material-light-theme.sh
Normal file
11
bspwm/.config/bspwm/themes/lupan-material-light-theme.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
65
bspwm/.config/polybar/config
Normal file
65
bspwm/.config/polybar/config
Normal file
@@ -0,0 +1,65 @@
|
||||
[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%
|
||||
169
bspwm/.config/sxhkd/sxhkdrc
Normal file
169
bspwm/.config/sxhkd/sxhkdrc
Normal file
@@ -0,0 +1,169 @@
|
||||
#
|
||||
# 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
|
||||
@@ -1,53 +1,63 @@
|
||||
#!/bin/sh
|
||||
|
||||
REQUIRED="$1"
|
||||
echo '# qtile:'
|
||||
for CMD in \
|
||||
alacritty \
|
||||
qtile \
|
||||
emacsclient \
|
||||
setxkbmap \
|
||||
slock \
|
||||
systemctl \
|
||||
xmodmap \
|
||||
xrandr \
|
||||
xrdb \
|
||||
xsetroot \
|
||||
xsettingsd \
|
||||
rofi; do
|
||||
which "$CMD"
|
||||
done
|
||||
|
||||
check_dependency() {
|
||||
local CMD="$1"
|
||||
shift
|
||||
for REQ in "$@"; do
|
||||
if [ "$REQ" = "$REQUIRED" ]; then
|
||||
which "$CMD"
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
echo -e '\n# bspwm:'
|
||||
for CMD in \
|
||||
alacritty \
|
||||
bspc \
|
||||
bspwm \
|
||||
dmenu \
|
||||
dmenu_run \
|
||||
emacsclient \
|
||||
pkill \
|
||||
polybar \
|
||||
polybar-msg \
|
||||
sed \
|
||||
setxkbmap \
|
||||
slock \
|
||||
sxhkd \
|
||||
systemctl \
|
||||
xargs \
|
||||
xdo \
|
||||
xmodmap \
|
||||
xrandr \
|
||||
xrdb \
|
||||
xsetroot \
|
||||
xsettingsd \
|
||||
xtitle \
|
||||
xss-lock; do
|
||||
which "$CMD"
|
||||
done
|
||||
|
||||
echo '# required:'
|
||||
echo -e '\n# bspwm (optional):'
|
||||
for CMD in \
|
||||
firefox \
|
||||
mpc \
|
||||
mpd \
|
||||
pamixer \
|
||||
sx \
|
||||
thunderbird \
|
||||
xbacklight; do
|
||||
which "$CMD"
|
||||
done
|
||||
|
||||
check_dependency zsh dwm hypr
|
||||
check_dependency git dwm hypr
|
||||
check_dependency cc dwm
|
||||
check_dependency make dwm
|
||||
check_dependency setxkbmap dwm
|
||||
check_dependency slock dwm
|
||||
check_dependency systemctl dwm hypr
|
||||
check_dependency xmodmap dwm
|
||||
check_dependency xrandr dwm
|
||||
check_dependency xrdb dwm
|
||||
check_dependency xset dwm
|
||||
check_dependency xsetroot dwm
|
||||
check_dependency hsetroot dwm
|
||||
check_dependency xsettingsd dwm
|
||||
check_dependency sed dwm hypr
|
||||
check_dependency pkill dwm
|
||||
check_dependency dmenu dwm
|
||||
check_dependency dmenu_run dwm
|
||||
check_dependency xss-lock dwm
|
||||
check_dependency exa dwm hypr
|
||||
check_dependency fzf dwm hypr
|
||||
check_dependency Hyprland hypr
|
||||
check_dependency hyprctl hypr
|
||||
check_dependency alacritty hypr
|
||||
check_dependency swaylock hypr
|
||||
check_dependency waybar hypr
|
||||
check_dependency wofi hypr
|
||||
|
||||
echo -e '\n# optional:'
|
||||
|
||||
check_dependency sx dwm
|
||||
check_dependency picom dwm
|
||||
check_dependency compton dwm
|
||||
check_dependency xbacklight dwm
|
||||
check_dependency wl-copy hypr
|
||||
check_dependency wl-paste hypr
|
||||
echo -e '\n# shell:'
|
||||
for CMD in emacsclient zsh; do
|
||||
which "$CMD"
|
||||
done
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
mkdir -p tools/.local/bin
|
||||
|
||||
uid=$(id -u):$(id -g)
|
||||
|
||||
go-install() {
|
||||
echo "build $1"
|
||||
docker exec -u "$uid" dotfiles-go go install -ldflags="-s -w" "$@"
|
||||
}
|
||||
|
||||
cargo-install() {
|
||||
B="$1"
|
||||
shift
|
||||
echo "build $B"
|
||||
docker exec -u "$uid" dotfiles-rust cargo install --quiet "$@"
|
||||
docker exec -u "$uid" dotfiles-rust cp "/usr/local/cargo/bin/$B" /rust/bin
|
||||
strip "tools/.local/bin/$B"
|
||||
}
|
||||
|
||||
docker kill dotfiles-go && sleep 3 || :
|
||||
docker run --rm -d --name dotfiles-go -e HOME=/go -v ./tools/.local/bin:/go/bin golang:1.25.1-alpine3.22 tail -f /dev/null
|
||||
docker exec dotfiles-go chown "$uid" /go
|
||||
|
||||
go-install github.com/junegunn/fzf@latest
|
||||
go-install github.com/gokcehan/lf@latest
|
||||
go-install github.com/rs/curlie@latest
|
||||
|
||||
docker kill dotfiles-go
|
||||
|
||||
docker kill dotfiles-rust && sleep 3 || :
|
||||
docker run --rm -d --name dotfiles-rust -v ./tools/.local/bin:/rust/bin rust:1.90-bullseye tail -f /dev/null
|
||||
|
||||
cargo-install zoxide zoxide --locked
|
||||
cargo-install rg ripgrep
|
||||
cargo-install fd fd-find
|
||||
cargo-install bat bat --locked
|
||||
cargo-install eza eza
|
||||
cargo-install delta git-delta
|
||||
cargo-install jj --bin jj jj-cli --locked
|
||||
cargo-install lazyjj lazyjj --locked
|
||||
|
||||
docker kill dotfiles-rust
|
||||
@@ -1,175 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# determine where to place the log file
|
||||
logfile="$HOME/.dkrc.log"
|
||||
[ -d "$HOME/.local/share/xorg" ] && logfile="$HOME/.local/share/xorg/dkrc.log"
|
||||
: > "$logfile"
|
||||
|
||||
# load sxhkd for keybinds
|
||||
pgrep sxhkd || sxhkd -c "$HOME/.config/dk/sxhkdrc" &
|
||||
|
||||
# spawn a scratchpad terminal if not already (see sxhkdrc and rules for binds/setup)
|
||||
# pgrep -f "st -c scratchpad" || st -c scratchpad &
|
||||
|
||||
# adjust border widths based on the DPI of the monitor
|
||||
px=$(xrandr | grep ' connected' | tail -n1 | grep -o '[0-9]\+x[0-9]\+' | cut -d'x' -f2)
|
||||
mm=$(xrandr | grep ' connected' | tail -n1 | grep -o '[0-9]\+mm' | tail -n1 | sed 's/mm//')
|
||||
dpi=$(( (px / mm) * 25 ))
|
||||
|
||||
if [ $dpi -ge 140 ]; then
|
||||
border_width=5
|
||||
border_outer_width=3
|
||||
elif [ $dpi -ge 120 ]; then
|
||||
border_width=4
|
||||
border_outer_width=2
|
||||
else
|
||||
border_width=2
|
||||
border_outer_width=1
|
||||
fi
|
||||
|
||||
{ # compound command to redirect all output
|
||||
|
||||
# workspace settings
|
||||
# ------------------------
|
||||
|
||||
# initialize 6 workspaces (1-6) (default: 1/monitor)
|
||||
dkcmd set numws=10
|
||||
|
||||
# default workspace '_' values used when allocating new workspaces
|
||||
# can be applied to all existing workspaces when passed 'apply' after ws=_
|
||||
dkcmd set ws=_ apply layout=tile master=1 stack=3 gap=0 msplit=0.5 ssplit=0.5
|
||||
|
||||
# use grid layout, padding, and gaps on last workspace
|
||||
#dkcmd set ws=6 layout=grid pad left=200 right=200 top=100 bottom=100 gap=50
|
||||
|
||||
# change workspace names (default: number == name -> 1:1, 2:2, 3:3....)
|
||||
# dkcmd set \
|
||||
# ws=1 name="edit" \
|
||||
# ws=2 name="web" \
|
||||
# ws=3 name="😀" \
|
||||
# ws=4 name="😠" \
|
||||
# ws=5 name="5" \
|
||||
# ws=6 name="6" \
|
||||
|
||||
# enable static workspaces assigned to monitors (relevant for multiple monitors)
|
||||
monitors=$(polybar -m | sed 's/+/:/g' | awk -F: '{print $3, $1}' | sort -n | cut -d' ' -f2 | xargs)
|
||||
mon1=$(echo $monitors | cut -d' ' -f1)
|
||||
mon2=$(echo $monitors | cut -d' ' -f2)
|
||||
mon3=$(echo $monitors | cut -d' ' -f3)
|
||||
if [ -z "$mon2" ]; then
|
||||
mon2="$mon1"
|
||||
mon3="$mon1"
|
||||
elif [ -z "$mon3" ]; then
|
||||
mon3="$mon1"
|
||||
fi
|
||||
dkcmd set static_ws=true \
|
||||
ws=1 mon=$mon2 \
|
||||
ws=2 mon=$mon2 \
|
||||
ws=3 mon=$mon2 \
|
||||
ws=4 mon=$mon2 \
|
||||
ws=5 mon=$mon2 \
|
||||
ws=6 mon=$mon2 \
|
||||
ws=7 mon=$mon2 \
|
||||
ws=8 mon=$mon2 \
|
||||
ws=9 mon=$mon1 \
|
||||
ws=10 mon=$mon3
|
||||
|
||||
# global settings
|
||||
# ---------------------
|
||||
|
||||
# focus windows when receiving activation and enable focus-follows-mouse
|
||||
dkcmd set focus_open=true focus_urgent=true focus_mouse=true
|
||||
|
||||
# place clients at the tail and ignore size hints on tiled windows
|
||||
dkcmd set tile_tohead=0 tile_hints=false
|
||||
|
||||
# minimum width/height for resizing, and minimum allowed on-screen when moving
|
||||
dkcmd set win_minwh=50 win_minxy=10
|
||||
|
||||
# disable gaps and borders in single window layouts
|
||||
dkcmd set smart_gap=true smart_border=true
|
||||
|
||||
# define mouse mod and move/resize buttons
|
||||
dkcmd set mouse mod=mod4 move=button1 resize=button3
|
||||
|
||||
# obey motif border hints on windows that draw their own (steam, easyeffects, etc.)
|
||||
dkcmd set obey_motif=true
|
||||
|
||||
|
||||
# borders
|
||||
# ---------
|
||||
|
||||
# traditional
|
||||
# set border width and colour for each window state
|
||||
# dkcmd set border width=$border_width colour focus='#6699cc' unfocus='#000000' urgent='#ee5555'
|
||||
|
||||
# alternative
|
||||
# enable split borders and colours, width is overall width, outer_width consumes some of width.
|
||||
# outer_width must be less than width, outer_width of 0 will be single borders
|
||||
dkcmd set border width=$border_width outer_width=$border_outer_width \
|
||||
colour \
|
||||
focus='#6699cc' \
|
||||
unfocus='#444444' \
|
||||
urgent='#ee5555' \
|
||||
outer_focus='#222222' \
|
||||
outer_unfocus='#222222' \
|
||||
outer_urgent='#222222'
|
||||
|
||||
|
||||
# window rules
|
||||
# --------------
|
||||
|
||||
# rule class, instance, and title regex are *always* case INSENSITIVE
|
||||
|
||||
# open window(s) on a specific workspace (assigned monitor)
|
||||
# dkcmd rule class="^gimp$" ws=2
|
||||
|
||||
# open window(s) on a monitor by number or name (active workspace on monitor)
|
||||
# dkcmd rule class="^chromium$" mon="HDMI-A-0"
|
||||
|
||||
# open window(s) and use a callback function (user defined in config.h)
|
||||
# we also ignore_cfg=true to stop the window from being resized on it's own from events
|
||||
# eg. mpv --x11-name=albumart /path/to/media
|
||||
# dkcmd rule class="^mpv$" instance="^albumart$" float=true ignore_cfg=true callback=albumart bw=0
|
||||
|
||||
# open window(s) in a floating state
|
||||
dkcmd rule class="^(pavucontrol|transmission-gtk|steam|lxappearance)$" float=true
|
||||
|
||||
# open window(s) with a specific geometry and coordinates (floating only!)
|
||||
# dkcmd rule class="^google-chrome$" title="^open files$" float=true w=1280 h=720
|
||||
|
||||
# open window(s) with ignore_msg=true to avoid focus being grabbed and changing workspace
|
||||
# dkcmd rule class="^TelegramDesktop$" ignore_msg=true
|
||||
|
||||
# define some terminals and allow them to be absorbed by spawned windows
|
||||
dkcmd rule class="^(st|st-256color|urxvt|kitty|alacritty|xterm|xterm-256color)$" terminal=true
|
||||
|
||||
# set a window to never absorb other windows, like the xev event tester
|
||||
dkcmd rule title="^Event Tester$" no_absorb=true
|
||||
|
||||
# send a window to the scratchpad
|
||||
dkcmd rule class="^scratchpad$" scratch=true
|
||||
|
||||
# focus window and workspace on opening
|
||||
# dkcmd rule class="^firefox$" ws=1 focus=true
|
||||
|
||||
# update or remove an existing rule with the same match patterns
|
||||
# dkcmd rule class="^firefox$" mon="HDMI-A-0"
|
||||
# dkcmd rule remove class="^firefox$"
|
||||
|
||||
# apply current rule set to all existing windows (used mainly for WM restart)
|
||||
dkcmd rule apply '*'
|
||||
|
||||
# delete all rules
|
||||
# dkcmd rule remove '*'
|
||||
|
||||
} >> "$logfile" 2>&1 # append responses
|
||||
|
||||
# inform of any errors in a notification
|
||||
if grep -q 'error:' "$logfile"; then
|
||||
hash notify-send && notify-send -t 0 -u critical "dkrc has errors" \
|
||||
"$(awk '/error:/ {sub(/^error: /, ""); gsub(/</, "\<"); print}' "$logfile")"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -1,117 +0,0 @@
|
||||
# sxhkdrc for use with dk
|
||||
#########################################################
|
||||
|
||||
# launcher
|
||||
mod4 + p
|
||||
dmenu_run -fn 'Fira Code Nerd Font Ret:size=13'
|
||||
|
||||
# terminal
|
||||
mod4 + shift + Return
|
||||
st
|
||||
|
||||
mod4 + ctrl + shift + Return
|
||||
st-abduco-tabbed
|
||||
|
||||
# screenshot and selection capture
|
||||
{_,mod4 + }@Print
|
||||
scrot {_,-s}
|
||||
|
||||
# dedicated volume keys
|
||||
{XF86AudioRaiseVolume,XF86AudioLowerVolume}
|
||||
pamixer {-i,-d} 2
|
||||
|
||||
# dedicated backlight keys
|
||||
{XF86MonBrightnessUp,XF86MonBrightnessDown}
|
||||
xbacklight {+10,-10}
|
||||
|
||||
# alt volume keys
|
||||
mod4 + {Insert,Delete}
|
||||
pamixer {-i,-d} 2
|
||||
|
||||
# reload sxhkd
|
||||
mod4 + shift + x
|
||||
pkill -USR1 -x sxhkd
|
||||
|
||||
|
||||
|
||||
# quit dk
|
||||
mod4 + shift + q
|
||||
dkcmd exit
|
||||
|
||||
# reload dkrc
|
||||
mod4 + shift + r
|
||||
$HOME/.config/dk/dkrc
|
||||
|
||||
# restart dk
|
||||
mod4 + ctrl + shift + r
|
||||
dkcmd restart
|
||||
|
||||
# focus next or previous window
|
||||
mod4 + {j,k}
|
||||
dkcmd win focus {next,prev}
|
||||
|
||||
# close window, swap tiled window in/out of master, cycle tiled windows in place
|
||||
mod4 + {q,space,Tab}
|
||||
dkcmd win {kill,swap,cycle}
|
||||
|
||||
# toggle fullscreen and fake fullscreen (enable manipulating fullscreen window)
|
||||
{_,mod4 + }F11
|
||||
dkcmd win {full,fakefull}
|
||||
|
||||
# toggle floating, sticky, or scratchpad
|
||||
mod4 + shift + {space,s,u}
|
||||
dkcmd win {float,stick,scratch}
|
||||
# alternatively to scratch a window by class "scratchpad"
|
||||
#dkcmd win {float,stick,scratchpad scratch}
|
||||
|
||||
# move window, signed (+/-) for relative changes, for tiled windows
|
||||
# y coord changes will move the window up/down the stack
|
||||
mod4 + shift + {h,j,k,l}
|
||||
dkcmd win resize {x=-20,y=+20,y=-20,x=+20}
|
||||
|
||||
# resize window, signed (+/-) for relative changes
|
||||
mod4 + ctrl + {h,j,k,l}
|
||||
dkcmd win resize {w=-20,h=+20,h=-20,w=+20}
|
||||
|
||||
# view, send, or follow to a workspace (by number)
|
||||
mod4 + {_,shift + ,ctrl + }{1-9,0}
|
||||
dkcmd ws {view,send,follow} {1-9,10}
|
||||
|
||||
# view, send, or follow to the next, previous, last active,
|
||||
# next non-empty, or prev non-empty workspace
|
||||
mod4 + {_,shift + ,ctrl + }{bracketleft,bracketright,BackSpace,Left,Right}
|
||||
dkcmd ws {view,send,follow} {prev,next,last,prevne,nextne}
|
||||
|
||||
# view, send, or follow to the next, previous, or last active monitor
|
||||
mod4 + {_,shift + ,ctrl + }{comma,period,backslash}
|
||||
dkcmd mon {view,send,follow} {prev,next,last}
|
||||
|
||||
# change active workspace layout or cycle between them
|
||||
mod4 + {t,r,m,g,s,w,f,u,c}
|
||||
dkcmd set layout {tile,rtile,mono,grid,spiral,dwindle,none,tstack,cycle}
|
||||
|
||||
# change number of windows in master or first stack
|
||||
mod4 + {_,shift + }{i,d}
|
||||
dkcmd set {master,stack} {+1,-1}
|
||||
|
||||
# change gap width
|
||||
mod4 + {equal,minus}
|
||||
dkcmd set gap {+5,-5}
|
||||
|
||||
# change border widths
|
||||
mod4 + ctrl + {_,shift + }{equal,minus}
|
||||
dkcmd set border {width,outer_width} {+1,-1}
|
||||
|
||||
# lock screen
|
||||
mod4 + ctrl + shift + l
|
||||
slock
|
||||
|
||||
# suspend
|
||||
mod4 + ctrl + shift + s
|
||||
systemctl suspend
|
||||
|
||||
# toggle light/dark theme
|
||||
mod4 + F6
|
||||
lupan-set-theme toggle
|
||||
|
||||
# vim:ft=sxhkdrc
|
||||
@@ -1,4 +0,0 @@
|
||||
[main]
|
||||
font = Fira Code Nerd Font:size=11
|
||||
|
||||
include = /usr/share/foot/themes/nord
|
||||
@@ -1,4 +0,0 @@
|
||||
monitor=DP-1,highres,0x0,2,transform,1
|
||||
monitor=HDMI-A-2,highres,1080x0,2
|
||||
|
||||
# vim: ft=hyprlang
|
||||
@@ -1,4 +0,0 @@
|
||||
monitor=DP-1,highres,0x0,2
|
||||
monitor=HDMI-A-2,highres,1920x0,2
|
||||
|
||||
# vim: ft=hyprlang
|
||||
@@ -1,151 +0,0 @@
|
||||
source = ~/.config/hypr/white.conf
|
||||
|
||||
input {
|
||||
kb_layout = pl
|
||||
kb_options = ctrl:nocaps
|
||||
}
|
||||
|
||||
general {
|
||||
gaps_in = 3
|
||||
gaps_out = 4
|
||||
layout = master
|
||||
border_size = 3
|
||||
col.inactive_border = 0xff5387ac
|
||||
col.active_border = 0xffac7853
|
||||
}
|
||||
|
||||
dwindle {
|
||||
preserve_split = true
|
||||
}
|
||||
|
||||
decoration {
|
||||
rounding = 4
|
||||
}
|
||||
|
||||
animations {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
misc {
|
||||
disable_hyprland_logo = true
|
||||
disable_splash_rendering = true
|
||||
disable_autoreload = true
|
||||
background_color = 0xff808080
|
||||
}
|
||||
|
||||
binds {
|
||||
workspace_back_and_forth = true
|
||||
}
|
||||
|
||||
$menu = wofi -S run
|
||||
$terminal = alacritty || kitty
|
||||
|
||||
$mainMod = SUPER
|
||||
|
||||
bind = $mainMod, P, exec, $menu
|
||||
bind = $mainMod SHIFT, Return, exec, $terminal
|
||||
bind = $mainMod ALT, Return, exec, $terminal
|
||||
bind = $mainMod, Return, layoutmsg,swapwithmaster master
|
||||
bind = $mainMod CONTROL SHIFT, Q, exit
|
||||
bind = $mainMod, Q, exec, hyprctl reload
|
||||
bind = $mainMod CONTROL SHIFT, C, killactive
|
||||
bind = $mainMod CONTROL SHIFT, L, exec, swaylock -c 263c59
|
||||
bind = $mainMod ALT, O, exec, swaylock -c 263c59
|
||||
bind = $mainMod CONTROL SHIFT, S, exec, swaylock -c 263c59
|
||||
bind = $mainMod CONTROL SHIFT, S, exec, systemctl suspend
|
||||
bind = $mainMod ALT, S, exec, swaylock -c 263c59
|
||||
bind = $mainMod ALT, S, exec, systemctl suspend
|
||||
bind = $mainMod CONTROL, Space, togglefloating
|
||||
bind = $mainMod, D, exec, hyprctl keyword general:layout "dwindle"
|
||||
bind = $mainMod, M, exec, hyprctl keyword general:layout "master"
|
||||
bind = $mainMod, F, fullscreen, 0
|
||||
bind = $mainMod SHIFT, F, fullscreen, 1
|
||||
bind = $mainMod ALT, F, fullscreen, 1
|
||||
bind = $mainMod, U, layoutmsg, togglesplit
|
||||
bind = $mainMod, I, layoutmsg, cycleprev
|
||||
bind = $mainMod, O, layoutmsg, cyclenext
|
||||
bind = $mainMod, A, focuscurrentorlast
|
||||
bind = $mainMod SHIFT, I, layoutmsg, swapprev
|
||||
bind = $mainMod SHIFT, O, layoutmsg, swapnext
|
||||
bind = $mainMod CONTROL, I, layoutmsg, removemaster
|
||||
bind = $mainMod CONTROL, O, layoutmsg, addmaster
|
||||
bind = $mainMod SHIFT, F6, exec, ~/bin/lupan-set-theme toggle
|
||||
bind = $mainMod ALT, T, exec, ~/bin/lupan-set-theme toggle
|
||||
|
||||
bind = $mainMod, h, movefocus, l
|
||||
bind = $mainMod, j, movefocus, d
|
||||
bind = $mainMod, k, movefocus, u
|
||||
bind = $mainMod, l, movefocus, r
|
||||
|
||||
bind = $mainMod SHIFT, h, swapwindow, l
|
||||
bind = $mainMod SHIFT, j, swapwindow, d
|
||||
bind = $mainMod SHIFT, k, swapwindow, u
|
||||
bind = $mainMod SHIFT, l, swapwindow, r
|
||||
|
||||
bind = $mainMod ALT, h, swapwindow, l
|
||||
bind = $mainMod ALT, j, swapwindow, d
|
||||
bind = $mainMod ALT, k, swapwindow, u
|
||||
bind = $mainMod ALT, l, swapwindow, r
|
||||
|
||||
bind = $mainMod CONTROL, h, layoutmsg, orientationleft
|
||||
bind = $mainMod CONTROL, j, layoutmsg, orientationbottom
|
||||
bind = $mainMod CONTROL, k, layoutmsg, orientationtop
|
||||
bind = $mainMod CONTROL, l, layoutmsg, orientationright
|
||||
|
||||
# Switch workspaces with mainMod + [0-9]
|
||||
bind = $mainMod, 1, workspace, 1
|
||||
bind = $mainMod, 2, workspace, 2
|
||||
bind = $mainMod, 3, workspace, 3
|
||||
bind = $mainMod, 4, workspace, 4
|
||||
bind = $mainMod, 5, workspace, 5
|
||||
bind = $mainMod, 6, workspace, 6
|
||||
bind = $mainMod, 7, workspace, 7
|
||||
bind = $mainMod, 8, workspace, 8
|
||||
bind = $mainMod, 9, workspace, 9
|
||||
bind = $mainMod, 0, workspace, 10
|
||||
|
||||
# Move active window to a workspace with mainMod + SHIFT + [0-9]
|
||||
bind = $mainMod SHIFT, 1, movetoworkspace, 1
|
||||
bind = $mainMod SHIFT, 2, movetoworkspace, 2
|
||||
bind = $mainMod SHIFT, 3, movetoworkspace, 3
|
||||
bind = $mainMod SHIFT, 4, movetoworkspace, 4
|
||||
bind = $mainMod SHIFT, 5, movetoworkspace, 5
|
||||
bind = $mainMod SHIFT, 6, movetoworkspace, 6
|
||||
bind = $mainMod SHIFT, 7, movetoworkspace, 7
|
||||
bind = $mainMod SHIFT, 8, movetoworkspace, 8
|
||||
bind = $mainMod SHIFT, 9, movetoworkspace, 9
|
||||
bind = $mainMod SHIFT, 0, movetoworkspace, 10
|
||||
|
||||
bind = $mainMod ALT, 1, movetoworkspace, 1
|
||||
bind = $mainMod ALT, 2, movetoworkspace, 2
|
||||
bind = $mainMod ALT, 3, movetoworkspace, 3
|
||||
bind = $mainMod ALT, 4, movetoworkspace, 4
|
||||
bind = $mainMod ALT, 5, movetoworkspace, 5
|
||||
bind = $mainMod ALT, 6, movetoworkspace, 6
|
||||
bind = $mainMod ALT, 7, movetoworkspace, 7
|
||||
bind = $mainMod ALT, 8, movetoworkspace, 8
|
||||
bind = $mainMod ALT, 9, movetoworkspace, 9
|
||||
bind = $mainMod ALT, 0, movetoworkspace, 10
|
||||
|
||||
bind = $mainMod, right, workspace, m+1
|
||||
bind = $mainMod, left, workspace, m-1
|
||||
|
||||
# Switch workspaces on current monitor with mainMod + Control + [0-9]
|
||||
bind = $mainMod CONTROL, 1, focusworkspaceoncurrentmonitor, 1
|
||||
bind = $mainMod CONTROL, 2, focusworkspaceoncurrentmonitor, 2
|
||||
bind = $mainMod CONTROL, 3, focusworkspaceoncurrentmonitor, 3
|
||||
bind = $mainMod CONTROL, 4, focusworkspaceoncurrentmonitor, 4
|
||||
bind = $mainMod CONTROL, 5, focusworkspaceoncurrentmonitor, 5
|
||||
bind = $mainMod CONTROL, 6, focusworkspaceoncurrentmonitor, 6
|
||||
bind = $mainMod CONTROL, 7, focusworkspaceoncurrentmonitor, 7
|
||||
bind = $mainMod CONTROL, 8, focusworkspaceoncurrentmonitor, 8
|
||||
bind = $mainMod CONTROL, 9, focusworkspaceoncurrentmonitor, 9
|
||||
bind = $mainMod CONTROL, 0, focusworkspaceoncurrentmonitor, 10
|
||||
|
||||
bindm = $mainMod,mouse:272,movewindow
|
||||
bindm = $mainMod,mouse:273,resizewindow
|
||||
|
||||
exec-once = waybar
|
||||
exec-once = swayidle -w timeout 300 'swaylock -f -c 263c59' before-sleep 'swaylock -f -c 263c59'
|
||||
|
||||
# vim: ft=hyprlang
|
||||
@@ -1,5 +0,0 @@
|
||||
monitor=eDP-1,prefered,0x0,1.5
|
||||
monitor=DP-1,highres,1280x0,2
|
||||
monitor=HDMI-A-1,highres,3200x0,2
|
||||
|
||||
# vim: ft=hyprlang
|
||||
@@ -1,10 +0,0 @@
|
||||
env = LIBVA_DRIVER_NAME,nvidia
|
||||
env = XDG_SESSION_TYPE,wayland
|
||||
env = GBM_BACKEND,nvidia-drm
|
||||
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
|
||||
env = WLR_NO_HARDWARE_CURSORS,1
|
||||
|
||||
monitor=DP-1,highres,0x0,2
|
||||
monitor=DP-2,highres,1920x0,2
|
||||
|
||||
# vim: ft=hyprlang
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
"modules-left": [
|
||||
"hyprland/workspaces",
|
||||
"hyprland/window"
|
||||
],
|
||||
"modules-right": [
|
||||
"tray",
|
||||
"clock"
|
||||
],
|
||||
"reload_style_on_change": true,
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
* {
|
||||
background-color: #3f4947;
|
||||
color: #9bafac;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
border-bottom: 3px solid #9bafac;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
border-bottom: 3px solid #a65959;
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
* {
|
||||
background-color: #dde4e3;
|
||||
color: #2c3131;
|
||||
}
|
||||
|
||||
|
||||
#workspaces button.active {
|
||||
border-bottom: 3px solid #2c3131;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
border-bottom: 3px solid #9e412e;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
@import url("file:///home/lupan/.config/waybar/dark.css");
|
||||
|
||||
* {
|
||||
font-family: Fira Code Nerd Font;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
padding: 0 0.5rem;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 3px;
|
||||
border-radius: 0;
|
||||
border-bottom: 3px solid transparent;
|
||||
}
|
||||
|
||||
#window {
|
||||
border-bottom: 3px solid transparent;
|
||||
}
|
||||
|
||||
#clock {
|
||||
padding: 0 0.5rem;
|
||||
border-bottom: 3px solid transparent;
|
||||
}
|
||||
189
i3/.config/i3/config
Normal file
189
i3/.config/i3/config
Normal file
@@ -0,0 +1,189 @@
|
||||
# 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 window’s width.
|
||||
# Pressing right will grow the window’s width.
|
||||
# Pressing up will shrink the window’s height.
|
||||
# Pressing down will grow the window’s 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
|
||||
}
|
||||
}
|
||||
16
i3/.config/i3status/config
Normal file
16
i3/.config/i3status/config
Normal file
@@ -0,0 +1,16 @@
|
||||
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 "
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
font_family FiraCode Nerd
|
||||
font_size 11
|
||||
|
||||
cursor_blink_interval 0
|
||||
|
||||
tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title} {index}"
|
||||
|
||||
action_alias launch_tab launch --type=tab --cwd=current
|
||||
|
||||
map ctrl+shift+n launch_tab tmux
|
||||
map ctrl+shift+t launch_tab tmux attach
|
||||
map ctrl+shift+s launch_tab zsh
|
||||
map ctrl+shift+6 no_op
|
||||
|
||||
map ctrl+shift+h previous_tab
|
||||
map ctrl+shift+l next_tab
|
||||
map ctrl+shift+p goto_tab -1
|
||||
map ctrl+alt+1 goto_tab 1
|
||||
map ctrl+alt+2 goto_tab 2
|
||||
map ctrl+alt+3 goto_tab 3
|
||||
map ctrl+alt+4 goto_tab 4
|
||||
map ctrl+alt+5 goto_tab 5
|
||||
map ctrl+alt+6 goto_tab 6
|
||||
map ctrl+alt+7 goto_tab 7
|
||||
map ctrl+alt+8 goto_tab 8
|
||||
map ctrl+alt+9 goto_tab 9
|
||||
map ctrl+alt+0 goto_tab 10
|
||||
|
||||
# BEGIN_KITTY_THEME
|
||||
# Afterglow
|
||||
include current-theme.conf
|
||||
# END_KITTY_THEME
|
||||
@@ -1,9 +0,0 @@
|
||||
os:
|
||||
edit: 'nvim {{filename}}'
|
||||
editAtLine: 'nvim +{{line}} {{filename}}'
|
||||
editAtLineAndWait: 'nvim +{{line}} {{filename}}'
|
||||
editInTerminal: true
|
||||
openDirInEditor: 'nvim {{dir}}'
|
||||
|
||||
gui:
|
||||
nerdFontsVersion: "3"
|
||||
@@ -1,8 +1,2 @@
|
||||
PREFIX = /usr/local
|
||||
|
||||
lupan-clock: lupan-clock.c
|
||||
${CC} -o $@ $< -lX11 -Wall
|
||||
|
||||
install:
|
||||
mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
cp -f lupan-clock ${DESTDIR}${PREFIX}/bin
|
||||
|
||||
965
lupan-wm/Cargo.lock
generated
Normal file
965
lupan-wm/Cargo.lock
generated
Normal file
@@ -0,0 +1,965 @@
|
||||
# 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",
|
||||
]
|
||||
12
lupan-wm/Cargo.toml
Normal file
12
lupan-wm/Cargo.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
[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"] }
|
||||
184
lupan-wm/src/main.rs
Normal file
184
lupan-wm/src/main.rs
Normal file
@@ -0,0 +1,184 @@
|
||||
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()
|
||||
}
|
||||
@@ -1,20 +1,495 @@
|
||||
require("config.options")
|
||||
require("config.remap")
|
||||
require("config.lsp")
|
||||
-- Set <space> as the leader key (must be before plugins)
|
||||
-- See `:help mapleader`
|
||||
|
||||
require("plugins.arrow")
|
||||
require("plugins.auto-session")
|
||||
require("plugins.colorscheme")
|
||||
require("plugins.conform")
|
||||
require("plugins.flash")
|
||||
require("plugins.guess-indent")
|
||||
require("plugins.luasnip")
|
||||
require("plugins.multicursor")
|
||||
require("plugins.nvim-various-textobjs")
|
||||
require("plugins.oil")
|
||||
require("plugins.slimline")
|
||||
require("plugins.snacks")
|
||||
require("plugins.telescope")
|
||||
require("plugins.surround")
|
||||
require("plugins.treesitter")
|
||||
require("plugins.which-key")
|
||||
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,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"rmehri01/onenord.nvim",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd.colorscheme 'onenord'
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
-- Set lualine as statusline
|
||||
'nvim-lualine/lualine.nvim',
|
||||
-- See `:help lualine.txt`
|
||||
opts = {
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
theme = 'onenord',
|
||||
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' },
|
||||
|
||||
-- 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" })
|
||||
|
||||
-- [[ 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
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"arrow.nvim": { "branch": "master", "commit": "6e0f726f55f99332dd726a53effd6813786b6d49" },
|
||||
"conform.nvim": { "branch": "master", "commit": "1bf8b5b9caee51507aa51eaed3da5b0f2595c6b9" },
|
||||
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"multicursor.nvim": { "branch": "1.0", "commit": "a6cf4e7daaf10a6b14bb7838caf779f0de5070cd" },
|
||||
"nightfox.nvim": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" },
|
||||
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
cmd = { "clangd" },
|
||||
filetypes = { "c", "cpp" },
|
||||
root_markers = { ".git" },
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
cmd = { "gopls" },
|
||||
filetypes = { "go", "gomod", "gowork", "gosum", "gotmpl" },
|
||||
root_markers = { "go.mod", "go.work", ".git" },
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
return {
|
||||
cmd = { "lua-language-server" },
|
||||
filetypes = { "lua" },
|
||||
root_markers = { ".luarc.json", ".git" },
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
cmd = { "ols" },
|
||||
filetypes = { "odin" },
|
||||
root_markers = { ".git" },
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
cmd = { "templ", "lsp" },
|
||||
filetypes = { "templ" },
|
||||
root_markers = { "go.mod", "go.work", ".git" },
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
cmd = { "typescript-language-server", "--stdio" },
|
||||
filetypes = { "javascript", "typescript", "javascriptreact", "typescriptreact" },
|
||||
root_markers = { "package.json", "tsconfig.json", ".git" },
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
local home = os.getenv("HOME")
|
||||
local filename = home .. "/.lightmode"
|
||||
|
||||
local colorschemes = nil
|
||||
|
||||
function M.set_colorschemes(dark, light)
|
||||
colorschemes = { dark = dark, light = light }
|
||||
end
|
||||
|
||||
function M.terminalbg()
|
||||
if vim.uv.fs_stat(filename) then
|
||||
return "light"
|
||||
else
|
||||
return "dark"
|
||||
end
|
||||
end
|
||||
|
||||
function M.update_colorscheme(only_if_changed)
|
||||
local next = M.terminalbg()
|
||||
if not only_if_changed or next ~= vim.o.background then
|
||||
vim.o.background = next
|
||||
if colorschemes then
|
||||
vim.cmd.colorscheme(colorschemes[next])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function M.toggle_colorscheme()
|
||||
if vim.o.background == "dark" then
|
||||
vim.o.background = "light"
|
||||
else
|
||||
vim.o.background = "dark"
|
||||
end
|
||||
if colorschemes then
|
||||
vim.cmd.colorscheme(colorschemes[vim.o.background])
|
||||
end
|
||||
end
|
||||
|
||||
local w = vim.uv.new_fs_event()
|
||||
|
||||
local function watch(fname)
|
||||
w:start(
|
||||
fname,
|
||||
{},
|
||||
vim.schedule_wrap(function(...)
|
||||
M.update_colorscheme(true)
|
||||
w:stop()
|
||||
watch(fname)
|
||||
end)
|
||||
)
|
||||
end
|
||||
|
||||
watch(home)
|
||||
|
||||
return M
|
||||
@@ -1,17 +0,0 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({ { import = "plugins" } })
|
||||
@@ -1,27 +0,0 @@
|
||||
vim.lsp.enable({
|
||||
"clangd",
|
||||
"gopls",
|
||||
"templ-lsp",
|
||||
"lua_ls",
|
||||
"ols",
|
||||
"typescript-language-server",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("lsp-keys-complete", { clear = true }),
|
||||
callback = function(event)
|
||||
vim.lsp.completion.enable(true, event.data.client_id, event.data.bufnr, {
|
||||
convert = function(item)
|
||||
return { abbr = item.label:gsub("%b()", "") }
|
||||
end,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action)
|
||||
vim.keymap.set("i", "<C-space>", vim.lsp.completion.get)
|
||||
vim.keymap.set("n", "<leader>k", function()
|
||||
vim.diagnostic.jump({ float = true, count = -1 })
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>j", function()
|
||||
vim.diagnostic.jump({ float = true, count = 1 })
|
||||
end)
|
||||
end,
|
||||
})
|
||||
@@ -1,13 +0,0 @@
|
||||
vim.opt.shortmess = vim.opt.shortmess + "I"
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " \\"
|
||||
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.opt.title = true
|
||||
|
||||
vim.opt.timeout = false
|
||||
|
||||
vim.o.undofile = true
|
||||
@@ -1,12 +0,0 @@
|
||||
local set = vim.keymap.set
|
||||
|
||||
set("n", "<M-h>", "<C-w>h")
|
||||
set("n", "<M-k>", "<C-w>k")
|
||||
set("n", "<M-j>", "<C-w>j")
|
||||
set("n", "<M-l>", "<C-w>l")
|
||||
|
||||
set("n", "<Esc>", "<cmd>nohlsearch<cr>")
|
||||
set("n", "<leader>K", "<cmd>cp<cr>")
|
||||
set("n", "<leader>J", "<cmd>cn<cr>")
|
||||
set("n", "<leader>x", "<cmd>copen<cr>")
|
||||
set("n", "<leader>X", "<cmd>cclose<cr>")
|
||||
@@ -1,12 +0,0 @@
|
||||
vim.pack.add({ "https://github.com/otavioschwanck/arrow.nvim" })
|
||||
|
||||
local ok, arrow = pcall(require, "arrow")
|
||||
if ok then
|
||||
arrow.setup({
|
||||
show_icons = false,
|
||||
leader_key = "_",
|
||||
buffer_leader_key = " m",
|
||||
})
|
||||
else
|
||||
print("plugin arrow missing")
|
||||
end
|
||||
@@ -1,12 +0,0 @@
|
||||
vim.pack.add({ "https://github.com/rmagatti/auto-session" })
|
||||
|
||||
vim.keymap.set("n", "<leader>wa", "<cmd>AutoSession search<cr>")
|
||||
|
||||
local ok, sess = pcall(require, "auto-session")
|
||||
if ok then
|
||||
sess.setup({
|
||||
suppressed_dirs = { "~/", "~/src", "~/Downloads", "/" },
|
||||
})
|
||||
else
|
||||
print("plugin auto-session missing")
|
||||
end
|
||||
@@ -1,5 +0,0 @@
|
||||
vim.pack.add({ "https://github.com/EdenEast/nightfox.nvim", "https://github.com/rebelot/kanagawa.nvim" })
|
||||
|
||||
local cs = require("config.colorscheme")
|
||||
cs.set_colorschemes("kanagawa-wave", "dayfox")
|
||||
cs.update_colorscheme()
|
||||
@@ -1,36 +0,0 @@
|
||||
vim.pack.add({ "https://github.com/stevearc/conform.nvim" })
|
||||
|
||||
local ok, conform = pcall(require, "conform")
|
||||
if ok then
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
},
|
||||
format_on_save = function(bufnr)
|
||||
-- Disable with a global or buffer-local variable
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
return { timeout_ms = 500, lsp_format = "fallback" }
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
||||
if args.bang then
|
||||
-- FormatDisable! will disable formatting just for this buffer
|
||||
vim.b.disable_autoformat = true
|
||||
else
|
||||
vim.g.disable_autoformat = true
|
||||
end
|
||||
end, {
|
||||
desc = "Disable autoformat-on-save",
|
||||
bang = true,
|
||||
})
|
||||
vim.api.nvim_create_user_command("FormatEnable", function()
|
||||
vim.b.disable_autoformat = false
|
||||
vim.g.disable_autoformat = false
|
||||
end, {
|
||||
desc = "Re-enable autoformat-on-save",
|
||||
})
|
||||
else
|
||||
print("plugin conform missing")
|
||||
end
|
||||
@@ -1,30 +0,0 @@
|
||||
vim.pack.add({ "https://github.com/folke/flash.nvim" })
|
||||
|
||||
local ok, flash = pcall(require, "flash")
|
||||
|
||||
if ok then
|
||||
flash.setup({
|
||||
modes = {
|
||||
char = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local set = vim.keymap.set
|
||||
|
||||
set({ "n", "x", "o" }, "\\", function()
|
||||
require("flash").jump()
|
||||
end, { desc = "Flash" })
|
||||
set({ "n", "x", "o" }, "=", function()
|
||||
require("flash").treesitter()
|
||||
end, { desc = "Flash Treesitter" })
|
||||
set({ "o" }, "r", function()
|
||||
require("flash").remote()
|
||||
end, { desc = "Remote Flash" })
|
||||
set({ "n", "x", "o" }, " t", function()
|
||||
require("flash").treesitter_search()
|
||||
end, { desc = "Treesitter Search" })
|
||||
else
|
||||
print("plugin flash missing")
|
||||
end
|
||||
@@ -1,8 +0,0 @@
|
||||
vim.pack.add({ "https://github.com/NMAC427/guess-indent.nvim" })
|
||||
|
||||
local ok, guess_indent = pcall(require, "guess-indent")
|
||||
if ok then
|
||||
guess_indent.setup()
|
||||
else
|
||||
print("plugin guess-indent missing")
|
||||
end
|
||||
@@ -1,48 +0,0 @@
|
||||
vim.api.nvim_create_autocmd("PackChanged", {
|
||||
group = vim.api.nvim_create_augroup("luasnip-update", { clear = true }),
|
||||
callback = function(ev)
|
||||
local name, kind = ev.data.spec.name, ev.data.kind
|
||||
if name == "luasnip" and (kind == "install" or kind == "update") then
|
||||
vim.system({ "make install_jsregexp" }, { cwd = ev.data.path }):wait()
|
||||
print("luasnip make done.")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.pack.add({ { src = "https://github.com/L3MON4D3/LuaSnip", version = vim.version.range("^2.0.0") } })
|
||||
local ok, ls = pcall(require, "luasnip")
|
||||
|
||||
if ok then
|
||||
vim.keymap.set({ "i" }, "<C-K>", function()
|
||||
ls.expand()
|
||||
end, { silent = true })
|
||||
vim.keymap.set({ "i", "s" }, "<C-L>", function(fallback)
|
||||
if ls.locally_jumpable() then
|
||||
ls.jump(1)
|
||||
else
|
||||
local key = vim.api.nvim_replace_termcodes("<C-L>", true, false, true)
|
||||
vim.api.nvim_feedkeys(key, "n", false)
|
||||
end
|
||||
end, { silent = true })
|
||||
vim.keymap.set({ "i", "s" }, "<C-J>", function()
|
||||
if ls.locally_jumpable() then
|
||||
ls.jump(-1)
|
||||
else
|
||||
local key = vim.api.nvim_replace_termcodes("<C-J>", true, false, true)
|
||||
vim.api.nvim_feedkeys(key, "n", false)
|
||||
end
|
||||
end, { silent = true })
|
||||
|
||||
vim.keymap.set({ "i", "s" }, "<C-E>", function()
|
||||
if ls.choice_active() then
|
||||
ls.change_choice(1)
|
||||
else
|
||||
local key = vim.api.nvim_replace_termcodes("<C-E>", true, false, true)
|
||||
vim.api.nvim_feedkeys(key, "n", false)
|
||||
end
|
||||
end, { silent = true })
|
||||
|
||||
require("luasnip.loaders.from_lua").load({ paths = vim.fs.joinpath(vim.fn.stdpath("config"), "lua", "snippets") })
|
||||
else
|
||||
print("plugin luasnip missing")
|
||||
end
|
||||
@@ -1,76 +0,0 @@
|
||||
vim.pack.add({ { src = "https://github.com/jake-stewart/multicursor.nvim", version = "1.0" } })
|
||||
|
||||
local ok, mc = pcall(require, "multicursor-nvim")
|
||||
if ok then
|
||||
mc.setup()
|
||||
|
||||
local set = vim.keymap.set
|
||||
|
||||
-- Add or skip cursor above/below the main cursor.
|
||||
set({ "n", "x" }, "<c-k>", function()
|
||||
mc.lineAddCursor(-1)
|
||||
end)
|
||||
set({ "n", "x" }, "<c-j>", function()
|
||||
mc.lineAddCursor(1)
|
||||
end)
|
||||
set({ "n", "x" }, "<leader><c-k>", function()
|
||||
mc.lineSkipCursor(-1)
|
||||
end)
|
||||
set({ "n", "x" }, "<leader><c-j>", function()
|
||||
mc.lineSkipCursor(1)
|
||||
end)
|
||||
|
||||
-- Add or skip adding a new cursor by matching word/selection
|
||||
set({ "n", "x" }, "<c-n>", function()
|
||||
mc.matchAddCursor(1)
|
||||
end)
|
||||
set({ "n", "x" }, "<leader><c-n>", function()
|
||||
mc.matchSkipCursor(1)
|
||||
end)
|
||||
set({ "n", "x" }, "<c-p>", function()
|
||||
mc.matchAddCursor(-1)
|
||||
end)
|
||||
set({ "n", "x" }, "<leader><c-p>", function()
|
||||
mc.matchSkipCursor(-1)
|
||||
end)
|
||||
|
||||
-- Add and remove cursors with control + left click.
|
||||
set("n", "<c-leftmouse>", mc.handleMouse)
|
||||
set("n", "<c-leftdrag>", mc.handleMouseDrag)
|
||||
set("n", "<c-leftrelease>", mc.handleMouseRelease)
|
||||
|
||||
-- Disable and enable cursors.
|
||||
set({ "n", "x" }, "<leader><c-q>", mc.toggleCursor)
|
||||
|
||||
-- Mappings defined in a keymap layer only apply when there are
|
||||
-- multiple cursors. This lets you have overlapping mappings.
|
||||
mc.addKeymapLayer(function(layerSet)
|
||||
-- Select a different cursor as the main one.
|
||||
layerSet({ "n", "x" }, "<left>", mc.prevCursor)
|
||||
layerSet({ "n", "x" }, "<right>", mc.nextCursor)
|
||||
|
||||
-- Delete the main cursor.
|
||||
layerSet({ "n", "x" }, "<leader>x", mc.deleteCursor)
|
||||
|
||||
-- Enable and clear cursors using escape.
|
||||
layerSet("n", "<esc>", function()
|
||||
if not mc.cursorsEnabled() then
|
||||
mc.enableCursors()
|
||||
else
|
||||
mc.clearCursors()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
-- Customize how cursors look.
|
||||
local hl = vim.api.nvim_set_hl
|
||||
hl(0, "MultiCursorCursor", { reverse = true })
|
||||
hl(0, "MultiCursorVisual", { link = "Visual" })
|
||||
hl(0, "MultiCursorSign", { link = "SignColumn" })
|
||||
hl(0, "MultiCursorMatchPreview", { link = "Search" })
|
||||
hl(0, "MultiCursorDisabledCursor", { reverse = true })
|
||||
hl(0, "MultiCursorDisabledVisual", { link = "Visual" })
|
||||
hl(0, "MultiCursorDisabledSign", { link = "SignColumn" })
|
||||
else
|
||||
print("plugin multicursor-nvim missing")
|
||||
end
|
||||
@@ -1,8 +0,0 @@
|
||||
vim.pack.add({ "https://github.com/chrisgrieser/nvim-various-textobjs" })
|
||||
|
||||
local ok, oil = pcall(require, "various-textobjs")
|
||||
if ok then
|
||||
oil.setup({ keymaps = { useDefaults = true } })
|
||||
else
|
||||
print("plugin nvim-various-textobjs missing")
|
||||
end
|
||||
@@ -1,10 +0,0 @@
|
||||
vim.pack.add({ "https://github.com/stevearc/oil.nvim" })
|
||||
|
||||
local ok, oil = pcall(require, "oil")
|
||||
if ok then
|
||||
oil.setup()
|
||||
else
|
||||
print("plugin oil missing")
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<leader>-", "<cmd>Oil<cr>", { desc = "Oil file manager" })
|
||||
@@ -1,8 +0,0 @@
|
||||
vim.pack.add({ "https://github.com/sschleemilch/slimline.nvim" })
|
||||
|
||||
local ok, slimline = pcall(require, "slimline")
|
||||
if ok then
|
||||
slimline.setup()
|
||||
else
|
||||
print("plugin slimline missing")
|
||||
end
|
||||
@@ -1,136 +0,0 @@
|
||||
vim.pack.add({ "https://github.com/folke/snacks.nvim" })
|
||||
|
||||
local ok, snacks = pcall(require, "snacks")
|
||||
if ok then
|
||||
snacks.setup({
|
||||
picker = { enabled = true },
|
||||
})
|
||||
else
|
||||
print("plugin snacks missing")
|
||||
end
|
||||
|
||||
local set = vim.keymap.set
|
||||
|
||||
set("n", "<leader>ea", function()
|
||||
Snacks.explorer()
|
||||
end, { desc = "File Explorer" })
|
||||
|
||||
set("n", "<leader>ga", function()
|
||||
Snacks.lazygit()
|
||||
end, { desc = "Lazygit" })
|
||||
|
||||
set("n", "<leader>gh", function()
|
||||
Snacks.picker.git_diff()
|
||||
end, { desc = "Git Diff (Hunks)" })
|
||||
|
||||
set("n", "<leader>gl", function()
|
||||
Snacks.picker.git_log_line()
|
||||
end, { desc = "Git Log Line" })
|
||||
|
||||
set("n", "<leader>gL", function()
|
||||
Snacks.picker.git_log()
|
||||
end, { desc = "Git Log" })
|
||||
|
||||
set("n", "<leader>gr", function()
|
||||
Snacks.lazygit.log_file()
|
||||
end, { desc = "Git Log File (reflog)" })
|
||||
|
||||
set({ "n", "v" }, "<leader>gw", function()
|
||||
Snacks.picker.grep_word()
|
||||
end, { desc = "Grep Visual Selection or Word" })
|
||||
|
||||
set({ "n", "v" }, "<leader>gx", function()
|
||||
Snacks.gitbrowse()
|
||||
end, { desc = "Git Browse" })
|
||||
|
||||
set("n", "<leader>xr", function()
|
||||
Snacks.picker.recent()
|
||||
end, { desc = "Recent files" })
|
||||
|
||||
set("n", "<leader>xR", function()
|
||||
Snacks.picker.resume()
|
||||
end, { desc = "Resume" })
|
||||
|
||||
set("n", "<leader>U", function()
|
||||
Snacks.picker.undo()
|
||||
end, { desc = "Undo History" })
|
||||
|
||||
set("n", "<leader>xC", function()
|
||||
Snacks.picker.colorschemes()
|
||||
end, { desc = "Colorschemes" })
|
||||
|
||||
set("n", "<leader>n", function()
|
||||
Snacks.notifier.show_history()
|
||||
end, { desc = "Notification History" })
|
||||
|
||||
set("n", "<leader>N", function()
|
||||
Snacks.picker.notifications()
|
||||
end, { desc = "Notifications" })
|
||||
|
||||
set("n", "<leader>$", function()
|
||||
Snacks.rename.rename_file()
|
||||
end, { desc = "Rename File" })
|
||||
|
||||
set("n", "<leader>z", function()
|
||||
Snacks.zen.zoom()
|
||||
end, { desc = "Toggle Zoom" })
|
||||
|
||||
set("n", "<leader>.", function()
|
||||
Snacks.scratch()
|
||||
end, { desc = "Toggle Scratch Buffer" })
|
||||
|
||||
set("n", "<leader>x.", function()
|
||||
Snacks.scratch.select()
|
||||
end, { desc = "Select Scratch Buffer" })
|
||||
|
||||
-- LSP
|
||||
|
||||
set("n", "gD", function()
|
||||
Snacks.picker.lsp_declarations()
|
||||
end, { desc = "Goto Declaration" })
|
||||
|
||||
-- Terminal
|
||||
|
||||
set({ "n", "t" }, "<c-/>", function()
|
||||
Snacks.terminal()
|
||||
end, { desc = "Toggle Terminal" })
|
||||
|
||||
set({ "n", "t" }, "<c-_>", function()
|
||||
Snacks.terminal()
|
||||
end, { desc = "which_key_ignore" })
|
||||
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
callback = function()
|
||||
-- Setup some globals for debugging (lazy-loaded)
|
||||
_G.dd = function(...)
|
||||
Snacks.debug.inspect(...)
|
||||
end
|
||||
_G.bt = function()
|
||||
Snacks.debug.backtrace()
|
||||
end
|
||||
|
||||
-- Override print to use snacks for `:=` command
|
||||
if vim.fn.has("nvim-0.11") == 1 then
|
||||
vim._print = function(_, ...)
|
||||
dd(...)
|
||||
end
|
||||
else
|
||||
vim.print = _G.dd
|
||||
end
|
||||
|
||||
-- Create some toggle mappings
|
||||
Snacks.toggle.option("spell", { name = "Spelling" }):map("<leader>us")
|
||||
Snacks.toggle.option("wrap", { name = "Wrap" }):map("<leader>uw")
|
||||
Snacks.toggle.option("relativenumber", { name = "Relative Number" }):map("<leader>uL")
|
||||
Snacks.toggle.diagnostics():map("<leader>ud")
|
||||
Snacks.toggle.line_number():map("<leader>ul")
|
||||
Snacks.toggle
|
||||
.option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 })
|
||||
:map("<leader>uc")
|
||||
Snacks.toggle.treesitter():map("<leader>uT")
|
||||
Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark Background" }):map("<leader>ub")
|
||||
Snacks.toggle.inlay_hints():map("<leader>uh")
|
||||
Snacks.toggle.indent():map("<leader>ug")
|
||||
Snacks.toggle.dim():map("<leader>uD")
|
||||
end,
|
||||
})
|
||||
@@ -1,13 +0,0 @@
|
||||
vim.pack.add({
|
||||
{
|
||||
src = "https://github.com/kylechui/nvim-surround",
|
||||
version = vim.version.range("^3.0.0"),
|
||||
},
|
||||
})
|
||||
|
||||
local ok, surround = pcall(require, "nvim-surround")
|
||||
if ok then
|
||||
surround.setup()
|
||||
else
|
||||
print("plugin surround missing")
|
||||
end
|
||||
@@ -1,99 +0,0 @@
|
||||
vim.api.nvim_create_autocmd("PackChanged", {
|
||||
group = vim.api.nvim_create_augroup("telescope-fzf-native-update", { clear = true }),
|
||||
callback = function(ev)
|
||||
local name, kind = ev.data.spec.name, ev.data.kind
|
||||
if name == "telescope-fzf-native.nvim" and (kind == "install" or kind == "update") then
|
||||
vim.system({ "make" }, { cwd = ev.data.path }):wait()
|
||||
print("telescope-fzf-native make done.")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/nvim-telescope/telescope.nvim", version = "v0.2.1" },
|
||||
"https://github.com/nvim-lua/plenary.nvim",
|
||||
"https://github.com/nvim-telescope/telescope-fzf-native.nvim",
|
||||
"https://gitlab.com/davvid/telescope-git-grep.nvim",
|
||||
{ src = "https://github.com/nvim-telescope/telescope-frecency.nvim", version = vim.version.range("^1.0.0") },
|
||||
})
|
||||
|
||||
local ok, builtin = pcall(require, "telescope.builtin")
|
||||
if ok then
|
||||
require("telescope").setup({
|
||||
defaults = require("telescope.themes").get_ivy(),
|
||||
})
|
||||
local set = vim.keymap.set
|
||||
|
||||
require("telescope").load_extension("fzf")
|
||||
require("telescope").load_extension("git_grep")
|
||||
require("telescope").load_extension("frecency")
|
||||
set("n", "<leader><space>", function()
|
||||
require("telescope-frecency").start()
|
||||
end, { desc = "Telescope frecency" })
|
||||
set("n", "<leader>;", function()
|
||||
require("telescope-frecency").start({ workspace = "CWD" })
|
||||
end, { desc = "Telescope frecency" })
|
||||
set("n", "<leader>b", builtin.buffers, { desc = "Telescope buffers" })
|
||||
set("n", "<leader>cc", builtin.commands, { desc = "Telescope commands" })
|
||||
set("n", "<leader>ch", builtin.command_history, { desc = "Telescope command history" })
|
||||
set("n", "<leader>cH", builtin.highlights, { desc = "Telescope highlights" })
|
||||
set("n", "<leader>da", builtin.diagnostics, { desc = "Telescope diagnostics" })
|
||||
set("n", "<leader>ec", function()
|
||||
builtin.find_files({ cwd = vim.fn.stdpath("config") })
|
||||
end, { desc = "Telescope nvim config files" })
|
||||
set("n", "<leader>ep", function()
|
||||
builtin.find_files({ cwd = vim.fs.joinpath(vim.fn.stdpath("data"), "site") })
|
||||
end, { desc = "Telescope find files" })
|
||||
set("n", "<leader>fa", builtin.git_files, { desc = "Telescope nvim package files" })
|
||||
set("n", "<leader>F", builtin.find_files, { desc = "Telescope find files" })
|
||||
set("n", "<leader>fh", function()
|
||||
builtin.find_files({ hidden = true })
|
||||
end, { desc = "Telescope find files (hidden)" })
|
||||
set("n", "<leader>gB", builtin.git_branches, { desc = "Telescope git branches" })
|
||||
set("n", "<leader>gc", builtin.git_bcommits, { desc = "Telescope git buffer commits" })
|
||||
set("n", "<leader>gC", builtin.git_commits, { desc = "Telescope git commits" })
|
||||
set("n", "<leader>gs", builtin.git_status, { desc = "Telescope git status" })
|
||||
set("n", "<leader>gS", builtin.git_stash, { desc = "Telescope git stash" })
|
||||
set("n", "<leader>ha", builtin.help_tags, { desc = "Telescope help tags" })
|
||||
set("n", "<leader>hk", builtin.keymaps, { desc = "Telescope keymaps" })
|
||||
set("n", "<leader>l", builtin.current_buffer_fuzzy_find, { desc = "Telescope current buffer fuzzy find" })
|
||||
set("n", "<leader>L", function()
|
||||
builtin.live_grep({ grep_open_files = true })
|
||||
end, { desc = "Telescope grep open files" })
|
||||
set("n", "<leader>m", builtin.marks, { desc = "Telescope marks" })
|
||||
set("n", "<leader>M", builtin.man_pages, { desc = "Telescope man pages" })
|
||||
set("n", "<leader>o", builtin.oldfiles, { desc = "Telescope oldfiles" })
|
||||
set("n", "<leader>qa", builtin.quickfix, { desc = "Telescope quickfix" })
|
||||
set("n", "<leader>qh", builtin.quickfixhistory, { desc = "Telescope quickfix history" })
|
||||
set("n", "<leader>ql", builtin.loclist, { desc = "Telescope loclist" })
|
||||
set("n", "<leader>r", builtin.resume, { desc = "Telescope resume" })
|
||||
set("n", "<leader>t", builtin.treesitter, { desc = "Telescope treesitter symbols" })
|
||||
set("n", "<leader>R", builtin.registers, { desc = "Telescope registers" })
|
||||
set("n", "<leader>sa", function()
|
||||
require("git_grep").live_grep()
|
||||
end, { desc = "Telescope git live grep" })
|
||||
set("n", "<leader>S", builtin.live_grep, { desc = "Telescope live grep" })
|
||||
set("n", "<leader>sh", builtin.search_history, { desc = "Telescope search history" })
|
||||
set("n", "<leader>so", function()
|
||||
builtin.grep_string({ grep_open_files = true })
|
||||
end, { desc = "Telescope grep open files" })
|
||||
set({ "n", "v" }, "<leader>sw", function()
|
||||
require("git_grep").grep()
|
||||
end, { desc = "Telescope git grep word" })
|
||||
set("n", "<leader>wd", builtin.lsp_document_symbols, { desc = "Telescope document symbols" })
|
||||
set("n", "<leader>wp", builtin.lsp_workspace_symbols, { desc = "Telescope workspace symbols" })
|
||||
set("n", "<leader>ws", function()
|
||||
require("git_grep").workspace_live_grep()
|
||||
end, { desc = "Telescope workspace git live grep" })
|
||||
set("n", "<leader>wy", function()
|
||||
require("git_grep").workspace_grep()
|
||||
end, { desc = "Telescope workspace git grep word" })
|
||||
set("n", "<leader>:", builtin.builtin, { desc = "Telescope builtin" })
|
||||
|
||||
set("n", "gd", builtin.lsp_definitions, { desc = "Goto Definition" })
|
||||
set("n", "grr", builtin.lsp_references, { desc = "References" })
|
||||
set("n", "gI", builtin.lsp_implementations, { desc = "Goto Implementation" })
|
||||
set("n", "gy", builtin.lsp_type_definitions, { desc = "Goto T[y]pe Definition" })
|
||||
else
|
||||
print("plugin builtin missing")
|
||||
end
|
||||
@@ -1,84 +0,0 @@
|
||||
-- run ":TSUpdate" after plugin update
|
||||
-- If hooks need to run on install, run this before `vim.pack.add()`
|
||||
vim.api.nvim_create_autocmd("PackChanged", {
|
||||
group = vim.api.nvim_create_augroup("nvim-treesitter-update", { clear = true }),
|
||||
callback = function(ev)
|
||||
local name, kind = ev.data.spec.name, ev.data.kind
|
||||
if name == "nvim-treesitter" and kind == "update" then
|
||||
if not ev.data.active then
|
||||
vim.cmd.packadd("nvim-treesitter")
|
||||
end
|
||||
vim.cmd("TSUpdate")
|
||||
print("TSUpdate done.")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects", version = "master" },
|
||||
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "master" },
|
||||
})
|
||||
local ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||
if ok then
|
||||
configs.setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
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",
|
||||
["al"] = "@call.outer",
|
||||
["il"] = "@call.inner",
|
||||
["ao"] = "@loop.outer",
|
||||
["io"] = "@loop.inner",
|
||||
["ad"] = "@conditional.outer",
|
||||
["id"] = "@conditional.inner",
|
||||
["ar"] = "@return.outer",
|
||||
["ir"] = "@return.inner",
|
||||
["as"] = "@statement.outer",
|
||||
["ag"] = "@assignment.outer",
|
||||
["ig"] = "@assignment.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>p"] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>P"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
else
|
||||
print("plugin nvim-treesitter.configs missing")
|
||||
end
|
||||
@@ -1,8 +0,0 @@
|
||||
vim.pack.add({ "https://github.com/folke/which-key.nvim" })
|
||||
|
||||
local ok, whichkey = pcall(require, "which-key")
|
||||
if ok then
|
||||
whichkey.setup({ preset = "helix", delay = 1000 })
|
||||
else
|
||||
print("plugin whichkey missing")
|
||||
end
|
||||
@@ -1,43 +0,0 @@
|
||||
return {
|
||||
s(
|
||||
"ife",
|
||||
fmt(
|
||||
[[
|
||||
if err != nil {
|
||||
<>
|
||||
}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
},
|
||||
{ delimiters = "<>" }
|
||||
)
|
||||
),
|
||||
|
||||
s(
|
||||
"ifse",
|
||||
fmt(
|
||||
[[
|
||||
if <><>err = <>; err != nil {
|
||||
<>
|
||||
}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
f(function(args)
|
||||
local a = args[1][1]
|
||||
if string.sub(a, -2) == ", " or a == "" then
|
||||
return ""
|
||||
elseif string.sub(a, -1) == "," then
|
||||
return " "
|
||||
else
|
||||
return ", "
|
||||
end
|
||||
end, { 1 }),
|
||||
i(2),
|
||||
i(0),
|
||||
},
|
||||
{ delimiters = "<>" }
|
||||
)
|
||||
),
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
{
|
||||
"plugins": {
|
||||
"LuaSnip": {
|
||||
"rev": "5a1e39223db9a0498024a77b8441169d260c8c25",
|
||||
"src": "https://github.com/L3MON4D3/LuaSnip",
|
||||
"version": "2.0.0 - 3.0.0"
|
||||
},
|
||||
"arrow.nvim": {
|
||||
"rev": "6e0f726f55f99332dd726a53effd6813786b6d49",
|
||||
"src": "https://github.com/otavioschwanck/arrow.nvim"
|
||||
},
|
||||
"auto-session": {
|
||||
"rev": "292492ab7af4bd8b9e37e28508bc8ce995722fd5",
|
||||
"src": "https://github.com/rmagatti/auto-session"
|
||||
},
|
||||
"conform.nvim": {
|
||||
"rev": "8314f4c9e205e7f30b62147069729f9a1227d8bf",
|
||||
"src": "https://github.com/stevearc/conform.nvim"
|
||||
},
|
||||
"flash.nvim": {
|
||||
"rev": "fcea7ff883235d9024dc41e638f164a450c14ca2",
|
||||
"src": "https://github.com/folke/flash.nvim"
|
||||
},
|
||||
"guess-indent.nvim": {
|
||||
"rev": "84a4987ff36798c2fc1169cbaff67960aed9776f",
|
||||
"src": "https://github.com/NMAC427/guess-indent.nvim"
|
||||
},
|
||||
"kanagawa.nvim": {
|
||||
"rev": "aef7f5cec0a40dbe7f3304214850c472e2264b10",
|
||||
"src": "https://github.com/rebelot/kanagawa.nvim"
|
||||
},
|
||||
"multicursor.nvim": {
|
||||
"rev": "993c6eda70077c5619388900dcffefff73b40c96",
|
||||
"src": "https://github.com/jake-stewart/multicursor.nvim",
|
||||
"version": "'1.0'"
|
||||
},
|
||||
"nightfox.nvim": {
|
||||
"rev": "ba47d4b4c5ec308718641ba7402c143836f35aa9",
|
||||
"src": "https://github.com/EdenEast/nightfox.nvim"
|
||||
},
|
||||
"nvim-surround": {
|
||||
"rev": "1098d7b3c34adcfa7feb3289ee434529abd4afd1",
|
||||
"src": "https://github.com/kylechui/nvim-surround",
|
||||
"version": "3.0.0 - 4.0.0"
|
||||
},
|
||||
"nvim-treesitter": {
|
||||
"rev": "42fc28ba918343ebfd5565147a42a26580579482",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter",
|
||||
"version": "'master'"
|
||||
},
|
||||
"nvim-treesitter-textobjects": {
|
||||
"rev": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects",
|
||||
"version": "'master'"
|
||||
},
|
||||
"nvim-various-textobjs": {
|
||||
"rev": "1532de4649c81b88ee0b4e53bdd17e551dd4589a",
|
||||
"src": "https://github.com/chrisgrieser/nvim-various-textobjs"
|
||||
},
|
||||
"oil.nvim": {
|
||||
"rev": "81b8a91735ad5cd24a6b3137f14a89f19176364f",
|
||||
"src": "https://github.com/stevearc/oil.nvim"
|
||||
},
|
||||
"plenary.nvim": {
|
||||
"rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509",
|
||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
"slimline.nvim": {
|
||||
"rev": "b23d6239ae06d7b422b30b227756971348ffcd68",
|
||||
"src": "https://github.com/sschleemilch/slimline.nvim"
|
||||
},
|
||||
"snacks.nvim": {
|
||||
"rev": "fe7cfe9800a182274d0f868a74b7263b8c0c020b",
|
||||
"src": "https://github.com/folke/snacks.nvim"
|
||||
},
|
||||
"telescope-frecency.nvim": {
|
||||
"rev": "d4f1bb2a939cc02720bceb635095246751db144f",
|
||||
"src": "https://github.com/nvim-telescope/telescope-frecency.nvim",
|
||||
"version": "1.0.0 - 2.0.0"
|
||||
},
|
||||
"telescope-fzf-native.nvim": {
|
||||
"rev": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c",
|
||||
"src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
||||
},
|
||||
"telescope-git-grep.nvim": {
|
||||
"rev": "0936967941a6e7b3875d1b1bfff41b8bcd75bdf5",
|
||||
"src": "https://gitlab.com/davvid/telescope-git-grep.nvim"
|
||||
},
|
||||
"telescope.nvim": {
|
||||
"rev": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179",
|
||||
"src": "https://github.com/nvim-telescope/telescope.nvim",
|
||||
"version": "'v0.2.1'"
|
||||
},
|
||||
"which-key.nvim": {
|
||||
"rev": "3aab2147e74890957785941f0c1ad87d0a44c15a",
|
||||
"src": "https://github.com/folke/which-key.nvim"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"workspace.library" : [
|
||||
"/usr/local/share/oxwm"
|
||||
]
|
||||
}
|
||||
@@ -1,321 +0,0 @@
|
||||
---@meta
|
||||
|
||||
---Load type definitions for LSP
|
||||
---@module 'oxwm'
|
||||
|
||||
-- Modifier key: "Mod4" is the Super/Windows key, "Mod1" is Alt
|
||||
local modkey = "Mod4"
|
||||
|
||||
-- Terminal emulator command (defaults to alacritty)
|
||||
local terminal = "st"
|
||||
|
||||
local colors
|
||||
local f = io.open(os.getenv("HOME") .. "/.lightmode")
|
||||
if f ~= nil then
|
||||
io.close(f)
|
||||
colors = require("light")
|
||||
else
|
||||
colors = require("dark")
|
||||
end
|
||||
os.execute("hsetroot -solid '" .. colors.bg .. "'")
|
||||
|
||||
-- Workspace tags - can be numbers, names, or icons (requires a Nerd Font)
|
||||
local tags = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }
|
||||
|
||||
-- Font for the status bar (use "fc-list" to see available fonts)
|
||||
local bar_font = "monospace:style=Bold:size=10"
|
||||
|
||||
-- Define your blocks
|
||||
-- Similar to widgets in qtile, or dwmblocks
|
||||
local blocks = {
|
||||
oxwm.bar.block.ram({
|
||||
format = "Ram: {used}/{total} GB",
|
||||
interval = 5,
|
||||
color = colors.light_blue,
|
||||
underline = false,
|
||||
}),
|
||||
oxwm.bar.block.static({
|
||||
text = " │ ",
|
||||
interval = 999999999,
|
||||
color = colors.lavender,
|
||||
underline = false,
|
||||
}),
|
||||
oxwm.bar.block.shell({
|
||||
format = "{}",
|
||||
command = "uname -r",
|
||||
interval = 999999999,
|
||||
color = colors.red,
|
||||
underline = false,
|
||||
}),
|
||||
-- oxwm.bar.block.static({
|
||||
-- text = " │ ",
|
||||
-- interval = 999999999,
|
||||
-- color = colors.lavender,
|
||||
-- underline = false,
|
||||
-- }),
|
||||
-- oxwm.bar.block.battery({
|
||||
-- format = "Bat: {}%",
|
||||
-- charging = "⚡ Bat: {}%",
|
||||
-- discharging = "- Bat: {}%",
|
||||
-- full = "✓ Bat: {}%",
|
||||
-- interval = 30,
|
||||
-- color = colors.green,
|
||||
-- underline = false,
|
||||
-- }),
|
||||
oxwm.bar.block.static({
|
||||
text = " │ ",
|
||||
interval = 999999999,
|
||||
color = colors.lavender,
|
||||
underline = false,
|
||||
}),
|
||||
oxwm.bar.block.datetime({
|
||||
format = "{}",
|
||||
date_format = "%a, %b %d - %H:%M",
|
||||
interval = 1,
|
||||
color = colors.cyan,
|
||||
underline = false,
|
||||
}),
|
||||
}
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Basic Settings
|
||||
-------------------------------------------------------------------------------
|
||||
oxwm.set_terminal(terminal)
|
||||
oxwm.set_modkey(modkey) -- This is for Mod + mouse binds, such as drag/resize
|
||||
oxwm.set_tags(tags)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Layouts
|
||||
-------------------------------------------------------------------------------
|
||||
-- Set custom symbols for layouts (displayed in the status bar)
|
||||
-- Available layouts: "tiling", "normie" (floating), "grid", "monocle", "tabbed"
|
||||
oxwm.set_layout_symbol("tiling", "[T]")
|
||||
oxwm.set_layout_symbol("normie", "[F]")
|
||||
oxwm.set_layout_symbol("tabbed", "[=]")
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Appearance
|
||||
-------------------------------------------------------------------------------
|
||||
-- Border configuration
|
||||
|
||||
-- Width in pixels
|
||||
oxwm.border.set_width(3)
|
||||
-- Color of focused window border
|
||||
oxwm.border.set_focused_color(colors.orange)
|
||||
-- Color of unfocused window borders
|
||||
oxwm.border.set_unfocused_color(colors.grey)
|
||||
|
||||
-- Smart Enabled = No border if 1 window
|
||||
oxwm.gaps.set_smart(true)
|
||||
-- Inner gaps (horizontal, vertical) in pixels
|
||||
oxwm.gaps.set_inner(5, 5)
|
||||
-- Outer gaps (horizontal, vertical) in pixels
|
||||
oxwm.gaps.set_outer(5, 5)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Window Rules
|
||||
-------------------------------------------------------------------------------
|
||||
-- Rules allow you to automatically configure windows based on their properties
|
||||
-- You can match windows by class, instance, title, or role
|
||||
-- Available properties: floating, tag, fullscreen, etc.
|
||||
--
|
||||
-- Common use cases:
|
||||
-- - Force floating for certain applications (dialogs, utilities)
|
||||
-- - Send specific applications to specific workspaces
|
||||
-- - Configure window behavior based on title or class
|
||||
|
||||
-- Examples (uncomment to use):
|
||||
oxwm.rule.add({ instance = "gimp", floating = true })
|
||||
-- oxwm.rule.add({ class = "Alacritty", tag = 9, focus = true })
|
||||
-- oxwm.rule.add({ class = "firefox", title = "Library", floating = true })
|
||||
-- oxwm.rule.add({ class = "firefox", tag = 2 })
|
||||
-- oxwm.rule.add({ instance = "mpv", floating = true })
|
||||
|
||||
-- To find window properties, use xprop and click on the window
|
||||
-- WM_CLASS(STRING) shows both instance and class (instance, class)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Status Bar Configuration
|
||||
-------------------------------------------------------------------------------
|
||||
-- Font configuration
|
||||
oxwm.bar.set_font(bar_font)
|
||||
|
||||
-- Set your blocks here (defined above)
|
||||
oxwm.bar.set_blocks(blocks)
|
||||
|
||||
-- Bar color schemes (for workspace tag display)
|
||||
-- Parameters: foreground, background, border
|
||||
|
||||
-- Unoccupied tags
|
||||
oxwm.bar.set_scheme_normal(colors.fg, colors.bg, "#444444")
|
||||
-- Occupied tags
|
||||
oxwm.bar.set_scheme_occupied(colors.cyan, colors.bg, colors.cyan)
|
||||
-- Currently selected tag
|
||||
oxwm.bar.set_scheme_selected(colors.orange, colors.bg, colors.orange)
|
||||
-- Urgent tags (windows requesting attention)
|
||||
oxwm.bar.set_scheme_urgent(colors.red, colors.bg, colors.red)
|
||||
|
||||
-- Hide tags that have no windows and are not selected
|
||||
-- oxwm.bar.set_hide_vacant_tags(true)
|
||||
--
|
||||
function shell_quote(s)
|
||||
return '"' .. string.gsub(s, '[$"!`\\]', "\\%1") .. '"'
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Keybindings
|
||||
-------------------------------------------------------------------------------
|
||||
-- Keybindings are defined using oxwm.key.bind(modifiers, key, action)
|
||||
-- Modifiers: {"Mod4"}, {"Mod1"}, {"Shift"}, {"Control"}, or combinations like {"Mod4", "Shift"}
|
||||
-- Keys: Use uppercase for letters (e.g., "Return", "H", "J", "K", "L")
|
||||
-- Actions: Functions that return actions (e.g., oxwm.spawn(), oxwm.client.kill())
|
||||
--
|
||||
-- A list of available keysyms can be found in the X11 keysym definitions.
|
||||
-- Common keys: Return, Space, Tab, Escape, Backspace, Delete, Left, Right, Up, Down
|
||||
|
||||
-- Basic window management
|
||||
|
||||
oxwm.key.bind({ modkey }, "Return", oxwm.spawn_terminal())
|
||||
-- Launch Dmenu
|
||||
oxwm.key.bind(
|
||||
{ modkey },
|
||||
"P",
|
||||
oxwm.spawn({
|
||||
"sh",
|
||||
"-c",
|
||||
"dmenu_run -l 10 -fn " .. shell_quote(bar_font) .. " -nb " .. shell_quote(colors.bg) .. " -nf " .. shell_quote(
|
||||
colors.fg
|
||||
) .. " -sb " .. shell_quote(colors.orange) .. " -sf " .. shell_quote(colors.black),
|
||||
})
|
||||
)
|
||||
-- Copy screenshot to clipboard
|
||||
oxwm.key.bind({ modkey }, "S", oxwm.spawn({ "sh", "-c", "maim -s | xclip -selection clipboard -t image/png" }))
|
||||
oxwm.key.bind({ modkey }, "X", oxwm.client.kill())
|
||||
|
||||
-- Keybind overlay - Shows important keybindings on screen
|
||||
oxwm.key.bind({ modkey, "Shift" }, "Slash", oxwm.show_keybinds())
|
||||
|
||||
-- Window state toggles
|
||||
oxwm.key.bind({ modkey }, "F", oxwm.client.toggle_fullscreen())
|
||||
oxwm.key.bind({ modkey, "Shift" }, "Space", oxwm.client.toggle_floating())
|
||||
|
||||
-- Layout management
|
||||
oxwm.key.bind({ modkey, "Shift" }, "F", oxwm.layout.set("normie"))
|
||||
oxwm.key.bind({ modkey }, "T", oxwm.layout.set("tiling"))
|
||||
oxwm.key.bind({ modkey }, "G", oxwm.layout.set("grid"))
|
||||
oxwm.key.bind({ modkey }, "M", oxwm.layout.set("monocle"))
|
||||
oxwm.key.bind({ modkey }, "B", oxwm.layout.set("tabbed"))
|
||||
oxwm.key.bind({ modkey, "Shift" }, "S", oxwm.layout.set("scrolling"))
|
||||
oxwm.key.bind({ modkey }, "N", oxwm.layout.cycle())
|
||||
|
||||
oxwm.key.bind({ modkey, "Shift" }, "T", oxwm.spawn({ "lupan-set-theme", "toggle" }))
|
||||
|
||||
-- Master area controls (tiling layout)
|
||||
|
||||
-- Decrease/Increase master area width
|
||||
oxwm.key.bind({ modkey }, "H", oxwm.set_master_factor(-5))
|
||||
oxwm.key.bind({ modkey }, "L", oxwm.set_master_factor(5))
|
||||
-- Increment/Decrement number of master windows
|
||||
oxwm.key.bind({ modkey }, "I", oxwm.inc_num_master(1))
|
||||
oxwm.key.bind({ modkey, "Shift" }, "I", oxwm.inc_num_master(-1))
|
||||
|
||||
-- Gaps toggle
|
||||
oxwm.key.bind({ modkey }, "A", oxwm.toggle_gaps())
|
||||
|
||||
-- Window manager controls
|
||||
oxwm.key.bind({ modkey, "Shift" }, "Q", oxwm.quit())
|
||||
oxwm.key.bind({ modkey, "Shift" }, "R", oxwm.restart())
|
||||
|
||||
-- Focus movement [1 for up in the stack, -1 for down]
|
||||
oxwm.key.bind({ modkey }, "J", oxwm.client.focus_stack(1))
|
||||
oxwm.key.bind({ modkey }, "K", oxwm.client.focus_stack(-1))
|
||||
|
||||
-- Window movement (swap position in stack)
|
||||
oxwm.key.bind({ modkey, "Shift" }, "J", oxwm.client.move_stack(1))
|
||||
oxwm.key.bind({ modkey, "Shift" }, "K", oxwm.client.move_stack(-1))
|
||||
|
||||
-- Multi-monitor support
|
||||
|
||||
-- Focus next/previous Monitors
|
||||
oxwm.key.bind({ modkey }, "Comma", oxwm.monitor.focus(-1))
|
||||
oxwm.key.bind({ modkey }, "Period", oxwm.monitor.focus(1))
|
||||
-- Move window to next/previous Monitors
|
||||
oxwm.key.bind({ modkey, "Shift" }, "Comma", oxwm.monitor.tag(-1))
|
||||
oxwm.key.bind({ modkey, "Shift" }, "Period", oxwm.monitor.tag(1))
|
||||
|
||||
-- Workspace (tag) navigation
|
||||
-- Switch to workspace N (tags are 0-indexed, so tag "1" is index 0)
|
||||
oxwm.key.bind({ modkey }, "1", oxwm.tag.view(0))
|
||||
oxwm.key.bind({ modkey }, "2", oxwm.tag.view(1))
|
||||
oxwm.key.bind({ modkey }, "3", oxwm.tag.view(2))
|
||||
oxwm.key.bind({ modkey }, "4", oxwm.tag.view(3))
|
||||
oxwm.key.bind({ modkey }, "5", oxwm.tag.view(4))
|
||||
oxwm.key.bind({ modkey }, "6", oxwm.tag.view(5))
|
||||
oxwm.key.bind({ modkey }, "7", oxwm.tag.view(6))
|
||||
oxwm.key.bind({ modkey }, "8", oxwm.tag.view(7))
|
||||
oxwm.key.bind({ modkey }, "9", oxwm.tag.view(8))
|
||||
|
||||
-- Move focused window to workspace N
|
||||
oxwm.key.bind({ modkey, "Shift" }, "1", oxwm.tag.move_to(0))
|
||||
oxwm.key.bind({ modkey, "Shift" }, "2", oxwm.tag.move_to(1))
|
||||
oxwm.key.bind({ modkey, "Shift" }, "3", oxwm.tag.move_to(2))
|
||||
oxwm.key.bind({ modkey, "Shift" }, "4", oxwm.tag.move_to(3))
|
||||
oxwm.key.bind({ modkey, "Shift" }, "5", oxwm.tag.move_to(4))
|
||||
oxwm.key.bind({ modkey, "Shift" }, "6", oxwm.tag.move_to(5))
|
||||
oxwm.key.bind({ modkey, "Shift" }, "7", oxwm.tag.move_to(6))
|
||||
oxwm.key.bind({ modkey, "Shift" }, "8", oxwm.tag.move_to(7))
|
||||
oxwm.key.bind({ modkey, "Shift" }, "9", oxwm.tag.move_to(8))
|
||||
|
||||
-- Combo view (view multiple tags at once) {argos_nothing}
|
||||
-- Example: Mod+Ctrl+2 while on tag 1 will show BOTH tags 1 and 2
|
||||
oxwm.key.bind({ modkey, "Control" }, "1", oxwm.tag.toggleview(0))
|
||||
oxwm.key.bind({ modkey, "Control" }, "2", oxwm.tag.toggleview(1))
|
||||
oxwm.key.bind({ modkey, "Control" }, "3", oxwm.tag.toggleview(2))
|
||||
oxwm.key.bind({ modkey, "Control" }, "4", oxwm.tag.toggleview(3))
|
||||
oxwm.key.bind({ modkey, "Control" }, "5", oxwm.tag.toggleview(4))
|
||||
oxwm.key.bind({ modkey, "Control" }, "6", oxwm.tag.toggleview(5))
|
||||
oxwm.key.bind({ modkey, "Control" }, "7", oxwm.tag.toggleview(6))
|
||||
oxwm.key.bind({ modkey, "Control" }, "8", oxwm.tag.toggleview(7))
|
||||
oxwm.key.bind({ modkey, "Control" }, "9", oxwm.tag.toggleview(8))
|
||||
|
||||
-- Multi tag (window on multiple tags)
|
||||
-- Example: Mod+Ctrl+Shift+2 puts focused window on BOTH current tag and tag 2
|
||||
oxwm.key.bind({ modkey, "Control", "Shift" }, "1", oxwm.tag.toggletag(0))
|
||||
oxwm.key.bind({ modkey, "Control", "Shift" }, "2", oxwm.tag.toggletag(1))
|
||||
oxwm.key.bind({ modkey, "Control", "Shift" }, "3", oxwm.tag.toggletag(2))
|
||||
oxwm.key.bind({ modkey, "Control", "Shift" }, "4", oxwm.tag.toggletag(3))
|
||||
oxwm.key.bind({ modkey, "Control", "Shift" }, "5", oxwm.tag.toggletag(4))
|
||||
oxwm.key.bind({ modkey, "Control", "Shift" }, "6", oxwm.tag.toggletag(5))
|
||||
oxwm.key.bind({ modkey, "Control", "Shift" }, "7", oxwm.tag.toggletag(6))
|
||||
oxwm.key.bind({ modkey, "Control", "Shift" }, "8", oxwm.tag.toggletag(7))
|
||||
oxwm.key.bind({ modkey, "Control", "Shift" }, "9", oxwm.tag.toggletag(8))
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Advanced: Keychords
|
||||
-------------------------------------------------------------------------------
|
||||
-- Keychords allow you to bind multiple-key sequences (like Emacs or Vim)
|
||||
-- Format: {{modifiers}, key1}, {{modifiers}, key2}, ...
|
||||
-- Example: Press Mod4+Space, then release and press T to spawn a terminal
|
||||
oxwm.key.chord({
|
||||
{ { modkey }, "Space" },
|
||||
{ {}, "T" },
|
||||
}, oxwm.spawn_terminal())
|
||||
oxwm.key.chord({
|
||||
{ { modkey }, "Space" },
|
||||
{ {}, "F" },
|
||||
}, oxwm.spawn({ "firefox" }))
|
||||
oxwm.key.chord({
|
||||
{ { modkey }, "Space" },
|
||||
{ {}, "L" },
|
||||
}, oxwm.spawn({ "slock" }))
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Autostart
|
||||
-------------------------------------------------------------------------------
|
||||
-- Commands to run once when OXWM starts
|
||||
-- Uncomment and modify these examples, or add your own
|
||||
|
||||
-- oxwm.autostart("picom")
|
||||
-- oxwm.autostart("feh --bg-scale ~/wallpaper.jpg")
|
||||
-- oxwm.autostart("dunst")
|
||||
-- oxwm.autostart("nm-applet")
|
||||
@@ -1,14 +0,0 @@
|
||||
return {
|
||||
fg = "#aaaaaa",
|
||||
red = "#f7768e",
|
||||
bg = "#1a1b26",
|
||||
black = "#1a1b26",
|
||||
cyan = "#0db9d7",
|
||||
green = "#9ece6a",
|
||||
lavender = "#a9b1d6",
|
||||
light_blue = "#7aa2f7",
|
||||
grey = "#737373",
|
||||
blue = "#6dade3",
|
||||
purple = "#ad8ee6",
|
||||
orange = "#bd6628",
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
return {
|
||||
fg = "#1a1b26",
|
||||
red = "#b94646",
|
||||
bg = "#dddddd",
|
||||
black = "#1a1b26",
|
||||
cyan = "#4d8080",
|
||||
green = "#9ece6a",
|
||||
lavender = "#a9b1d6",
|
||||
light_blue = "#7aa2f7",
|
||||
grey = "#bbbbbb",
|
||||
blue = "#6dade3",
|
||||
purple = "#ad8ee6",
|
||||
orange = "#d78042",
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/* appearance */
|
||||
static const unsigned int borderpx = 2; /* border pixel of windows */
|
||||
static const unsigned int snap = 32; /* snap pixel */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
static const char *fonts[] = { "FiraCode Nerd Font Ret:size=10" };
|
||||
static const char dmenufont[] = "FiraCode Nerd Font Ret:size=10";
|
||||
static const char col_gray1[] = "#222222";
|
||||
static const char col_gray2[] = "#444444";
|
||||
static const char col_gray3[] = "#bbbbbb";
|
||||
static const char col_gray4[] = "#eeeeee";
|
||||
static const char col_blue[] = "#414868";
|
||||
static const char col_cyan[] = "#7dcfff";
|
||||
static const char *colors[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_blue, col_cyan },
|
||||
};
|
||||
|
||||
/* tagging */
|
||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||
|
||||
static const Rule rules[] = {
|
||||
/* xprop(1):
|
||||
* WM_CLASS(STRING) = instance, class
|
||||
* WM_NAME(STRING) = title
|
||||
*/
|
||||
/* class instance title tags mask isfloating monitor */
|
||||
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
||||
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
||||
};
|
||||
|
||||
/* layout(s) */
|
||||
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
|
||||
static const int nmaster = 1; /* number of clients in master area */
|
||||
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
|
||||
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
|
||||
|
||||
static const Layout layouts[] = {
|
||||
/* symbol arrange function */
|
||||
{ "[]=", tile }, /* first entry is default */
|
||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
||||
{ "[M]", monocle },
|
||||
};
|
||||
|
||||
/* key definitions */
|
||||
#define MODKEY Mod4Mask
|
||||
#define TAGKEYS(KEY,TAG) \
|
||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
||||
|
||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
|
||||
/* commands */
|
||||
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_blue, "-sf", col_gray4, NULL };
|
||||
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 */
|
||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||
{ 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, XK_b, togglebar, {0} },
|
||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
||||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||
{ MODKEY, XK_Return, zoom, {0} },
|
||||
{ MODKEY, XK_Tab, view, {0} },
|
||||
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
||||
{ MODKEY, XK_space, setlayout, {0} },
|
||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
||||
TAGKEYS( XK_1, 0)
|
||||
TAGKEYS( XK_2, 1)
|
||||
TAGKEYS( XK_3, 2)
|
||||
TAGKEYS( XK_4, 3)
|
||||
TAGKEYS( XK_5, 4)
|
||||
TAGKEYS( XK_6, 5)
|
||||
TAGKEYS( XK_7, 6)
|
||||
TAGKEYS( XK_8, 7)
|
||||
TAGKEYS( XK_9, 8)
|
||||
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||
};
|
||||
|
||||
/* button definitions */
|
||||
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
||||
static const Button buttons[] = {
|
||||
/* click event mask button function argument */
|
||||
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
||||
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
||||
{ ClkWinTitle, 0, Button2, zoom, {0} },
|
||||
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
||||
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
||||
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
|
||||
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
||||
{ ClkTagBar, 0, Button1, view, {0} },
|
||||
{ ClkTagBar, 0, Button3, toggleview, {0} },
|
||||
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||
};
|
||||
|
||||
231
patches/st-lupan-0.8.5.diff
Normal file
231
patches/st-lupan-0.8.5.diff
Normal file
@@ -0,0 +1,231 @@
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 91ab8ca..5bbc088 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
|
||||
*/
|
||||
-static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
|
||||
+static char *font = "Iosevka Slab Light:size=12:antialias=true:autohint=true";
|
||||
static int borderpx = 2;
|
||||
|
||||
/*
|
||||
@@ -95,35 +95,61 @@ unsigned int tabspaces = 8;
|
||||
|
||||
/* Terminal colors (16 first used in escape sequence) */
|
||||
static const char *colorname[] = {
|
||||
- /* 8 normal colors */
|
||||
- "black",
|
||||
- "red3",
|
||||
- "green3",
|
||||
- "yellow3",
|
||||
- "blue2",
|
||||
- "magenta3",
|
||||
- "cyan3",
|
||||
- "gray90",
|
||||
-
|
||||
- /* 8 bright colors */
|
||||
- "gray50",
|
||||
- "red",
|
||||
- "green",
|
||||
- "yellow",
|
||||
- "#5c5cff",
|
||||
- "magenta",
|
||||
- "cyan",
|
||||
- "white",
|
||||
+ /* windi dark */
|
||||
+ "#1f1f1f", /* 0: black */
|
||||
+ "#ef4444", /* 1: red */
|
||||
+ "#22c55e", /* 2: green */
|
||||
+ "#eab308", /* 3: yellow */
|
||||
+ "#3b82f6", /* 4: blue */
|
||||
+ "#d946ef", /* 5: magenta */
|
||||
+ "#06b6d4", /* 6: cyan */
|
||||
+ "#f2f2f2", /* 7: white */
|
||||
+ "#737373", /* 8: brblack */
|
||||
+ "#fecaca", /* 9: brred */
|
||||
+ "#bbf7d0", /* 10: brgreen */
|
||||
+ "#fef08a", /* 11: bryellow */
|
||||
+ "#bfdbfe", /* 12: brblue */
|
||||
+ "#f5d0fe", /* 13: brmagenta*/
|
||||
+ "#a5f3fc", /* 14: brcyan */
|
||||
+ "#fafafa", /* 15: brwhite */
|
||||
|
||||
[255] = 0,
|
||||
|
||||
/* more colors can be added after 255 to use with DefaultXX */
|
||||
- "#cccccc",
|
||||
- "#555555",
|
||||
- "gray90", /* default foreground colour */
|
||||
- "black", /* default background colour */
|
||||
+ "white",
|
||||
+ "black",
|
||||
+ "#E7E7E7", /* default foreground colour */
|
||||
+ "#2C444D",
|
||||
};
|
||||
|
||||
+/* Terminal colors for alternate (light) palette */
|
||||
+static const char *altcolorname[] = {
|
||||
+ /* windi light */
|
||||
+ "#1b1b1b", /* 0: black */
|
||||
+ "#b91c1c", /* 1: red */
|
||||
+ "#15803d", /* 2: green */
|
||||
+ "#a16207", /* 3: yellow */
|
||||
+ "#1d4ed8", /* 4: blue */
|
||||
+ "#a21caf", /* 5: magenta*/
|
||||
+ "#0e7490", /* 6: cyan */
|
||||
+ "#e9ecef", /* 7: white */
|
||||
+ "#404040", /* 8: brblack */
|
||||
+ "#ef4444", /* 9: brred */
|
||||
+ "#22c55e", /* 10: brgreen */
|
||||
+ "#eab308", /* 11: bryellow */
|
||||
+ "#3b82f6", /* 12: brblue */
|
||||
+ "#d946ef", /* 13: brmagenta */
|
||||
+ "#06b6d4", /* 14: brcyan */
|
||||
+ "#f2f2f2", /* 15: brwhite */
|
||||
+
|
||||
+ [255] = 0,
|
||||
+
|
||||
+ /* more colors can be added after 255 to use with DefaultXX */
|
||||
+ "#00638a",
|
||||
+ "#f2f2f2",
|
||||
+ "#454545", /* default foreground colour */
|
||||
+ "#f2f2f2",
|
||||
+};
|
||||
|
||||
/*
|
||||
* Default colors (colorname index)
|
||||
@@ -201,6 +227,7 @@ static Shortcut shortcuts[] = {
|
||||
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
|
||||
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
|
||||
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
|
||||
+ { XK_ANY_MOD, XK_F6, swapcolors, {.i = 0} },
|
||||
};
|
||||
|
||||
/*
|
||||
diff --git a/st.h b/st.h
|
||||
index 519b9bd..c25b693 100644
|
||||
--- a/st.h
|
||||
+++ b/st.h
|
||||
@@ -122,6 +122,7 @@ extern wchar_t *worddelimiters;
|
||||
extern int allowaltscreen;
|
||||
extern int allowwindowops;
|
||||
extern char *termname;
|
||||
+extern int usealtcolors;
|
||||
extern unsigned int tabspaces;
|
||||
extern unsigned int defaultfg;
|
||||
extern unsigned int defaultbg;
|
||||
diff --git a/x.c b/x.c
|
||||
index 8a16faa..4b569df 100644
|
||||
--- a/x.c
|
||||
+++ b/x.c
|
||||
@@ -55,6 +55,7 @@ static void clipcopy(const Arg *);
|
||||
static void clippaste(const Arg *);
|
||||
static void numlock(const Arg *);
|
||||
static void selpaste(const Arg *);
|
||||
+static void swapcolors(const Arg *);
|
||||
static void zoom(const Arg *);
|
||||
static void zoomabs(const Arg *);
|
||||
static void zoomreset(const Arg *);
|
||||
@@ -254,6 +255,8 @@ static char *opt_title = NULL;
|
||||
|
||||
static int oldbutton = 3; /* button event on startup: 3 = release */
|
||||
|
||||
+int usealtcolors = 0; /* 1 to use alternate palette */
|
||||
+
|
||||
void
|
||||
clipcopy(const Arg *dummy)
|
||||
{
|
||||
@@ -292,6 +295,18 @@ numlock(const Arg *dummy)
|
||||
win.mode ^= MODE_NUMLOCK;
|
||||
}
|
||||
|
||||
+void
|
||||
+swapcolors(const Arg *arg)
|
||||
+{
|
||||
+ int next = (arg->i == 'D') ? 0 : (arg->i == 'L') ? 1 : !usealtcolors;
|
||||
+
|
||||
+ if (next != usealtcolors) {
|
||||
+ usealtcolors = next;
|
||||
+ xloadcols();
|
||||
+ redraw();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void
|
||||
zoom(const Arg *arg)
|
||||
{
|
||||
@@ -750,6 +765,11 @@ sixd_to_16bit(int x)
|
||||
return x == 0 ? 0 : 0x3737 + 0x2828 * x;
|
||||
}
|
||||
|
||||
+const char* getcolorname(int i)
|
||||
+{
|
||||
+ return (usealtcolors) ? altcolorname[i] : colorname[i];
|
||||
+}
|
||||
+
|
||||
int
|
||||
xloadcolor(int i, const char *name, Color *ncolor)
|
||||
{
|
||||
@@ -768,7 +788,7 @@ xloadcolor(int i, const char *name, Color *ncolor)
|
||||
return XftColorAllocValue(xw.dpy, xw.vis,
|
||||
xw.cmap, &color, ncolor);
|
||||
} else
|
||||
- name = colorname[i];
|
||||
+ name = getcolorname(i);
|
||||
}
|
||||
|
||||
return XftColorAllocName(xw.dpy, xw.vis, xw.cmap, name, ncolor);
|
||||
@@ -791,8 +811,8 @@ xloadcols(void)
|
||||
|
||||
for (i = 0; i < dc.collen; i++)
|
||||
if (!xloadcolor(i, NULL, &dc.col[i])) {
|
||||
- if (colorname[i])
|
||||
- die("could not allocate color '%s'\n", colorname[i]);
|
||||
+ if (getcolorname(i))
|
||||
+ die("could not allocate color '%s'\n", getcolorname(i));
|
||||
else
|
||||
die("could not allocate color %d\n", i);
|
||||
}
|
||||
@@ -1184,13 +1204,13 @@ xinit(int cols, int rows)
|
||||
cursor = XCreateFontCursor(xw.dpy, mouseshape);
|
||||
XDefineCursor(xw.dpy, xw.win, cursor);
|
||||
|
||||
- if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) {
|
||||
+ if (XParseColor(xw.dpy, xw.cmap, getcolorname(mousefg), &xmousefg) == 0) {
|
||||
xmousefg.red = 0xffff;
|
||||
xmousefg.green = 0xffff;
|
||||
xmousefg.blue = 0xffff;
|
||||
}
|
||||
|
||||
- if (XParseColor(xw.dpy, xw.cmap, colorname[mousebg], &xmousebg) == 0) {
|
||||
+ if (XParseColor(xw.dpy, xw.cmap, getcolorname(mousebg), &xmousebg) == 0) {
|
||||
xmousebg.red = 0x0000;
|
||||
xmousebg.green = 0x0000;
|
||||
xmousebg.blue = 0x0000;
|
||||
@@ -2008,6 +2028,15 @@ usage(void)
|
||||
" [stty_args ...]\n", argv0, argv0);
|
||||
}
|
||||
|
||||
+void
|
||||
+sig_usr_handler(int num)
|
||||
+{
|
||||
+ Arg a = { .i = (num == 10) ? 'D' : 'L' };
|
||||
+ signal(num, sig_usr_handler);
|
||||
+ swapcolors(&a);
|
||||
+}
|
||||
+
|
||||
+
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
@@ -2066,6 +2095,8 @@ run:
|
||||
if (!opt_title)
|
||||
opt_title = (opt_line || !opt_cmd) ? "st" : opt_cmd[0];
|
||||
|
||||
+ signal(SIGUSR1, sig_usr_handler);
|
||||
+ signal(SIGUSR2, sig_usr_handler);
|
||||
setlocale(LC_CTYPE, "");
|
||||
XSetLocaleModifiers("");
|
||||
cols = MAX(cols, 1);
|
||||
@@ -1,197 +0,0 @@
|
||||
;==========================================================
|
||||
;
|
||||
;
|
||||
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
|
||||
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
|
||||
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
|
||||
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
|
||||
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
|
||||
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
|
||||
;
|
||||
;
|
||||
; To learn more about how to configure Polybar
|
||||
; go to https://github.com/polybar/polybar
|
||||
;
|
||||
; The README contains a lot of information
|
||||
;
|
||||
;==========================================================
|
||||
|
||||
[common]
|
||||
priv = false
|
||||
|
||||
[colors]
|
||||
background = #282A2E
|
||||
background-alt = #373B41
|
||||
foreground = #C5C8C6
|
||||
primary = #F0C674
|
||||
secondary = #8ABEB7
|
||||
alert = #A54242
|
||||
disabled = #707880
|
||||
|
||||
[bar/bar]
|
||||
monitor = ${env:MONITOR:}
|
||||
width = 100%
|
||||
height = 24pt
|
||||
radius = 6
|
||||
|
||||
; dpi = 96
|
||||
|
||||
background = ${colors.background}
|
||||
foreground = ${colors.foreground}
|
||||
|
||||
line-size = 3pt
|
||||
|
||||
border-size = 4pt
|
||||
border-color = #00000000
|
||||
|
||||
padding-left = 0
|
||||
padding-right = 1
|
||||
|
||||
module-margin = 1
|
||||
|
||||
separator = |
|
||||
separator-foreground = ${colors.disabled}
|
||||
|
||||
font-0 = Fira Code Nerd Font:size=18;4
|
||||
|
||||
modules-left = xworkspaces xwindow
|
||||
modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date
|
||||
|
||||
cursor-click = pointer
|
||||
cursor-scroll = ns-resize
|
||||
|
||||
enable-ipc = true
|
||||
|
||||
; wm-restack = generic
|
||||
; wm-restack = bspwm
|
||||
; wm-restack = i3
|
||||
|
||||
; override-redirect = true
|
||||
|
||||
; This module is not active by default (to enable it, add it to one of the
|
||||
; modules-* list above).
|
||||
; Please note that only a single tray can exist at any time. If you launch
|
||||
; multiple bars with this module, only a single one will show it, the others
|
||||
; will produce a warning. Which bar gets the module is timing dependent and can
|
||||
; be quite random.
|
||||
; For more information, see the documentation page for this module:
|
||||
; https://polybar.readthedocs.io/en/stable/user/modules/tray.html
|
||||
[module/systray]
|
||||
type = internal/tray
|
||||
|
||||
format-margin = 8pt
|
||||
tray-spacing = 16pt
|
||||
|
||||
[module/xworkspaces]
|
||||
type = internal/xworkspaces
|
||||
|
||||
group-by-monitor = false
|
||||
|
||||
label-active = %name%
|
||||
label-active-background = ${colors.background-alt}
|
||||
label-active-underline= ${colors.primary}
|
||||
label-active-padding = 1
|
||||
|
||||
label-occupied = %name%
|
||||
label-occupied-padding = 1
|
||||
|
||||
label-urgent = %name%
|
||||
label-urgent-background = ${colors.alert}
|
||||
label-urgent-padding = 1
|
||||
|
||||
label-empty = %name%
|
||||
label-empty-foreground = ${colors.disabled}
|
||||
label-empty-padding = 1
|
||||
|
||||
[module/xwindow]
|
||||
type = internal/xwindow
|
||||
label = %title:0:60:...%
|
||||
|
||||
[module/filesystem]
|
||||
type = internal/fs
|
||||
interval = 25
|
||||
|
||||
mount-0 = /
|
||||
|
||||
label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%%
|
||||
|
||||
label-unmounted = %mountpoint% not mounted
|
||||
label-unmounted-foreground = ${colors.disabled}
|
||||
|
||||
[module/pulseaudio]
|
||||
type = internal/pulseaudio
|
||||
|
||||
format-volume-prefix = "VOL "
|
||||
format-volume-prefix-foreground = ${colors.primary}
|
||||
format-volume = <label-volume>
|
||||
|
||||
label-volume = %percentage%%
|
||||
|
||||
label-muted = muted
|
||||
label-muted-foreground = ${colors.disabled}
|
||||
|
||||
click-middle = "polybar-msg action eth module_toggle; polybar-msg action wlan module_toggle"
|
||||
click-right = pavucontrol
|
||||
|
||||
[module/xkeyboard]
|
||||
type = internal/xkeyboard
|
||||
blacklist-0 = num lock
|
||||
|
||||
label-layout = %layout%
|
||||
label-layout-foreground = ${colors.primary}
|
||||
|
||||
label-indicator-padding = 2
|
||||
label-indicator-margin = 1
|
||||
label-indicator-foreground = ${colors.background}
|
||||
label-indicator-background = ${colors.secondary}
|
||||
|
||||
[module/memory]
|
||||
type = internal/memory
|
||||
interval = 2
|
||||
format-prefix = "RAM "
|
||||
format-prefix-foreground = ${colors.primary}
|
||||
label = %percentage_used:2%%
|
||||
|
||||
[module/cpu]
|
||||
type = internal/cpu
|
||||
interval = 2
|
||||
format-prefix = "CPU "
|
||||
format-prefix-foreground = ${colors.primary}
|
||||
label = %percentage:2%%
|
||||
|
||||
[module/temperature]
|
||||
type = internal/temperature
|
||||
|
||||
[network-base]
|
||||
type = internal/network
|
||||
interval = 5
|
||||
format-connected = <label-connected>
|
||||
format-disconnected = <label-disconnected>
|
||||
label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected
|
||||
hidden = ${common.priv}
|
||||
|
||||
[module/wlan]
|
||||
inherit = network-base
|
||||
interface-type = wireless
|
||||
label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip%
|
||||
|
||||
[module/eth]
|
||||
inherit = network-base
|
||||
interface-type = wired
|
||||
label-connected = %{F#F0C674}%ifname%%{F-} %local_ip%
|
||||
|
||||
[module/date]
|
||||
type = internal/date
|
||||
interval = 1
|
||||
|
||||
date = %H:%M
|
||||
date-alt = %Y-%m-%d %H:%M:%S
|
||||
|
||||
label = %date%
|
||||
label-foreground = ${colors.primary}
|
||||
|
||||
[settings]
|
||||
screenchange-reload = true
|
||||
pseudo-transparency = true
|
||||
|
||||
; vim:ft=dosini
|
||||
40
qtile/.config/qtile/colors.py
Normal file
40
qtile/.config/qtile/colors.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# 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",
|
||||
}
|
||||
}
|
||||
177
qtile/.config/qtile/config.py
Normal file
177
qtile/.config/qtile/config.py
Normal file
@@ -0,0 +1,177 @@
|
||||
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
|
||||
13
qtile/.config/qtile/monitors.py
Normal file
13
qtile/.config/qtile/monitors.py
Normal file
@@ -0,0 +1,13 @@
|
||||
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]
|
||||
70
qtile/.config/qtile/themes.py
Normal file
70
qtile/.config/qtile/themes.py
Normal file
@@ -0,0 +1,70 @@
|
||||
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)
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
FIFO="$XDG_RUNTIME_DIR/sandbar"
|
||||
|
||||
run() {
|
||||
echo run
|
||||
[ -e "$FIFO" ] && rm -f "$FIFO"
|
||||
mkfifo "$FIFO"
|
||||
|
||||
"$HOME/.config/river/status" &
|
||||
|
||||
while cat "$FIFO"; do :; done | sandbar \
|
||||
-font "FiraCode Nerd Font Ret:size=10" \
|
||||
-active-fg-color "#000000" \
|
||||
-active-bg-color "#e8c47d" \
|
||||
-inactive-fg-color "#e8c47d" \
|
||||
-inactive-bg-color "#000000" \
|
||||
-urgent-fg-color "#000000" \
|
||||
-urgent-bg-color "#cc241d" \
|
||||
-title-fg-color "#000000" \
|
||||
-title-bg-color "#e8c47d"
|
||||
}
|
||||
|
||||
while true; do
|
||||
run
|
||||
CODE=$?
|
||||
if [ $CODE -ne 139 && $CODE -ne 134 ]; then
|
||||
echo exit because $CODE
|
||||
exit
|
||||
fi
|
||||
echo sleep and continue
|
||||
sleep 1
|
||||
done
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
LOCK_COMMAND='swaylock -f -c 1f7693'
|
||||
RANDR_COMMAND='${HOME}/.config/river/randr --on'
|
||||
RANDR_OFF_COMMAND='${HOME}/.config/river/randr --off'
|
||||
|
||||
riverctl spawn "${RANDR_COMMAND}"
|
||||
|
||||
"${HOME}/.config/river/keymap"
|
||||
|
||||
# Set the default layout generator to be rivertile and start it.
|
||||
# River will send the process group of the init executable SIGTERM on exit.
|
||||
riverctl default-layout rivertile
|
||||
rivertile -view-padding 1 -outer-padding 0 &
|
||||
|
||||
riverctl spawn "${HOME}/.config/river/bar"
|
||||
|
||||
riverctl spawn "swayidle -w timeout 300 '${LOCK_COMMAND}' \
|
||||
timeout 330 '${RANDR_OFF_COMMAND}' resume '${RANDR_COMMAND}' \
|
||||
before-sleep '${LOCK_COMMAND}' after-resume '${RANDR_COMMAND}'"
|
||||
@@ -1,164 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
LOCK_COMMAND='swaylock -f -c 1f7693'
|
||||
|
||||
# Note: the "Super" modifier is also known as Logo, GUI, Windows, Mod4, etc.
|
||||
|
||||
# Super+Shift+Return to start an instance of foot (https://codeberg.org/dnkl/foot)
|
||||
riverctl map normal Super+Shift Return spawn alacritty
|
||||
riverctl map normal Super+Alt Return spawn alacritty
|
||||
|
||||
riverctl map normal Super P spawn "wofi -S run"
|
||||
|
||||
# Super+Q to close the focused view
|
||||
riverctl map normal Super Q close
|
||||
|
||||
# Super+Shift+E to exit river
|
||||
riverctl map normal Super+Shift E exit
|
||||
|
||||
# Super+J and Super+K to focus the next/previous view in the layout stack
|
||||
riverctl map normal Super J focus-view next
|
||||
riverctl map normal Super K focus-view previous
|
||||
|
||||
# Super+Shift+J and Super+Shift+K to swap the focused view with the next/previous
|
||||
# view in the layout stack
|
||||
riverctl map normal Super+Shift J swap next
|
||||
riverctl map normal Super+Shift K swap previous
|
||||
|
||||
# Super+Period and Super+Comma to focus the next/previous output
|
||||
riverctl map normal Super Period focus-output next
|
||||
riverctl map normal Super Comma focus-output previous
|
||||
|
||||
# Super+Shift+{Period,Comma} to send the focused view to the next/previous output
|
||||
riverctl map normal Super+Shift Period send-to-output next
|
||||
riverctl map normal Super+Shift Comma send-to-output previous
|
||||
|
||||
# Super+Return to bump the focused view to the top of the layout stack
|
||||
riverctl map normal Super Return zoom
|
||||
|
||||
# Super+H and Super+L to decrease/increase the main ratio of rivertile(1)
|
||||
riverctl map normal Super H send-layout-cmd rivertile "main-ratio -0.05"
|
||||
riverctl map normal Super L send-layout-cmd rivertile "main-ratio +0.05"
|
||||
|
||||
# Super+Shift+H and Super+Shift+L to increment/decrement the main count of rivertile(1)
|
||||
riverctl map normal Super+Shift H send-layout-cmd rivertile "main-count +1"
|
||||
riverctl map normal Super+Shift L send-layout-cmd rivertile "main-count -1"
|
||||
|
||||
# Super+Alt+{H,J,K,L} to move views
|
||||
riverctl map normal Super+Alt H move left 100
|
||||
riverctl map normal Super+Alt J move down 100
|
||||
riverctl map normal Super+Alt K move up 100
|
||||
riverctl map normal Super+Alt L move right 100
|
||||
|
||||
# Super+Alt+Control+{H,J,K,L} to snap views to screen edges
|
||||
riverctl map normal Super+Alt+Control H snap left
|
||||
riverctl map normal Super+Alt+Control J snap down
|
||||
riverctl map normal Super+Alt+Control K snap up
|
||||
riverctl map normal Super+Alt+Control L snap right
|
||||
|
||||
# Super+Alt+Shift+{H,J,K,L} to resize views
|
||||
riverctl map normal Super+Alt+Shift H resize horizontal -100
|
||||
riverctl map normal Super+Alt+Shift J resize vertical 100
|
||||
riverctl map normal Super+Alt+Shift K resize vertical -100
|
||||
riverctl map normal Super+Alt+Shift L resize horizontal 100
|
||||
|
||||
# Super + Left Mouse Button to move views
|
||||
riverctl map-pointer normal Super BTN_LEFT move-view
|
||||
|
||||
# Super + Right Mouse Button to resize views
|
||||
riverctl map-pointer normal Super BTN_RIGHT resize-view
|
||||
|
||||
# Super + Middle Mouse Button to toggle float
|
||||
riverctl map-pointer normal Super BTN_MIDDLE toggle-float
|
||||
|
||||
for i in $(seq 1 9)
|
||||
do
|
||||
tags=$((1 << ($i - 1)))
|
||||
|
||||
# Super+[1-9] to focus tag [0-8]
|
||||
riverctl map normal Super $i set-focused-tags $tags
|
||||
|
||||
# Super+Shift+[1-9] to tag focused view with tag [0-8]
|
||||
riverctl map normal Super+Shift $i set-view-tags $tags
|
||||
|
||||
# Super+Control+[1-9] to toggle focus of tag [0-8]
|
||||
riverctl map normal Super+Control $i toggle-focused-tags $tags
|
||||
|
||||
# Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view
|
||||
riverctl map normal Super+Shift+Control $i toggle-view-tags $tags
|
||||
done
|
||||
|
||||
# Super+0 to focus all tags
|
||||
# Super+Shift+0 to tag focused view with all tags
|
||||
all_tags=$(((1 << 32) - 1))
|
||||
riverctl map normal Super 0 set-focused-tags $all_tags
|
||||
riverctl map normal Super+Shift 0 set-view-tags $all_tags
|
||||
|
||||
# Super+Space to toggle float
|
||||
riverctl map normal Super Space toggle-float
|
||||
|
||||
# Super+F to toggle fullscreen
|
||||
riverctl map normal Super F toggle-fullscreen
|
||||
|
||||
# Super+{Up,Right,Down,Left} to change layout orientation
|
||||
riverctl map normal Super Up send-layout-cmd rivertile "main-location top"
|
||||
riverctl map normal Super Right send-layout-cmd rivertile "main-location right"
|
||||
riverctl map normal Super Down send-layout-cmd rivertile "main-location bottom"
|
||||
riverctl map normal Super Left send-layout-cmd rivertile "main-location left"
|
||||
|
||||
# Declare a passthrough mode. This mode has only a single mapping to return to
|
||||
# normal mode. This makes it useful for testing a nested wayland compositor
|
||||
riverctl declare-mode passthrough
|
||||
|
||||
# Super+F11 to enter passthrough mode
|
||||
riverctl map normal Super F11 enter-mode passthrough
|
||||
|
||||
# Super+F11 to return to normal mode
|
||||
riverctl map passthrough Super F11 enter-mode normal
|
||||
|
||||
# Various media key mapping examples for both normal and locked mode which do
|
||||
# not have a modifier
|
||||
for mode in normal locked
|
||||
do
|
||||
# Eject the optical drive (well if you still have one that is)
|
||||
riverctl map $mode None XF86Eject spawn 'eject -T'
|
||||
|
||||
# Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer)
|
||||
riverctl map $mode None XF86AudioRaiseVolume spawn 'pamixer -i 5'
|
||||
riverctl map $mode None XF86AudioLowerVolume spawn 'pamixer -d 5'
|
||||
riverctl map $mode None XF86AudioMute spawn 'pamixer --toggle-mute'
|
||||
|
||||
# Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl)
|
||||
riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause'
|
||||
riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause'
|
||||
riverctl map $mode None XF86AudioPrev spawn 'playerctl previous'
|
||||
riverctl map $mode None XF86AudioNext spawn 'playerctl next'
|
||||
|
||||
# Control screen backlight brightness with brightnessctl (https://github.com/Hummer12007/brightnessctl)
|
||||
riverctl map $mode None XF86MonBrightnessUp spawn 'brightnessctl set +5%'
|
||||
riverctl map $mode None XF86MonBrightnessDown spawn 'brightnessctl set 5%-'
|
||||
done
|
||||
|
||||
riverctl map normal Super A focus-previous-tags
|
||||
riverctl map normal Super+Control+Shift L spawn "${LOCK_COMMAND}"
|
||||
riverctl map normal Super+Control+Shift S spawn "systemctl suspend"
|
||||
|
||||
riverctl map normal Super+Alt O spawn "${LOCK_COMMAND}"
|
||||
riverctl map normal Super+Alt S spawn "systemctl suspend"
|
||||
|
||||
riverctl map normal Super+Alt T spawn "${HOME}/bin/lupan-set-theme toggle"
|
||||
|
||||
# Set background and border color
|
||||
riverctl background-color 0x002b36
|
||||
riverctl border-color-focused 0xac7853
|
||||
riverctl border-color-unfocused 0x5387ac
|
||||
|
||||
riverctl keyboard-layout -options ctrl:nocaps pl
|
||||
# Set keyboard repeat rate
|
||||
riverctl set-repeat 50 300
|
||||
|
||||
# Make all views with an app-id that starts with "float" and title "foo" start floating.
|
||||
riverctl rule-add -app-id 'float*' -title 'foo' float
|
||||
|
||||
# Make all views with app-id "bar" and any title use client-side decorations
|
||||
riverctl rule-add -app-id "bar" csd
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
repeat() {
|
||||
for x in {0..10}; do
|
||||
echo "$@"
|
||||
"$@"
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--on)
|
||||
repeat wlr-randr --output DP-1 --on --scale 2 --pos 0,0 &
|
||||
repeat wlr-randr --output DP-2 --on --scale 2 --pos 1920,0 &
|
||||
sleep 10
|
||||
;;
|
||||
--off)
|
||||
wlr-randr --output DP-1 --off
|
||||
wlr-randr --output DP-2 --off
|
||||
;;
|
||||
esac
|
||||
@@ -1,52 +0,0 @@
|
||||
#!/bin/env sh
|
||||
|
||||
cpu() {
|
||||
cpu="$(grep -o "^[^ ]*" /proc/loadavg)"
|
||||
}
|
||||
|
||||
memory() {
|
||||
memory="$(free -h | sed -n "2s/\([^ ]* *\)\{2\}\([^ ]*\).*/\2/p")"
|
||||
}
|
||||
|
||||
disk() {
|
||||
disk="$(df -h | awk 'NR==2{print $4}')"
|
||||
}
|
||||
|
||||
datetime() {
|
||||
datetime="$(date "+%F %H:%M")"
|
||||
}
|
||||
|
||||
bat() {
|
||||
read -r bat_status </sys/class/power_supply/BAT0/status
|
||||
read -r bat_capacity </sys/class/power_supply/BAT0/capacity
|
||||
bat="$bat_status $bat_capacity%"
|
||||
}
|
||||
|
||||
vol() {
|
||||
vol="$([ "$(pamixer --get-mute)" = "false" ] && printf "%s%%" "$(pamixer --get-volume)" || printf '-')"
|
||||
}
|
||||
|
||||
display() {
|
||||
echo "all status [$memory $cpu $disk] [$bat] [$vol] [$datetime]" >"$FIFO"
|
||||
}
|
||||
|
||||
printf "%s" "$$" > "$XDG_RUNTIME_DIR/status_pid"
|
||||
FIFO="$XDG_RUNTIME_DIR/sandbar"
|
||||
[ -e "$FIFO" ] || mkfifo "$FIFO"
|
||||
sec=0
|
||||
|
||||
while true; do
|
||||
sleep 1 &
|
||||
wait && {
|
||||
[ $((sec % 15)) -eq 0 ] && memory
|
||||
[ $((sec % 15)) -eq 0 ] && cpu
|
||||
[ $((sec % 15)) -eq 0 ] && disk
|
||||
[ $((sec % 60)) -eq 0 ] && bat
|
||||
[ $((sec % 5)) -eq 0 ] && vol
|
||||
[ $((sec % 5)) -eq 0 ] && datetime
|
||||
|
||||
[ $((sec % 5)) -eq 0 ] && display
|
||||
|
||||
sec=$((sec + 1))
|
||||
}
|
||||
done
|
||||
@@ -1,16 +0,0 @@
|
||||
#
|
||||
# ~/.bashrc
|
||||
#
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
[[ $- != *i* ]] && return
|
||||
|
||||
alias ls='ls --color=auto'
|
||||
PS1='\e[34m\u@\h\e[0m \e[32m\W\e[0m \$ '
|
||||
|
||||
function before_command() { echo -ne '\e[2 q'; }
|
||||
trap before_command DEBUG
|
||||
|
||||
if [[ -f /usr/share/bash-completion/bash_completion ]]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
fi
|
||||
@@ -1,831 +0,0 @@
|
||||
# Nushell Config File
|
||||
#
|
||||
# version = "0.89.0"
|
||||
|
||||
# For more information on defining custom themes, see
|
||||
# https://www.nushell.sh/book/coloring_and_theming.html
|
||||
# And here is the theme collection
|
||||
# https://github.com/nushell/nu_scripts/tree/main/themes
|
||||
let dark_theme = {
|
||||
# color for nushell primitives
|
||||
separator: white
|
||||
leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off
|
||||
header: green_bold
|
||||
empty: blue
|
||||
# Closures can be used to choose colors for specific values.
|
||||
# The value (in this case, a bool) is piped into the closure.
|
||||
# eg) {|| if $in { 'light_cyan' } else { 'light_gray' } }
|
||||
bool: light_cyan
|
||||
int: white
|
||||
filesize: cyan
|
||||
duration: white
|
||||
date: purple
|
||||
range: white
|
||||
float: white
|
||||
string: white
|
||||
nothing: white
|
||||
binary: white
|
||||
cell-path: white
|
||||
row_index: green_bold
|
||||
record: white
|
||||
list: white
|
||||
block: white
|
||||
hints: dark_gray
|
||||
search_result: {bg: red fg: white}
|
||||
shape_and: purple_bold
|
||||
shape_binary: purple_bold
|
||||
shape_block: blue_bold
|
||||
shape_bool: light_cyan
|
||||
shape_closure: green_bold
|
||||
shape_custom: green
|
||||
shape_datetime: cyan_bold
|
||||
shape_directory: cyan
|
||||
shape_external: cyan
|
||||
shape_externalarg: green_bold
|
||||
shape_external_resolved: light_yellow_bold
|
||||
shape_filepath: cyan
|
||||
shape_flag: blue_bold
|
||||
shape_float: purple_bold
|
||||
# shapes are used to change the cli syntax highlighting
|
||||
shape_garbage: { fg: white bg: red attr: b}
|
||||
shape_globpattern: cyan_bold
|
||||
shape_int: purple_bold
|
||||
shape_internalcall: cyan_bold
|
||||
shape_keyword: cyan_bold
|
||||
shape_list: cyan_bold
|
||||
shape_literal: blue
|
||||
shape_match_pattern: green
|
||||
shape_matching_brackets: { attr: u }
|
||||
shape_nothing: light_cyan
|
||||
shape_operator: yellow
|
||||
shape_or: purple_bold
|
||||
shape_pipe: purple_bold
|
||||
shape_range: yellow_bold
|
||||
shape_record: cyan_bold
|
||||
shape_redirection: purple_bold
|
||||
shape_signature: green_bold
|
||||
shape_string: green
|
||||
shape_string_interpolation: cyan_bold
|
||||
shape_table: blue_bold
|
||||
shape_variable: purple
|
||||
shape_vardecl: purple
|
||||
}
|
||||
|
||||
let light_theme = {
|
||||
# color for nushell primitives
|
||||
separator: dark_gray
|
||||
leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off
|
||||
header: green_bold
|
||||
empty: blue
|
||||
# Closures can be used to choose colors for specific values.
|
||||
# The value (in this case, a bool) is piped into the closure.
|
||||
# eg) {|| if $in { 'dark_cyan' } else { 'dark_gray' } }
|
||||
bool: dark_cyan
|
||||
int: dark_gray
|
||||
filesize: cyan_bold
|
||||
duration: dark_gray
|
||||
date: purple
|
||||
range: dark_gray
|
||||
float: dark_gray
|
||||
string: dark_gray
|
||||
nothing: dark_gray
|
||||
binary: dark_gray
|
||||
cell-path: dark_gray
|
||||
row_index: green_bold
|
||||
record: dark_gray
|
||||
list: dark_gray
|
||||
block: dark_gray
|
||||
hints: dark_gray
|
||||
search_result: {fg: white bg: red}
|
||||
shape_and: purple_bold
|
||||
shape_binary: purple_bold
|
||||
shape_block: blue_bold
|
||||
shape_bool: light_cyan
|
||||
shape_closure: green_bold
|
||||
shape_custom: green
|
||||
shape_datetime: cyan_bold
|
||||
shape_directory: cyan
|
||||
shape_external: cyan
|
||||
shape_externalarg: green_bold
|
||||
shape_external_resolved: light_purple_bold
|
||||
shape_filepath: cyan
|
||||
shape_flag: blue_bold
|
||||
shape_float: purple_bold
|
||||
# shapes are used to change the cli syntax highlighting
|
||||
shape_garbage: { fg: white bg: red attr: b}
|
||||
shape_globpattern: cyan_bold
|
||||
shape_int: purple_bold
|
||||
shape_internalcall: cyan_bold
|
||||
shape_keyword: cyan_bold
|
||||
shape_list: cyan_bold
|
||||
shape_literal: blue
|
||||
shape_match_pattern: green
|
||||
shape_matching_brackets: { attr: u }
|
||||
shape_nothing: light_cyan
|
||||
shape_operator: yellow
|
||||
shape_or: purple_bold
|
||||
shape_pipe: purple_bold
|
||||
shape_range: yellow_bold
|
||||
shape_record: cyan_bold
|
||||
shape_redirection: purple_bold
|
||||
shape_signature: green_bold
|
||||
shape_string: green
|
||||
shape_string_interpolation: cyan_bold
|
||||
shape_table: blue_bold
|
||||
shape_variable: purple
|
||||
shape_vardecl: purple
|
||||
}
|
||||
|
||||
# External completer example
|
||||
let carapace_completer = if (which carapace | is-empty) {
|
||||
null
|
||||
} else {
|
||||
{|spans| carapace $spans.0 nushell ...$spans | from json}
|
||||
}
|
||||
|
||||
# The default config record. This is where much of your global configuration is setup.
|
||||
$env.config = {
|
||||
show_banner: false # true or false to enable or disable the welcome banner at startup
|
||||
|
||||
ls: {
|
||||
use_ls_colors: true # use the LS_COLORS environment variable to colorize output
|
||||
clickable_links: true # enable or disable clickable links. Your terminal has to support links.
|
||||
}
|
||||
|
||||
rm: {
|
||||
always_trash: false # always act as if -t was given. Can be overridden with -p
|
||||
}
|
||||
|
||||
table: {
|
||||
mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
|
||||
index_mode: always # "always" show indexes, "never" show indexes, "auto" = show indexes when a table has "index" column
|
||||
show_empty: true # show 'empty list' and 'empty record' placeholders for command output
|
||||
padding: { left: 1, right: 1 } # a left right padding of each column in a table
|
||||
trim: {
|
||||
methodology: wrapping # wrapping or truncating
|
||||
wrapping_try_keep_words: true # A strategy used by the 'wrapping' methodology
|
||||
truncating_suffix: "..." # A suffix used by the 'truncating' methodology
|
||||
}
|
||||
header_on_separator: false # show header text on separator/border line
|
||||
# abbreviated_row_count: 10 # limit data rows from top and bottom after reaching a set point
|
||||
}
|
||||
|
||||
error_style: "fancy" # "fancy" or "plain" for screen reader-friendly error messages
|
||||
|
||||
# datetime_format determines what a datetime rendered in the shell would look like.
|
||||
# Behavior without this configuration point will be to "humanize" the datetime display,
|
||||
# showing something like "a day ago."
|
||||
datetime_format: {
|
||||
# normal: '%a, %d %b %Y %H:%M:%S %z' # shows up in displays of variables or other datetime's outside of tables
|
||||
# table: '%m/%d/%y %I:%M:%S%p' # generally shows up in tabular outputs such as ls. commenting this out will change it to the default human readable datetime format
|
||||
}
|
||||
|
||||
explore: {
|
||||
status_bar_background: {fg: "#1D1F21", bg: "#C4C9C6"},
|
||||
command_bar_text: {fg: "#C4C9C6"},
|
||||
highlight: {fg: "black", bg: "yellow"},
|
||||
status: {
|
||||
error: {fg: "white", bg: "red"},
|
||||
warn: {}
|
||||
info: {}
|
||||
},
|
||||
table: {
|
||||
split_line: {fg: "#404040"},
|
||||
selected_cell: {bg: light_blue},
|
||||
selected_row: {},
|
||||
selected_column: {},
|
||||
},
|
||||
}
|
||||
|
||||
history: {
|
||||
max_size: 100_000 # Session has to be reloaded for this to take effect
|
||||
sync_on_enter: true # Enable to share history between multiple sessions, else you have to close the session to write history to file
|
||||
file_format: "plaintext" # "sqlite" or "plaintext"
|
||||
isolation: false # only available with sqlite file_format. true enables history isolation, false disables it. true will allow the history to be isolated to the current session using up/down arrows. false will allow the history to be shared across all sessions.
|
||||
}
|
||||
|
||||
completions: {
|
||||
case_sensitive: false # set to true to enable case-sensitive completions
|
||||
quick: true # set this to false to prevent auto-selecting completions when only one remains
|
||||
partial: true # set this to false to prevent partial filling of the prompt
|
||||
algorithm: "prefix" # prefix or fuzzy
|
||||
external: {
|
||||
enable: true # set to false to prevent nushell looking into $env.PATH to find more suggestions, `false` recommended for WSL users as this look up may be very slow
|
||||
max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options
|
||||
completer: $carapace_completer
|
||||
}
|
||||
}
|
||||
|
||||
filesize: {
|
||||
metric: false # true => KB, MB, GB (ISO standard), false => KiB, MiB, GiB (Windows standard)
|
||||
format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, auto
|
||||
}
|
||||
|
||||
cursor_shape: {
|
||||
emacs: line # block, underscore, line, blink_block, blink_underscore, blink_line, inherit to skip setting cursor shape (line is the default)
|
||||
vi_insert: line # block, underscore, line, blink_block, blink_underscore, blink_line, inherit to skip setting cursor shape (block is the default)
|
||||
vi_normal: block # block, underscore, line, blink_block, blink_underscore, blink_line, inherit to skip setting cursor shape (underscore is the default)
|
||||
}
|
||||
|
||||
color_config: $dark_theme # if you want a more interesting theme, you can replace the empty record with `$dark_theme`, `$light_theme` or another custom record
|
||||
use_grid_icons: true
|
||||
footer_mode: "25" # always, never, number_of_rows, auto
|
||||
float_precision: 2 # the precision for displaying floats in tables
|
||||
buffer_editor: "" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL
|
||||
use_ansi_coloring: true
|
||||
bracketed_paste: true # enable bracketed paste, currently useless on windows
|
||||
edit_mode: vi # emacs, vi
|
||||
shell_integration: false # enables terminal shell integration. Off by default, as some terminals have issues with this.
|
||||
render_right_prompt_on_last_line: false # true or false to enable or disable right prompt to be rendered on last line of the prompt.
|
||||
use_kitty_protocol: false # enables keyboard enhancement protocol implemented by kitty console, only if your terminal support this.
|
||||
highlight_resolved_externals: false # true enables highlighting of external commands in the repl resolved by which.
|
||||
|
||||
hooks: {
|
||||
pre_prompt: [{ null }] # run before the prompt is shown
|
||||
pre_execution: [{ null }] # run before the repl input is run
|
||||
env_change: {
|
||||
PWD: [{|before, after| null }] # run if the PWD environment is different since the last repl input
|
||||
}
|
||||
display_output: "if (term size).columns >= 100 { table -e } else { table }" # run to display the output of a pipeline
|
||||
command_not_found: { null } # return an error message when a command is not found
|
||||
}
|
||||
|
||||
menus: [
|
||||
# Configuration for default nushell menus
|
||||
# Note the lack of source parameter
|
||||
{
|
||||
name: completion_menu
|
||||
only_buffer_difference: false
|
||||
marker: "| "
|
||||
type: {
|
||||
layout: columnar
|
||||
columns: 4
|
||||
col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
|
||||
col_padding: 2
|
||||
}
|
||||
style: {
|
||||
text: green
|
||||
selected_text: green_reverse
|
||||
description_text: yellow
|
||||
}
|
||||
}
|
||||
{
|
||||
name: history_menu
|
||||
only_buffer_difference: true
|
||||
marker: "? "
|
||||
type: {
|
||||
layout: list
|
||||
page_size: 10
|
||||
}
|
||||
style: {
|
||||
text: green
|
||||
selected_text: green_reverse
|
||||
description_text: yellow
|
||||
}
|
||||
}
|
||||
{
|
||||
name: help_menu
|
||||
only_buffer_difference: true
|
||||
marker: "? "
|
||||
type: {
|
||||
layout: description
|
||||
columns: 4
|
||||
col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
|
||||
col_padding: 2
|
||||
selection_rows: 4
|
||||
description_rows: 10
|
||||
}
|
||||
style: {
|
||||
text: green
|
||||
selected_text: green_reverse
|
||||
description_text: yellow
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
keybindings: [
|
||||
{
|
||||
name: completion_menu
|
||||
modifier: none
|
||||
keycode: tab
|
||||
mode: [emacs vi_normal vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{ send: menu name: completion_menu }
|
||||
{ send: menunext }
|
||||
{ edit: complete }
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: history_menu
|
||||
modifier: control
|
||||
keycode: char_r
|
||||
mode: [emacs, vi_insert, vi_normal]
|
||||
event: { send: menu name: history_menu }
|
||||
}
|
||||
{
|
||||
name: help_menu
|
||||
modifier: none
|
||||
keycode: f1
|
||||
mode: [emacs, vi_insert, vi_normal]
|
||||
event: { send: menu name: help_menu }
|
||||
}
|
||||
{
|
||||
name: completion_previous_menu
|
||||
modifier: shift
|
||||
keycode: backtab
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: menuprevious }
|
||||
}
|
||||
{
|
||||
name: next_page_menu
|
||||
modifier: control
|
||||
keycode: char_x
|
||||
mode: emacs
|
||||
event: { send: menupagenext }
|
||||
}
|
||||
{
|
||||
name: undo_or_previous_page_menu
|
||||
modifier: control
|
||||
keycode: char_z
|
||||
mode: emacs
|
||||
event: {
|
||||
until: [
|
||||
{ send: menupageprevious }
|
||||
{ edit: undo }
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: escape
|
||||
modifier: none
|
||||
keycode: escape
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: esc } # NOTE: does not appear to work
|
||||
}
|
||||
{
|
||||
name: cancel_command
|
||||
modifier: control
|
||||
keycode: char_c
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: ctrlc }
|
||||
}
|
||||
{
|
||||
name: quit_shell
|
||||
modifier: control
|
||||
keycode: char_d
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: ctrld }
|
||||
}
|
||||
{
|
||||
name: clear_screen
|
||||
modifier: control
|
||||
keycode: char_l
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: clearscreen }
|
||||
}
|
||||
{
|
||||
name: search_history
|
||||
modifier: control
|
||||
keycode: char_q
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: searchhistory }
|
||||
}
|
||||
{
|
||||
name: open_command_editor
|
||||
modifier: control
|
||||
keycode: char_o
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: openeditor }
|
||||
}
|
||||
{
|
||||
name: move_up
|
||||
modifier: none
|
||||
keycode: up
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: menuup}
|
||||
{send: up}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_down
|
||||
modifier: none
|
||||
keycode: down
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: menudown}
|
||||
{send: down}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_left
|
||||
modifier: none
|
||||
keycode: left
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: menuleft}
|
||||
{send: left}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_right_or_take_history_hint
|
||||
modifier: none
|
||||
keycode: right
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintcomplete}
|
||||
{send: menuright}
|
||||
{send: right}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_one_word_left
|
||||
modifier: control
|
||||
keycode: left
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {edit: movewordleft}
|
||||
}
|
||||
{
|
||||
name: move_one_word_right_or_take_history_hint
|
||||
modifier: control
|
||||
keycode: right
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintwordcomplete}
|
||||
{edit: movewordright}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_to_line_start
|
||||
modifier: none
|
||||
keycode: home
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {edit: movetolinestart}
|
||||
}
|
||||
{
|
||||
name: move_to_line_start
|
||||
modifier: control
|
||||
keycode: char_a
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {edit: movetolinestart}
|
||||
}
|
||||
{
|
||||
name: move_to_line_end_or_take_history_hint
|
||||
modifier: none
|
||||
keycode: end
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintcomplete}
|
||||
{edit: movetolineend}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_to_line_end_or_take_history_hint
|
||||
modifier: control
|
||||
keycode: char_e
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintcomplete}
|
||||
{edit: movetolineend}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_to_line_start
|
||||
modifier: control
|
||||
keycode: home
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {edit: movetolinestart}
|
||||
}
|
||||
{
|
||||
name: move_to_line_end
|
||||
modifier: control
|
||||
keycode: end
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {edit: movetolineend}
|
||||
}
|
||||
{
|
||||
name: move_up
|
||||
modifier: control
|
||||
keycode: char_p
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: menuup}
|
||||
{send: up}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_down
|
||||
modifier: control
|
||||
keycode: char_t
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: menudown}
|
||||
{send: down}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: delete_one_character_backward
|
||||
modifier: none
|
||||
keycode: backspace
|
||||
mode: [emacs, vi_insert]
|
||||
event: {edit: backspace}
|
||||
}
|
||||
{
|
||||
name: delete_one_word_backward
|
||||
modifier: control
|
||||
keycode: backspace
|
||||
mode: [emacs, vi_insert]
|
||||
event: {edit: backspaceword}
|
||||
}
|
||||
{
|
||||
name: delete_one_character_forward
|
||||
modifier: none
|
||||
keycode: delete
|
||||
mode: [emacs, vi_insert]
|
||||
event: {edit: delete}
|
||||
}
|
||||
{
|
||||
name: delete_one_character_forward
|
||||
modifier: control
|
||||
keycode: delete
|
||||
mode: [emacs, vi_insert]
|
||||
event: {edit: delete}
|
||||
}
|
||||
{
|
||||
name: delete_one_character_forward
|
||||
modifier: control
|
||||
keycode: char_h
|
||||
mode: [emacs, vi_insert]
|
||||
event: {edit: backspace}
|
||||
}
|
||||
{
|
||||
name: delete_one_word_backward
|
||||
modifier: control
|
||||
keycode: char_w
|
||||
mode: [emacs, vi_insert]
|
||||
event: {edit: backspaceword}
|
||||
}
|
||||
{
|
||||
name: move_left
|
||||
modifier: none
|
||||
keycode: backspace
|
||||
mode: vi_normal
|
||||
event: {edit: moveleft}
|
||||
}
|
||||
{
|
||||
name: newline_or_run_command
|
||||
modifier: none
|
||||
keycode: enter
|
||||
mode: emacs
|
||||
event: {send: enter}
|
||||
}
|
||||
{
|
||||
name: move_left
|
||||
modifier: control
|
||||
keycode: char_b
|
||||
mode: emacs
|
||||
event: {
|
||||
until: [
|
||||
{send: menuleft}
|
||||
{send: left}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_right_or_take_history_hint
|
||||
modifier: control
|
||||
keycode: char_f
|
||||
mode: emacs
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintcomplete}
|
||||
{send: menuright}
|
||||
{send: right}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: redo_change
|
||||
modifier: control
|
||||
keycode: char_g
|
||||
mode: emacs
|
||||
event: {edit: redo}
|
||||
}
|
||||
{
|
||||
name: undo_change
|
||||
modifier: control
|
||||
keycode: char_z
|
||||
mode: emacs
|
||||
event: {edit: undo}
|
||||
}
|
||||
{
|
||||
name: paste_before
|
||||
modifier: control
|
||||
keycode: char_y
|
||||
mode: emacs
|
||||
event: {edit: pastecutbufferbefore}
|
||||
}
|
||||
{
|
||||
name: cut_word_left
|
||||
modifier: control
|
||||
keycode: char_w
|
||||
mode: emacs
|
||||
event: {edit: cutwordleft}
|
||||
}
|
||||
{
|
||||
name: cut_line_to_end
|
||||
modifier: control
|
||||
keycode: char_k
|
||||
mode: emacs
|
||||
event: {edit: cuttoend}
|
||||
}
|
||||
{
|
||||
name: cut_line_from_start
|
||||
modifier: control
|
||||
keycode: char_u
|
||||
mode: [emacs vi_insert]
|
||||
event: {edit: cutfromstart}
|
||||
}
|
||||
{
|
||||
name: swap_graphemes
|
||||
modifier: control
|
||||
keycode: char_t
|
||||
mode: emacs
|
||||
event: {edit: swapgraphemes}
|
||||
}
|
||||
{
|
||||
name: move_one_word_left
|
||||
modifier: alt
|
||||
keycode: left
|
||||
mode: emacs
|
||||
event: {edit: movewordleft}
|
||||
}
|
||||
{
|
||||
name: move_one_word_right_or_take_history_hint
|
||||
modifier: alt
|
||||
keycode: right
|
||||
mode: emacs
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintwordcomplete}
|
||||
{edit: movewordright}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_one_word_left
|
||||
modifier: alt
|
||||
keycode: char_b
|
||||
mode: emacs
|
||||
event: {edit: movewordleft}
|
||||
}
|
||||
{
|
||||
name: move_one_word_right_or_take_history_hint
|
||||
modifier: alt
|
||||
keycode: char_f
|
||||
mode: emacs
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintwordcomplete}
|
||||
{edit: movewordright}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: delete_one_word_forward
|
||||
modifier: alt
|
||||
keycode: delete
|
||||
mode: emacs
|
||||
event: {edit: deleteword}
|
||||
}
|
||||
{
|
||||
name: delete_one_word_backward
|
||||
modifier: alt
|
||||
keycode: backspace
|
||||
mode: emacs
|
||||
event: {edit: backspaceword}
|
||||
}
|
||||
{
|
||||
name: delete_one_word_backward
|
||||
modifier: alt
|
||||
keycode: char_m
|
||||
mode: emacs
|
||||
event: {edit: backspaceword}
|
||||
}
|
||||
{
|
||||
name: cut_word_to_right
|
||||
modifier: alt
|
||||
keycode: char_d
|
||||
mode: emacs
|
||||
event: {edit: cutwordright}
|
||||
}
|
||||
{
|
||||
name: upper_case_word
|
||||
modifier: alt
|
||||
keycode: char_u
|
||||
mode: emacs
|
||||
event: {edit: uppercaseword}
|
||||
}
|
||||
{
|
||||
name: lower_case_word
|
||||
modifier: alt
|
||||
keycode: char_l
|
||||
mode: emacs
|
||||
event: {edit: lowercaseword}
|
||||
}
|
||||
{
|
||||
name: capitalize_char
|
||||
modifier: alt
|
||||
keycode: char_c
|
||||
mode: emacs
|
||||
event: {edit: capitalizechar}
|
||||
}
|
||||
{
|
||||
name: move_up
|
||||
modifier: control
|
||||
keycode: char_k
|
||||
mode: [vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: menuup}
|
||||
{send: up}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_down
|
||||
modifier: control
|
||||
keycode: char_j
|
||||
mode: [vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: menudown}
|
||||
{send: down}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_left
|
||||
modifier: control
|
||||
keycode: char_h
|
||||
mode: [vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: menuleft}
|
||||
{send: left}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_right_or_take_history_hint
|
||||
modifier: control
|
||||
keycode: char_l
|
||||
mode: [vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintcomplete}
|
||||
{send: menuright}
|
||||
{send: right}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
alias v = nvim
|
||||
alias tl = tmux list-sessions
|
||||
alias tn = tmux new -s
|
||||
alias ta = tmux attach -t
|
||||
alias nocaps = setxkbmap pl -option ctrl:nocaps
|
||||
|
||||
def gst [] {
|
||||
git status -s | detect columns -n | rename status file
|
||||
}
|
||||
|
||||
def glog [] {
|
||||
git log --pretty=%h»¦«%aN»¦«%s»¦«%aD | lines | split column "»¦«" sha1 committer desc merged_at
|
||||
}
|
||||
|
||||
def l [pattern? = '.'] {
|
||||
ls $pattern | grid -c
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
# Nushell Environment Config File
|
||||
#
|
||||
# version = "0.89.0"
|
||||
|
||||
def create_left_prompt [] {
|
||||
let home = $nu.home-path
|
||||
|
||||
# Perform tilde substitution on dir
|
||||
# To determine if the prefix of the path matches the home dir, we split the current path into
|
||||
# segments, and compare those with the segments of the home dir. In cases where the current dir
|
||||
# is a parent of the home dir (e.g. `/home`, homedir is `/home/user`), this comparison will
|
||||
# also evaluate to true. Inside the condition, we attempt to str replace `$home` with `~`.
|
||||
# Inside the condition, either:
|
||||
# 1. The home prefix will be replaced
|
||||
# 2. The current dir is a parent of the home dir, so it will be uneffected by the str replace
|
||||
let dir = (
|
||||
if ($env.PWD | path split | zip ($home | path split) | all { $in.0 == $in.1 }) {
|
||||
($env.PWD | str replace $home "~")
|
||||
} else {
|
||||
$env.PWD
|
||||
}
|
||||
)
|
||||
|
||||
let path_color = (if (is-admin) { ansi red_bold } else { ansi green_bold })
|
||||
let separator_color = (if (is-admin) { ansi light_red_bold } else { ansi light_green_bold })
|
||||
let path_segment = $"($path_color)($dir)"
|
||||
|
||||
let userhost = $'(ansi blue_bold)(id -un)@(hostname)(ansi reset)'
|
||||
let base = $path_segment | str replace --all (char path_sep) $"($separator_color)(char path_sep)($path_color)"
|
||||
let branch = do { git rev-parse --abbrev-ref HEAD } | complete
|
||||
if $branch.exit_code == 0 {
|
||||
$"($userhost) ($base) ($separator_color)\((ansi magenta)($branch.stdout | str trim)($separator_color)) "
|
||||
} else {
|
||||
$'($userhost) ($base) '
|
||||
}
|
||||
}
|
||||
|
||||
def create_right_prompt [] {
|
||||
# create a right prompt in magenta with green separators and am/pm underlined
|
||||
let time_segment = ([
|
||||
(ansi reset)
|
||||
(ansi magenta)
|
||||
(date now | format date '%x %X %p') # try to respect user's locale
|
||||
] | str join | str replace --regex --all "([/:])" $"(ansi green)${1}(ansi magenta)" |
|
||||
str replace --regex --all "([AP]M)" $"(ansi magenta_underline)${1}")
|
||||
|
||||
let last_exit_code = if ($env.LAST_EXIT_CODE != 0) {([
|
||||
(ansi rb)
|
||||
($env.LAST_EXIT_CODE)
|
||||
] | str join)
|
||||
} else { "" }
|
||||
|
||||
([$last_exit_code, (char space), $time_segment] | str join)
|
||||
}
|
||||
|
||||
# Use nushell functions to define your right and left prompt
|
||||
$env.PROMPT_COMMAND = {|| create_left_prompt }
|
||||
# FIXME: This default is not implemented in rust code as of 2023-09-08.
|
||||
$env.PROMPT_COMMAND_RIGHT = {|| create_right_prompt }
|
||||
|
||||
# The prompt indicators are environmental variables that represent
|
||||
# the state of the prompt
|
||||
$env.PROMPT_INDICATOR = {|| "> " }
|
||||
$env.PROMPT_INDICATOR_VI_INSERT = {|| ": " }
|
||||
$env.PROMPT_INDICATOR_VI_NORMAL = {|| "> " }
|
||||
$env.PROMPT_MULTILINE_INDICATOR = {|| "::: " }
|
||||
|
||||
# If you want previously entered commands to have a different prompt from the usual one,
|
||||
# you can uncomment one or more of the following lines.
|
||||
# This can be useful if you have a 2-line prompt and it's taking up a lot of space
|
||||
# because every command entered takes up 2 lines instead of 1. You can then uncomment
|
||||
# the line below so that previously entered commands show with a single `🚀`.
|
||||
# $env.TRANSIENT_PROMPT_COMMAND = {|| "🚀 " }
|
||||
# $env.TRANSIENT_PROMPT_INDICATOR = {|| "" }
|
||||
# $env.TRANSIENT_PROMPT_INDICATOR_VI_INSERT = {|| "" }
|
||||
# $env.TRANSIENT_PROMPT_INDICATOR_VI_NORMAL = {|| "" }
|
||||
# $env.TRANSIENT_PROMPT_MULTILINE_INDICATOR = {|| "" }
|
||||
# $env.TRANSIENT_PROMPT_COMMAND_RIGHT = {|| "" }
|
||||
|
||||
# Specifies how environment variables are:
|
||||
# - converted from a string to a value on Nushell startup (from_string)
|
||||
# - converted from a value back to a string when running external commands (to_string)
|
||||
# Note: The conversions happen *after* config.nu is loaded
|
||||
$env.ENV_CONVERSIONS = {
|
||||
"PATH": {
|
||||
from_string: { |s| $s | split row (char esep) | path expand --no-symlink }
|
||||
to_string: { |v| $v | path expand --no-symlink | str join (char esep) }
|
||||
}
|
||||
"Path": {
|
||||
from_string: { |s| $s | split row (char esep) | path expand --no-symlink }
|
||||
to_string: { |v| $v | path expand --no-symlink | str join (char esep) }
|
||||
}
|
||||
}
|
||||
|
||||
# Directories to search for scripts when calling source or use
|
||||
# The default for this is $nu.default-config-dir/scripts
|
||||
$env.NU_LIB_DIRS = [
|
||||
($nu.default-config-dir | path join 'scripts') # add <nushell-config-dir>/scripts
|
||||
]
|
||||
|
||||
# Directories to search for plugin binaries when calling register
|
||||
# The default for this is $nu.default-config-dir/plugins
|
||||
$env.NU_PLUGIN_DIRS = [
|
||||
($nu.default-config-dir | path join 'plugins') # add <nushell-config-dir>/plugins
|
||||
]
|
||||
|
||||
# To add entries to PATH (on Windows you might use Path), you can use the following pattern:
|
||||
# $env.PATH = ($env.PATH | split row (char esep) | prepend '/some/path')
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
alias v=nvim
|
||||
alias ll='ls -l'
|
||||
alias tl='tmux list-sessions'
|
||||
alias rgh='rg -.'
|
||||
alias fdh='fd -H'
|
||||
alias lg=lazygit
|
||||
|
||||
if alias st > /dev/null; then
|
||||
alias gst='_vcs status'
|
||||
unalias st
|
||||
fi
|
||||
if alias r > /dev/null; then
|
||||
unalias r
|
||||
fi
|
||||
|
||||
if which eza > /dev/null; then
|
||||
alias ls='eza --icons'
|
||||
alias tree='eza --tree --icons'
|
||||
elif which exa > /dev/null; then
|
||||
alias ls='exa --icons'
|
||||
alias tree='exa --tree --icons'
|
||||
fi
|
||||
|
||||
alias nocaps='setxkbmap pl -option ctrl:nocaps'
|
||||
alias fixdp='xrandr --output DP-0 --right-of DP-2'
|
||||
|
||||
tn() {
|
||||
if [ $# -eq 0 ]; then
|
||||
tmux new
|
||||
else
|
||||
tmux new -A -s "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
tni() {
|
||||
local Q="${@:-}"
|
||||
local DIR=$(zoxide query -l | vis-menu -p 'Dir:' -l 10 "$Q")
|
||||
if [ -n "$DIR" ]; then
|
||||
local NAME=$(echo | vis-menu -p 'Session name:' $(basename $DIR))
|
||||
if [ -n "$DIR" ]; then
|
||||
tmux new -A -s "$NAME" -c "$DIR"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
ta() {
|
||||
if [ $# -eq 0 ]; then
|
||||
tmux attach
|
||||
else
|
||||
tmux attach -t "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
tai() {
|
||||
local Q="${@:-}"
|
||||
local NAME=$(tmux ls | vis-menu -p 'Session:' -l 10 "$Q" | cut -d: -f1)
|
||||
if [ -n "$NAME" ]; then
|
||||
tmux attach -t "$NAME"
|
||||
fi
|
||||
}
|
||||
|
||||
vf() {
|
||||
nvim $(fzf --multi)
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
alias hs='history -$HISTSIZE | rg'
|
||||
|
||||
alias -s pdf=zathura
|
||||
alias -s {jpg,jpeg,png}=sxiv
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -e ~/.profile ] && . ~/.profile
|
||||
@@ -1,17 +0,0 @@
|
||||
# Firstly, load the common customization script.
|
||||
. --autoload --no-alias initialization/common
|
||||
|
||||
LANG=pl_PL.UTF-8
|
||||
|
||||
set -o vi
|
||||
|
||||
[ -e ~/.config/shellconfig/aliases.sh ] && . ~/.config/shellconfig/aliases.sh
|
||||
|
||||
# Clear the screen with Ctrl-L.
|
||||
bindkey --emacs '\^L' clear-and-redraw-all
|
||||
bindkey --vi-insert '\^L' clear-and-redraw-all
|
||||
bindkey --vi-command '\^L' clear-and-redraw-all
|
||||
|
||||
# And add your own customization below.
|
||||
|
||||
eval "$(zoxide init posix --hook prompt)"
|
||||
6
shell/.config/zsh/plugins/README.md
Normal file
6
shell/.config/zsh/plugins/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
Directory for plugins. Checkout here
|
||||
|
||||
1. zsh-autosuggestions (https://github.com/zsh-users/zsh-autosuggestions)
|
||||
2. zsh-syntax-highlighting (https://github.com/zsh-users/zsh-syntax-highlighting)
|
||||
|
||||
or install then with package manager in /usr/share/zsh/plugins/ and symlink.
|
||||
@@ -1 +0,0 @@
|
||||
editMode: Vi
|
||||
@@ -1,11 +0,0 @@
|
||||
set editing-mode vi
|
||||
set show-mode-in-prompt on
|
||||
set vi-ins-mode-string \1\e[6 q\2
|
||||
set vi-cmd-mode-string \1\e[2 q\2
|
||||
|
||||
set keymap vi-command
|
||||
"k": history-substring-search-backward
|
||||
"j": history-substring-search-forward
|
||||
|
||||
set keymap vi-insert
|
||||
"\C-l": clear-screen
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user