Compare commits
No commits in common. 'main' and 'nvim' have entirely different histories.
@ -1,5 +1,4 @@
|
||||
# dotfiles
|
||||
|
||||
### TODO
|
||||
|
||||
- port scripts to use rofi or equiv
|
||||
- Add main polybar file and create bar as needed from modules
|
||||
|
@ -1,9 +1,6 @@
|
||||
picom
|
||||
polybar
|
||||
feh
|
||||
imagemagick
|
||||
rofi
|
||||
rofi-calc
|
||||
mpv
|
||||
mpd
|
||||
mpc
|
@ -1,11 +0,0 @@
|
||||
neovim
|
||||
lua
|
||||
# language servers
|
||||
clang
|
||||
gopls
|
||||
python-lsp-server
|
||||
typescript-language-server
|
||||
lua-language-server
|
||||
rust-analyzer
|
||||
# various tools
|
||||
xclip
|
@ -1,2 +0,0 @@
|
||||
seafile
|
||||
seafile-client
|
@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Expects a file with pacakge names on newlines in $1
|
||||
# Will skip lines beginning in a #
|
||||
#
|
||||
# Rationale:
|
||||
# I hated how long it took to extract cached AUR packages just to tell me that
|
||||
# it is up to date and skip installation.
|
||||
# This helper loops over arguments and installs only packages not already on the system.
|
||||
# Then the built in package manager can maintain these packages
|
||||
|
||||
packages=`cat "$1" | grep -v '#'`
|
||||
|
||||
for package in "$packages" ; do
|
||||
echo "$package"
|
||||
continue
|
||||
needed=`yay -Qi "$package" 2>&1 >/dev/null`
|
||||
[ -n "$needed" ] && yay --sudoloop --nodiffmenu --noeditmenu --nocleanmenu --noupgrademenu -S "$package"
|
||||
done
|
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
# getting focused pwd
|
||||
PID=$(xdotool getwindowfocus getwindowpid)
|
||||
child=$PID
|
||||
children=()
|
||||
while [ -n "$child" ] ; do
|
||||
children+=($child)
|
||||
child=$(pgrep -P $child)
|
||||
done
|
||||
|
||||
last_ps=$(ps ${children[-1]} | grep -v PID | awk '{print $5}')
|
||||
|
||||
if [ "$last_ps" == "tmux" ] ; then
|
||||
current_pane=$(tmux list-panes | grep '(active)' | grep -o '^[0-9]')
|
||||
cwd=$(tmux display-message -p -t $current_pane -F '#{pane_current_path}')
|
||||
else
|
||||
cwd=$(readlink -e /proc/${children[-1]}/cwd)
|
||||
fi
|
||||
|
||||
# change to the directory
|
||||
cd $cwd
|
||||
files=$(find * -type f)
|
||||
|
||||
selection=$(echo "$files" | rofi-dmenu)
|
||||
|
||||
# exit on quit
|
||||
if [ -z "$selection" ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# grab extension
|
||||
extension=$(echo "$selection" | grep -o '.\([a-zA-Z]\+\)$')
|
||||
|
||||
# get proper opener
|
||||
case "$extension" in
|
||||
'.pdf') prg="zathura" ;;
|
||||
'.md') prg="vim" ;;
|
||||
'.png') prg="feh" ;;
|
||||
'.jpg') prg="feh" ;;
|
||||
'.jpeg') prg="feh" ;;
|
||||
*) prg="xdg-open" ;;
|
||||
esac
|
||||
|
||||
if [[ "$1" == '-S' && "$prg" =~ [feh|zathura] ]] ; then
|
||||
swallow $prg "$selection"
|
||||
else
|
||||
$prg "$selection"
|
||||
fi
|
@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# checks mullvad status for monitoring in polybar
|
||||
|
||||
CONNECTED=$(printf '%s%s' '%{F#0F0}' $(echo -e '\Uf0318')) # green
|
||||
DISCONNECTED=$(printf '%s%s' '%{F#F00}' $(echo -e '\Uf0319')) # red
|
||||
|
||||
# check that its installed
|
||||
if ! command -v mullvad &>/dev/null ; then
|
||||
echo "Seafile not downloaded to device!">&2
|
||||
echo "$DISCONNECTED"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# reading vpn status as continous output
|
||||
while read VPN_STATUS; do
|
||||
|
||||
VPN_DISCONNECTED=$(echo "$VPN_STATUS" | grep Disconnect);
|
||||
|
||||
if [[ -n "$VPN_DISCONNECTED" ]] ; then
|
||||
# vpn is disconnected
|
||||
echo "$DISCONNECTED"
|
||||
continue
|
||||
fi
|
||||
|
||||
# connected
|
||||
echo "$CONNECTED"
|
||||
done < <(mullvad status listen)
|
@ -1 +0,0 @@
|
||||
Subproject commit 4af034b82620c67492f951be0fbbe0a024ab31e2
|
@ -0,0 +1,48 @@
|
||||
require('keymap')
|
||||
require('plugins')
|
||||
require('calcurse')
|
||||
require('i3conf')
|
||||
|
||||
-- prevent cursor override
|
||||
vim.cmd('set guicursor=')
|
||||
-- basic settings
|
||||
vim.cmd('filetype plugin indent on')
|
||||
vim.cmd('set ts=4 sts=4 sw=4 expandtab')
|
||||
|
||||
-- hybrid numbering
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.number = true
|
||||
vim.opt.cursorline = true
|
||||
|
||||
vim.opt.compatible = false
|
||||
|
||||
-- ignores search case unless capital is used
|
||||
vim.opt.smartcase = true
|
||||
vim.opt.hlsearch = true
|
||||
|
||||
-- colorscheme and syntax settings
|
||||
vim.cmd([[
|
||||
syntax enable
|
||||
colorscheme hybrid
|
||||
hi Normal ctermbg=NONE
|
||||
]])
|
||||
|
||||
-- defaults to transparent
|
||||
transparent = true
|
||||
|
||||
-- timeouts
|
||||
vim.opt.ttimeout = true
|
||||
vim.opt.ttimeoutlen = 100
|
||||
|
||||
-- nvim tree basics
|
||||
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- vimwiki changes
|
||||
vim.cmd([[
|
||||
let g:vimwiki_list = [{'path': '~/vimwiki/',
|
||||
\ 'syntax': 'markdown', 'ext':'.md'}]
|
||||
]])
|
||||
|
||||
|
@ -0,0 +1,7 @@
|
||||
-- calcurse -> markdown
|
||||
vim.api.nvim_create_autocmd({"BufRead","BufNewFile"}, {
|
||||
pattern = {"/tmp/calcurse*","~/.local/share/calcurse/notes/*"},
|
||||
command = "set filetype=markdown",
|
||||
})
|
||||
|
||||
|
@ -0,0 +1,325 @@
|
||||
local M = {}
|
||||
_VT_NS = vim.api.nvim_create_namespace("lsp_signature")
|
||||
|
||||
local prescript
|
||||
local prescript_hi
|
||||
local due_hi
|
||||
local ft
|
||||
local today
|
||||
local today_hi
|
||||
local overdue
|
||||
local overdue_hi
|
||||
local date_hi
|
||||
local pattern_start
|
||||
local pattern_end
|
||||
|
||||
local use_clock_time
|
||||
local use_clock_today
|
||||
local use_seconds
|
||||
local default_due_time
|
||||
|
||||
local user_hour
|
||||
local user_min
|
||||
local user_sec
|
||||
|
||||
local date_pattern
|
||||
local datetime_pattern
|
||||
local datetime12_pattern
|
||||
local fulldate_pattern
|
||||
local fulldatetime_pattern
|
||||
local fulldatetime12_pattern
|
||||
|
||||
local regex_hi
|
||||
|
||||
local update_rate
|
||||
|
||||
local function patternify(str)
|
||||
return str:gsub("[%(%)%.%%%+%-%*%?%[%^%$%]]", "%%%1")
|
||||
end
|
||||
|
||||
local function regexify(str) return str:gsub("\\%^%$%.%*~%[%]&", "\\%1") end
|
||||
|
||||
local function make_pattern(pattern)
|
||||
return patternify(pattern_start) .. pattern:gsub('%(', ''):gsub('%)', '') ..
|
||||
patternify(pattern_end)
|
||||
end
|
||||
|
||||
local function make_pattern_match(pattern)
|
||||
return patternify(pattern_start) .. pattern .. patternify(pattern_end)
|
||||
end
|
||||
|
||||
local function parseDue(due)
|
||||
local year = 31556926
|
||||
local month = 2629743
|
||||
local week = 604800
|
||||
local day = 86400
|
||||
local hour = 3600
|
||||
local minute = 60
|
||||
local res = ''
|
||||
local is_today = due < day
|
||||
|
||||
if due >= year then
|
||||
res = res .. math.floor(due / year) .. 'y '
|
||||
due = due % year
|
||||
end
|
||||
|
||||
if due >= month then
|
||||
res = res .. math.floor(due / month) .. 'm '
|
||||
due = due % month
|
||||
end
|
||||
|
||||
if due >= week then
|
||||
res = res .. math.floor(due / week) .. 'w '
|
||||
due = due % week
|
||||
end
|
||||
|
||||
if use_clock_time or (is_today and use_clock_today) then
|
||||
if due >= day then
|
||||
res = res .. math.floor(due / day) .. 'd '
|
||||
due = due % day
|
||||
end
|
||||
|
||||
if due >= hour then
|
||||
res = res .. math.floor(due / hour) .. 'h '
|
||||
due = due % hour
|
||||
end
|
||||
|
||||
if due >= minute then
|
||||
res = res .. math.floor(due / minute) .. 'min '
|
||||
due = due % minute
|
||||
end
|
||||
|
||||
if use_seconds then res = res .. math.floor(due / 1) + 1 .. 's ' end
|
||||
|
||||
else
|
||||
res = res .. math.floor(due / day) + 1 .. 'd '
|
||||
end
|
||||
|
||||
return res
|
||||
end
|
||||
|
||||
function M.setup(c)
|
||||
c = c or {}
|
||||
use_clock_time = c.use_clock_time or false
|
||||
use_clock_today = c.use_clock_time or false
|
||||
if type(c.use_seconds) == 'boolean' then
|
||||
use_seconds = c.use_seconds
|
||||
else
|
||||
use_seconds = c.use_clock_time or false
|
||||
end
|
||||
update_rate = c.update_rate or
|
||||
(use_clock_time and (use_seconds and 1000 or 60000) or 0)
|
||||
default_due_time = c.default_due_time or 'midnight'
|
||||
prescript = c.prescript or 'due: '
|
||||
prescript_hi = c.prescript_hi or 'Comment'
|
||||
due_hi = c.due_hi or 'String'
|
||||
ft = c.ft or '*.md'
|
||||
today = c.today or 'TODAY'
|
||||
today_hi = c.today_hi or 'Character'
|
||||
overdue = c.overdue or 'OVERDUE'
|
||||
overdue_hi = c.overdue_hi or 'Error'
|
||||
date_hi = c.date_hi or 'Conceal'
|
||||
week_hi = c.week_hi or 'Question'
|
||||
pattern_start = c.pattern_start or '<'
|
||||
pattern_end = c.pattern_end or '>'
|
||||
date_pattern = c.date_pattern or '(%d%d)%-(%d%d)'
|
||||
datetime_pattern = c.datetime_pattern or (date_pattern .. ' (%d+):(%d%d)')
|
||||
datetime12_pattern = c.datetime12_pattern or (datetime_pattern .. ' (%a%a)')
|
||||
fulldate_pattern = c.fulldate_pattern or ('(%d%d%d%d)%-' .. date_pattern)
|
||||
fulldatetime_pattern = c.fulldatetime_pattern or
|
||||
('(%d%d%d%d)%-' .. datetime_pattern)
|
||||
fulldatetime12_pattern = c.fulldatetime12_pattern or
|
||||
(fulldatetime_pattern .. ' (%a%a)')
|
||||
regex_hi = c.regex_hi or
|
||||
"\\d*-*\\d\\+-\\d\\+\\( \\d*:\\d*\\( \\a\\a\\)\\?\\)\\?"
|
||||
|
||||
if default_due_time == "midnight" then
|
||||
user_hour = 23
|
||||
user_min = 59
|
||||
user_sec = 59
|
||||
elseif default_due_time == "noon" then
|
||||
user_hour = 12
|
||||
user_min = 00
|
||||
user_sec = 00
|
||||
end
|
||||
|
||||
local regex_start = regexify(pattern_start)
|
||||
local regex_end = regexify(pattern_end)
|
||||
|
||||
local regex_hi_full = '/' .. regex_start .. regex_hi .. regex_end .. '/'
|
||||
|
||||
vim.api.nvim_exec(string.format(
|
||||
[[
|
||||
augroup Due
|
||||
autocmd!
|
||||
autocmd BufEnter %s lua require("due_nvim").draw(0)
|
||||
autocmd BufEnter %s lua require("due_nvim").async_update(0)
|
||||
autocmd InsertLeave %s lua require("due_nvim").redraw(0)
|
||||
autocmd TextChanged %s lua require("due_nvim").redraw(0)
|
||||
autocmd TextChangedI %s lua require("due_nvim").redraw(0)
|
||||
autocmd BufEnter %s syn match DueDate %s display containedin=mkdNonListItemBlock,mkdListItemLine,mkdBlockquote conceal
|
||||
autocmd BufEnter %s hi def link DueDate %s
|
||||
augroup END
|
||||
]] , ft, ft, ft, ft, ft, ft, regex_hi_full, ft, date_hi),
|
||||
false
|
||||
)
|
||||
-- old autcmd
|
||||
--autocmd BufEnter %s syn match DueDate %s display containedin=mkdNonListItemBlock,mkdListItemLine,mkdBlockquote contained conceal
|
||||
end
|
||||
|
||||
local function draw_due(due, buf, key)
|
||||
local parsed
|
||||
|
||||
if due > 0 then
|
||||
if not (use_clock_time or use_clock_today) and due < 86400 then
|
||||
parsed = { today, today_hi }
|
||||
elseif due < 86400 then
|
||||
parsed = { parseDue(due), today_hi }
|
||||
elseif due < 604800 then
|
||||
parsed = { parseDue(due), due_hi }
|
||||
else
|
||||
parsed = { parseDue(due), week_hi }
|
||||
end
|
||||
else
|
||||
parsed = { overdue, overdue_hi }
|
||||
end
|
||||
|
||||
vim.api.nvim_buf_set_virtual_text(buf, _VT_NS, key - 1,
|
||||
{ { prescript, prescript_hi }, parsed }, {})
|
||||
end
|
||||
|
||||
function M.draw(buf)
|
||||
-- get current time
|
||||
local now = os.time(os.date('*t'))
|
||||
|
||||
-- find which date pattern is being passed in by user
|
||||
for key, value in pairs(vim.api.nvim_buf_get_lines(buf, 0, -1, {})) do
|
||||
local fulldatetime12 = value:match(make_pattern(fulldatetime12_pattern))
|
||||
if fulldatetime12 then
|
||||
local year, month, day, hour, min, period =
|
||||
fulldatetime12:match(make_pattern_match(fulldatetime12_pattern))
|
||||
hour = tonumber(hour)
|
||||
local is_pm = period:lower() == 'pm'
|
||||
if is_pm and hour < 12 or not is_pm and hour == 12 then
|
||||
hour = hour + 12
|
||||
if hour == 24 then
|
||||
hour = 0
|
||||
end
|
||||
end
|
||||
draw_due(os.time({
|
||||
year = year,
|
||||
month = month,
|
||||
day = day,
|
||||
hour = hour,
|
||||
min = min,
|
||||
sec = user_sec
|
||||
}) - now, buf, key)
|
||||
goto continue
|
||||
end
|
||||
|
||||
local fulldatetime = value:match(make_pattern(fulldatetime_pattern))
|
||||
if fulldatetime then
|
||||
local year, month, day, hour, min =
|
||||
fulldatetime:match(make_pattern_match(fulldatetime_pattern))
|
||||
draw_due(os.time({
|
||||
year = year,
|
||||
month = month,
|
||||
day = day,
|
||||
hour = hour,
|
||||
min = min,
|
||||
sec = user_sec
|
||||
}) - now, buf, key)
|
||||
goto continue
|
||||
end
|
||||
|
||||
local fulldate = value:match(make_pattern(fulldate_pattern))
|
||||
if fulldate then
|
||||
local year, month, day = fulldate:match(make_pattern_match(
|
||||
fulldate_pattern))
|
||||
draw_due(os.time({
|
||||
year = year,
|
||||
month = month,
|
||||
day = day,
|
||||
hour = user_hour,
|
||||
min = user_min,
|
||||
sec = user_sec
|
||||
}) - now, buf, key)
|
||||
goto continue
|
||||
end
|
||||
|
||||
local datetime12 = value:match(make_pattern(datetime12_pattern))
|
||||
if datetime12 then
|
||||
local month, day, hour, min, period =
|
||||
datetime12:match(make_pattern_match(datetime12_pattern))
|
||||
local year = os.date("%Y")
|
||||
hour = tonumber(hour)
|
||||
local is_pm = period:lower() == 'pm'
|
||||
if is_pm and hour < 12 or not is_pm and hour == 12 then
|
||||
hour = hour + 12
|
||||
if hour == 24 then
|
||||
hour = 0
|
||||
end
|
||||
end
|
||||
draw_due(os.time({
|
||||
year = year,
|
||||
month = month,
|
||||
day = day,
|
||||
hour = hour,
|
||||
min = min,
|
||||
sec = user_sec
|
||||
}) - now, buf, key)
|
||||
goto continue
|
||||
end
|
||||
|
||||
local datetime = value:match(make_pattern(datetime_pattern))
|
||||
if datetime then
|
||||
local month, day, hour, min = datetime:match(make_pattern_match(
|
||||
datetime_pattern))
|
||||
local year = os.date("%Y")
|
||||
draw_due(os.time({
|
||||
year = year,
|
||||
month = month,
|
||||
day = day,
|
||||
hour = hour,
|
||||
min = min,
|
||||
sec = user_sec
|
||||
}) - now, buf, key)
|
||||
goto continue
|
||||
end
|
||||
|
||||
local date = value:match(make_pattern(date_pattern))
|
||||
if date then
|
||||
local month, day = date:match(make_pattern_match(date_pattern))
|
||||
local year = os.date("%Y")
|
||||
|
||||
draw_due(os.time({
|
||||
year = year,
|
||||
month = month,
|
||||
day = day,
|
||||
hour = user_hour,
|
||||
min = user_min,
|
||||
sec = user_sec
|
||||
}) - now, buf, key)
|
||||
goto continue
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
|
||||
function M.clear(buf) vim.api.nvim_buf_clear_namespace(buf, _VT_NS, 0, -1) end
|
||||
|
||||
function M.redraw(buf)
|
||||
M.clear(buf)
|
||||
M.draw(buf)
|
||||
end
|
||||
|
||||
function M.async_update(buf)
|
||||
if update_rate <= 0 then return end
|
||||
local timer = vim.loop.new_timer()
|
||||
timer:start(update_rate, 0, vim.schedule_wrap(function()
|
||||
M.redraw(buf)
|
||||
M.async_update(buf)
|
||||
end))
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,11 @@
|
||||
require('telescope').setup({
|
||||
defaults = {
|
||||
layout_config = {
|
||||
horizontal = { width = 0.5 }
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n','<leader>f', builtin.find_files, {})
|
||||
vim.keymap.set('n','<leader>s', builtin.spell_suggest, {})
|
@ -0,0 +1,6 @@
|
||||
-- recognize i3 config from dotfiles
|
||||
--
|
||||
vim.api.nvim_create_autocmd({"BufRead","BufNewFile"}, {
|
||||
pattern = {"*/i3/*.conf"},
|
||||
command = "set filetype=i3config",
|
||||
})
|
@ -0,0 +1,38 @@
|
||||
require("transparent")
|
||||
|
||||
vim.g.mapleader = " "
|
||||
|
||||
vim.keymap.set("n", "<leader>b", ":lua toggleTransparent()<CR>")
|
||||
|
||||
-- nvim-tree bindings
|
||||
|
||||
vim.keymap.set("n", "<leader>t", ":NvimTreeToggle<CR>")
|
||||
|
||||
vim.keymap.set("n", "<leader>a", ":lua spellToggle()<CR>")
|
||||
|
||||
-- toggle spell check
|
||||
function spellToggle()
|
||||
if vim.o.spell == nil or vim.o.spell then
|
||||
vim.o.spell = false
|
||||
else
|
||||
vim.o.spell = true
|
||||
end
|
||||
end
|
||||
|
||||
-- markdown preview
|
||||
|
||||
vim.keymap.set("n", "<leader>p", ":MarkdownPreviewToggle<CR>")
|
||||
|
||||
-- custom shell script to move windows
|
||||
vim.cmd([[
|
||||
function OpenMarkdownPreview (url)
|
||||
execute "silent ! markdown-preview.sh " . a:url
|
||||
endfunction
|
||||
]])
|
||||
|
||||
vim.g.mkdp_browserfunc = 'OpenMarkdownPreview'
|
||||
|
||||
-- git actions
|
||||
vim.keymap.set("n", "<leader>ga", ":Git add .<CR>")
|
||||
vim.keymap.set("n", "<leader>gm", ":Git commit<CR>")
|
||||
|
@ -0,0 +1,13 @@
|
||||
require('tree')
|
||||
require('fuzzy')
|
||||
|
||||
-- airline settings
|
||||
if vim.g.airline_symbols == nil then
|
||||
vim.g.airline_symbols = vim.empty_dict()
|
||||
end
|
||||
|
||||
vim.g.airline_powerline_fonts = 1
|
||||
vim.g.airline_symbols.linenr = ''
|
||||
vim.g.airline_symbols.maxlinenr = ''
|
||||
vim.g.airline_symbols.dirty = ''
|
||||
|
@ -0,0 +1,9 @@
|
||||
function toggleTransparent()
|
||||
transparent = not transparent
|
||||
if transparent then
|
||||
vim.cmd("hi Normal ctermbg=NONE")
|
||||
else
|
||||
vim.cmd("set background=dark")
|
||||
vim.cmd("syntax enable")
|
||||
end
|
||||
end
|
@ -0,0 +1,40 @@
|
||||
require('nvim-tree').setup({
|
||||
open_on_tab = false,
|
||||
filters = {
|
||||
dotfiles = true,
|
||||
},
|
||||
actions = {
|
||||
open_file = {
|
||||
quit_on_open = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
showHiddenFiles = false
|
||||
|
||||
local function open_nvim_tree(data)
|
||||
|
||||
-- buffer is a directory
|
||||
local directory = vim.fn.isdirectory(data.file) == 1
|
||||
|
||||
local empty_file = data.file == ""
|
||||
|
||||
if not directory and not empty_file then
|
||||
return
|
||||
end
|
||||
|
||||
if directory then
|
||||
vim.cmd.cd(data.file)
|
||||
end
|
||||
vim.cmd.enew()
|
||||
vim.cmd.bw(data.buf)
|
||||
-- change to directory and open
|
||||
require("nvim-tree.api").tree.open()
|
||||
end
|
||||
|
||||
-- toggle dotfiles visibility
|
||||
vim.keymap.set("n", "<leader>d", ":lua require('nvim-tree.api').tree.toggle_hidden_filter()<CR>")
|
||||
|
||||
-- nvim-tree open at startup
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree, })
|
||||
|
@ -0,0 +1,15 @@
|
||||
L2
|
||||
L3
|
||||
Pset
|
||||
Kalynn
|
||||
Appt
|
||||
EPR
|
||||
S983
|
||||
Airpods
|
||||
swiffer
|
||||
postlab
|
||||
TypeScript
|
||||
ADTs
|
||||
tradeoffs
|
||||
nonterminal
|
||||
righthand
|
Binary file not shown.
@ -0,0 +1,40 @@
|
||||
require('keymap')
|
||||
require('plugins')
|
||||
require('calcurse')
|
||||
|
||||
-- prevent cursor override
|
||||
vim.cmd('set guicursor=')
|
||||
-- basic settings
|
||||
vim.cmd('filetype plugin indent on')
|
||||
vim.cmd('set ts=4 sts=4 sw=4 expandtab')
|
||||
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.compatible = false
|
||||
|
||||
-- colorscheme and syntax settings
|
||||
vim.cmd([[
|
||||
syntax enable
|
||||
colorscheme hybrid
|
||||
hi Normal ctermbg=NONE
|
||||
]])
|
||||
|
||||
-- defaults to transparent
|
||||
transparent = true
|
||||
|
||||
-- timeouts
|
||||
vim.opt.ttimeout = true
|
||||
vim.opt.ttimeoutlen = 100
|
||||
|
||||
-- nvim tree basics
|
||||
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- vimwiki changes
|
||||
vim.cmd([[
|
||||
let g:vimwiki_list = [{'path': '~/vimwiki/',
|
||||
\ 'syntax': 'markdown', 'ext':'.md'}]
|
||||
]])
|
||||
|
||||
|
@ -0,0 +1,7 @@
|
||||
-- calcurse -> markdown
|
||||
vim.api.nvim_create_autocmd({"BufRead","BufNewFile"}, {
|
||||
pattern = {"/tmp/calcurse*","~/.local/share/calcurse/notes/*"},
|
||||
command = "set filetype=markdown",
|
||||
})
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
require("transparent")
|
||||
|
||||
vim.g.mapleader = " "
|
||||
|
||||
vim.keymap.set("n", "<leader>b", ":lua toggleTransparent()<CR>")
|
||||
|
||||
-- nvim-tree bindings
|
||||
|
||||
vim.keymap.set("n", "<leader>t", ":NvimTreeToggle<CR>")
|
||||
|
||||
vim.keymap.set("n", "<leader>s", ":lua spellToggle()<CR>")
|
||||
|
||||
-- toggle spell check
|
||||
function spellToggle()
|
||||
if vim.o.spell == nil or vim.o.spell then
|
||||
vim.o.spell = false
|
||||
else
|
||||
vim.o.spell = true
|
||||
end
|
||||
end
|
||||
|
||||
-- markdown preview
|
||||
|
||||
vim.keymap.set("n", "<leader>p", ":MarkdownPreviewToggle<CR>")
|
@ -0,0 +1,12 @@
|
||||
require('tree')
|
||||
|
||||
-- airline settings
|
||||
if vim.g.airline_symbols == nil then
|
||||
vim.g.airline_symbols = vim.empty_dict()
|
||||
end
|
||||
|
||||
vim.g.airline_powerline_fonts = 1
|
||||
vim.g.airline_symbols.linenr = ''
|
||||
vim.g.airline_symbols.maxlinenr = ''
|
||||
vim.g.airline_symbols.dirty = ''
|
||||
|
@ -0,0 +1,9 @@
|
||||
function toggleTransparent()
|
||||
transparent = not transparent
|
||||
if transparent then
|
||||
vim.cmd("hi Normal ctermbg=NONE")
|
||||
else
|
||||
vim.cmd("set background=dark")
|
||||
vim.cmd("syntax enable")
|
||||
end
|
||||
end
|
@ -0,0 +1,40 @@
|
||||
require('nvim-tree').setup({
|
||||
open_on_tab = false,
|
||||
filters = {
|
||||
dotfiles = true,
|
||||
},
|
||||
actions = {
|
||||
open_file = {
|
||||
quit_on_open = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
showHiddenFiles = false
|
||||
|
||||
local function open_nvim_tree(data)
|
||||
|
||||
-- buffer is a directory
|
||||
local directory = vim.fn.isdirectory(data.file) == 1
|
||||
|
||||
local empty_file = data.file == ""
|
||||
|
||||
if not directory and not empty_file then
|
||||
return
|
||||
end
|
||||
|
||||
if directory then
|
||||
vim.cmd.cd(data.file)
|
||||
end
|
||||
vim.cmd.enew()
|
||||
vim.cmd.bw(data.buf)
|
||||
-- change to directory and open
|
||||
require("nvim-tree.api").tree.open()
|
||||
end
|
||||
|
||||
-- toggle dotfiles visibility
|
||||
vim.keymap.set("n", "<leader>d", ":lua require('nvim-tree.api').tree.toggle_hidden_filter()<CR>")
|
||||
|
||||
-- nvim-tree open at startup
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree, })
|
||||
|
@ -0,0 +1,8 @@
|
||||
vim.cmd('packadd vim-go')
|
||||
|
||||
vim.g.go_hightlight_types = 1
|
||||
vim.g.go_hightlight_fields = 1
|
||||
vim.g.go_hightlight_functions = 1
|
||||
vim.g.go_hightlight_function_calls = 1
|
||||
vim.g.go_hightlight_operators = 1
|
||||
vim.g.go_hightlight_extra_types = 1
|
@ -0,0 +1,27 @@
|
||||
-- adding packages
|
||||
vim.cmd('packadd vim-markdown')
|
||||
vim.cmd('packadd vimwiki')
|
||||
-- due date highlighting
|
||||
require('due_nvim').setup {
|
||||
ft = '*.md',
|
||||
date_hi = 'Comment',
|
||||
week_hi = 'Structure',
|
||||
|
||||
pattern_start = '<',
|
||||
pattern_end = '>',
|
||||
|
||||
use_clock_time = true,
|
||||
use_clock_today = true,
|
||||
use_seconds = false,
|
||||
}
|
||||
-- setting spell check
|
||||
vim.cmd([[
|
||||
setlocal spell
|
||||
setlocal wrap
|
||||
]])
|
||||
|
||||
-- markdown plugin settings
|
||||
vim.opt.conceallevel = 2
|
||||
vim.g.vim_markdown_folding_disabled = 1
|
||||
vim.g.vim_markdown_math = 1
|
||||
vim.g.vim_markdown_strikethrough = 1
|
@ -0,0 +1,2 @@
|
||||
-- adding packages
|
||||
vim.cmd('packadd vim-typescript')
|
@ -0,0 +1 @@
|
||||
Subproject commit 94e3b0990017a42fa4581ea3d0bc08b897727d4d
|
@ -0,0 +1 @@
|
||||
Subproject commit 253d34830709d690f013daf2853a9d21ad7accab
|
@ -0,0 +1 @@
|
||||
Subproject commit 942fe5faef47b21241e970551eba407bc10d9547
|
@ -0,0 +1 @@
|
||||
Subproject commit a494378f6c106a97e39c62b493c14476f9f7de4f
|
@ -0,0 +1 @@
|
||||
Subproject commit 5d3d1b6cbdc4be0b4c6105c1ab1f769d76d3c68f
|
@ -0,0 +1 @@
|
||||
Subproject commit dec6a9ecab3e5ec9ceff28b84cabb5c62d05ee9f
|
@ -0,0 +1 @@
|
||||
Subproject commit 02cc3874738bc0f86e4b91f09b8a0ac88aef8e96
|
@ -0,0 +1 @@
|
||||
Subproject commit e87cd90dc09c2a203e13af9704bd0ef79303d755
|
@ -0,0 +1 @@
|
||||
Subproject commit ef99f1d90cdb33a52931aed5868785b51fb9411d
|
@ -0,0 +1 @@
|
||||
Subproject commit 6580cf539c33a212f4f5542068a3b4dd2b3ad834
|
@ -0,0 +1 @@
|
||||
Subproject commit 3d188ed2113431cf8dac77be61b842acb64433d9
|
@ -0,0 +1 @@
|
||||
Subproject commit a532fed72ace069e61c0132125b728316f9abd3c
|
@ -0,0 +1 @@
|
||||
Subproject commit 52f3ca3474d51f5021696ffb7297d989e49121ac
|
@ -1,8 +1,8 @@
|
||||
include base.conf
|
||||
|
||||
# binding workspaces
|
||||
workspace 1 output DP-0
|
||||
workspace 2 output DP-2
|
||||
workspace 1 output DP-2
|
||||
workspace 2 output DP-0
|
||||
|
||||
# poly bar
|
||||
exec_always --no-startup-id polybar-launch.sh desktop-bar
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit dbf546e61c0ca848f2474db55b601dead6d41f7e
|
||||
Subproject commit 0def3cd15974a19606a93082778c043d370df8bd
|
@ -1,6 +1,6 @@
|
||||
- shell:
|
||||
- [arch/yay_installer, Installing yay]
|
||||
- [bin/arch_package_installer.sh arch/base, installing base dependancies]
|
||||
#command: "yay --sudoloop --nodiffmenu --noeditmenu --noupgrademenu --nocleanmenu --noredownload --norebuild --useask --needed -S `cat arch/base.deps | grep -v '#'`"
|
||||
#description: "Installing base dependancies"
|
||||
-
|
||||
command: "yay --sudoloop --nodiffmenu --noeditmenu --noupgrademenu --nocleanmenu --noredownload --norebuild --useask --needed -S `cat arch/base.deps | grep -v '#'`"
|
||||
description: "Installing base dependancies"
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
- shell:
|
||||
- [bin/arch_package_installer.sh arch/i3, Installing i3 dependancies]
|
||||
#command: "yay --sudoloop --nodiffmenu --noeditmenu --noupgrademenu --nocleanmenu --noredownload --norebuild --useask --needed -S `cat arch/i3.deps | grep -v '#'`"
|
||||
#description: "Installing i3 dependancies"
|
||||
-
|
||||
command: "yay --sudoloop --nodiffmenu --noeditmenu --noupgrademenu --nocleanmenu --noredownload --norebuild --useask --needed -S `cat arch/i3.deps | grep -v '#'`"
|
||||
description: "Installing i3 dependancies"
|
||||
|
@ -1,7 +0,0 @@
|
||||
- shell:
|
||||
- [bin/arch_package_installer.sh arch/nvim, Installing nvim dependancies]
|
||||
# command: "yay --sudoloop --nodiffmenu --noeditmenu --noupgrademenu --nocleanmenu --noredownload --norebuild --useask --needed -S `cat arch/nvim.deps | grep -v '#'`"
|
||||
# description: "Installing base dependancies"
|
||||
# stderr: true
|
||||
# stdout: true
|
||||
|
@ -0,0 +1,5 @@
|
||||
- shell:
|
||||
-
|
||||
command: "yay --sudoloop --nodiffmenu --noeditmenu --noupgrademenu --nocleanmenu --noredownload --norebuild --useask --needed -S picom"
|
||||
description: "Installing picom"
|
||||
|
@ -0,0 +1,5 @@
|
||||
- shell:
|
||||
-
|
||||
command: "yay --sudoloop --nodiffmenu --noeditmenu --noupgrademenu --nocleanmenu --noredownload --norebuild --useask --needed -S polybar"
|
||||
description: "Installing polybar"
|
||||
|
@ -1,7 +0,0 @@
|
||||
- link:
|
||||
~/.config/nvim: editors/neovim/config
|
||||
~/.local/share/nvim/site: editors/neovim/site
|
||||
|
||||
- shell:
|
||||
- command: "cd editors/neovim/site/pack/markdown/start/markdown-preview.nvim/app && if [[ -z `ls bin 2>/dev/null` ]] ; then ./install.sh; fi"
|
||||
#- [cd editors/neovim/site/pack/markdown/start/markdown-preview.nvim && yarn install --checkfiles && NODE_OPTIONS=--openssl-legacy-provider yarn build, building markdown preview]
|
@ -0,0 +1,10 @@
|
||||
- clean:
|
||||
~/.config/nvim:
|
||||
~/.local/share/nvim:
|
||||
|
||||
- link:
|
||||
~/.config/nvim: editors/nvim/mac-config
|
||||
~/.local/share/nvim/site: editors/nvim/site
|
||||
|
||||
- shell:
|
||||
- [cd editors/nvim/site/pack/markdown/start/markdown-preview.nvim && yarn install && NODE_OPTIONS=--openssl-legacy-provider yarn build, building markdown preview]
|
@ -0,0 +1,10 @@
|
||||
- clean:
|
||||
~/.config/nvim:
|
||||
~/.local/share/nvim:
|
||||
|
||||
- link:
|
||||
~/.config/nvim: editors/nvim/config
|
||||
~/.local/share/nvim/site: editors/nvim/site
|
||||
|
||||
- shell:
|
||||
- [cd editors/nvim/site/pack/markdown/start/markdown-preview.nvim && yarn install && NODE_OPTIONS=--openssl-legacy-provider yarn build, building markdown preview]
|
@ -1,2 +1,2 @@
|
||||
- shell:
|
||||
- [cd shells/st && sudo make install CONFIG=desktop && tic -sx st.info && make clean, Installing st (desktop)]
|
||||
- [cd shells/st && sudo make install CONFIG=desktop && make clean, Installing st (desktop)]
|
||||
|
@ -1,2 +1,2 @@
|
||||
- shell:
|
||||
- [cd shells/st && sudo make install CONFIG=thinkpad && tic -sx st.info && make clean, Installing st (Thinkpad)]
|
||||
- [cd shells/st && sudo make install CONFIG=thinkpad, Installing st (Thinkpad)]
|
||||
|
@ -1,2 +1,2 @@
|
||||
- shell:
|
||||
- [cd shells/st && sudo make install CONFIG=work && tic -sx st.info && make clean, Installing st (work)]
|
||||
- [cd shells/st && sudo make install CONFIG=work, Installing st (work)]
|
||||
|
@ -1,2 +1,2 @@
|
||||
- link:
|
||||
~/.config/tmux/tmux.conf: terminals/tmux/tmux.sparse.conf
|
||||
~/.tmux.conf: terminals/tmux/tmux.sparse.conf
|
||||
|
@ -1,10 +0,0 @@
|
||||
- shell:
|
||||
- command: chsh -s $(which zsh)
|
||||
stdin: true
|
||||
stdout: true
|
||||
stderr: true
|
||||
|
||||
- link:
|
||||
~/.zprofile: shells/zsh/zprofile
|
||||
~/.zshrc: shells/zsh/zshrc.basic
|
||||
~/.p10k.sh: shells/zsh/p10k.sh
|
@ -1,9 +1,6 @@
|
||||
- shell:
|
||||
- command: bin/zsh-check
|
||||
stdin: true
|
||||
stdout: true
|
||||
- [bin/zsh-check]
|
||||
|
||||
- link:
|
||||
~/.config/zsh/.zprofile: shells/zsh/zprofile
|
||||
~/.config/zsh/.zshrc: shells/zsh/zshrc
|
||||
~/.config/zsh/.p10k.sh: shells/zsh/p10k.sh
|
||||
~/.zshrc: shells/zsh/zshrc
|
||||
~/.zprofile: shells/zsh/zprofile
|
||||
|
@ -1,2 +0,0 @@
|
||||
- shell:
|
||||
- [echo 'export ZDOTDIR="$HOME/.config/zsh"' > /etc/zsh/zshenv, "creating zshenv"]
|
@ -1,5 +0,0 @@
|
||||
tmux.sparse
|
||||
zsh.basic
|
||||
oh-my-zsh
|
||||
neovim
|
||||
clean
|
@ -0,0 +1,21 @@
|
||||
arch.base
|
||||
arch.i3
|
||||
arch.picom
|
||||
arch.polybar
|
||||
nvim
|
||||
zsh
|
||||
oh-my-zsh
|
||||
fzf
|
||||
tmux.sparse
|
||||
tmuxp
|
||||
st.desktop
|
||||
i3.desktop
|
||||
polybar
|
||||
picom
|
||||
rofi
|
||||
lf
|
||||
scripts
|
||||
calcurse
|
||||
seafile
|
||||
passwords
|
||||
clean
|
@ -0,0 +1,19 @@
|
||||
arch.base
|
||||
arch.i3
|
||||
arch.picom
|
||||
arch.polybar
|
||||
zsh
|
||||
oh-my-zsh
|
||||
fzf
|
||||
tmux.sparse
|
||||
st.thinkpad
|
||||
i3.thinkpad
|
||||
polybar
|
||||
picom
|
||||
rofi
|
||||
lf
|
||||
scripts
|
||||
calcurse
|
||||
seafile
|
||||
passwords
|
||||
clean
|
@ -0,0 +1,18 @@
|
||||
arch.base
|
||||
arch.i3
|
||||
arch.picom
|
||||
arch.polybar
|
||||
zsh
|
||||
oh-my-zsh
|
||||
fzf
|
||||
tmux.sparse
|
||||
nvim
|
||||
st.work
|
||||
i3.work
|
||||
picom
|
||||
polybar
|
||||
rofi
|
||||
lf
|
||||
scripts
|
||||
timetracker
|
||||
clean
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
Subproject commit c1b5b2c8aab51b2a5b0d29d078e3cb53bb4c46bb
|
||||
Subproject commit b474978b2e9435c10ca66f8281352ebc825264f4
|
@ -1 +1 @@
|
||||
Subproject commit 56aba76874efb3bb5914d8eaf9e356057113aea7
|
||||
Subproject commit 462ef27cf39db4a837eeecf7135fb65cd0b8789a
|
@ -0,0 +1,487 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/*
|
||||
* appearance
|
||||
*
|
||||
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
|
||||
*/
|
||||
static char *font = "Hack Nerd Font:pixelsize=20: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/sh";
|
||||
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 = 8;
|
||||
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;
|
||||
|
||||
/* bg opacity */
|
||||
float alpha = 0.8, alphaUnfocused = 0.6;
|
||||
|
||||
/* 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 */
|
||||
"#c5c8c6", // hybrid fg
|
||||
"#1d1f21", // hybrid bg
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Default colors (colorname index)
|
||||
* foreground, background, cursor, reverse cursor
|
||||
*/
|
||||
unsigned int defaultfg = 260;
|
||||
unsigned int defaultbg = 261;
|
||||
unsigned int defaultcs = 256;
|
||||
static unsigned int defaultrcs = 257;
|
||||
unsigned int bg = 261, bgUnfocused = 261;
|
||||
|
||||
/*
|
||||
* https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-SP-q.1D81
|
||||
* Default style of cursor
|
||||
* 0: blinking block
|
||||
* 1: blinking block (default)
|
||||
* 2: steady block ("█")
|
||||
* 3: blinking underline
|
||||
* 4: steady underline ("_")
|
||||
* 5: blinking bar
|
||||
* 6: steady bar ("|")
|
||||
* 7: blinking st cursor
|
||||
* 8: steady st cursor
|
||||
*/
|
||||
static unsigned int cursorstyle = 3;
|
||||
static Rune stcursor = 0x2603; /* snowman ("☃") */
|
||||
|
||||
/*
|
||||
* 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_Prior, zoom, {.f = +1} },
|
||||
{ TERMMOD, XK_Next, 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} },
|
||||
};
|
||||
|
||||
/*
|
||||
* 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{|}~";
|
@ -0,0 +1,487 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/*
|
||||
* appearance
|
||||
*
|
||||
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
|
||||
*/
|
||||
static char *font = "Hack Nerd Font:pixelsize=14:antialias=true:autohint=true";
|
||||
static int borderpx = 1;
|
||||
|
||||
/*
|
||||
* 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/sh";
|
||||
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 = 8;
|
||||
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;
|
||||
|
||||
/* bg opacity */
|
||||
float alpha = 0.85, alphaUnfocused = 0.6;
|
||||
|
||||
/* 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 */
|
||||
"#c5c8c6", // hybrid fg
|
||||
"#1d1f21", // hybrid bg
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Default colors (colorname index)
|
||||
* foreground, background, cursor, reverse cursor
|
||||
*/
|
||||
unsigned int defaultfg = 260;
|
||||
unsigned int defaultbg = 261;
|
||||
unsigned int defaultcs = 256;
|
||||
static unsigned int defaultrcs = 257;
|
||||
unsigned int bg = 261, bgUnfocused = 261;
|
||||
|
||||
/*
|
||||
* https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-SP-q.1D81
|
||||
* Default style of cursor
|
||||
* 0: blinking block
|
||||
* 1: blinking block (default)
|
||||
* 2: steady block ("█")
|
||||
* 3: blinking underline
|
||||
* 4: steady underline ("_")
|
||||
* 5: blinking bar
|
||||
* 6: steady bar ("|")
|
||||
* 7: blinking st cursor
|
||||
* 8: steady st cursor
|
||||
*/
|
||||
static unsigned int cursorstyle = 3;
|
||||
static Rune stcursor = 0x2603; /* snowman ("☃") */
|
||||
|
||||
/*
|
||||
* 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_Prior, zoom, {.f = +1} },
|
||||
{ TERMMOD, XK_Next, 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} },
|
||||
};
|
||||
|
||||
/*
|
||||
* 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{|}~";
|
@ -0,0 +1,487 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/*
|
||||
* appearance
|
||||
*
|
||||
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
|
||||
*/
|
||||
static char *font = "Hack Nerd Font: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/sh";
|
||||
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 = 8;
|
||||
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;
|
||||
|
||||
/* bg opacity */
|
||||
float alpha = 0.8, alphaUnfocused = 0.6;
|
||||
|
||||
/* 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 */
|
||||
"#c5c8c6", // hybrid fg
|
||||
"#1d1f21", // hybrid bg
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Default colors (colorname index)
|
||||
* foreground, background, cursor, reverse cursor
|
||||
*/
|
||||
unsigned int defaultfg = 260;
|
||||
unsigned int defaultbg = 261;
|
||||
unsigned int defaultcs = 256;
|
||||
static unsigned int defaultrcs = 257;
|
||||
unsigned int bg = 261, bgUnfocused = 261;
|
||||
|
||||
/*
|
||||
* https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-SP-q.1D81
|
||||
* Default style of cursor
|
||||
* 0: blinking block
|
||||
* 1: blinking block (default)
|
||||
* 2: steady block ("█")
|
||||
* 3: blinking underline
|
||||
* 4: steady underline ("_")
|
||||
* 5: blinking bar
|
||||
* 6: steady bar ("|")
|
||||
* 7: blinking st cursor
|
||||
* 8: steady st cursor
|
||||
*/
|
||||
static unsigned int cursorstyle = 3;
|
||||
static Rune stcursor = 0x2603; /* snowman ("☃") */
|
||||
|
||||
/*
|
||||
* 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_Prior, zoom, {.f = +1} },
|
||||
{ TERMMOD, XK_Next, 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} },
|
||||
};
|
||||
|
||||
/*
|
||||
* 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{|}~";
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
export ZDOTDIR="$HOME/.config/zsh"
|
@ -1,107 +0,0 @@
|
||||
# Path to your oh-my-zsh installation.
|
||||
# export ZSH="$HOME/.oh-my-zsh"
|
||||
export ZSH="$HOME/.local/share/oh-my-zsh"
|
||||
|
||||
# path fix for deb
|
||||
export PATH=$PATH:/usr/local/bin
|
||||
|
||||
# Would you like to use another custom folder than $ZSH/custom?
|
||||
export ZSH_CUSTOM="$HOME/.local/share/omz-custom/custom"
|
||||
# export ZSH_CUSTOM=$HOME/.local/share/omz-custom
|
||||
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
||||
# Initialization code that may require console input (password prompts, [y/n]
|
||||
# confirmations, etc.) must go above this block; everything else may go below.
|
||||
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||
fi
|
||||
|
||||
# If you come from bash you might have to change your $PATH.
|
||||
# export PATH=$HOME/bin:/usr/local/bin:$PATH
|
||||
|
||||
# fixing gopath and binaries
|
||||
export GOPATH="$HOME/.local/share/go"
|
||||
|
||||
# moving cargo cache dir
|
||||
export CARGO_HOME="$HOME/.local/share/cargo"
|
||||
export RUSTUP_HOME="$HOME/.local/sare/rustup"
|
||||
|
||||
|
||||
# Path to your oh-my-zsh installation.
|
||||
# export ZSH="$HOME/.oh-my-zsh"
|
||||
export ZSH="$HOME/.local/share/oh-my-zsh"
|
||||
|
||||
# Would you like to use another custom folder than $ZSH/custom?
|
||||
export ZSH_CUSTOM="$HOME/.local/share/omz-custom/custom"
|
||||
# export ZSH_CUSTOM=$HOME/.local/share/omz-custom
|
||||
|
||||
# ZSH theme
|
||||
ZSH_THEME="powerlevel10k/powerlevel10k"
|
||||
|
||||
|
||||
# Which plugins would you like to load?
|
||||
# Standard plugins can be found in $ZSH/plugins/
|
||||
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
|
||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||
# Add wisely, as too many plugins slow down shell startup.
|
||||
plugins=(
|
||||
zsh-autosuggestions
|
||||
git
|
||||
)
|
||||
#vi-mode
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
# vi-mode settings
|
||||
export KEYTIMEOUT=10
|
||||
bindkey -v
|
||||
# Uncomment the following line to use hyphen-insensitive completion.
|
||||
# Case-sensitive completion must be off. _ and - will be interchangeable.
|
||||
# HYPHEN_INSENSITIVE="true"
|
||||
|
||||
# Uncomment the following line if you want to disable marking untracked files
|
||||
# under VCS as dirty. This makes repository status check for large repositories
|
||||
# much, much faster.
|
||||
# DISABLE_UNTRACKED_FILES_DIRTY="true"
|
||||
|
||||
# Uncomment the following line if you want to change the command execution time
|
||||
# stamp shown in the history command output.
|
||||
# You can set one of the optional three formats:
|
||||
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
|
||||
# or set a custom format using the strftime function format specifications,
|
||||
# see 'man strftime' for details.
|
||||
# HIST_STAMPS="mm/dd/yyyy"
|
||||
|
||||
|
||||
|
||||
# export LANG=en_US.UTF-8
|
||||
|
||||
# Preferred editor for local and remote sessions
|
||||
# if [[ -n $SSH_CONNECTION ]]; then
|
||||
# export EDITOR='vim'
|
||||
# else
|
||||
# export EDITOR='nvim'
|
||||
# fi
|
||||
|
||||
# Compilation flags
|
||||
# export ARCHFLAGS="-arch x86_64"
|
||||
|
||||
#
|
||||
# switching to neovim
|
||||
alias vim="nvim"
|
||||
|
||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||
export POWERLEVEL9K_CONFIG_FILE="$HOME/.config/zsh/.p10k.sh"
|
||||
|
||||
[[ ! -f "$POWERLEVEL9K_CONFIG_FILE" ]] || source "$POWERLEVEL9K_CONFIG_FILE"
|
||||
|
||||
# home and clear
|
||||
alias c="cd && clear"
|
||||
|
||||
# colorize ls
|
||||
alias ls="ls --color=auto"
|
||||
|
||||
export FZF_DEFAULT_OPTS='--layout=reverse --border'
|
||||
|
||||
# git aliases
|
||||
alias gadd="git add ."
|
||||
alias gbug="git add . && git commit -m 'bug fixes'"
|
||||
alias gp="git push"
|
||||
alias glog="git log --pretty --oneline --graph --all --decorate"
|
@ -1 +1 @@
|
||||
Subproject commit e75250ac9f2ea0ad557fe971a263842c0717b80f
|
||||
Subproject commit 06434a49350a669263b7bc45e5210b5f3e699ced
|
@ -1 +1 @@
|
||||
Subproject commit 96670d5f16dcf23d590eb1d83d1de351b2e8fb15
|
||||
Subproject commit 20230402d087858ca9a93aa8fe53d289f29c1836
|
@ -1 +1 @@
|
||||
Subproject commit c5672a5864bc78a932de438e4f64fefcee5c6ea6
|
||||
Subproject commit dbe65c011c8f9d653470333a07a9892ab2d227c7
|
Loading…
Reference in New Issue