diff options
| -rw-r--r-- | .config/alacritty.toml | 39 | ||||
| -rw-r--r-- | .config/nvim/colors/mine.lua | 91 | ||||
| -rw-r--r-- | .config/nvim/colors/mini-theme.lua | 82 | ||||
| -rw-r--r-- | .config/nvim/init.lua | 23 | ||||
| -rwxr-xr-x | .local/bin/dwm_status.sh (renamed from dwm_status.sh) | 2 | ||||
| -rwxr-xr-x | .local/bin/screenshot | 6 | ||||
| -rw-r--r-- | .xinitrc | 9 | ||||
| -rw-r--r-- | README | 16 | ||||
| -rwxr-xr-x | dmenu_dt | 12 | ||||
| -rw-r--r-- | src/dmenu/config.h (renamed from dmenu_config.h) | 2 | ||||
| -rw-r--r-- | src/dwm/config.h (renamed from dwm_config.h) | 8 | ||||
| -rw-r--r-- | src/st/config.h | 476 | ||||
| -rw-r--r-- | update.sh | 27 |
13 files changed, 533 insertions, 260 deletions
diff --git a/.config/alacritty.toml b/.config/alacritty.toml deleted file mode 100644 index f121594..0000000 --- a/.config/alacritty.toml +++ /dev/null @@ -1,39 +0,0 @@ -[window] -dynamic_padding = true -opacity = 1 - -[font] -normal = {family="CommitMono", style="Regular"} -bold = {family="CommitMono", style="Bold"} -italic = {family="CommitMono", style="Italic"} -bold_italic = {family="CommitMono", style="Bold Italic"} -offset.x = 0 -offset.y = 0 -size = 14 - -[colors] -draw_bold_text_with_bright_colors = true - -[colors.primary] -foreground = "#FFFFFF" -background = "#000000" - -[colors.normal] -black = "#333333" -red = "#990911" -green = "#099911" -yellow = "#CC9900" -blue = "#5511CC" -magenta = "#990966" -cyan = "#0077AA" -white = "#999999" - -[colors.bright] -black = "#666666" -red = "#ff2222" -green = "#22ff44" -yellow = "#ffff00" -blue = "#8833FF" -magenta = "#ff4499" -cyan = "#22ccff" -white = "#FFFFFF" diff --git a/.config/nvim/colors/mine.lua b/.config/nvim/colors/mine.lua deleted file mode 100644 index 48af24b..0000000 --- a/.config/nvim/colors/mine.lua +++ /dev/null @@ -1,91 +0,0 @@ ----@diagnostic disable: undefined-global - -vim.cmd("hi clear") - -vim.g.colors_name = "mine" -vim.g.background = "dark" - -local colors = { - ["Terminal"] = {link="Normal"}, - ["TermCursor"] = {link="Cursor"}, - ["TermCursorNC"] = {link="Cursor"}, - ["CurSearch"] = {link="Search"}, - ["CursorLineFold"] = {link="CursorLine"}, - ["CursorLineSign"] = {link="CursorLine"}, - ["MessageWindow"] = {link="Pmenu"}, - ["PopupNotification"] = {link="Todo"}, - ["Character"] = {link="String"}, - ["FloatBorder"] = {link="NormalFloat"}, - ["NormalFloat"] = {link="Normal"}, - - ["ModeMsg"] = {fg="#FF88CC", bold=true}, - ["StatusLine"] = {fg="#000000", bg="#AA66DD"}, - ["StatusLineNC"] = {fg="#FFFFFF"}, - ["ColorColumn"] = {bg="#333333"}, - ["WinSeparator"] = {fg="#222222"}, - ["CursorLine"] = {bg="#222222"}, - ["EndOfBuffer"] = {fg="#222222"}, - ["LineNr"] = {fg="#CCCCCC"}, - ["LineNrAbove"] = {fg="#888888"}, - ["LineNrBelow"] = {fg="#888888"}, - ["MatchParen"] = {fg="#EE66AA", bold=true}, - ["Normal"] = {fg="#AAAAAA", bg="#1A191C"}, - ["Pmenu"] = {fg="#FFFFFF", bg="#333333"}, - ["PmenuSel"] = {fg="#333333", bg="#FFFFFF", bold=true}, - ["Search"] = {fg="#333333", bg="#FFFF88", bold=true}, - ["Visual"] = {bg="#333333"}, - - ["Comment"] = {fg="#777777", italic=true}, - - ["Constant"] = {fg="#44FF99"}, - ["Number"] = {fg="#44FF99"}, - ["String"] = {fg="#FFFF00"}, - ["Boolean"] = {fg="#44FF99"}, - - ["Identifier"] = {fg="#FFFFFF"}, - ["Function"] = {fg="#5599EE"}, - ["Statement"] = {fg="#FF4499"}, - ["Label"] = {fg="#FF9944"}, - - -- ["Operator"] = {link="Normal"}, - - ["PreProc"] = {fg="#FF4499"}, - ["Typedef"] = {fg="#AA7FFF"}, - ["Type"] = {fg="#AA7FFF"}, - - ["StorageClass"] = {fg="#4499FF"}, - ["Structure"] = {fg="#4499FF"}, - - ["Special"] = {fg="#CCCCDD"}, - ["SpecialChar"] = {fg="#FFFFFF", bold=true}, - - ["Error"] = {fg="#FF4444", bold=true, undercurl=true}, - ["Todo"] = {fg="#FFFFFF", bold=true, undercurl=true}, - ["Added"] = {fg="#44FF44"}, - ["Changed"] = {fg="#FFFF44"}, - ["Removed"] = {fg="#FF4444"}, - - ["@constant.builtin"] = {link="Constant"}, - ["@type.builtin"] = {link="Type"}, - ["@function.builtin"] = {link="Function"}, - ["@attribute.builtin"] = {link="@attribute"}, - - ["@keyword.repeat"] = {fg="#DD66FF"}, - ["@keyword.conditional"] = {fg="#FF66DD"}, - - ["@variable"] = {fg="#CCCCCC"}, - ["@variable.parameter.builtin"] = {link="@variable.builtin"}, - ["@variable.parameter"] = {fg="#CCCCCC", italic=true}, - ["@variable.builtin"] = {fg="#DD66FF", italic=true}, - ["@variable.member"] = {fg="#9999FF"}, - - ["@lsp.type.variable"] = {fg="none"}, - ["@lsp.type.parameter"] = {link="@variable.parameter"}, - ["@lsp.type.enumMember"] = {link="Constant"}, - ["@lsp.typemod.variable.static"] = {link="@lsp.typemod.variable.global"}, - ["@lsp.typemod.variable.global"] = {fg="#FFDD66"}, -} - -for k, v in pairs(colors) do - vim.api.nvim_set_hl(0, k, v) -end diff --git a/.config/nvim/colors/mini-theme.lua b/.config/nvim/colors/mini-theme.lua deleted file mode 100644 index 0d706dc..0000000 --- a/.config/nvim/colors/mini-theme.lua +++ /dev/null @@ -1,82 +0,0 @@ ----@diagnostic disable: undefined-global - -vim.cmd("hi clear") - -vim.g.colors_name = "mine" -vim.g.background = "dark" - -local colors = { - ["Terminal"] = {link="Normal"}, - ["TermCursor"] = {link="Cursor"}, - ["TermCursorNC"] = {link="Cursor"}, - ["CurSearch"] = {link="Search"}, - ["CursorLineFold"] = {link="CursorLine"}, - ["CursorLineSign"] = {link="CursorLine"}, - ["MessageWindow"] = {link="Pmenu"}, - ["PopupNotification"] = {link="Todo"}, - ["Character"] = {link="String"}, - ["FloatBorder"] = {link="NormalFloat"}, - ["NormalFloat"] = {link="Normal"}, - - ["ModeMsg"] = {fg="#FF88CC", bold=true}, - ["StatusLine"] = {fg="#000000", bg="#AA66DD"}, - ["StatusLineNC"] = {fg="#FFFFFF"}, - ["ColorColumn"] = {bg="#121115"}, - ["WinSeparator"] = {fg="#222222"}, - ["CursorLine"] = {bg="#222222"}, - ["EndOfBuffer"] = {fg="#222222"}, - ["LineNr"] = {fg="#CCCCCC", bg="#121115"}, - ["LineNrAbove"] = {fg="#888888", bg="#121115"}, - ["LineNrBelow"] = {fg="#888888", bg="#121115"}, - ["SignColumn"] = {fg="#888888", bg="#121115"}, - ["MatchParen"] = {fg="#EE66AA", bold=true}, - ["Normal"] = {fg="#AAAAAA", bg="#1A191C"}, - ["Pmenu"] = {fg="#FFFFFF", bg="#333333"}, - ["PmenuSel"] = {fg="#333333", bg="#FFFFFF", bold=true}, - ["Search"] = {fg="#333333", bg="#FFFF88", bold=true}, - ["Visual"] = {bg="#333333"}, - - ["Comment"] = {fg="#88DEDE", italic=true}, - - ["Constant"] = {fg="#DDDD66"--[[, bg="#272620"]]}, - ["Number"] = {link="Constant"}, - ["String"] = {link="Constant"}, - ["Boolean"] = {link="Constant"}, - - ["Function"] = {fg="#9999EE", bold=true}, - ["Identifier"] = {link="Normal"}, - ["Statement"] = {bold=true}, - ["Label"] = {link="Normal"}, - - ["Operator"] = {link="Normal"}, - - ["Special"] = {fg="#CCCCDD"}, - ["SpecialChar"] = {fg="#FFFFFF"}, - - ["Error"] = {fg="#FF4444", undercurl=true}, - - ["@punctuation"] = {link="Operator"}, - - ["@constant.builtin"] = {link="@constant"}, - - ["@constructor"] = {link="Normal"}, - - ["@lsp.typemod.function.declaration"] = {link="Function"}, - ["@lsp.type.function"] = {link="@function.call"}, - ["@lsp.type.method"] = {link="@function.call"}, - ["@lsp.type.function.lua"] = {link="@function.call"}, - ["@function.builtin"] = {link="@function.call"}, - ["@function.method.call"] = {link="@function.call"}, - ["@function.call"] = {fg="#9999EE"}, - - ["@variable"] = {link="Normal"}, - -- ["@variable"] = {fg="#ff0000"}, - ["@variable.builtin"] = {link="@variable"}, - - ["@module"] = {link="Normal"}, - ["@module.builtin"] = {link="@module"}, -} - -for k, v in pairs(colors) do - vim.api.nvim_set_hl(0, k, v) -end diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 301f329..286740d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -6,7 +6,7 @@ vim.o.cc = "80" vim.o.updatetime = 1000 vim.o.splitright = true vim.o.splitbelow = true -vim.o.signcolumn = "yes" +vim.o.signcolumn = "no" vim.o.ignorecase = true vim.o.tabstop = 2 vim.o.shiftwidth = 0 @@ -22,6 +22,7 @@ vim.g.mapleader = " " vim.pack.add({ "https://github.com/neovim/nvim-lspconfig", "https://github.com/nvim-mini/mini.pick", + "https://github.com/stevearc/oil.nvim", {src="https://github.com/nvim-treesitter/nvim-treesitter", version="main"}, }) @@ -39,14 +40,20 @@ require("mini.pick").setup({ }, }) +require("oil").setup({ + view_options = {show_hidden=true}, +}) + require("nvim-treesitter").install({"c", "cpp", "lua", "odin", "vim", "vimdoc"}) require("nvim-treesitter").setup() vim.api.nvim_create_autocmd("FileType", { pattern = "odin", - callback = function() vim.treesitter.start() end + callback = function() vim.treesitter.start() end, }) +vim.keymap.set("t", "<esc><esc>", "<C-\\><C-n>") +vim.keymap.set("n", "<leader>t", ":hori term<CR>:resize 20<CR>") vim.keymap.set("n", "<leader>f", ":Pick files tool='rg'<CR>") -- Switch between semantically related files easily :) @@ -107,10 +114,10 @@ vim.keymap.set("n", "<leader>o", function() end) vim.lsp.enable({"lua_ls", "clangd", "ols"}) --- vim.diagnostic.config({ --- virtual_text = true, --- severity_sort = true, --- }) +vim.diagnostic.config({ + virtual_text = true, + severity_sort = true, +}) vim.api.nvim_create_autocmd("LspAttach", { callback = function(ev) local opts = {silent=true, buffer=ev.buf} @@ -128,6 +135,8 @@ vim.api.nvim_create_autocmd("LspAttach", { end, }) -vim.cmd.colorscheme("mini-theme") +vim.cmd.colorscheme("lunaperche") + +vim.api.nvim_create_user_command("Ex", "Oil", {}) -- require('vim._extui').enable({}) diff --git a/dwm_status.sh b/.local/bin/dwm_status.sh index 003a8fd..b2faf84 100755 --- a/dwm_status.sh +++ b/.local/bin/dwm_status.sh @@ -3,7 +3,7 @@ while true; do ram=`free -m | awk 'NR==2{printf "RAM %.2f%%", $3*100/$2}'` cpu=`top -bn1 | grep load | awk '{printf "CPU %.2f", $(NF-2)}'` - clock=`date +"%a %b %d, %H.%M.%S"` + clock=`date +"%a %b %d, %r"` pkg=`xbps-query -l | wc -l` vol=`pactl get-sink-volume @DEFAULT_SINK@ | awk 'NR==1{printf "VOL %s", $5}'` xprop -root -set WM_NAME " PKG $pkg $vol $ram $cpu $clock " diff --git a/.local/bin/screenshot b/.local/bin/screenshot index 20c98af..fb50efe 100755 --- a/.local/bin/screenshot +++ b/.local/bin/screenshot @@ -3,9 +3,9 @@ maim -u | feh -F - & id=$! -maim -suc 1,1,1 > /tmp/cropped.png -xclip -selection clipboard -t image/png /tmp/cropped.png +maim -suc 1,1,1 > /tmp/screenshot.png +xclip -selection clipboard -t image/png /tmp/screenshot.png kill $id -notify-send -u low -a "maim" -i /tmp/cropped.png "Screenshot captured" +notify-send -u low -a "maim" -i /tmp/screenshot.png "Screenshot captured" @@ -1,11 +1,12 @@ -setxkbmap -layout eu -option grp:caps_toggle & -xrandr --output HDMI-A-1 --mode 1920x1080 --rate 240 --primary & +export XDG_SESSION_TYPE="x11" + +setxkbmap -layout eu -option grp:caps_toggle +xrandr --output HDMI-A-1 --mode 1920x1080 --rate 240 --primary + xbanish & thunderbird & pipewire & sh dotfiles/dwm_status.sh & -nitrogen --restore & dunst & devmon --exec-on-drive "notify-send 'Mounted %f to %d'" & -xrdb .Xresources & exec dwm @@ -1,7 +1,15 @@ == Dotfiles == -Font: -I use Commit Mono +I like suckless stuff. -Neovim: -Uses v0.12, for vim.pack. +Software: + - neovim (0.12) + - dwm + - st + - dmenu + - dunst + - Commit Mono + +Extra: + - thunderbird + - xbanish diff --git a/dmenu_dt b/dmenu_dt deleted file mode 100755 index b736722..0000000 --- a/dmenu_dt +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -DIR1=~/.local/share/applications -DIR2=/usr/share/applications - -RES=`ls $DIR1 $DIR2 | sed 's/.desktop$//g' | dmenu -i` - -gio launch $DIR1/$RES.desktop &> /dev/null - -if [[ $? != 0 ]]; then - gio launch $DIR2/$RES.desktop -fi diff --git a/dmenu_config.h b/src/dmenu/config.h index 69f2e40..c9278f5 100644 --- a/dmenu_config.h +++ b/src/dmenu/config.h @@ -4,7 +4,7 @@ static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ /* -fn option overrides fonts[0]; default X11 font or font set */ static const char *fonts[] = { - "CommitMono:style=Regular:pixelsize=14" + "CommitMono:style=Regular:pixelsize=16:antialias=true:autohint=true", }; static const char *prompt = NULL; /* -p option; prompt to the left of input field */ static const char *colors[SchemeLast][2] = { diff --git a/dwm_config.h b/src/dwm/config.h index a3e3fd0..fb9fcb1 100644 --- a/dwm_config.h +++ b/src/dwm/config.h @@ -9,8 +9,8 @@ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ // static const char *fonts[] = {"Fixed:style=Regular:pixelsize=14:antialias=false"}; // static const char dmenufont[] = "Fixed:style=Regular:pixelsize=14:antialias=false"; -static const char *fonts[] = {"CommitMono:style=Regular:pixelsize=14"}; -static const char dmenufont[] = "Fixed:style=Regular:pixelsize=14:antialias=false"; +static const char *fonts[] = {"CommitMono:style=Regular:pixelsize=16:antialias=true"}; +static const char dmenufont[] = "CommitMono:style=Regular:pixelsize=16:antialias=true"; static const char col_bg_active[] = "#202020"; static const char col_fg_active[] = "#ffffff"; @@ -44,9 +44,9 @@ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen win static const Layout layouts[] = { /* symbol arrange function */ + {"[M]", monocle}, {"[]=", tile}, /* first entry is default */ {"><>", NULL}, /* no layout function means floating behavior */ - {"[M]", monocle}, }; /* key definitions */ @@ -63,7 +63,7 @@ static const Layout layouts[] = { /* commands */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static const char *dmenucmd[] = {"dmenu_run", NULL}; -static const char *termcmd[] = {"alacritty", NULL}; +static const char *termcmd[] = {"st", NULL}; static const char *sscmd[] = {"screenshot", NULL}; static const char *pausecmd[] = {"playerctl", "play-pause", NULL}; static const char *nextcmd[] = {"playerctl", "next", NULL}; diff --git a/src/st/config.h b/src/st/config.h new file mode 100644 index 0000000..8f0ce6a --- /dev/null +++ b/src/st/config.h @@ -0,0 +1,476 @@ +/* See LICENSE file for copyright and license details. */ + +/* + * appearance + * + * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html + */ +static char *font = "CommitMono:pixelsize=16:antialias=true:autohint=true"; +static int borderpx = 2; + +/* + * What program is execed by st depends of these precedence rules: + * 1: program passed with -e + * 2: scroll and/or utmp + * 3: SHELL environment variable + * 4: value of shell in /etc/passwd + * 5: value of shell in config.h + */ +static char *shell = "/bin/zsh"; +char *utmp = NULL; +/* scroll program: to enable use a string like "scroll" */ +char *scroll = NULL; +char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; + +/* identification sequence returned in DA and DECID */ +char *vtiden = "\033[?6c"; + +/* Kerning / character bounding-box multipliers */ +static float cwscale = 1.0; +static float chscale = 1.0; + +/* + * word delimiter string + * + * More advanced example: L" `'\"()[]{}" + */ +wchar_t *worddelimiters = L" "; + +/* selection timeouts (in milliseconds) */ +static unsigned int doubleclicktimeout = 300; +static unsigned int tripleclicktimeout = 600; + +/* alt screens */ +int allowaltscreen = 1; + +/* allow certain non-interactive (insecure) window operations such as: + setting the clipboard text */ +int allowwindowops = 0; + +/* + * draw latency range in ms - from new content/keypress/etc until drawing. + * within this range, st draws when content stops arriving (idle). mostly it's + * near minlatency, but it waits longer for slow updates to avoid partial draw. + * low minlatency will tear/flicker more, as it can "detect" idle too early. + */ +static double minlatency = 2; +static double maxlatency = 33; + +/* + * blinking timeout (set to 0 to disable blinking) for the terminal blinking + * attribute. + */ +static unsigned int blinktimeout = 800; + +/* + * thickness of underline and bar cursors + */ +static unsigned int cursorthickness = 2; + +/* + * bell volume. It must be a value between -100 and 100. Use 0 for disabling + * it + */ +static int bellvolume = 0; + +/* default TERM value */ +char *termname = "st-256color"; + +/* + * spaces per tab + * + * When you are changing this value, don't forget to adapt the »it« value in + * the st.info and appropriately install the st.info in the environment where + * you use this st version. + * + * it#$tabspaces, + * + * Secondly make sure your kernel is not expanding tabs. When running `stty + * -a` »tab0« should appear. You can tell the terminal to not expand tabs by + * running following command: + * + * stty tabs + */ +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", + + [255] = 0, + + /* more colors can be added after 255 to use with DefaultXX */ + "#cccccc", + "#555555", + "gray90", /* default foreground colour */ + "black", /* default background colour */ +}; + + +/* + * Default colors (colorname index) + * foreground, background, cursor, reverse cursor + */ +unsigned int defaultfg = 258; +unsigned int defaultbg = 259; +unsigned int defaultcs = 256; +static unsigned int defaultrcs = 257; + +/* + * Default shape of cursor + * 2: Block ("█") + * 4: Underline ("_") + * 6: Bar ("|") + * 7: Snowman ("☃") + */ +static unsigned int cursorshape = 2; + +/* + * Default columns and rows numbers + */ + +static unsigned int cols = 80; +static unsigned int rows = 24; + +/* + * Default colour and shape of the mouse cursor + */ +static unsigned int mouseshape = XC_xterm; +static unsigned int mousefg = 7; +static unsigned int mousebg = 0; + +/* + * Color used to display font attributes when fontconfig selected a font which + * doesn't match the ones requested. + */ +static unsigned int defaultattr = 11; + +/* + * Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set). + * Note that if you want to use ShiftMask with selmasks, set this to an other + * modifier, set to 0 to not use it. + */ +static uint forcemousemod = ShiftMask; + +/* + * Internal mouse shortcuts. + * Beware that overloading Button1 will disable the selection. + */ +static MouseShortcut mshortcuts[] = { + /* mask button function argument release */ + { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 }, + { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} }, + { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} }, + { ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} }, + { XK_ANY_MOD, Button5, ttysend, {.s = "\005"} }, +}; + +/* Internal keyboard shortcuts. */ +#define MODKEY Mod1Mask +#define TERMMOD (ControlMask|ShiftMask) + +static Shortcut shortcuts[] = { + /* mask keysym function argument */ + { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, + { ControlMask, XK_Print, toggleprinter, {.i = 0} }, + { ShiftMask, XK_Print, printscreen, {.i = 0} }, + { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, + { TERMMOD, XK_g, zoom, {.f = +1} }, + { TERMMOD, XK_f, zoom, {.f = -1} }, + { TERMMOD, XK_Home, zoomreset, {.f = 0} }, + { TERMMOD, XK_C, clipcopy, {.i = 0} }, + { TERMMOD, XK_V, clippaste, {.i = 0} }, + { TERMMOD, XK_Y, selpaste, {.i = 0} }, + { ShiftMask, XK_Insert, selpaste, {.i = 0} }, + { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, + { ShiftMask, XK_Page_Up, kscrollup, {.f = -0.1} }, + { ShiftMask, XK_Page_Down, kscrolldown, {.f = -0.1} }, +}; + +/* + * Special keys (change & recompile st.info accordingly) + * + * Mask value: + * * Use XK_ANY_MOD to match the key no matter modifiers state + * * Use XK_NO_MOD to match the key alone (no modifiers) + * appkey value: + * * 0: no value + * * > 0: keypad application mode enabled + * * = 2: term.numlock = 1 + * * < 0: keypad application mode disabled + * appcursor value: + * * 0: no value + * * > 0: cursor application mode enabled + * * < 0: cursor application mode disabled + * + * Be careful with the order of the definitions because st searches in + * this table sequentially, so any XK_ANY_MOD must be in the last + * position for a key. + */ + +/* + * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) + * to be mapped below, add them to this array. + */ +static KeySym mappedkeys[] = { -1 }; + +/* + * State bits to ignore when matching key or button events. By default, + * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. + */ +static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; + +/* + * This is the huge key array which defines all compatibility to the Linux + * world. Please decide about changes wisely. + */ +static Key key[] = { + /* keysym mask string appkey appcursor */ + { XK_KP_Home, ShiftMask, "\033[2J", 0, -1}, + { XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1}, + { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1}, + { XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1}, + { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0}, + { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1}, + { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1}, + { XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0}, + { XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1}, + { XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1}, + { XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0}, + { XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1}, + { XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1}, + { XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0}, + { XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1}, + { XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1}, + { XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0}, + { XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, + { XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0}, + { XK_KP_End, ControlMask, "\033[J", -1, 0}, + { XK_KP_End, ControlMask, "\033[1;5F", +1, 0}, + { XK_KP_End, ShiftMask, "\033[K", -1, 0}, + { XK_KP_End, ShiftMask, "\033[1;2F", +1, 0}, + { XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0}, + { XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0}, + { XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0}, + { XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0}, + { XK_KP_Insert, ShiftMask, "\033[4l", -1, 0}, + { XK_KP_Insert, ControlMask, "\033[L", -1, 0}, + { XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0}, + { XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, + { XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, + { XK_KP_Delete, ControlMask, "\033[M", -1, 0}, + { XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0}, + { XK_KP_Delete, ShiftMask, "\033[2K", -1, 0}, + { XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0}, + { XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0}, + { XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, + { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0}, + { XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0}, + { XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0}, + { XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0}, + { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0}, + { XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0}, + { XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0}, + { XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0}, + { XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0}, + { XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0}, + { XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0}, + { XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0}, + { XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0}, + { XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0}, + { XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0}, + { XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0}, + { XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0}, + { XK_Up, ShiftMask, "\033[1;2A", 0, 0}, + { XK_Up, Mod1Mask, "\033[1;3A", 0, 0}, + { XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0}, + { XK_Up, ControlMask, "\033[1;5A", 0, 0}, + { XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0}, + { XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0}, + { XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0}, + { XK_Up, XK_ANY_MOD, "\033[A", 0, -1}, + { XK_Up, XK_ANY_MOD, "\033OA", 0, +1}, + { XK_Down, ShiftMask, "\033[1;2B", 0, 0}, + { XK_Down, Mod1Mask, "\033[1;3B", 0, 0}, + { XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0}, + { XK_Down, ControlMask, "\033[1;5B", 0, 0}, + { XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0}, + { XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0}, + { XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0}, + { XK_Down, XK_ANY_MOD, "\033[B", 0, -1}, + { XK_Down, XK_ANY_MOD, "\033OB", 0, +1}, + { XK_Left, ShiftMask, "\033[1;2D", 0, 0}, + { XK_Left, Mod1Mask, "\033[1;3D", 0, 0}, + { XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0}, + { XK_Left, ControlMask, "\033[1;5D", 0, 0}, + { XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0}, + { XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0}, + { XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0}, + { XK_Left, XK_ANY_MOD, "\033[D", 0, -1}, + { XK_Left, XK_ANY_MOD, "\033OD", 0, +1}, + { XK_Right, ShiftMask, "\033[1;2C", 0, 0}, + { XK_Right, Mod1Mask, "\033[1;3C", 0, 0}, + { XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0}, + { XK_Right, ControlMask, "\033[1;5C", 0, 0}, + { XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0}, + { XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0}, + { XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0}, + { XK_Right, XK_ANY_MOD, "\033[C", 0, -1}, + { XK_Right, XK_ANY_MOD, "\033OC", 0, +1}, + { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0}, + { XK_Return, Mod1Mask, "\033\r", 0, 0}, + { XK_Return, XK_ANY_MOD, "\r", 0, 0}, + { XK_Insert, ShiftMask, "\033[4l", -1, 0}, + { XK_Insert, ShiftMask, "\033[2;2~", +1, 0}, + { XK_Insert, ControlMask, "\033[L", -1, 0}, + { XK_Insert, ControlMask, "\033[2;5~", +1, 0}, + { XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, + { XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, + { XK_Delete, ControlMask, "\033[M", -1, 0}, + { XK_Delete, ControlMask, "\033[3;5~", +1, 0}, + { XK_Delete, ShiftMask, "\033[2K", -1, 0}, + { XK_Delete, ShiftMask, "\033[3;2~", +1, 0}, + { XK_Delete, XK_ANY_MOD, "\033[P", -1, 0}, + { XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, + { XK_BackSpace, XK_NO_MOD, "\177", 0, 0}, + { XK_BackSpace, Mod1Mask, "\033\177", 0, 0}, + { XK_Home, ShiftMask, "\033[2J", 0, -1}, + { XK_Home, ShiftMask, "\033[1;2H", 0, +1}, + { XK_Home, XK_ANY_MOD, "\033[H", 0, -1}, + { XK_Home, XK_ANY_MOD, "\033[1~", 0, +1}, + { XK_End, ControlMask, "\033[J", -1, 0}, + { XK_End, ControlMask, "\033[1;5F", +1, 0}, + { XK_End, ShiftMask, "\033[K", -1, 0}, + { XK_End, ShiftMask, "\033[1;2F", +1, 0}, + { XK_End, XK_ANY_MOD, "\033[4~", 0, 0}, + { XK_Prior, ControlMask, "\033[5;5~", 0, 0}, + { XK_Prior, ShiftMask, "\033[5;2~", 0, 0}, + { XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, + { XK_Next, ControlMask, "\033[6;5~", 0, 0}, + { XK_Next, ShiftMask, "\033[6;2~", 0, 0}, + { XK_Next, XK_ANY_MOD, "\033[6~", 0, 0}, + { XK_F1, XK_NO_MOD, "\033OP" , 0, 0}, + { XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0}, + { XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0}, + { XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0}, + { XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0}, + { XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0}, + { XK_F2, XK_NO_MOD, "\033OQ" , 0, 0}, + { XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0}, + { XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0}, + { XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0}, + { XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0}, + { XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0}, + { XK_F3, XK_NO_MOD, "\033OR" , 0, 0}, + { XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0}, + { XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0}, + { XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0}, + { XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0}, + { XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0}, + { XK_F4, XK_NO_MOD, "\033OS" , 0, 0}, + { XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0}, + { XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0}, + { XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0}, + { XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0}, + { XK_F5, XK_NO_MOD, "\033[15~", 0, 0}, + { XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0}, + { XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0}, + { XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0}, + { XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0}, + { XK_F6, XK_NO_MOD, "\033[17~", 0, 0}, + { XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0}, + { XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0}, + { XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0}, + { XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0}, + { XK_F7, XK_NO_MOD, "\033[18~", 0, 0}, + { XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0}, + { XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0}, + { XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0}, + { XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0}, + { XK_F8, XK_NO_MOD, "\033[19~", 0, 0}, + { XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0}, + { XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0}, + { XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0}, + { XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0}, + { XK_F9, XK_NO_MOD, "\033[20~", 0, 0}, + { XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0}, + { XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0}, + { XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0}, + { XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0}, + { XK_F10, XK_NO_MOD, "\033[21~", 0, 0}, + { XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0}, + { XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0}, + { XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0}, + { XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0}, + { XK_F11, XK_NO_MOD, "\033[23~", 0, 0}, + { XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0}, + { XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0}, + { XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0}, + { XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0}, + { XK_F12, XK_NO_MOD, "\033[24~", 0, 0}, + { XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0}, + { XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0}, + { XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0}, + { XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0}, + { XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0}, + { XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0}, + { XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0}, + { XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0}, + { XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0}, + { XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0}, + { XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0}, + { XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0}, + { XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0}, + { XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0}, + { XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0}, + { XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0}, + { XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0}, + { XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0}, + { XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0}, + { XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0}, + { XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0}, + { XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0}, + { XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0}, + { XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0}, + { XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0}, + { XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0}, + { XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0}, +}; + +/* + * Selection types' masks. + * Use the same masks as usual. + * Button1Mask is always unset, to make masks match between ButtonPress. + * ButtonRelease and MotionNotify. + * If no match is found, regular selection is used. + */ +static uint selmasks[] = { + [SEL_RECTANGULAR] = Mod1Mask, +}; + +/* + * Printable characters in ASCII, used to estimate the advance width + * of single wide characters. + */ +static char ascii_printable[] = + " !\"#$%&'()*+,-./0123456789:;<=>?" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" + "`abcdefghijklmnopqrstuvwxyz{|}~"; @@ -1,25 +1,28 @@ rm -rf .config/ -mkdir .config/ +rm -rf .local/ +rm -rf src/ +mkdir .config/ mkdir -p .local/bin +mkdir -p src/st +mkdir -p src/dwm +mkdir -p src/dmenu cp ~/.xinitrc . -# alacritty -cp ~/.config/alacritty.toml .config - -# st -cp ~/git/dwm/config.h ./dwm_config.h -cp ~/git/dmenu/config.h ./dmenu_config.h +# Suckless +cp ~/git/st/config.h ./src/st +cp ~/git/dwm/config.h ./src/dwm +cp ~/git/dmenu/config.h ./src/dmenu # Neovim cp -r ~/.config/nvim .config -rm -rf .config/nvim/plugin -rm -rf .config/nvim/live-server rm -rf .config/nvim/nvim-pack-lock.json -cp ~/.local/bin/screenshot ./.local/bin -cp ~/.local/bin/screenrecord ./.local/bin - # Dunst cp -r ~/.config/dunst .config + +# Terminal Util +cp ~/.local/bin/screenshot ./.local/bin +cp ~/.local/bin/screenrecord ./.local/bin +cp ~/.local/bin/dwm_status.sh ./.local/bin |
