chezmoi: reorganise repo

This commit is contained in:
js0ny 2025-09-27 15:28:09 +01:00
parent b391e03c87
commit 67a78879db
278 changed files with 102 additions and 182 deletions

View file

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>

View file

@ -0,0 +1,604 @@
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader")
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
local menubar = require("menubar")
local hotkeys_popup = require("awful.hotkeys_popup")
-- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened:
require("awful.hotkeys_popup.keys")
-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
if awesome.startup_errors then
naughty.notify({
preset = naughty.config.presets.critical,
title = "Oops, there were errors during startup!",
text = awesome.startup_errors,
})
end
-- Handle runtime errors after startup
do
local in_error = false
awesome.connect_signal("debug::error", function(err)
-- Make sure we don't go into an endless error loop
if in_error then
return
end
in_error = true
naughty.notify({
preset = naughty.config.presets.critical,
title = "Oops, an error happened!",
text = tostring(err),
})
in_error = false
end)
end
-- }}}
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
-- This is used later as the default terminal and editor to run.
terminal = "wezterm"
editor = os.getenv("EDITOR") or "vim"
editor_cmd = terminal .. " -e " .. editor
-- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt.
-- If you do not like this or do not have such a key,
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
-- However, you can use another modifier like Mod1, but it may interact with others.
modkey = "Mod4"
-- Table of layouts to cover with awful.layout.inc, order matters.
awful.layout.layouts = {
awful.layout.suit.tile, -- Tile by default
awful.layout.suit.floating,
awful.layout.suit.tile.left,
awful.layout.suit.tile.bottom,
awful.layout.suit.tile.top,
awful.layout.suit.fair,
awful.layout.suit.fair.horizontal,
awful.layout.suit.spiral,
awful.layout.suit.spiral.dwindle,
awful.layout.suit.max,
awful.layout.suit.max.fullscreen,
awful.layout.suit.magnifier,
awful.layout.suit.corner.nw,
-- awful.layout.suit.corner.ne,
-- awful.layout.suit.corner.sw,
-- awful.layout.suit.corner.se,
}
-- }}}
-- {{{ Menu
-- Create a launcher widget and a main menu
myawesomemenu = {
{
"hotkeys",
function()
hotkeys_popup.show_help(nil, awful.screen.focused())
end,
},
{ "manual", terminal .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awesome.conffile },
{ "restart", awesome.restart },
{
"quit",
function()
awesome.quit()
end,
},
}
mymainmenu = awful.menu({
items = {
{ "awesome", myawesomemenu, beautiful.awesome_icon },
{ "open terminal", terminal },
},
})
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, menu = mymainmenu })
-- Menubar configuration
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
-- }}}
-- Keyboard map indicator and switcher
mykeyboardlayout = awful.widget.keyboardlayout()
-- {{{ Wibar
-- Create a textclock widget
mytextclock = wibox.widget.textclock()
-- Create a wibox for each screen and add it
local taglist_buttons = gears.table.join(
awful.button({}, 1, function(t)
t:view_only()
end),
awful.button({ modkey }, 1, function(t)
if client.focus then
client.focus:move_to_tag(t)
end
end),
awful.button({}, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t)
if client.focus then
client.focus:toggle_tag(t)
end
end),
awful.button({}, 4, function(t)
awful.tag.viewnext(t.screen)
end),
awful.button({}, 5, function(t)
awful.tag.viewprev(t.screen)
end)
)
local tasklist_buttons = gears.table.join(
awful.button({}, 1, function(c)
if c == client.focus then
c.minimized = true
else
c:emit_signal("request::activate", "tasklist", { raise = true })
end
end),
awful.button({}, 3, function()
awful.menu.client_list({ theme = { width = 250 } })
end),
awful.button({}, 4, function()
awful.client.focus.byidx(1)
end),
awful.button({}, 5, function()
awful.client.focus.byidx(-1)
end)
)
local function set_wallpaper(s)
-- Wallpaper
if beautiful.wallpaper then
local wallpaper = beautiful.wallpaper
-- If wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then
wallpaper = wallpaper(s)
end
gears.wallpaper.maximized(wallpaper, s, true)
end
end
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", set_wallpaper)
awful.screen.connect_for_each_screen(function(s)
-- Wallpaper
set_wallpaper(s)
-- Each screen has its own tag table.
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
-- Create a promptbox for each screen
s.mypromptbox = awful.widget.prompt()
-- Create an imagebox widget which will contain an icon indicating which layout we're using.
-- We need one layoutbox per screen.
s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox:buttons(gears.table.join(
awful.button({}, 1, function()
awful.layout.inc(1)
end),
awful.button({}, 3, function()
awful.layout.inc(-1)
end),
awful.button({}, 4, function()
awful.layout.inc(1)
end),
awful.button({}, 5, function()
awful.layout.inc(-1)
end)
))
-- Create a taglist widget
s.mytaglist = awful.widget.taglist({
screen = s,
filter = awful.widget.taglist.filter.all,
buttons = taglist_buttons,
})
-- Create a tasklist widget
s.mytasklist = awful.widget.tasklist({
screen = s,
filter = awful.widget.tasklist.filter.currenttags,
buttons = tasklist_buttons,
})
-- Create the wibox
s.mywibox = awful.wibar({ position = "top", screen = s })
-- Add widgets to the wibox
s.mywibox:setup({
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
mylauncher,
s.mytaglist,
s.mypromptbox,
},
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
mykeyboardlayout,
wibox.widget.systray(),
mytextclock,
s.mylayoutbox,
},
})
end)
-- }}}
-- {{{ Mouse bindings
root.buttons(gears.table.join(
awful.button({}, 3, function()
mymainmenu:toggle()
end),
awful.button({}, 4, awful.tag.viewnext),
awful.button({}, 5, awful.tag.viewprev)
))
-- }}}
-- {{{ Key bindings
globalkeys = gears.table.join(
awful.key({ modkey }, "s", hotkeys_popup.show_help, { description = "show help", group = "awesome" }),
awful.key({ modkey }, "Left", awful.tag.viewprev, { description = "view previous", group = "tag" }),
awful.key({ modkey }, "Right", awful.tag.viewnext, { description = "view next", group = "tag" }),
awful.key({ modkey }, "Escape", awful.tag.history.restore, { description = "go back", group = "tag" }),
awful.key({ modkey }, "n", function()
awful.client.focus.byidx(1)
end, { description = "focus next by index", group = "client" }),
awful.key({ modkey }, "e", function()
awful.client.focus.byidx(-1)
end, { description = "focus previous by index", group = "client" }),
awful.key({ modkey }, "w", function()
mymainmenu:show()
end, { description = "show main menu", group = "awesome" }),
-- Layout manipulation
awful.key({ modkey, "Shift" }, "n", function()
awful.client.swap.byidx(1)
end, { description = "swap with next client by index", group = "client" }),
awful.key({ modkey, "Shift" }, "e", function()
awful.client.swap.byidx(-1)
end, { description = "swap with previous client by index", group = "client" }),
awful.key({ modkey, "Control" }, "n", function()
awful.screen.focus_relative(1)
end, { description = "focus the next screen", group = "screen" }),
awful.key({ modkey, "Control" }, "e", function()
awful.screen.focus_relative(-1)
end, { description = "focus the previous screen", group = "screen" }),
awful.key({ modkey }, "u", awful.client.urgent.jumpto, { description = "jump to urgent client", group = "client" }),
awful.key({ modkey }, "Tab", function()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end, { description = "go back", group = "client" }),
-- Standard program
awful.key({ modkey }, "Return", function()
awful.spawn(terminal)
end, { description = "open a terminal", group = "launcher" }),
awful.key({ modkey, "Control" }, "r", awesome.restart, { description = "reload awesome", group = "awesome" }),
awful.key({ modkey, "Shift" }, "q", awesome.quit, { description = "quit awesome", group = "awesome" }),
awful.key({ modkey }, "i", function()
awful.tag.incmwfact(0.05)
end, { description = "increase master width factor", group = "layout" }),
awful.key({ modkey }, "h", function()
awful.tag.incmwfact(-0.05)
end, { description = "decrease master width factor", group = "layout" }),
awful.key({ modkey, "Shift" }, "h", function()
awful.tag.incnmaster(1, nil, true)
end, { description = "increase the number of master clients", group = "layout" }),
awful.key({ modkey, "Shift" }, "i", function()
awful.tag.incnmaster(-1, nil, true)
end, { description = "decrease the number of master clients", group = "layout" }),
awful.key({ modkey, "Control" }, "h", function()
awful.tag.incncol(1, nil, true)
end, { description = "increase the number of columns", group = "layout" }),
awful.key({ modkey, "Control" }, "i", function()
awful.tag.incncol(-1, nil, true)
end, { description = "decrease the number of columns", group = "layout" }),
awful.key({ modkey }, "space", function()
awful.spawn.with_shell("albert show")
end, { description = "select next", group = "layout" }),
awful.key({ modkey, "Shift" }, "space", function()
awful.layout.inc(-1)
end, { description = "select previous", group = "layout" }),
awful.key({ modkey, "Control" }, "k", function()
local c = awful.client.restore()
-- Focus restored client
if c then
c:emit_signal("request::activate", "key.unminimize", { raise = true })
end
end, { description = "restore minimized", group = "client" }),
-- Prompt
awful.key({ modkey }, "r", function()
awful.screen.focused().mypromptbox:run()
end, { description = "run prompt", group = "launcher" }),
awful.key({ modkey }, "x", function()
awful.prompt.run({
prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval",
})
end, { description = "lua execute prompt", group = "awesome" }),
-- Menubar
awful.key({ modkey }, "p", function()
menubar.show()
end, { description = "show the menubar", group = "launcher" })
)
clientkeys = gears.table.join(
awful.key({ modkey }, "f", function(c)
c.fullscreen = not c.fullscreen
c:raise()
end, { description = "toggle fullscreen", group = "client" }),
awful.key({ modkey, "Shift" }, "c", function(c)
c:kill()
end, { description = "close", group = "client" }),
awful.key(
{ modkey, "Control" },
"space",
awful.client.floating.toggle,
{ description = "toggle floating", group = "client" }
),
awful.key({ modkey, "Control" }, "Return", function(c)
c:swap(awful.client.getmaster())
end, { description = "move to master", group = "client" }),
awful.key({ modkey }, "o", function(c)
c:move_to_screen()
end, { description = "move to screen", group = "client" }),
awful.key({ modkey }, "t", function(c)
c.ontop = not c.ontop
end, { description = "toggle keep on top", group = "client" }),
awful.key({ modkey }, "k", function(c)
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
c.minimized = true
end, { description = "minimize", group = "client" }),
awful.key({ modkey }, "m", function(c)
c.maximized = not c.maximized
c:raise()
end, { description = "(un)maximize", group = "client" }),
awful.key({ modkey, "Control" }, "m", function(c)
c.maximized_vertical = not c.maximized_vertical
c:raise()
end, { description = "(un)maximize vertically", group = "client" }),
awful.key({ modkey, "Shift" }, "m", function(c)
c.maximized_horizontal = not c.maximized_horizontal
c:raise()
end, { description = "(un)maximize horizontally", group = "client" })
)
-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it work on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 9 do
globalkeys = gears.table.join(
globalkeys,
-- View tag only.
awful.key({ modkey }, "#" .. i + 9, function()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
tag:view_only()
end
end, { description = "view tag #" .. i, group = "tag" }),
-- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9, function()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
end, { description = "toggle tag #" .. i, group = "tag" }),
-- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9, function()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:move_to_tag(tag)
end
end
end, { description = "move focused client to tag #" .. i, group = "tag" }),
-- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:toggle_tag(tag)
end
end
end, { description = "toggle focused client on tag #" .. i, group = "tag" })
)
end
clientbuttons = gears.table.join(
awful.button({}, 1, function(c)
c:emit_signal("request::activate", "mouse_click", { raise = true })
end),
awful.button({ modkey }, 1, function(c)
c:emit_signal("request::activate", "mouse_click", { raise = true })
awful.mouse.client.move(c)
end),
awful.button({ modkey }, 3, function(c)
c:emit_signal("request::activate", "mouse_click", { raise = true })
awful.mouse.client.resize(c)
end)
)
-- Set keys
root.keys(globalkeys)
-- }}}
-- {{{ Rules
-- Rules to apply to new clients (through the "manage" signal).
awful.rules.rules = {
-- All clients will match this rule.
{
rule = {},
properties = {
border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap + awful.placement.no_offscreen,
},
},
-- Floating clients.
{
rule_any = {
instance = {
"DTA", -- Firefox addon DownThemAll.
"copyq", -- Includes session name in class.
"pinentry",
},
class = {
"Arandr",
"Blueman-manager",
"Gpick",
"Kruler",
"MessageWin", -- kalarm.
"Sxiv",
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
"Wpa_gui",
"veromix",
"xtightvncviewer",
},
-- Note that the name property shown in xprop might be set slightly after creation of the client
-- and the name shown there might not match defined rules here.
name = {
"Event Tester", -- xev.
},
role = {
"AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
},
},
properties = { floating = true },
},
-- Add titlebars to normal clients and dialogs
{ rule_any = { type = { "normal", "dialog" } }, properties = { titlebars_enabled = true } },
-- Set Firefox to always map on the tag named "2" on screen 1.
-- { rule = { class = "Firefox" },
-- properties = { screen = 1, tag = "2" } },
}
-- }}}
-- {{{ Signals
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function(c)
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c)
end
end)
-- Add a titlebar if titlebars_enabled is set to true in the rules.
client.connect_signal("request::titlebars", function(c)
-- buttons for the titlebar
local buttons = gears.table.join(
awful.button({}, 1, function()
c:emit_signal("request::activate", "titlebar", { raise = true })
awful.mouse.client.move(c)
end),
awful.button({}, 3, function()
c:emit_signal("request::activate", "titlebar", { raise = true })
awful.mouse.client.resize(c)
end)
)
awful.titlebar(c):setup({
{ -- Left
awful.titlebar.widget.iconwidget(c),
buttons = buttons,
layout = wibox.layout.fixed.horizontal,
},
{ -- Middle
{ -- Title
align = "center",
widget = awful.titlebar.widget.titlewidget(c),
},
buttons = buttons,
layout = wibox.layout.flex.horizontal,
},
{ -- Right
awful.titlebar.widget.floatingbutton(c),
awful.titlebar.widget.maximizedbutton(c),
awful.titlebar.widget.stickybutton(c),
awful.titlebar.widget.ontopbutton(c),
awful.titlebar.widget.closebutton(c),
layout = wibox.layout.fixed.horizontal(),
},
layout = wibox.layout.align.horizontal,
})
end)
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
c:emit_signal("request::activate", "mouse_enter", { raise = false })
end)
client.connect_signal("focus", function(c)
c.border_color = beautiful.border_focus
end)
client.connect_signal("unfocus", function(c)
c.border_color = beautiful.border_normal
end)
-- }}}
--
autorun = true
autorunApps = {
"fcitx5",
"albert",
}
if autorun then
for app = 1, #autorunApps do
awful.spawn(autorunApps[app])
end
end
awful.spawn.with_shell("setxkbmap -option caps:escape")
awful.spawn.with_shell("feh --bg-fill ~/Pictures/Wallpaper/current.jpg")

View file

@ -0,0 +1,134 @@
# vim:ft=bash
# This should be in
# ~/.bash_aliases
# or in if antidots and wheel
# ~/.config/bash/bash_aliases
if command -v zoxide >/dev/null; then
eval "$(zoxide init bash)"
# Relative navigation #
alias ..="z .."
alias ...="z ../.."
alias ....="z ../../.."
alias .....="z ../../../.."
alias ......="z ../../../../.."
# Use `-` to jump to the previous directory
# Oh-My-Zsh defines a similar one
-() {
z -
}
zls() {
cd $1 && ls
}
else
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ......="cd ../../../../.."
-() {
cd -
}
fi
alias ni=touch
alias cls=clear
alias ii=open
# Editors #
alias v=nvim
alias c=code
# Use neovide as gVim
alias gvi="neovide"
alias svi="sudo vim -u ~/.dotfiles/common/vim.noxdg.vimrc" # Prevent conflicts with svelte-cli
alias sn="sudo nvim -u ~/.config/nvim/init.lua"
# Dev #
alias gpp='g++ -std=c++2b' # Set the default C++ standard to C++20
alias gcc='gcc -std=c99' # Set the default C standard to C99
alias cl='clang -std=c99'
alias clpp='clang++ -std=c++2b'
alias python=python3 # Set the default Python version to Python 3
alias py=python
alias ipy=ipython
alias g=lazygit
alias doomd="emacsclient -t ~/.config/doom/"
# lsd - modern ls
if command -v lsd >/dev/null; then
alias ls='lsd'
alias l='lsd -lah'
alias ll='lsd -l'
alias la='lsd -A'
alias l.='lsd -d .*'
alias tree='lsd --tree -A'
else
alias l='ls -lah'
alias ll='ls -l'
fi
# Functions #
mkcd() {
mkdir -p $1 && cd $1
}
cdls() {
cd $1 && ls
}
tc() {
touch $1 && code $1
}
tv() {
touch $1 && nvim $1
}
mt() {
mkdir -p $(dirname $1) && touch $1
}
mtv() {
mkdir -p $(dirname $1) && touch $1 && nvim $1
}
alias update="source $DOTFILES/scripts/update.zsh"
if command -v pacman >/dev/null; then
alias pac="sudo pacman"
alias paci="sudo pacman -S"
alias pacr="sudo pacman -R"
alias pacu="sudo pacman -Syu"
alias pacl="pacman -Q"
if command -v paru >/dev/null; then
alias pacs="paru -Ss"
elif command -v yay >/dev/null; then
alias pacs="yay -Ss"
else
alias pacs="pacman -Ss"
fi
fi
if command -v apt >/dev/null; then
alias apt="sudo apt"
alias apti="sudo apt install"
alias aptr="sudo apt remove"
alias aptu="sudo apt update && sudo apt upgrade"
alias apts="apt search"
alias aptl="apt list --installed"
fi
if command -v brew >/dev/null; then
alias brewi="brew install"
alias brewr="brew uninstall"
alias brewu="brew update && brew upgrade"
alias brews="brew search"
alias brewl="brew list"
fi
# TODO: Does not work
if [ "$TERM" = "xterm-ghostty" ] || [ "$TERM" = "xterm-kitty" ]; then
alias icat="kitten icat"
elif [ "$TERM_PROGRAM" = "WezTerm" ]; then
if [ -n "$WSL_DISTRO_NAME" ]; then
alias icat="wezterm.exe imgcat"
else
alias icat="wezterm imgcat"
fi
fi

View file

@ -0,0 +1,33 @@
# vim:ft=bash
# If wheel and antidots:
# ln -sf $DOTFILES/tools/bash/profile ~/.config/bash/bashrc
# If not wheel or antidots:
# ln -sf $DOTFILES/tools/bash/bashrc ~/.bashrc
export DOTFILES=$HOME/.dotfiles
# Force to choose English font name
export LC_CTYPE=en_GB.UTF-8
if [ -n "$WSL_DISTRO_NAME" ]; then
alias clip="clip.exe"
alias paste="pwsh.exe -NoProfile -Command 'Get-Clipboard'"
elif [ -n "$WAYLAND_DISPLAY" ]; then
alias clip="wl-copy"
alias paste="wl-paste"
elif [ -n "$DISPLAY" ]; then
alias clip="xclip"
fi
source "$DOTFILES"/tools/bash/bash_aliases # For compatibility
export IPYTHONDIR="$XDG_CONFIG_HOME"/ipython
if command -v fzf >/dev/null; then
eval "$(fzf --bash)"
fi
if command -v starship >/dev/null; then
eval "$(starship init bash)"
fi
#
# bind 'set show-mode-in-prompt off'

View file

@ -0,0 +1,3 @@
#:vim: set ft=bash:
test -f $HOME/.config/bash/bashrc && source $HOME/.config/bash/bashrc
test -f $HOME/.bashrc && source $HOME/.bashrc

View file

@ -0,0 +1,176 @@
# vim:ft=bash
# Put this file in $XDG_CONFIG_HOME/bash/profile
# This file is sourced by /etc/profile.d/xdg-compat.sh
# and will source user's XDG-compliant Bash Run Commands
# If no admin rights, just
# ln -sf $DOTFILES/tools/bash/profile ~/.bash_profile
# Before antidots
if [ -n "$BASH_VERSION" ] && [ -f "$HOME/.bash_profile" ]; then
. "$HOME/.bash_profile"
fi
if [ -n "$BASH_VERSION" ] && [ -f "$XDG_CONFIG_HOME/bash/bashrc" ]; then
. "$XDG_CONFIG_HOME/bash/bashrc"
fi
pathadd() {
# 检查是否存在且不在 PATH 中
if [[ -d "$1" && ":$PATH:" != *":$1:"* ]]; then
# 检查是否是符号链接
if [[ -L "$1" ]]; then
# 检查符号链接指向的目标是否存在
if [[ -e "$1" ]]; then
PATH="$1:$PATH"
fi
else
# 普通目录直接添加
PATH="$1:$PATH"
fi
fi
}
# Dynamically Add Path
minimal_path=(
"/bin"
"/sbin"
"/usr/bin"
"/usr/sbin"
"/usr/local/bin"
"/usr/local/sbin"
"$HOME/.local/bin"
"$HOME/.local/sbin"
"$HOME/.local/scripts"
)
export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc
for p in "${minimal_path[@]}"; do
pathadd "$p"
done
if [ -d "/opt/homebrew/bin" ]; then # macOS
export PATH="/opt/homebrew/bin:$PATH"
elif [ -d "/home/linuxbrew/.linuxbrew/bin" ]; then # Linux
export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
fi
# macOS Specific
# This syntax is POSIX standard, for portability
if [ "$(uname)" = "Darwin" ]; then
: # Do nothing
fi
# Linux Specific
if [ "$(uname)" = "Linux" ]; then
# CUDA
export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv
fi
# Azure CLI
if command -v az > /dev/null; then
export AZURE_CONFIG_DIR="$XDG_DATA_HOME"/azure
fi
# Bun JS
# mv ~/.bun $XDG_DATA_HOME/bun
# ln -sf $XDG_DATA_HOME/bun/bin/bun ~/.local/bin/bun
if command -v bun > /dev/null; then
export BUN_INSTALL="$XDG_DATA_HOME"/bun
export PATH="$BUN_INSTALL/bin:$PATH"
[ -s "$BUN_INSTALL/_bun" ] && source "$BUN_INSTALL/_bun"
fi
# Cargo
if command -v cargo > /dev/null; then
export CARGO_HOME="$XDG_DATA_HOME"/cargo
export PATH="$CARGO_HOME/bin:$PATH"
fi
# CGDB
if command -v cgdb > /dev/null; then
export CGDB_DIR="$XDG_CONFIG_HOME"/cgdb
fi
# .NET
if command -v dotnet > /dev/null; then
export DOTNET_CLI_HOME="$XDG_DATA_HOME"/dotnet
export PATH="$DOTNET_CLI_HOME/.dotnet/tools:$PATH"
fi
# Docker
if command -v docker > /dev/null; then
export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker
fi
# GnuPG
if command -v gpg > /dev/null; then
export GNUPGHOME="$XDG_DATA_HOME"/gnupg
fi
# Go
export GOPATH="$XDG_DATA_HOME"/go
export PATH="$GOPATH/bin:$PATH"
# Julia
if command -v julia > /dev/null; then
export JULIA_DEPOT_PATH="$XDG_DATA_HOME/julia:$JULIA_DEPOT_PATH"
fi
# Node.js
if command -v node > /dev/null; then
export NODE_REPL_HISTORY="$XDG_STATE_HOME"/node/repl_history
export TS_NODE_REPL_HISTORY="$XDG_STATE_HOME"/node/ts_node_repl_history
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
export NPM_CONFIG_INIT_MODULE="$XDG_CONFIG_HOME"/npm/config/npm-init.js
export NPM_CONFIG_CACHE="$XDG_CACHE_HOME"/npm
export NPM_CONFIG_TMP="$XDG_RUNTIME_DIR"/npm
fi
# Parallel
if command -v parallel > /dev/null; then
export PARALLEL_HOME="$XDG_CONFIG_HOME"/parallel
fi
# Python
# Works only with Python 3.13.0a3 and later
if command -v python3 > /dev/null; then
export PYTHON_HISTORY="$XDG_DATA_HOME"/python/history
fi
# GNU Screen
if command -v screen > /dev/null; then
export SCREENRC="$XDG_CONFIG_HOME"/screen/screenrc
export SCREENDIR="${XDG_RUNTIME_DIR}/screen"
fi
# Ruby Gem
# Ruby Gem
if command -v gem > /dev/null; then
for dir in "$HOME/.local/share/gem/ruby/"*/bin; do
if [ -d "$dir" ]; then
export PATH="$dir:$PATH"
fi
done
fi
# Spacemacs
if command -v emacs > /dev/null; then
export SPACEMACSDIR="$XDG_CONFIG_HOME"/spacemacs
fi
# tldr
# Works only with C client (did not verify)
if command -v tldr > /dev/null; then
export TLDR_CACHE_DIR="$XDG_CACHE_HOME"/tldr
fi
# W3M
if command -v w3m > /dev/null; then
export W3M_DIR="$XDG_DATA_HOME"/w3m
fi
# Wakatime
if command -v wakatime > /dev/null; then
export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime"
fi
# Wget
if command -v wget > /dev/null; then
alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"'
fi
# zsh .zcompdump
# compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
# Vcpkg
if command -v vcpkg > /dev/null; then
export VCPKG_ROOT="$XDG_DATA_HOME"/vcpkg
fi
export PADER="less -R"
export EDITOR="nvim"
export VISUAL="nvim"

View file

@ -0,0 +1,19 @@
# $DOTFILES/tools/bash/xdg-compat.sh
# Author: js0ny
# Date: 2025-01-28
# Sourced by /etc/profile
# Location: /etc/profile.d/xdg-compat.sh
# cp $DOTFILES/tools/bash/xdg-compat.sh /etc/profile.d/xdg-compat.sh
# Set XDG Base Directory Path
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
# Source user's XDG-compliant Bash configs
if [ -f "$XDG_CONFIG_HOME/bash/profile" ]; then
. "$XDG_CONFIG_HOME/bash/profile"
fi

View file

@ -0,0 +1,41 @@
# $DOTFILES/common/bat.config
# Date: 2025-01-26
# Author: js0ny
# Location;
# Unix: $XDG_CONFIG_HOME/bat/config
# Windows:
# - Default: %AppData%\bat\config
# - Portable: (scoop prefix bat) + config
# Linking:
# ln -sf $DOTFILES/common/bat.config $XDG_CONFIG_HOME/bat/config
# This is `bat`s configuration file. Each line either contains a comment or
# a command-line option that you want to pass to `bat` by default. You can
# run `bat --help` to get a list of all possible configuration options.
# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes`
# for a list of all available themes
--theme="Catppuccin Mocha"
# Enable this to use italic text on the terminal. This is not supported on all
# terminal emulators (like tmux, by default):
#--italic-text=always
# Uncomment the following line to disable automatic paging:
#--paging=never
# Uncomment the following line if you are using less version >= 551 and want to
# enable mouse scrolling support in `bat` when running inside tmux. This might
# disable text selection, unless you press shift.
--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse"
# Syntax mappings: map a certain filename pattern to a language.
# Example 1: use the C++ syntax for Arduino .ino files
# Example 2: Use ".gitignore"-style highlighting for ".ignore" files
#--map-syntax "*.ino:C++"
#--map-syntax ".ignore:Git Ignore"
# Squeeze consecutive empty lines
--squeeze-blank

View file

@ -0,0 +1,42 @@
# $DOTFILES/common/bat.config
# Date: 2025-01-26
# Author: js0ny
# Location;
# Unix: $XDG_CONFIG_HOME/bat/config
# Windows:
# - Default: %AppData%\bat\config
# - Portable: (scoop prefix bat) + config
# Linking:
# ln -sf $DOTFILES/common/bat.config $XDG_CONFIG_HOME/bat/config
# This is `bat`s configuration file. Each line either contains a comment or
# a command-line option that you want to pass to `bat` by default. You can
# run `bat --help` to get a list of all possible configuration options.
# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes`
# for a list of all available themes
--theme="Catppuccin Latte"
# Enable this to use italic text on the terminal. This is not supported on all
# terminal emulators (like tmux, by default):
#--italic-text=always
# Uncomment the following line to disable automatic paging:
#--paging=never
# Uncomment the following line if you are using less version >= 551 and want to
# enable mouse scrolling support in `bat` when running inside tmux. This might
# disable text selection, unless you press shift.
--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse"
# Syntax mappings: map a certain filename pattern to a language.
# Example 1: use the C++ syntax for Arduino .ino files
# Example 2: Use ".gitignore"-style highlighting for ".ignore" files
#--map-syntax "*.ino:C++"
#--map-syntax ".ignore:Git Ignore"
# Squeeze consecutive empty lines
--squeeze-blank

View file

@ -0,0 +1 @@
bat.config.dark

View file

@ -0,0 +1,4 @@
--UseOzonePlatform=wayland
--ozone-platform=wayland
--password-store=kwallet6
--enable-wayland-ime

View file

@ -0,0 +1,14 @@
# $DOTFILES/common/condarc.yaml
# Date: 2024-12-22
# Author: js0ny
# Location:
# $XDG_CONFIG_HOME/conda/.condarc
# Linking:
# ln -s $DOTFILES/.config/conda/condarc.yaml $XDG_CONFIG_HOME/conda/.condarc
# ================================================================================
# Reference:
# https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html
# Use system python by default for better script compatibility
auto_activate_base: false

View file

@ -0,0 +1,35 @@
;;; init-beancount.el --- beancount support -*- lexical-binding: t -*-
(after! beancount
;; 1. 自动启用 outline-minor-mode
(add-hook! 'beancount-mode-hook #'outline-minor-mode)
;; 2. 设置大纲导航快捷键 (使用 Doom 的 map! 宏)
(map! :map beancount-mode-map
"C-c C-n" #'outline-next-visible-heading
"C-c C-p" #'outline-previous-visible-heading)
;; 3. 核心功能:跨文件账户补全 (这部分逻辑完全保留)
(defvar my-beancount-accounts-files nil "List of account files.")
(setq my-beancount-accounts-files
(directory-files "~/Documents/Finance/Beancount/config/" 'full (rx ".beancount" eos)))
(defun my-beancount--collect-accounts-from-files (oldfun &rest args)
"Collect all accounts from files specified in `my-beancount-accounts-files'."
(let ((keys (apply oldfun args))
(hash (make-hash-table :test 'equal)))
(dolist (key keys)
(puthash key nil hash))
;; collect accounts from files
(save-excursion
(dolist (f my-beancount-accounts-files)
;; `ignore-errors` is a good practice for file operations
(ignore-errors
(with-current-buffer (find-file-noselect f)
(goto-char (point-min))
(while (re-search-forward beancount-account-regexp nil t)
(puthash (match-string-no-properties 1) nil hash))))))
(hash-table-keys hash)))
(advice-add #'beancount-collect
:around #'my-beancount--collect-accounts-from-files))

View file

@ -0,0 +1,79 @@
;;; ~/.doom.d/+calendar.el -*- lexical-binding: t; -*-
;;; https://github.com/cnsunyour/.doom.d/blob/master/modules/cnsunyour/calendar/config.el
;; 日历及纪念日相关设置
;; 定义可以设置农历纪念日的函数
;; (defun cnsunyour/diary-chinese-anniversary (lunar-month lunar-day &optional year mark)
;; (if year
;; (let* ((d-date (diary-make-date lunar-month lunar-day year))
;; (a-date (calendar-absolute-from-gregorian d-date))
;; (c-date (calendar-chinese-from-absolute a-date))
;; (cycle (car c-date))
;; (yy (cadr c-date))
;; (y (+ (* 100 cycle) yy)))
;; (diary-chinese-anniversary lunar-month lunar-day y mark))
;; (diary-chinese-anniversary lunar-month lunar-day year mark)))
(setq calendar-date-style 'iso)
(setq diary-date-forms '((year "" month "" day "" " 星期[" "日一二三四五六" "]") ;; Chinese
(year "-" month "-" day) ;; ISO
(month "[-/]" day "[^-/0-9]") (year "[-/]" month "[-/]" day "[^0-9]")
(monthname " *" day "[^-0-9]") (year " *" monthname " *" day "[^0-9]")
(dayname "\\W")))
(setq calendar-mark-holidays-flag t
calendar-week-start-day 1)
(use-package! cal-china-x
:custom
(cal-china-x-important-holidays '((holiday-chinese-new-year)
(holiday-lunar 12 23 "小年(北)" 1)
(holiday-lunar 12 24 "小年(南)" 1)
(holiday-lunar 12 30 "除夕" 1)
(holiday-lunar 1 1 "春节" 0)
(holiday-lunar 1 2 "春节" 0)
(holiday-lunar 1 3 "春节" 0)
(holiday-lunar 1 4 "春节" 0)
(holiday-lunar 1 5 "春节(破五)" 0)
(holiday-lunar 1 15 "元宵节" 0)
(holiday-lunar 2 2 "龙抬头" 0)
(holiday-solar-term "清明" "清明节")
(holiday-fixed 5 1 "劳动节")
(holiday-lunar 5 5 "端午节" 0)
(holiday-lunar 7 7 "七夕节" 0)
(holiday-lunar 7 15 "中元节" 0)
(holiday-lunar 8 15 "中秋节" 0)
(holiday-fixed 10 1 "国庆节")
(holiday-fixed 10 2 "国庆节")
(holiday-fixed 10 3 "国庆节")
(holiday-lunar 9 9 "重阳节" 0)
(holiday-lunar 10 1 "寒衣节" 0)
(holiday-lunar 12 8 "腊八" 1)
(holiday-solar-term "立春" "立春")
(holiday-solar-term "立夏" "立夏")
(holiday-solar-term "立秋" "立秋")
(holiday-solar-term "立冬" "立冬")
(holiday-solar-term "春分" "春分")
(holiday-solar-term "夏至" "夏至")
(holiday-solar-term "秋分" "秋分")
(holiday-solar-term "冬至" "冬至")))
(cal-china-x-general-holidays '((holiday-fixed 1 1 "元旦")
(holiday-fixed 2 14 "情人节")
(holiday-fixed 3 8 "妇女节")
(holiday-fixed 4 1 "愚人节")
(holiday-fixed 5 4 "青年节")
(holiday-float 5 0 2 "母亲节")
(holiday-fixed 6 1 "儿童节")
(holiday-float 6 0 3 "父亲节")
(holiday-fixed 9 10 "教师节")
(holiday-float 11 4 4 "感恩节")
(holiday-fixed 12 25 "圣诞节")))
:config
(setq calendar-holidays (append cal-china-x-important-holidays
cal-china-x-general-holidays)))
;; diary
(setq diary-file "~/.local/js0ny/diary")

View file

@ -0,0 +1,158 @@
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets. It is optional.
;; (setq user-full-name "John Doe"
;; user-mail-address "john@doe.com")
;; Doom exposes five (optional) variables for controlling fonts in Doom:
;;
;; - `doom-font' -- the primary font to use
;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable)
;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for
;; presentations or streaming.
;; - `doom-symbol-font' -- for symbols
;; - `doom-serif-font' -- for the `fixed-pitch-serif' face
;;
;; See 'C-h v doom-font' for documentation and more examples of what they
;; accept. For example:
;;
;; https://emacs-china.org/t/doom-emacs/23513/13
(setq doom-font (font-spec :family "Maple Mono NF CN" :size 14)
doom-serif-font doom-font
doom-symbol-font (font-spec :family "Maple Mono NF CN")
doom-variable-pitch-font (font-spec :family "Maple Mono NF CN" :weight 'extra-bold))
;; 如果不把这玩意设置为 nil, 会默认去用 fontset-default 来展示, 配置无效
(setq use-default-font-for-symbols nil)
;; Doom 的字体加载顺序问题, 如果不设定这个 hook, 配置会被覆盖失效
;;(add-hook! 'after-setting-font-hook
;; (set-fontset-font t 'latin (font-spec :family "Iosevka Nerd Font Propo"))
;; (set-fontset-font t 'symbol (font-spec :family "Symbola"))
;; (set-fontset-font t 'mathematical (font-spec :family "Symbola"))
;; (set-fontset-font t 'emoji (font-spec :family "Symbola")))
;; (dolist (charset '(kana han cjk-misc bopomofo))
;; (set-fontset-font t charset (font-spec :family "LXGW WenKai Mono" :size 16)))
;;
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
;; refresh your font settings. If Emacs still can't find your font, it likely
;; wasn't installed correctly. Font issues are rarely Doom issues!
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(setq doom-theme 'catppuccin)
(setq catppuccin-flavor 'mocha)
;(catppuccin-reload)
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers t)
(setq display-line-numbers-type 'visual)
;; Whenever you reconfigure a package, make sure to wrap your config in an
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
;;
;; (after! PACKAGE
;; (setq x y))
;;
;; The exceptions to this rule:
;;
;; - Setting file/directory variables (like `org-directory')
;; - Setting variables which explicitly tell you to set them before their
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
;; - Setting doom variables (which start with 'doom-' or '+').
;;
;; Here are some additional functions/macros that will help you configure Doom.
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package!' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
;; etc).
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.
(add-to-list 'load-path (expand-file-name "lisp" doom-user-dir))
(setq doom-local-dir (expand-file-name "emacs" (getenv "XDG_DATA_HOME")))
(setq doom-data-dir (expand-file-name "etc" doom-local-dir))
(after! recentf
(setq recentf-max-saved-items 200)
(add-to-list 'recentf-exclude "\\.revive$")
(add-to-list 'recentf-exclude "\\.windows$")
(add-to-list 'recentf-exclude "\\.#.+$")
(add-to-list 'recentf-exclude "^/tmp/")
(add-to-list 'recentf-exclude "COMMIT_EDITMSG\\'")
)[1][2]
(after! wakatime-mode
(global-wakatime-mode)
(setq wakatime-cli-path "~/.local/bin/wakatime"))
;; accept completion from copilot and fallback to company
(use-package! copilot
:hook (prog-mode . copilot-mode)
:bind (:map copilot-completion-map
("<tab>" . 'copilot-accept-completion)
("TAB" . 'copilot-accept-completion)
("C-TAB" . 'copilot-accept-completion-by-word)
("C-<tab>" . 'copilot-accept-completion-by-word)))
(load! "evil.el")
(load! "treemacs.el")
(load! "org.el")
(after! evil-matchit
(global-evil-matchit-mode 1)
)
(if (eq system-type 'gnu/linux)
(use-package! rime
:custom
(rime-user-data-dir (expand-file-name "emacs-rime" (getenv "XDG_CONFIG_HOME")))
; (rime-share-data-dir "~/.local/share/fcitx5/rime")
(default-input-method "rime")
;; :config
;; (add-hook! (org-mode markdown-mode) (activate-input-method default-input-method))
))
(load! "calendar.el")
(when (file-exists-p (expand-file-name "local.el" doom-user-dir))
(load! "local.el"))
;; (load! "telega.el")
(use-package! eee
:config
(if (eq system-type 'gnu/linux)
(setq ee-terminal-command "kitty"))
)
(load! "beancount.el")

View file

@ -0,0 +1,13 @@
;;; -*- lexical-binding: t -*-
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(auth-source-save-behavior nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

View file

@ -0,0 +1,3 @@
.custom.el
local.el
themes/

View file

@ -0,0 +1,15 @@
(map!
:nvm "H" 'evil-prev-buffer
:nvm "L" 'evil-next-buffer
:nvom "J" '(lambda () (interactive) (evil-next-line 5)) ; 5j
:nvom "K" '(lambda () (interactive) (evil-previous-line 5)) ; 5k
)
;; Swap ; and :
(map! :leader
";" #'execute-extended-command
":" #'pp-eval-expression
"f h" #'consult-recent-file
"b D" #'kill-some-buffers
"f c" #'doom/open-private-config
"f C" #'editorconfig-find-current-editorconfig)

View file

@ -0,0 +1,206 @@
;;; init.el -*- lexical-binding: t; -*-
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a link to Doom's Module Index where all
;; of our modules are listed, including what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
;; 'C-c c k' for non-vim users) to view its documentation. This works on
;; flags as well (those symbols that start with a plus).
;;
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
;; directory (for easy access to its source code).
(doom! :input
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
;;; 关闭 chinese 以启用 best Chinese IME
;; chinese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
;;company ; the ultimate code completion backend
(corfu +orderless) ; complete with cap(f), cape and a flying feather!
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;ivy ; a search engine for love and life
vertico ; the search engine of the future
:ui
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
;;(emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
indent-guides ; highlighted indent columns
ligatures ; ligatures and symbols to make your code pretty again
minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink cursor line after big motions
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
tabs ; a tab bar for Emacs
treemacs ; a project drawer, like neotree but cooler
unicode ; extended unicode support for various languages
(vc-gutter +pretty) ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
;;zen ; distraction-free coding or writing
:editor
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
word-wrap ; soft wrapping with language-aware indent
:emacs
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
;;eww ; the internet is gross
;;ibuffer ; interactive buffer management
undo ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree
:term
eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs
;;vterm ; the best terminal emulation in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
;;(spell +flyspell) ; tasing you for misspelling mispelling
grammar ; tasing grammar mistake every you make
:tools
;;ansible
;;biblio ; Writes a PhD for you (citation needed)
;;collab ; buffers with friends
;;debugger ; FIXME stepping through code, to help you add bugs
;;direnv
;;docker
editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
lookup ; navigate your code and its documentation
lsp ; M-x vscode
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
;;pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
tree-sitter ; syntax and parsing, sitting in a tree...
;;upload ; map local to remote projects via ssh/ftp
:os
(:if (featurep :system 'macos) macos) ; improve compatibility with macOS
;;tty ; improve the terminal Emacs experience
:lang
;;agda ; types of types of types of types...
beancount ; mind the GAAP
(cc +lsp) ; C > C++ == 1
;;clojure ; java with a lisp
;;common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
;;dhall
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
;;ess ; emacs speaks statistics
;;factor
;;faust ; dsp, but you get to keep your soul
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
;;gdscript ; the language you waited for
;;(go +lsp) ; the hipster dialect
;;(graphql +lsp) ; Give queries a REST
(haskell +lsp) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris ; a language you can depend on
(json +lsp +tree-sitter) ; At least it ain't XML
;;(java +lsp) ; the poster child for carpal tunnel syndrome
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
(latex +latexmk +cdlatex +lsp) ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove
;;ledger ; be audit you can be
;lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org ; organize your plain life in plain text
+pomodoro
+dragndrop
+noter
+pandoc
+pretty
)
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;graphviz ; diagrams for confusing yourself even more
;;purescript ; javascript, but functional
(python +lsp +tree-sitter +pyright) ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
(scheme +guile) ; a fully conniving family of lisps
(sh +lsp +tree-sitter +fish) ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
;;web ; the tubes
(yaml +lsp +tree-sitter) ; JSON, but readable
;;zig ; C, but simpler
:email
(mu4e +org +gmail)
;;notmuch
;;(wanderlust +gmail)
:app
calendar
;;emms
;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
(rss +org) ; emacs as an RSS reader
:config
;;literate
(default +bindings +smartparens)
:personal
telega
)
(setq custom-file (expand-file-name ".custom.el" doom-user-dir))
(load custom-file t)

View file

@ -0,0 +1,84 @@
;;; org-pomodoro-music-controller.el --- Play music during org-pomodoro breaks -*- lexical-binding: t; -*-
;;; Commentary:
;;; Add music control to org-pomodoro breaks.
;;; Code:
(require 'org-pomodoro)
;; Variables
(defcustom org-pomodoro-music-player-command
(cond
((eq system-type 'windows-nt) "clmcontrol")
((eq system-type 'darwin) "nowplaying-cli")
((eq system-type 'gnu/linux) "playerctl")
(t "playerctl"))
"Command to control the music player."
:type 'string
:group 'org-pomodoro)
(defcustom org-pomodoro-music-player-args nil
"Arguments to pass to the music player command."
:type '(repeat string)
:group 'org-pomodoro)
(defun org-pomodoro-music-get-status ()
"Get thestatus of the music player."
(with-temp-buffer
(let ((args (append org-pomodoro-music-player-args '("status"))))
(apply #'call-process org-pomodoro-music-player-command nil t nil args)
(string-trim (buffer-string)))))
(defun org-pomodoro-music-is-playing-p ()
"Check if the music player is playing."
(let ((status (org-pomodoro-music-get-status)))
(string= status "Playing")))
(defun org-pomodoro-music-pause ()
"Stop the music player."
(let ((args (append org-pomodoro-music-player-args '("pause"))))
(apply #'call-process org-pomodoro-music-player-command nil nil nil args)))
(defun org-pomodoro-music-play ()
"Start the music player."
(let ((args (append org-pomodoro-music-player-args '("play"))))
(apply #'call-process org-pomodoro-music-player-command nil nil nil args)))
;; Defining Hooks
(defun org-pomodoro-music-break-started-hook ()
"When a break start, pause the music player."
(setq org-pomodoro-music-was-playing (org-pomodoro-music-is-playing-p))
(when org-pomodoro-music-was-playing
(org-pomodoro-music-pause)
(message "休息开始,音乐已暂停")))
;; (defun org-pomodoro-music-break-finished-hook ()
;; "When a break finishes, resume the music player."
;; (when (and org-pomodoro-music-was-playing
;; (not (org-pomodoro-music-is-playing-p)))
;; (org-pomodoro-music-play)
;; (message "休息结束,音乐已恢复播放"))
;; (setq org-pomodoro-music-was-playing nil))
(defun org-pomodoro-music-started-hook ()
"When a pomodoro start, play the music player."
(unless (org-pomodoro-music-is-playing-p)
(org-pomodoro-music-play)
(message "番茄开始,音乐已开始播放"))
)
;; Adding hooks
;; (add-hook 'org-pomodoro-break-started-hook #'org-pomodoro-music-break-started-hook)
;; (add-hook 'org-pomodoro-break-finished-hook #'org-pomodoro-music-break-finished-hook)
;; (add-hook 'org-pomodoro-long-break-started-hook #'org-pomodoro-music-break-started-hook)
;; (add-hook 'org-pomodoro-long-break-finished-hook #'org-pomodoro-music-break-finished-hook)
(add-hook 'org-pomodoro-started-hook #'org-pomodoro-music-started-hook)
(provide 'org-pomodoro-music-controller)
;;; org-pomodoro-music-controller.el ends here

View file

@ -0,0 +1,57 @@
;;; org-pomodoro-telegram-notifier.el --- 为 org-pomodoro 添加发送 Telegram 通知的功能。 -*- lexical-binding: t; -*-
;;; Commentary:
;;; Provide a way to send Telegram notifications when org-pomodoro breaks end.
;;; Code:
(require 'org-pomodoro)
(require 'request)
(defcustom org-pomodoro-telegram-bot-token ""
"Your Telegram bot token."
:type 'string
:group 'org-pomodoro)
(defcustom org-pomodoro-telegram-chat-id ""
"Your Telegram chat ID."
:type 'string
:group 'org-pomodoro)
(defcustom org-pomodoro-telegram-break-end-message "休息时间结束"
"The message to send when a break ends."
:type 'string
:group 'org-pomodoro)
(defun org-pomodoro-send-telegram-message (message)
"Send a message to the Telegram chat.
MESSAGE is the message to send."
(interactive)
(when (and (not (string-empty-p org-pomodoro-telegram-bot-token))
(not (string-empty-p org-pomodoro-telegram-chat-id)))
(request
(format "https://api.telegram.org/bot%s/sendMessage" org-pomodoro-telegram-bot-token)
:type "POST"
:data `(("chat_id" . ,org-pomodoro-telegram-chat-id)
("text" . ,"⏳<b>[Emacs]</b> <code>org-pomodoro</code>: 休息时间结束")
("parse_mode" . "HTML"))
:parser 'json-read
:success (cl-function
(lambda (&key data &allow-other-keys)
(message "成功发送 Telegram 通知")))
:error (cl-function
(lambda (&key error-thrown &allow-other-keys)
(message "发送 Telegram 通知失败: %S" error-thrown))))
)
)
(defun org-pomodoro-telegram-break-finished-hook ()
"Send a Telegram message when a break ends."
(org-pomodoro-send-telegram-message org-pomodoro-telegram-break-end-message))
(add-hook 'org-pomodoro-break-finished-hook #'org-pomodoro-telegram-break-finished-hook)
(add-hook 'org-pomodoro-long-break-finished-hook #'org-pomodoro-telegram-break-finished-hook)
(provide 'org-pomodoro-telegram-notifier)
;;; org-pomodoro-telegram-notifier.el ends here

228
home/dot_config/doom/org.el Normal file
View file

@ -0,0 +1,228 @@
;; If use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/OrgFiles/")
;; (setq org-roam-directory "~/OrgFiles/roam/")
;;; org general
(after! org
;; For CJK users
;; Insert zero width space around the emphasis symbols, this might be useful for
;; languages that does not rely on space
(defun my/insert-emphasis-with-zws (char)
(interactive "c")
(insert ?\u200B char)
(save-excursion (insert char ?\u200B)))
;; Directory
(setq org-archive-location "~/OrgFiles/.archive/%s_archive::")
(setq org-default-notes-file "~/OrgFiles/tasks/inbox.org")
;; Initial Visibility
(setq org-startup-folded "show2levels")
;; Log into drawer
(setq org-log-into-drawer "LOGBOOK")
;;
(setq org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "WAIT(w@/!)" "|" "DONE(d@/!)" "CANCELLED(c@)")
))
(setq org-todo-keyword-faces
'(("TODO" . (:foreground "red" :weight bold :background "yellow"))
("NEXT" . (:foreground "blue" :weight bold :background "lightgray"))
("WAIT" . (:foreground "orange" :weight bold))
("DONE" . (:foreground "grey" :weight bold :italic t))
("CANCELLED" . (:foreground "grey" :weight bold))
))
;; Keymaps
(map! :map org-mode-map
:desc "Bold with ZWS" "C-c b" (lambda () (interactive) (my/insert-emphasis-with-zws ?*))
:desc "Italic with ZWS" "C-c i" (lambda () (interactive) (my/insert-emphasis-with-zws ?/))
:desc "Underline with ZWS" "C-c u" (lambda () (interactive) (my/insert-emphasis-with-zws ?_))
:desc "Code with ZWS" "C-c c" (lambda () (interactive) (my/insert-emphasis-with-zws ?~))
:nvom "M-n" 'org-metadown
:nvom "M-e" 'org-metaup)
(setq org-capture-templates
'(("t" "Task" entry (file+headline "~/OrgFiles/tasks/inbox.org" "Tasks")
"* TODO %?\n %U\n %a\n %i"
:empty-lines 1)
("n" "Note" entry (file+headline "~/OrgFiles/tasks/inbox.org" "Notes"))
))
;; 处理 Zotero 链接
(org-link-set-parameters
"zotero"
:follow (lambda (path) (browse-url (concat "zotero://" path)))
:export (lambda (path desc format)
(cond
((eq format 'html) (format "<a href=\"zotero://%s\">%s</a>" path (or desc path)))
((eq format 'latex) (format "\\href{zotero://%s}{%s}" path (or desc path)))
(t path))))
;; 处理 Obsidian 链接
(org-link-set-parameters
"obsidian"
:follow (lambda (path) (browse-url (concat "obsidian://" path)))
:export (lambda (path desc format)
(cond
((eq format 'html) (format "<a href=\"obsidian://%s\">%s</a>" path (or desc path)))
((eq format 'latex) (format "\\href{obsidian://%s}{%s}" path (or desc path)))
(t path))))
)
(after! evil-org
(map! :map evil-org-mode-map
:n "L" 'evil-org-insert-line
:n "I" 'evil-next-buffer
)
)
;;; org-agenda
(after! org-agenda
;; (setq org-agenda-files (directory-files-recursively "~/OrgFiles/tasks/" "\\.org$"))
(setq org-agenda-files (list (concat org-directory "tasks/")))
)
(map! :after org-agenda
:map evil-org-agenda-mode-map
:m "n" #'org-agenda-next-line
:m "e" #'org-agenda-previous-line
:m "gn" #'org-agenda-next-item
:m "ge" #'org-agenda-previous-item
:m "N" #'org-agenda-priority-up
:m "E" #'org-agenda-priority-down
:m "i" #'evil-forward-char
:m "," #'org-agenda-priority
:m "x" #'org-agenda-todo
:m "t" #'org-agenda-set-tags
:m "w" #'org-save-all-org-buffers
;; d: date reschedule
:m "ds" #'org-agenda-schedule
:m "dd" #'org-agenda-deadline
:m "$" #'org-agenda-archive
:m "!" #'org-agenda-toggle-deadlines
;; c: clock
:m "cp" #'org-pomodoro
:m "vd" #'org-agenda-day-view
:m "vw" #'org-agenda-week-view
:m "vm" #'org-agenda-month-view
:m "vy" #'org-agenda-year-view
:m "v." #'org-agenda-reset-view
:leader :desc "Org Agenda" "A" #'org-agenda)
(setq org-agenda-prefix-format '((agenda . " %i %-12:c%?-12t% s")
(todo . " %i %-12:c %e")
(tags . " %i %-12:c %e ")
(search . " %i %-12:c %e ")))
;; https://github.com/AbstProcDo/Master-Emacs-From-Scratch-with-Solid-Procedures/blob/master/06.Emacs-as-Agenda-by-Org.org
;;Sunrise and Sunset
;;日出而作, 日落而息
(defun js0ny/diary-sunrise ()
(let ((dss (diary-sunrise-sunset)))
(with-temp-buffer
(insert dss)
(goto-char (point-min))
(while (re-search-forward " ([^)]*)" nil t)
(replace-match "" nil nil))
(goto-char (point-min))
(search-forward ",")
(buffer-substring (point-min) (match-beginning 0)))))
(defun js0ny/diary-sunset ()
(let ((dss (diary-sunrise-sunset))
start end)
(with-temp-buffer
(insert dss)
(goto-char (point-min))
(while (re-search-forward " ([^)]*)" nil t)
(replace-match "" nil nil))
(goto-char (point-min))
(search-forward ", ")
(setq start (match-end 0))
(search-forward " at")
(setq end (match-beginning 0))
(goto-char start)
(capitalize-word 1)
(buffer-substring start end))))
(after! (org-agenda cal-china-x)
(setq org-agenda-format-date 'org-agenda-format-date-aligned)
(defun org-agenda-format-date-aligned (date)
"Format a DATE string for display in the daily/weekly agenda, or timeline.
This function makes sure that dates are aligned for easy reading."
(require 'cal-iso)
(let* ((dayname (aref cal-china-x-days
(calendar-day-of-week date)))
(day (cadr date))
(month (car date))
(year (nth 2 date))
(cn-date (calendar-chinese-from-absolute (calendar-absolute-from-gregorian date)))
(cn-month (cl-caddr cn-date))
(cn-day (cl-cadddr cn-date))
(cn-month-string (concat (aref cal-china-x-month-name
(1- (floor cn-month)))
(if (integerp cn-month)
""
"(闰月)")))
(cn-day-string (aref cal-china-x-day-name
(1- cn-day))))
(format "%04d-%02d-%02d 周%s %s%s" year month
day dayname cn-month-string cn-day-string))))
(setq org-agenda-time-grid (quote ((daily today require-timed)
(300 600 900 1200 1500 1800 2100 2400)
"......"
"-----------------------------------------------------"
)))
;; org-agenda-clockreport
(setq org-agenda-clockreport-parameter-plist '(:link t :maxlevel 3 :fileskip0 t :compact t :narrow 80))
;;; org-clock
;; org-pomodoro
(after! org-pomodoro
(setq org-pomodoro-format "Pomo~%s")
(setq org-pomodoro-short-break-format "摸~%s")
(setq org-pomodoro-long-break-format "猛摸~%s")
)
;;; org-babel
(if (not (eq system-type 'gnu/linux))
(setq org-babel-C-compiler "clang"))
;;; org-export
;; icalendar
(setq org-icalendar-use-scheduled '(event-if-todo event-if-not-todo))
(setq org-icalendar-use-deadline '(event-if-todo event-if-not-todo))
(setq org-icalendar-combined-agenda-file "~/Dropbox/org.ics")
(use-package! org-pomodoro-music-controller
:after org-pomodoro
:config
(customize-set-variable 'org-pomodoro-music-player-args '("--player=cider"))
)
(use-package! org-pomodoro-telegram-notifier
:after org-pomodoro
)

View file

@ -0,0 +1,68 @@
;; -*- no-byte-compile: t; -*-
;;; $DOOMDIR/packages.el
;; To install a package with Doom you must declare them here and run 'doom sync'
;; on the command line, then restart Emacs for the changes to take effect -- or
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
;; (package! some-package)
;; To install a package directly from a remote git repo, you must specify a
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
;; https://github.com/radian-software/straight.el#the-recipe-format
;; (package! another-package
;; :recipe (:host github :repo "username/repo"))
;; If the package you are trying to install does not contain a PACKAGENAME.el
;; file, or is located in a subdirectory of the repo, you'll need to specify
;; `:files' in the `:recipe':
;; (package! this-package
;; :recipe (:host github :repo "username/repo"
;; :files ("some-file.el" "src/lisp/*.el")))
;; If you'd like to disable a package included with Doom, you can do so here
;; with the `:disable' property:
;; (package! builtin-package :disable t)
;; You can override the recipe of a built in package without having to specify
;; all the properties for `:recipe'. These will inherit the rest of its recipe
;; from Doom or MELPA/ELPA/Emacsmirror:
;; (package! builtin-package :recipe (:nonrecursive t))
;; (package! builtin-package-2 :recipe (:repo "myfork/package"))
;; Specify a `:branch' to install a package from a particular branch or tag.
;; This is required for some packages whose default branch isn't 'master' (which
;; our package manager can't deal with; see radian-software/straight.el#279)
;; (package! builtin-package :recipe (:branch "develop"))
;; Use `:pin' to specify a particular commit to install.
;; (package! builtin-package :pin "1a2b3c4d5e")
;; Doom's packages are pinned to a specific commit and updated from release to
;; release. The `unpin!' macro allows you to unpin single packages...
;; (unpin! pinned-package)
;; ...or multiple packages
;; (unpin! pinned-package another-pinned-package)
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
;; (unpin! t)
(package! wakatime-mode)
(package! copilot
:recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el")))
(package! evil-matchit)
(package! rime)
(package! ox-typst)
(package! cal-china-x)
(package! telega :recipe (:files (:defaults "contrib/*.el" "etc" "server" "Makefile")))
(package! org-super-agenda)
(package! catppuccin-theme)
(package! eee
:recipe (:host github :repo "eval-exec/eee.el"
:files (:defaults "*.el" "*.sh")))

View file

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: align-math
# key: ali
# expand-env: ((yas-indent-line 'fixed))
# --
\\begin{align*}
$1
\\end{align*}

View file

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: display-math
# key: dm
# expand-env: ((yas-indent-line 'fixed))
# --
\\[
$1
\\]

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: inline-math
# key: mk
# expand-env: ((yas-indent-line 'fixed))
# --
\\( $1 \\)

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Limit
# key: lim
# condition: (org-inside-LaTeX-fragment-p)
# --
\\lim_{$1 \to $2} $0

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Summation
# key: sum
# condition: (org-inside-LaTeX-fragment-p)
# --
\\sum_{$1}^{$2} $0

View file

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: unnumbered
# key: unnumbered
# --
:PROPERTIES:
:UNNUMBERED: t
:END:

View file

@ -0,0 +1,72 @@
;; -*- lexical-binding: t; -*-
;; telegram client for emacs
(use-package! telega
:init
(setq telega-server-libs-prefix "/usr")
(setq telega-directory (expand-file-name "~/.local/share/telega"))
;; (prefix-key global-map (kbd "C-c t") telega-prefix-map)
(unless (display-graphic-p) (setq telega-use-images nil))
(when (modulep! :editor evil)
(cl-pushnew 'telega +evil-collection-disabled-list :test #'equal)
(setq evil-collection-mode-list (remove 'telega evil-collection-mode-list))
(set-evil-initial-state! '(telega-root-mode telega-chat-mode) 'emacs))
:hook
(telega-load . telega-mode-line-mode)
(telega-load . global-telega-url-shorten-mode)
(telega-load . global-telega-mnz-mode)
(telega-load . telega-autoplay-mode)
(telega-load . telega-transient-mode)
(telega-load . telega-adblock-mode)
(telega-chat-mode . (lambda ()
(setq-local visual-fill-column-extra-text-width
'(0 . 2))))
:config
(add-hook 'telega-msg-ignore-predicates
(telega-match-gen-predicate 'msg '(sender is-blocked)))
(setq telega-chat-show-deleted-messages-for '(me-is-owner OR-ADMIN)
;; telega-use-tracking-for '(or mention (and unread unmuted))
telega-open-file-function 'org-open-file
;; telega-open-message-as-file '(video video-note)
telega-translate-to-language-by-default "zh"
telega-avatar-workaround-gaps-for `(return t)
telega-mode-line-string-format (remove
'(:eval (telega-mode-line-icon))
telega-mode-line-string-format))
(map! (:prefix "C-c"
:desc "Telega all chats"
"c" #'telega-chat-with
:desc "Telega important chats"
"v" #'telega-switch-important-chat
:desc "Telega next important chat"
"SPC" (cmd! (let ((current-prefix-arg '(4)))
(call-interactively #'telega-switch-important-chat))))
(:map telega-chat-mode-map
(:prefix ("C-t" . "Telega chat topic")
:desc "Telega filter by chat topic"
"C-t" #'telega-chatbuf-filter-by-topic
:desc "Telega clear chat topic"
"C-c" #'telega-chatbuf-thread-cancel)))
; (load! "+telega-auto-input-method")
(set-popup-rule! (regexp-quote telega-root-buffer-name)
:slot 10 :vslot 10 :side 'right :size 90 :ttl nil :quit 'current :modeline t)
(set-popup-rule! "^◀[^◀\[]*[\[({<].+[\])}>]"
:slot 10 :vslot 10 :side 'right :size 90 :ttl 10 :quit 'current :modeline t)
(set-popup-rule! (regexp-quote "*Telega User*")
:slot 20 :vslot 10 :side 'right :height .5 :ttl 10 :quit t :modeline nil :select t)
(set-popup-rule! (regexp-quote "*Telegram Chat Info*")
:slot 20 :vslot 10 :side 'right :height .5 :ttl 10 :quit t :modeline nil :select t))
;; (load! "+telega-addition")
(use-package! telega-dired-dwim
:after telega dired)
(use-package! telega-bridge-bot
:after telega)

View file

@ -0,0 +1,24 @@
(after! treemacs
(map! :map evil-treemacs-state-map
"n" #'treemacs-next-line
"e" #'treemacs-previous-line
"N" #'treemacs-next-neighbour
"E" #'treemacs-previous-neighbour
"H" #'treemacs-toggle-show-dotfiles
"I" #'treemacs-hide-gitignored-files-mode
"i" #'treemacs-RET-action
"a" #'treemacs-create-file
"A" #'treemacs-create-dir
"c" #'treemacs-copy-file
"x" #'treemacs-move-file
"d" #'treemacs-delete-file
"r" #'treemacs-rename-file
"q" #'treemacs-quit
"y" #'treemacs-copy-relative-path-at-point
"Y" #'treemacs-copy-absolute-path-at-point
"m" #'treemacs-mark-or-unmark-path-at-point
)
)
(map! :leader
:desc "Toggle Treemacs" "f t" #'+treemacs/toggle)

View file

@ -0,0 +1,495 @@
# See dunst(5) for all configuration options
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = none
### Geometry ###
# The width of the window, excluding the frame.
# dynamic width from 0 to 300
# width = (0, 300)
# constant width of 300
width = 300
# The height of a single notification, excluding the frame.
# dynamic height from 0 to 300
height = (0, 300)
# constant height of 300
# height = 300
# NOTE: Dunst from version 1.11 and older don't support dynamic height
# and the given value is treated as the maximum height
# Position the notification in the top right corner
origin = top-right
# Offset from the origin
# NOTE: Dunst from version 1.11 and older use this alternative notation
# offset = 10x50
offset = (10, 50)
# Scale factor. It is auto-detected if value is 0.
scale = 2
# Maximum number of notification (0 means no limit)
notification_limit = 20
### Progress bar ###
# Turn on the progress bar. It appears when a progress hint is passed with
# for example dunstify -h int:value:12
progress_bar = true
# Set the progress bar height. This includes the frame, so make sure
# it's at least twice as big as the frame width.
progress_bar_height = 10
# Set the frame width of the progress bar
progress_bar_frame_width = 1
# Set the minimum width for the progress bar
progress_bar_min_width = 150
# Set the maximum width for the progress bar
progress_bar_max_width = 300
# Corner radius for the progress bar. 0 disables rounded corners.
progress_bar_corner_radius = 0
# Define which corners to round when drawing the progress bar. If progress_bar_corner_radius
# is set to 0 this option will be ignored.
progress_bar_corners = all
# Corner radius for the icon image.
icon_corner_radius = 0
# Define which corners to round when drawing the icon image. If icon_corner_radius
# is set to 0 this option will be ignored.
icon_corners = all
# Show how many messages are currently hidden (because of
# notification_limit).
indicate_hidden = yes
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.). (X11 only)
transparency = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
# If gap_size is greater than 0, this setting will be ignored.
separator_height = 2
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Padding between text and icon.
text_icon_padding = 0
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 3
# Defines color of the frame around the notification window.
frame_color = "#89b4fa"
highlight = "#89b4fa"
# Size of gap to display between notifications - requires a compositor.
# If value is greater than 0, separator_height will be ignored and a border
# of size frame_width will be drawn around each notification instead.
# Click events on gaps do not currently propagate to applications below.
gap_size = 0
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
# Sort type.
# possible values are:
# * id: sort by id
# * urgency_ascending: sort by urgency (low then normal then critical)
# * urgency_descending: sort by urgency (critical then normal then low)
# * update: sort by update (most recent always at the top)
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# A client can set the 'transient' hint to bypass this. See the rules
# section for how to disable this if necessary
# idle_threshold = 120
### Text ###
font = Maple Mono NF CN 8
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <https://docs.gtk.org/Pango/pango_markup.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = full
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Vertical alignment of message text and icon.
# Possible values are "top", "center" and "bottom".
vertical_alignment = center
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Specify where to make an ellipsis in long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Stack together notifications with the same content
stack_duplicates = true
# Hide the count of stacked notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
### Icons ###
# Recursive icon lookup. You can set a single theme, instead of having to
# define all lookup paths.
enable_recursive_icon_lookup = true
# Set icon theme (only used for recursive icon lookup)
icon_theme = "Papirus-Dark, Papirus, breeze, Adwaita"
# You can also set multiple icon themes, with the leftmost one being used first.
# icon_theme = "Adwaita, breeze"
# Align icons left/right/top/off
icon_position = left
# Scale small icons up to this size, set to 0 to disable. Helpful
# for e.g. small files or high-dpi screens. In case of conflict,
# max_icon_size takes precedence over this.
min_icon_size = 32
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 128
# Paths to default icons (only necessary when not using recursive icon lookup)
icon_path = /home/js0ny/.local/share/icons/ePapirus/16x16/:/usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
### Misc/Advanced ###
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst:
# Browser for opening urls in context menu.
browser = /usr/bin/xdg-open
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst (X11 only)
title = Dunst
# Define the class of the windows spawned by dunst (X11 only)
class = Dunst
# Define the corner radius of the notification window
# in pixel size. If the radius is 0, you have no rounded
# corners.
# The radius will be automatically lowered if it exceeds half of the
# notification height to avoid clipping text and/or icons.
corner_radius = 0
# Define which corners to round when drawing the window. If the corner radius
# is set to 0 this option will be ignored.
#
# Comma-separated list of the corners. The accepted corner values are bottom-right,
# bottom-left, top-right, top-left, top, bottom, left, right or all.
corners = all
# Ignore the dbus closeNotification message.
# Useful to enforce the timeout set by dunst configuration. Without this
# parameter, an application may close the notification sent before the
# user defined timeout.
ignore_dbusclose = false
### Wayland ###
# These settings are Wayland-specific. They have no effect when using X11
# Uncomment this if you want to let notifications appear under fullscreen
# applications (default: overlay)
# layer = top
# Set this to true to use X11 output on Wayland.
force_xwayland = false
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
### mouse
# Defines list of actions for each mouse event
# Possible values are:
# * none: Don't do anything.
# * do_action: Invoke the action determined by the action_name rule. If there is no
# such action, open the context menu.
# * open_url: If the notification has exactly one url, open it. If there are multiple
# ones, open the context menu.
# * close_current: Close current notification.
# * close_all: Close all notifications.
# * context: Open context menu for the notification.
# * context_all: Open context menu for all notifications.
# These values can be strung together for each mouse event, and
# will be executed in sequence.
mouse_left_click = close_current
mouse_middle_click = do_action, close_current
mouse_right_click = close_all
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#1e1e2e"
foreground = "#cdd6f4"
timeout = 10
# Icon for notifications with low urgency
default_icon = dialog-information
[urgency_normal]
background = "#1e1e2e"
foreground = "#cdd6f4"
timeout = 10
override_pause_level = 30
# Icon for notifications with normal urgency
default_icon = dialog-information
[urgency_critical]
background = "#1e1e2e"
foreground = "#cdd6f4"
frame_color = "#fab387"
timeout = 0
override_pause_level = 60
# Icon for notifications with critical urgency
default_icon = dialog-warning
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
#
# Messages can be matched by
# appname (discouraged, see desktop_entry)
# body
# category
# desktop_entry
# icon
# match_transient
# msg_urgency
# stack_tag
# summary
#
# and you can override the
# background
# foreground
# format
# frame_color
# fullscreen
# new_icon
# set_stack_tag
# set_transient
# set_category
# timeout
# urgency
# icon_position
# skip_display
# history_ignore
# action_name
# word_wrap
# ellipsize
# alignment
# hide_text
# override_pause_level
#
# Shell-like globbing will get expanded.
#
# Instead of the appname filter, it's recommended to use the desktop_entry filter.
# GLib based applications export their desktop-entry name. In comparison to the appname,
# the desktop-entry won't get localized.
#
# You can also allow a notification to appear even when paused. Notification will appear whenever notification's override_pause_level >= dunst's paused level.
# This can be used to set partial pause modes, where more urgent notifications get through, but less urgent stay paused. To do that, you can override the following in the rules:
# override_pause_level = X
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
# Disable the transient hint so that idle_threshold cannot be bypassed from the
# client
#[transient_disable]
# match_transient = yes
# set_transient = no
#
# Make the handling of transient notifications more strict by making them not
# be placed in history.
#[transient_history_ignore]
# match_transient = yes
# history_ignore = yes
# fullscreen values
# show: show the notifications, regardless if there is a fullscreen window opened
# delay: displays the new notification, if there is no fullscreen window active
# If the notification is already drawn, it won't get undrawn.
# pushback: same as delay, but when switching into fullscreen, the notification will get
# withdrawn from screen again and will get delayed like a new notification
#[fullscreen_delay_everything]
# fullscreen = delay
#[fullscreen_show_critical]
# msg_urgency = critical
# fullscreen = show
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# skip_display = true
#[history-ignore]
# # This notification will not be saved in history
# summary = "foobar"
# history_ignore = yes
#[skip-display]
# # This notification will not be displayed, but will be included in the history
# summary = "foobar"
# skip_display = yes
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
#[stack-volumes]
# appname = "some_volume_notifiers"
# set_stack_tag = "volume"
#
# vim: ft=cfg

View file

@ -0,0 +1,4 @@
--enable-features=WaylandWindowDecorations
--enable-features=UseOzonePlatform
--ozone-platform-hint=auto
--enable-wayland-ime

View file

@ -0,0 +1,61 @@
// ~/.config/fastfetch/config.jsonc
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
// "type": "auto",
"source": "arch_small",
"padding": {
"top": 2,
"left": 1,
"right": 2
}
},
"general": {
"multithreading": true
},
"display": {
"separator": " ",
"key": {
"width": 10,
"paddingLeft": 2,
"type": "icon"
}
},
"modules": [
{
"type": "title",
"format": "{#1}───────────── {#}{user-name-colored}@{host-name-colored}"
},
{
"type": "colors",
"symbol": "diamond",
"paddingLeft": 15
},
"os",
// "host",
// "kernel",
// "uptime",
{
"type": "packages"
},
"shell",
"display",
// "de",
// "wm",
// "wmtheme",
// "theme",
// "icons",
// "font",
// "cursor",
"terminal",
// "terminalfont",
"cpu",
"gpu",
"memory",
// "swap",
"disk",
// "battery",
"poweradapter",
"locale"
]
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,3 @@
# Hidden Notifications
HiddenNotifications=

View file

@ -0,0 +1,83 @@
[Hotkey]
# Enumerate when press trigger key repeatedly
EnumerateWithTriggerKeys=True
# Enumerate Input Method Forward
EnumerateForwardKeys=
# Enumerate Input Method Backward
EnumerateBackwardKeys=
# Skip first input method while enumerating
EnumerateSkipFirst=False
# Time limit in milliseconds for triggering modifier key shortcuts
ModifierOnlyKeyTimeout=250
[Hotkey/TriggerKeys]
0=Super+space
1=Zenkaku_Hankaku
2=Hangul
[Hotkey/AltTriggerKeys]
0=Shift_L
[Hotkey/EnumerateGroupForwardKeys]
0=Super+space
[Hotkey/EnumerateGroupBackwardKeys]
0=Shift+Super+space
[Hotkey/ActivateKeys]
0=Hangul_Hanja
[Hotkey/DeactivateKeys]
0=Hangul_Romaja
[Hotkey/PrevPage]
0=Up
[Hotkey/NextPage]
0=Down
[Hotkey/PrevCandidate]
0=Shift+Tab
[Hotkey/NextCandidate]
0=Tab
[Hotkey/TogglePreedit]
0=Control+Alt+P
[Behavior]
# Active By Default
ActiveByDefault=False
# Reset state on Focus In
resetStateWhenFocusIn=No
# Share Input State
ShareInputState=No
# Show preedit in application
PreeditEnabledByDefault=True
# Show Input Method Information when switch input method
ShowInputMethodInformation=True
# Show Input Method Information when changing focus
showInputMethodInformationWhenFocusIn=False
# Show compact input method information
CompactInputMethodInformation=True
# Show first input method information
ShowFirstInputMethodInformation=True
# Default page size
DefaultPageSize=5
# Override Xkb Option
OverrideXkbOption=False
# Custom Xkb Option
CustomXkbOption=
# Force Enabled Addons
EnabledAddons=
# Force Disabled Addons
DisabledAddons=
# Preload input method to be used by default
PreloadInputMethod=True
# Allow input method in the password field
AllowInputMethodForPassword=False
# Show preedit text when typing password
ShowPreeditForPassword=False
# Interval of saving user data in minutes
AutoSavePeriod=30

View file

@ -0,0 +1,32 @@
[Groups/0]
# Group Name
Name="Group 2"
# Layout
Default Layout=us
# Default Input Method
DefaultIM=keyboard-us
[Groups/0/Items/0]
# Name
Name=keyboard-us
# Layout
Layout=
[Groups/1]
# Group Name
Name="Group 1"
# Layout
Default Layout=us
# Default Input Method
DefaultIM=rime
[Groups/1/Items/0]
# Name
Name=rime
# Layout
Layout=
[GroupOrder]
0="Group 1"
1="Group 2"

View file

View file

@ -0,0 +1,176 @@
# $DOTFILES/tools/fish/conf.d/0init.fish
# Date: 2024-12-19
# Author: js0ny
# By dictionary order, this file is sourced first in fish shell
# Define user-specific environment variables for fish
# Location:
# ~/.config/fish/conf.d/0init.fish (default location)
# Linking: Link the whole directory for submodules
# ln -sf $DOTFILES/tools/fish ~/.config/fish
set -gx DOTFILES $HOME/.dotfiles
# XDG Base Directory Specification
set -gx XDG_CONFIG_HOME (set -q XDG_CONFIG_HOME; and echo $XDG_CONFIG_HOME; or echo $HOME/.config)
set -gx XDG_DATA_HOME (set -q XDG_DATA_HOME; and echo $XDG_DATA_HOME; or echo $HOME/.local/share)
set -gx XDG_STATE_HOME (set -q XDG_STATE_HOME; and echo $XDG_STATE_HOME; or echo $HOME/.local/state)
set -gx XDG_CACHE_HOME (set -q XDG_CACHE_HOME; and echo $XDG_CACHE_HOME; or echo $HOME/.local/cache)
if test (uname) = "Darwin"
set -gx XDG_RUNTIME_DIR $HOME/.tmp/run/
else
set -gx XDG_RUNTIME_DIR /run/user/(id -u)
end
set -gx GHCUP_USE_XDG_DIRS 1
set -gx PAGER "less -R"
set -gx EDITOR nvim
set -gx VISUAL nvim
# Minimal PATH for early commands
for dir in /usr/local/bin /usr/bin /bin /usr/sbin /sbin "$HOME/.local/bin" /opt/share/bin
if test -d "$dir" -a ! -L "$dir"
fish_add_path "$dir"
end
end
# Homebrew/Linuxbrew
test -d /opt/homebrew/bin && fish_add_path /opt/homebrew/bin
test -d /home/linuxbrew/.linuxbrew/bin && fish_add_path /home/linuxbrew/.linuxbrew/bin
if command -v brew > /dev/null
set -gx HOMEBREW_NO_ENV_HINTS
end
# Azure CLI
if command -v az > /dev/null
set -gx AZURE_CONFIG_DIR $XDG_DATA_HOME/azure
end
# Bun JS
if command -v bun > /dev/null
set -gx BUN_INSTALL "$XDG_DATA_HOME/bun"
set -gx PATH $BUN_INSTALL/bin $PATH
end
# Rust Cargo
if command -v cargo > /dev/null
set -gx CARGO_HOME $XDG_DATA_HOME/cargo
set -gx PATH $CARGO_HOME/bin $PATH
end
# CGDB
if command -v cgdb > /dev/null
set -gx CGDB_DIR $XDG_CONFIG_HOME/cgdb
end
# .NET
if command -v dotnet > /dev/null
set -gx DOTNET_CLI_HOME $XDG_DATA_HOME/dotnet
set -gx PATH $DOTNET_CLI_HOME/.dotnet/tools $PATH
end
# Docker
if command -v docker > /dev/null
set -gx DOCKER_CONFIG $XDG_CONFIG_HOME/docker
end
# GnuPG
if command -v gpg > /dev/null
set -gx GNUPGHOME $XDG_DATA_HOME/gnupg
end
# Go
if command -v go > /dev/null
set -gx GOPATH $XDG_DATA_HOME/go
set PATH $GOPATH/bin $PATH
end
# Julia
if command -v julia > /dev/null
set -gx JULIA_DEPOT_PATH $XDG_DATA_HOME/julia
end
# Node.js
if command -v node > /dev/null
set -gx NODE_REPL_HISTORY $XDG_STATE_HOME/node/repl_history
set -gx TS_NODE_REPL_HISTORY $XDG_STATE_HOME/node/ts_repl_history
set -gx NPM_CONFIG_USERCONFIG $XDG_CONFIG_HOME/npm/npmrc
set -gx NPM_CONFIG_INIT_MODULE $XDG_CONFIG_HOME/npm/config/npm-init.js
set -gx NPM_CONFIG_CACHE $XDG_CACHE_HOME/npm
set -gx NPM_CONFIG_TMP $XDG_RUNTIME_DIR/npm
end
# Parallel
if command -v parallel > /dev/null
set -gx PARALLEL_CONFIG $XDG_CONFIG_HOME/parallel
end
# Python
# Works only with Python 3.13.0a3 and later
if command -v python3 > /dev/null
set -gx PYTHON_HISTORY $XDG_DATA_HOME/python/history
end
# GNU Screen
if command -v screen > /dev/null
set -gx SCREENRC $XDG_CONFIG_HOME/screen/screenrc
set -gx SCREENDIR $XDG_RUNTIME_DIR/screen
end
# Ruby Gem
if command -v gem > /dev/null
for dir in $HOME/.local/share/gem/ruby/*/bin
if test -d $dir
set -gx PATH $dir $PATH
end
end
set -gx PATH $HOME/.local/share/gem/ruby/3.3.0/bin $PATH
end
# Spacemacs
if command -v emacs > /dev/null
set -gx SPACEMACSDIR $XDG_CONFIG_HOME/spacemacs
end
# tldr
if command -v tldr > /dev/null
set -gx TLDR_CACHE_DIR $XDG_CACHE_HOME/tldr
end
# W3M
if command -v w3m > /dev/null
set -gx W3M_DIR $XDG_DATA_HOME/w3m
end
# Wakatime
if command -v wakatime > /dev/null
set -gx WAKATIME_HOME $XDG_CONFIG_HOME/wakatime
end
# Wget
if command -v wget > /dev/null
alias wget="wget --hsts-file=$XDG_CACHE_HOME/wget-hsts"
end
# z
if command -v z > /dev/null
set -gx _Z_DATA $XDG_DATA_HOME/z
end
if command -v tldr > /dev/null
set -gx TLDR_CACHE_DIR $XDG_CACHE_HOME/tldr
end
if status is-interactive
if command -v ipython > /dev/null
set IPYTHONDIR $XDG_CONFIG_HOME/ipython
end
end
if command -v opam > /dev/null
set OPAMROOT $XDG_DATA_HOME/opam
test -r $OPAMROOT/opam-init/init.fish && source $OPAMROOT/opam-init/init.fish > /dev/null 2> /dev/null; or true
end
# Coursier: Scala dependency manager
if command -v coursier > /dev/null
set -gx PATH "$PATH:$XDG_DATA_HOME/coursier/bin"
end
# pnpm
set -gx PNPM_HOME "$XDG_DATA_HOME/pnpm"
if not string match -q -- $PNPM_HOME $PATH
set -gx PATH "$PNPM_HOME" $PATH
end
# pnpm end
test -d /opt/miniconda3 && source /opt/miniconda3/etc/fish/conf.d/conda.fish
test -f /opt/miniconda3/etc/fish/conf.d/conda.fish && source /opt/miniconda3/etc/fish/conf.d/conda.fish
# User-specific PATH
test -d $HOME/.local/scripts && fish_add_path $HOME/.local/scripts
test -d $HOME/.local/build && fish_add_path $HOME/.local/build
source "/home/js0ny/.deno/env.fish"

View file

@ -0,0 +1,179 @@
# $DOTFILES/tools/fish/conf.d/alias.fish
# Date: 2024-12-22
# Author: js0ny
# Location:
# ~/.config/fish/conf.d/alias.fish
# Linking: Link the whole directory for submodules
# ln -sf $DOTFILES/tools/fish ~/.config/fish
switch (uname)
case "Darwin"
# macOS Specific
#abbr --add clip pbcopy
#abbr --add paste pbpaste
alias clip="pbcopy"
alias paste="pbpaste"
# Use GNU Coreutils
alias cp=gcp
alias ln=gln
alias mkdir=gmkdir
alias mv=gmv
alias rm=grm
alias rmdir=grmdir
alias touch=gtouch
alias clip=pbcopy
alias paste=pbpaste
alias sed=gsed
abbr --add reboot "sudo reboot"
case "Linux"
# Linux Specific
#switch($XDG_SESSION_TYPE)
#case "wayland"
# Wayland Specific
alias clip="wl-copy"
alias paste="wl-paste"
#case "x11"
# # X11 Specific
# alias clip="xclip -selection clipboard"
# alias paste="xclip -selection clipboard -o"
case '*'
# Default / Fallback case
alias clip="xclip -selection clipboard"
alias paste="xclip -selection clipboard -o"
end
# Powershell equivalent
abbr --add ni touch
abbr --add cls clear
abbr --add ii open
# Editors #
abbr --add v nvim
abbr --add c code
alias svi="sudo vim -u ~/.dotfiles/common/vim.noxdg.vimrc" # Prevent conflicts with svelte-cli
# Dev #
abbr --add py python3
abbr --add ipy ipython
abbr --add g lazygit
abbr --add aic "aichat -s"
# lsd - modern ls
if command -v lsd > /dev/null
alias ls='lsd'
abbr --add l 'lsd -lah'
abbr --add ll 'lsd -l'
abbr --add la 'lsd -A'
abbr --add l. 'lsd -d .*'
abbr --add tree 'ls --tree'
else
abbr --add l 'ls -lah'
abbr --add ll 'ls -l'
end
# Functions #
function mkcd
mkdir -p $argv[1] && cd $argv[1]
end
function cdls
cd $argv[1] && ls
end
function tc
touch $argv[1] && code $argv[1]
end
function tv
touch $argv[1] && nvim $argv[1]
end
# Create a new file, if the directory does not exist, create it
# Arg: a file name
function mt
mkdir -p (dirname $argv[1]) && touch $argv[1]
end
function mtv
mkdir -p (dirname $argv[1]) && touch $argv[1] && nvim $argv[1]
end
abbr --add bcat "bat --style=plain"
# Use neovide as gVim
abbr --add gvi "neovide"
if command -v brew > /dev/null
abbr --add brewi "brew install"
abbr --add brewu "brew upgrade && brew update"
abbr --add brewr "brew remove"
abbr --add brewc "brew cleanup"
abbr --add brewl "brew list"
end
if command -v pacman > /dev/null
abbr --add pac "sudo pacman"
abbr --add paci "sudo pacman -S"
abbr --add pacr "sudo pacman -R"
abbr --add pacu "sudo pacman -Syu"
abbr --add pacl "pacman -Q"
if command -v paru > /dev/null
abbr --add pacs "paru -Ss"
else if command -v yay > /dev/null
abbr --add pacs "yay -Ss"
else
abbr --add pacs "pacman -Ss"
end
end
if command -v apt > /dev/null
abbr --add apt "sudo apt"
abbr --add apti "sudo apt install"
abbr --add aptr "sudo apt remove"
abbr --add aptu "sudo apt update && sudo apt upgrade"
abbr --add apts "apt search"
abbr --add aptl "apt list --installed"
end
if command -v dnf > /dev/null
abbr --add dnf "sudo dnf"
abbr --add dnfi "sudo dnf install"
abbr --add dnfr "sudo dnf remove"
abbr --add dnfu "sudo dnf update"
abbr --add dnfs "dnf search"
abbr --add dnfl "dnf list --installed"
end
if test "$TERM" = "xterm-ghostty" -o "$TERM" = "xterm-kitty"
abbr --add icat "kitten icat"
else if test "$TERM_PROGRAM" = "WezTerm"
if test "$WSL_DISTRO_NAME"
abbr --add icat "wezterm.exe imgcat"
else
abbr --add icat "wezterm imgcat"
end
end
# Bash Style Command Substitution
# https://github.com/fish-shell/fish-shell/wiki/Bash-Style-Command-Substitution-and-Chaining-(!!-!$)
function __last_history_item; echo $history[1]; end
abbr -a !! --position anywhere --function __last_history_item
function y
set tmp (mktemp -t "yazi-cwd.XXXXXX")
yazi $argv --cwd-file="$tmp"
if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
builtin cd -- "$cwd"
end
rm -f -- "$tmp"
end
abbr --add bcnt "emacs -nw $HOME/Documents/Finance/Beancount/"
if command -v chezmoi > /dev/null
alias pmoi="chezmoi --source ~/.local/share/pmoi --config ~/.config/chezmoi/pmoi.toml"
end

View file

@ -0,0 +1,18 @@
switch (uname)
case "Linux"
set SYSTEM_COLOR_SCHEME (gsettings get org.gnome.desktop.interface color-scheme)
if test $SYSTEM_COLOR_SCHEME = "'prefer-dark'"
fish_config theme choose "Catppuccin Mocha"
else
fish_config theme choose "Catppuccin Latte"
end
case "Darwin"
set SYSTEM_COLOR_SCHEME (defaults read -g AppleInterfaceStyle)
if test $SYSTEM_COLOR_SCHEME = "Dark"
fish_config theme choose "Catppuccin Mocha"
else
fish_config theme choose "Catppuccin Latte"
end
case '*'
fish_config theme choose "Catppuccin Mocha"
end

View file

@ -0,0 +1,49 @@
# $DOTFILES/tools/fish/conf.d/keymap.fish
# Date: 2024-12-22
# Author: js0ny
# Location:
# ~/.config/fish/conf.d/keymap.fish
# Linking: Link the whole directory for submodules
# ln -sf $DOTFILES/tools/fish ~/.config/fish
# read key: `fish_key_reader`
# get current bindings: `bind`
fish_vi_key_bindings
# source $DOTFILES/tools/fish/conf.d/keymap/+colemak.fish
# Emacs Hybrid
bind -M default ctrl-p up-or-search
bind -M default ctrl-n down-or-search
bind -M default ctrl-f forward-char
bind -M default ctrl-b backward-char
bind -M default ctrl-a beginning-of-line
bind -M default ctrl-e end-of-line
bind -M default ctrl-k kill-line
bind -M insert ctrl-p up-or-search
bind -M insert ctrl-n down-or-search
bind -M insert ctrl-f forward-char
bind -M insert ctrl-b backward-char
bind -M insert ctrl-a beginning-of-line
bind -M insert ctrl-e end-of-line
bind -M insert ctrl-k kill-line
bind -M insert ctrl-w backward-kill-path-component
# ctrl + backspace
bind -M insert ctrl-backspace backward-kill-path-component
# alt + backspace
bind -M insert alt-backspace backward-kill-line
# ctrl + delete
bind -M insert ctrl-delete kill-word
# alt + delete (d$)
bind -M insert alt-delete kill-line
fzf --fish | source
# C-r : fzf history search
# C-t : fzf file search
# A-c : fzf directory search

View file

@ -0,0 +1,23 @@
# Colemak hnei
# ^
# e
# < h i >
# n
# v
# bind -M default 'h' backward-char
bind -M default n down-or-search
bind -M default e up-or-search
bind -M default i forward-char
# Similar position to [i] in QWERTY
bind -M default -m insert l repaint-mode
bind -M default -m insert L beginning-of-line repaint-mode
# Ne{[k]s}t -> fish doesnt have this feature
# [J]ump
bind -M default j forward-word
bind -M default J forward-bigword
# Use N to Join
bind -M default N end-of-line delete-char

View file

@ -0,0 +1,47 @@
# $DOTFILES/tools/fish/conf.d/navi.fish
# Date: 2024-12-22
# Author: js0ny
# Location:
# ~/.config/fish/conf.d/navi.fish
# Linking: Link the whole directory for submodules
# ln -sf $DOTFILES/tools/fish ~/.config/fish
set __CD_CMD "cd"
if command -v zoxide > /dev/null
set __CD_CMD "z"
zoxide init fish | source
end
alias ..="$__CD_CMD .."
alias ...="$__CD_CMD ../.."
alias ....="$__CD_CMD ../../.."
alias .....="$__CD_CMD ../../../.."
alias ......="$__CD_CMD ../../../../.."
abbr --add \- "$__CD_CMD -"
function zls
$__CD_CMD $argv[1] && ls
end
alias cdls=zls
function __source_quick_jump
set dir (fd --type d --max-depth 1 . ~/Source/ | fzf --preview 'lsd --color always --icon always {}')
if test -n "$dir"
cd "$dir"
end
end
# Quick Jump Directories
test -d $DOTFILES && abbr --add dot "$__CD_CMD $DOTFILES"
test -d $HOME/Downloads && abbr --add down "$__CD_CMD $HOME/Downloads"
test -d $HOME/.config && abbr --add conf "$__CD_CMD $HOME/.config"
test -d $HOME/Obsidian && abbr --add ob "$__CD_CMD $HOME/Obsidian"
test -d $HOME/Source && alias src="__source_quick_jump"
test -d $HOME/Source/Scripts && alias scr="fd --type f --hidden --exclude .git --exclude '.*' . ~/Source/Scripts/ | fzf --preview 'bat --color=always --style=numbers {}' | xargs -r nvim"
test -d $HOME/OrgFiles && abbr --add org "$__CD_CMD $HOME/OrgFiles"

View file

@ -0,0 +1,13 @@
# $DOTFILES/tools/fish/conf.d/prompt.fish
# Date: 2024-12-22
# Author: js0ny
# Location:
# ~/.config/fish/conf.d/prompt.fish
# Linking: Link the whole directory for submodules
# ln -sf $DOTFILES/tools/fish ~/.config/fish
if command -v starship > /dev/null
starship init fish | source
end

View file

@ -0,0 +1,13 @@
if command -v wslpath > /dev/null
function cdw
cd (wslpath -u $argv)
end
function zw
z (wslpath -u $argv)
end
alias psw="tasklist.exe"
alias killw="taskkill.exe"
alias winget="winget.exe"
# https://github.com/stuartleeks/wsl-notify-send
alias notify-send="wsl-notify-send.exe"
end

View file

@ -0,0 +1,22 @@
# $DOTFILES/tools/fish/config.fish
# Date: 2024-12-15
# Author: js0ny
# Define interactive shell configurations for fish
# Location:
# ~/.config/fish/config.fish (default location)
# Linking: Link the whole directory for submodules
# ln -sf $DOTFILES/tools/fish ~/.config/fish
if status is-interactive
# Commands to run in interactive sessions can go here
set fish_greeting
end
# bun
set --export BUN_INSTALL "$HOME/.bun"
set --export PATH $BUN_INSTALL/bin $PATH
# moonbit
fish_add_path "$HOME/.moon/bin"

View file

View file

@ -0,0 +1,73 @@
function dotenv
# Parses commend-line arguments and sets _flag_[xuh] variables. Complains if the user tries to use both -x and -u.
argparse --name=dotenv -x 'u,x' 'u/unset' 'h/help' 'x/export' 'q/quiet' -- $argv
# If the h or --help flags are set (both can be checked using _flag_h), display help, and ignore everything else.
if test $_flag_h
__help_dotenv
else
# Any non-option command-line arguments are assumed to be .env files, so we check to see if any are present.
if set -q argv; and test (count $argv) -gt 0
set env_files $argv
# If no environment files are specified on the command-line, we default to .env
else
set env_files .env
end
# Loop through all of the specified environment variable files and set any variables found within
for env_file in $env_files
if test -r $env_file
while read -l line
# Set variables to be global, otherwise they will not be available in your shell once this script
# has finished running.
set set_args "-g"
# Remove the "export" directive from the line if present, and set a variable indicating whether or
# not it was found. Negate the return value of "string replace" so that 1/true means we found the
# export directive. This makes its usage easier to follow in subsequent lines.
set trimmed_line (not string replace -r '^\s*export\s+' '' -- $line)
set export $status
# If we found the export directive in the previous step, or if -x/--export was specified on the
# command-line, set the export flag for the upcoming 'set' command.
if test $export -eq 1; or begin; set -q _flag_x; and test "$_flag_x" = "-x"; end;
set set_args "$set_args"x
end
# Check to see if the line we are processing is basically sane. The fish set command will ignore
# leading white space on the variable name, so we allow it in our check.
if string match -q --regex -- '^\s*[a-zA-Z0-9_]+=' "$trimmed_line"
# Split the current line into name and value, and store them in $kv. We use -m1 because we only
# want to split on the first "=" we encounter. Everything after that, including additional "="
# characters, is part of the value.
set kv (string split -m 1 = -- $trimmed_line)
# If -u/--unset has been specified, erase the variable.
if set -q _flag_u; and test "$_flag_u" = "-u"
set -e $kv[1]
# Otherwise, set the shell variable. The variable $kv contains both the name and the value we
# want to set.
else
set $set_args $kv
end
end
# Combined with the `while` keyword, this reads $env_file one line at a time.
end <$env_file
else
if not set -q _flag_q; or test "$_flag_q" != '-q'
echo "Unable to locate file $env_file"
end
end
end
end
# This function will be available to be called directly from the shell, even though it is defined inside of dotenv.
# I put it into its own function because I think it looks a little cleaner than having a big blob of echoes inside
# the "if" statement near the top of this function.
function __help_dotenv
echo "Usage: dotenv [-u] [files]"
echo "-h/--help: Display this help message."
echo "-u/--unset: Read [files] and unset the variables found therein."
echo "-x/--export: Force variables to be exported, regardless of whether or not they are preceded by 'export' in the env file."
echo "[files]: One or more files containing name=value pairs to be read into the environment. Defaults to .env."
echo ""
end
end

View file

@ -0,0 +1,29 @@
## `type -q` vs `command -v`
```shell
󰈺 > time for i in (seq 1 10000)
type -q vim
end
time for i in (seq 1 10000)
command -v vim >/dev/null
end
________________________________________________________
Executed in 545.79 millis fish external
usr time 177.62 millis 174.28 millis 3.34 millis
sys time 367.72 millis 366.16 millis 1.56 millis
________________________________________________________
Executed in 292.97 millis fish external
usr time 71.23 millis 69.31 millis 1.93 millis
sys time 215.22 millis 214.78 millis 0.44 millis
```
`command -v` is faster

View file

@ -0,0 +1,30 @@
# name: 'Catppuccin Latte'
# url: 'https://github.com/catppuccin/fish'
# preferred_background: eff1f5
fish_color_normal 4c4f69
fish_color_command 1e66f5
fish_color_param dd7878
fish_color_keyword d20f39
fish_color_quote 40a02b
fish_color_redirection ea76cb
fish_color_end fe640b
fish_color_comment 8c8fa1
fish_color_error d20f39
fish_color_gray 9ca0b0
fish_color_selection --background=ccd0da
fish_color_search_match --background=ccd0da
fish_color_option 40a02b
fish_color_operator ea76cb
fish_color_escape e64553
fish_color_autosuggestion 9ca0b0
fish_color_cancel d20f39
fish_color_cwd df8e1d
fish_color_user 179299
fish_color_host 1e66f5
fish_color_host_remote 40a02b
fish_color_status d20f39
fish_pager_color_progress 9ca0b0
fish_pager_color_prefix ea76cb
fish_pager_color_completion 4c4f69
fish_pager_color_description 9ca0b0

View file

@ -0,0 +1,30 @@
# name: 'Catppuccin Mocha'
# url: 'https://github.com/catppuccin/fish'
# preferred_background: 1e1e2e
fish_color_normal cdd6f4
fish_color_command 89b4fa
fish_color_param f2cdcd
fish_color_keyword f38ba8
fish_color_quote a6e3a1
fish_color_redirection f5c2e7
fish_color_end fab387
fish_color_comment 7f849c
fish_color_error f38ba8
fish_color_gray 6c7086
fish_color_selection --background=313244
fish_color_search_match --background=313244
fish_color_option a6e3a1
fish_color_operator f5c2e7
fish_color_escape eba0ac
fish_color_autosuggestion 6c7086
fish_color_cancel f38ba8
fish_color_cwd f9e2af
fish_color_user 94e2d5
fish_color_host 89b4fa
fish_color_host_remote a6e3a1
fish_color_status f38ba8
fish_pager_color_progress 6c7086
fish_pager_color_prefix f5c2e7
fish_pager_color_completion cdd6f4
fish_pager_color_description 6c7086

View file

@ -0,0 +1,41 @@
# syntax highlighting variables
# https://fishshell.com/docs/current/interactive.html#syntax-highlighting-variables
fish_color_normal 575279
fish_color_command 907aa9
fish_color_keyword 56949f
fish_color_quote ea9d34
fish_color_redirection 286983
fish_color_end 797593
fish_color_error b4637a
fish_color_param d7827e
fish_color_comment 797593
# fish_color_match --background=brblue
fish_color_selection --reverse
# fish_color_history_current --bold
fish_color_operator 575279
fish_color_escape 286983
fish_color_autosuggestion 797593
fish_color_cwd d7827e
# fish_color_cwd_root red
fish_color_user ea9d34
fish_color_host 56949f
fish_color_host_remote 907aa9
fish_color_cancel 575279
fish_color_search_match --background=faf4ed
fish_color_valid_path
# pager color variables
# https://fishshell.com/docs/current/interactive.html#pager-color-variables
fish_pager_color_progress d7827e
fish_pager_color_background --background=fffaf3
fish_pager_color_prefix 56949f
fish_pager_color_completion 797593
fish_pager_color_description 797593
fish_pager_color_secondary_background
fish_pager_color_secondary_prefix
fish_pager_color_secondary_completion
fish_pager_color_secondary_description
fish_pager_color_selected_background --background=f2e9e1
fish_pager_color_selected_prefix 56949f
fish_pager_color_selected_completion 575279
fish_pager_color_selected_description 575279

View file

@ -0,0 +1,15 @@
# $DOTFILES/common/glow.yaml
# Date: 2024-12-22
# Author: js0ny
# Location:
# ~/.config/glow/config.yml
# ln -sf $DOTFILES/glow/glow.yaml ~/.config/glow/config.yml
# style name or JSON path (default "auto")
style: "auto"
# mouse support (TUI-mode only)
mouse: true
# use pager to display markdown
pager: true
# word-wrap at width
width: 80

View file

@ -0,0 +1 @@
.sass-cache

View file

@ -0,0 +1,19 @@
general {
lock_cmd = notify-send "lock!" # dbus/sysd lock command (loginctl lock-session)
unlock_cmd = notify-send "unlock!" # same as above, but unlock
before_sleep_cmd = notify-send "Zzz" # command ran before sleep
after_sleep_cmd = notify-send "Awake!" # command ran after sleep
ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)
ignore_systemd_inhibit = false # whether to ignore systemd-inhibit --what=idle inhibitors
}
listener {
timeout = 600 # in seconds
on-timeout = LC_ALL="en_GB.UTF-8" swaylock # command to run when timeout has passed
on-resume = notify-send "Welcome back!" # command to run when activity is detected after timeout has fired.
}
listener {
timeout = 1800 # 30min
on-timeout = systemctl suspend # suspend pc
}

View file

@ -0,0 +1,260 @@
# $DOTFILES/platforms/linux/hyprland/hypr/hyprland.conf
# Date: 2024-12-22
# Author: js0ny
# Hyprland Window Manager Configuration
# Location:
# $XDG_CONFIG_HOME/hypr/hyprland.conf
# Linking: (Link the whole `hypr` directory)
# ln -sf $DOTFILES/platforms/linux/hypr $XDG_CONFIG_HOME/hypr
# #######################################################################################
# AUTOGENERATED HYPRLAND CONFIG.
# PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hyprland.conf AND EDIT IT,
# OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS.
# #######################################################################################
$mainMod = SUPER # Sets "Windows" key as main modifier
$terminal = kitty
$fileManager = dolphin
$menu = rofi
$iconTheme = Papirus
source=~/.config/hypr/hyprland/current.conf
source=~/.config/hypr/hyprland/keymaps.conf
source=~/.config/hypr/hyprland/+qwerty.conf
source=~/.config/hypr/hyprland/rules.conf
autogenerated = 0 # remove this line to remove the warning
# This is an example Hyprland config file.
# Refer to the wiki for more information.
# https://wiki.hyprland.org/Configuring/
# Please note not all available settings / options are set here.
# For a full list, see the wiki
xwayland {
force_zero_scaling = true
}
################
### MONITORS ###
################
# See https://wiki.hyprland.org/Configuring/Monitors/
#
# monitor=,preferred,auto,auto
# Format:
# MONITOR_NAME,RESOLUTION@REFRESH_RATE,OFFSET_XxOFFSET_Y,SCALE
monitor=DP-2,3840x2160@60,0x0,1.667
###################
### MY PROGRAMS ###
###################
# See https://wiki.hyprland.org/Configuring/Keywords/
# Set programs that you use
#################
### AUTOSTART ###
#################
# Autostart necessary processes (like notifications daemons, status bars, etc.)
# Or execute your favorite apps at launch like this:
# exec-once = $terminal
# exec-once = nm-applet &
# Top Bar
exec-once = waybar &
# Notifications
exec-once = dunst &
# exec-once = hyprpanel &
# wallpapers
exec-once = swww-daemon &
exec-once = hypridle &
# Authentication agent
exec-once = systemctl --user start hyprpolkitagent
# Input Method
exec-once = fcitx5 &
# Clipboard history (called by wofi)
exec-once = wl-paste --watch cliphist store
# exec-once = QT_SCALE_FACTOR=1 albert &
# Bluetooth Manager
exec-once = blueman-applet &
# Time Tracker
exec-once = aw-qt &
#############################
### ENVIRONMENT VARIABLES ###
#############################
# See https://wiki.hyprland.org/Configuring/Environment-variables/
# env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24
env = QT_QPA_PLATFORMTHEME,qt6ct # for Qt apps
env = QT_QUICK_CONTROLS_STYLE,org.kde.desktop
env = LC_CTYPE,en_GB.UTF-8
#####################
### LOOK AND FEEL ###
#####################
# Refer to https://wiki.hyprland.org/Configuring/Variables/
# https://wiki.hyprland.org/Configuring/Variables/#general
general {
gaps_in = 0
gaps_out = 0
border_size = 5
# https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors
col.active_border = $lavender $pink 45deg
col.inactive_border = $overlay1
# Set to true enable resizing windows by clicking and dragging on borders and gaps
resize_on_border = true
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
layout = dwindle
no_border_on_floating = false
}
# https://wiki.hyprland.org/Configuring/Variables/#decoration
decoration {
rounding = 0
# Change transparency of focused and unfocused windows
# active_opacity = 1
# inactive_opacity = 0.9
active_opacity = 0.9
inactive_opacity = 0.85
shadow {
enabled = true
range = 4
render_power = 3
color = $base
}
# https://wiki.hyprland.org/Configuring/Variables/#blur
blur {
enabled = true
size = 10
passes = 2
vibrancy = 0.1696
}
}
# https://wiki.hyprland.org/Configuring/Variables/#animations
animations {
enabled = yes, please :)
# Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = easeOutQuint,0.23,1,0.32,1
bezier = easeInOutCubic,0.65,0.05,0.36,1
bezier = linear,0,0,1,1
bezier = almostLinear,0.5,0.5,0.75,1.0
bezier = quick,0.15,0,0.1,1
animation = global, 1, 10, default
animation = border, 1, 5.39, easeOutQuint
animation = windows, 1, 4.79, easeOutQuint
animation = windowsIn, 1, 4.1, easeOutQuint, popin 87%
# animation = windowsIn, 1, 4.1, easeOutQuint, popin 87%
animation = windowsOut, 1, 1.49, linear, popin 87%
animation = fadeIn, 1, 1.73, almostLinear
animation = fadeOut, 1, 1.46, almostLinear
animation = fade, 1, 3.03, quick
animation = layers, 1, 3.81, easeOutQuint
animation = layersIn, 1, 4, easeOutQuint, fade
animation = layersOut, 1, 1.5, linear, fade
animation = fadeLayersIn, 1, 1.79, almostLinear
animation = fadeLayersOut, 1, 1.39, almostLinear
animation = workspaces, 1, 1.94, almostLinear, slide
animation = workspacesIn, 1, 1.21, almostLinear, fade
animation = workspacesOut, 1, 1.94, almostLinear, fade
animation = specialWorkspace, 1, 1.94, almostLinear, fade
}
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
dwindle {
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true # You probably want this
}
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
master {
new_status = slave
}
# https://wiki.hyprland.org/Configuring/Variables/#misc
misc {
force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers
disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :(
}
#############
### INPUT ###
#############
# https://wiki.hyprland.org/Configuring/Variables/#input
input {
kb_layout = us
kb_variant =
kb_model =
kb_options =
kb_rules =
follow_mouse = 1
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
touchpad {
natural_scroll = true
scroll_factor = 0.2
}
}
# https://wiki.hyprland.org/Configuring/Variables/#gestures
gestures {
workspace_swipe = true
workspace_swipe_fingers = 4
}
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
# device {
# name = epic-mouse-v1
# sensitivity = -0.5
# }
windowrulev2 = opaque, workspace:2
windowrulev2 = float, workspace:10
windowrulev2 = opacity 0.95 0.4 0.7, workspace:10
windowrulev2 = bordersize 3, workspace:10
windowrulev2 = xray, workspace:10
windowrulev2 = noblur, workspace:10
bind = $mainMod SHIFT, BACKSLASH, togglegroup
bind = $mainMod, BACKSLASH, changegroupactive, f
bind = $mainMod, BRACKETRIGHT, exec, notify-send "$(hyprctl activewindow)"

View file

@ -0,0 +1,35 @@
bind = $mainMod, H, movefocus, l
bind = $mainMod, I, movefocus, r
bind = $mainMod, E, movefocus, u
bind = $mainMod, N, movefocus, d
bind = $mainMod SHIFT, H, swapwindow, l
bind = $mainMod SHIFT, I, swapwindow, r
bind = $mainMod SHIFT, E, swapwindow, u
bind = $mainMod SHIFT, N, swapwindow, d
bind = $mainMod, F, exec, $fileManager
bind = $mainMod CTRL, i, resizeactive, 10 0
bind = $mainMod CTRL, h, resizeactive, -10 0
bind = $mainMod CTRL, e, resizeactive, 0 -10
bind = $mainMod CTRL, n, resizeactive, 0 10
submap = resize
binde = , right, resizeactive, 10 0
binde = , left, resizeactive, -10 0
binde = , up, resizeactive, 0 -10
binde = , down, resizeactive, 0 10
binde = , i, resizeactive, 10 0
binde = , h, resizeactive, -10 0
binde = , e, resizeactive, 0 -10
binde = , n, resizeactive, 0 10
binde = SHIFT, I, resizeactive, 40 0
binde = SHIFT, H, resizeactive, -40 0
binde = SHIFT, E, resizeactive, 0 -40
binde = SHIFT, N, resizeactive, 0 40
bind = , escape, submap, reset
submap = reset

View file

@ -0,0 +1,35 @@
bind = $mainMod, H, movefocus, l
bind = $mainMod, L, movefocus, r
bind = $mainMod, K, movefocus, u
bind = $mainMod, J, movefocus, d
bind = $mainMod SHIFT, H, swapwindow, l
bind = $mainMod SHIFT, L, swapwindow, r
bind = $mainMod SHIFT, K, swapwindow, u
bind = $mainMod SHIFT, J, swapwindow, d
bind = $mainMod, E, exec, $fileManager
bind = $mainMod CTRL, l, resizeactive, 10 0
bind = $mainMod CTRL, h, resizeactive, -10 0
bind = $mainMod CTRL, k, resizeactive, 0 -10
bind = $mainMod CTRL, j, resizeactive, 0 10
submap = resize
binde = , right, resizeactive, 10 0
binde = , left, resizeactive, -10 0
binde = , up, resizeactive, 0 -10
binde = , down, resizeactive, 0 10
binde = , l, resizeactive, 10 0
binde = , h, resizeactive, -10 0
binde = , k, resizeactive, 0 -10
binde = , j, resizeactive, 0 10
binde = SHIFT, L, resizeactive, 40 0
binde = SHIFT, H, resizeactive, -40 0
binde = SHIFT, K, resizeactive, 0 -40
binde = SHIFT, J, resizeactive, 0 40
bind = , escape, submap, reset
submap = reset

View file

@ -0,0 +1,86 @@
# Catppuccin Mocha (Dark)
$rosewater = rgb(f5e0dc)
$rosewaterAlpha = f5e0dc
$flamingo = rgb(f2cdcd)
$flamingoAlpha = f2cdcd
$pink = rgb(f5c2e7)
$pinkAlpha = f5c2e7
$mauve = rgb(cba6f7)
$mauveAlpha = cba6f7
$red = rgb(f38ba8)
$redAlpha = f38ba8
$maroon = rgb(eba0ac)
$maroonAlpha = eba0ac
$peach = rgb(fab387)
$peachAlpha = fab387
$yellow = rgb(f9e2af)
$yellowAlpha = f9e2af
$green = rgb(a6e3a1)
$greenAlpha = a6e3a1
$teal = rgb(94e2d5)
$tealAlpha = 94e2d5
$sky = rgb(89dceb)
$skyAlpha = 89dceb
$sapphire = rgb(74c7ec)
$sapphireAlpha = 74c7ec
$blue = rgb(89b4fa)
$blueAlpha = 89b4fa
$lavender = rgb(b4befe)
$lavenderAlpha = b4befe
$text = rgb(cdd6f4)
$textAlpha = cdd6f4
$subtext1 = rgb(bac2de)
$subtext1Alpha = bac2de
$subtext0 = rgb(a6adc8)
$subtext0Alpha = a6adc8
$overlay2 = rgb(9399b2)
$overlay2Alpha = 9399b2
$overlay1 = rgb(7f849c)
$overlay1Alpha = 7f849c
$overlay0 = rgb(6c7086)
$overlay0Alpha = 6c7086
$surface2 = rgb(585b70)
$surface2Alpha = 585b70
$surface1 = rgb(45475a)
$surface1Alpha = 45475a
$surface0 = rgb(313244)
$surface0Alpha = 313244
$base = rgb(1e1e2e)
$baseAlpha = 1e1e2e
$mantle = rgb(181825)
$mantleAlpha = 181825
$crust = rgb(11111b)
$crustAlpha = 11111b
# https://github.com/hyprwm/Hyprland/discussions/5867
exec = gsettings set org.gnome.desktop.interface gtk-theme "BreezeDark" # for GTK3 apps
exec = gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" # for GTK4 apps
exec = kwriteconfig5 --group "General" --key "ColorScheme" "BreezeDark"
exec = hyprsunset -t 6000 &
exec = ln -sf ~/.config/waybar/dark.css ~/.config/waybar/current.css
exec = ln -sf ~/.config/rofi/dark.rasi ~/.config/rofi/current.rasi

View file

@ -0,0 +1,111 @@
## Open Applications
bind = $mainMod, R, exec, $terminal
bind = $mainMod, Q, killactive,
# bind = $mainMod, M, exit
bind = $mainMod SHIFT, F, exec, hyprctl --batch "dispatch togglefloating ; dispatch resizeactive exact 1440 810 ; dispatch centerwindow 1;"
# Maximize
bind = $mainMod SHIFT, M, fullscreen
bind = $mainMod, Page_Up, fullscreen
bind = ALT, Tab, cyclenext, # change focus to another window
bind = ALT SHIFT, Tab, cyclenext,prev # change focus to another window
## Submaps
bind = $mainMod SHIFT, R, submap, resize
bind = $mainMod, A, submap, apps
## Launcher
bind = $mainMod, W, exec, $menu -show window -icon-theme $iconTheme -show-icons # -window-thumbnail
bind = $mainMod, V, exec, cliphist list | $menu -dmenu | cliphist decode | wl-copy
bind = $mainMod, D, exec, $HOME/.local/scripts/picker/sdcv.sh
bind = alt, space, exec, $menu -show drun -icon-theme $iconTheme -show-icons
bind = $mainMod, SLASH, exec, $HOME/.local/scripts/picker/baloo.sh
bind = $mainMod SHIFT, SLASH, exec, $HOME/.local/scripts/picker/keybinds.sh
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, X, togglesplit, # dwindle
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
bind = $mainMod SHIFT, l, exec, LC_ALL="en_GB.UTF-8" swaylock
bind = $mainMod, c, exec, grimblast copysave area $HOME/Pictures/Screenshots/"$(date +%Y%m%d-%H%M%S)"
bind = $mainMod SHIFT, c, exec, notify-send "Color: $(hyprpicker)"
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Example special workspace (scratchpad)
bind = $mainMod, GRAVE, togglespecialworkspace, magic
bind = $mainMod SHIFT, GRAVE, movetoworkspace, special:magic
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Laptop multimedia keys for volume and LCD brightness
bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+
bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%-
# Requires playerctl
bindl = , XF86AudioNext, exec, playerctl next
bindl = , XF86AudioPause, exec, playerctl play-pause
bindl = , XF86AudioPlay, exec, playerctl play-pause
bindl = , XF86AudioPrev, exec, playerctl previous
# Submaps
# submap = apps
#
# binde = , a, exec, cherry-studio # AI
# binde = , c, exec, code # VSCode
# binde = , d, exec, dolphin
# binde = , e, exec, emacs
# binde = , f, exec, firefox
# binde = , g, exec, gimp
# binde = , o, exec, obsidian
# binde = , v, exec, vivaldi
# binde = SHIFT, v, exec, neovide
#
#
# bind = , escape, submap, reset
#
# submap = reset

View file

@ -0,0 +1,84 @@
$rosewater = rgb(dc8a78)
$rosewaterAlpha = dc8a78
$flamingo = rgb(dd7878)
$flamingoAlpha = dd7878
$pink = rgb(ea76cb)
$pinkAlpha = ea76cb
$mauve = rgb(8839ef)
$mauveAlpha = 8839ef
$red = rgb(d20f39)
$redAlpha = d20f39
$maroon = rgb(e64553)
$maroonAlpha = e64553
$peach = rgb(fe640b)
$peachAlpha = fe640b
$yellow = rgb(df8e1d)
$yellowAlpha = df8e1d
$green = rgb(40a02b)
$greenAlpha = 40a02b
$teal = rgb(179299)
$tealAlpha = 179299
$sky = rgb(04a5e5)
$skyAlpha = 04a5e5
$sapphire = rgb(209fb5)
$sapphireAlpha = 209fb5
$blue = rgb(1e66f5)
$blueAlpha = 1e66f5
$lavender = rgb(7287fd)
$lavenderAlpha = 7287fd
$text = rgb(4c4f69)
$textAlpha = 4c4f69
$subtext1 = rgb(5c5f77)
$subtext1Alpha = 5c5f77
$subtext0 = rgb(6c6f85)
$subtext0Alpha = 6c6f85
$overlay2 = rgb(7c7f93)
$overlay2Alpha = 7c7f93
$overlay1 = rgb(8c8fa1)
$overlay1Alpha = 8c8fa1
$overlay0 = rgb(9ca0b0)
$overlay0Alpha = 9ca0b0
$surface2 = rgb(acb0be)
$surface2Alpha = acb0be
$surface1 = rgb(bcc0cc)
$surface1Alpha = bcc0cc
$surface0 = rgb(ccd0da)
$surface0Alpha = ccd0da
$base = rgb(eff1f5)
$baseAlpha = eff1f5
$mantle = rgb(e6e9ef)
$mantleAlpha = e6e9ef
$crust = rgb(dce0e8)
$crustAlpha = dce0e8
# https://github.com/hyprwm/Hyprland/discussions/5867
exec = gsettings set org.gnome.desktop.interface gtk-theme "BreezeLight" # for GTK3 apps
exec = gsettings set org.gnome.desktop.interface color-scheme "prefer-light" # for GTK4 apps
exec = kwriteconfig5 --group "General" --key "ColorScheme" "BreezeLight"
exec = ln -sf ~/.config/waybar/light.css ~/.config/waybar/current.css
exec = ln -sf ~/.config/rofi/light.rasi ~/.config/rofi/current.rasi

View file

@ -0,0 +1,88 @@
##############################
### WINDOWS AND WORKSPACES ###
##############################
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# Ignore maximize requests from apps. You'll probably like this.
windowrulev2 = suppressevent maximize, class:.*
# Fix some dragging issues with XWayland
windowrulev2 = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
windowrulev2 = float, class:qt6ct
windowrulev2 = float, size 2560 1440, class:^(org.kde.gwenview)$
windowrulev2 = float, size 50%, center, class:^(org.kde.konsole)$
windowrulev2 = float, class:^(steam)$
# Browser Extension Popup
windowrulev2 = float, title:^(Bitwarden - )(.*)$
# Picture-in-Picture
windowrulev2 = float, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$
windowrulev2 = keepaspectratio, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$
windowrulev2 = move 73% 72%, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$
windowrulev2 = size 25%, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$
windowrulev2 = float, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$
windowrulev2 = pin, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$
windowrulev2 = float, title:^(画中画)(.*)$
windowrulev2 = keepaspectratio, title:^(画中画)(.*)$
windowrulev2 = move 73% 72%, title:^(画中画)(.*)$
windowrulev2 = size 25%, title:^(画中画)(.*)$
windowrulev2 = float, title:^(画中画)(.*)$
windowrulev2 = pin, title:^(画中画)(.*)$
# Dialog windows float+center these windows.
windowrulev2 = center, title:^(Open File)(.*)$
windowrulev2 = center, title:^(打开文件)(.*)$
windowrulev2 = center, title:^(Select a File)(.*)$
windowrulev2 = center, title:^(选择文件)(.*)$
windowrulev2 = center, title:^(Choose wallpaper)(.*)$
windowrulev2 = center, title:^(Open Folder)(.*)$
windowrulev2 = center, title:^(Save As)(.*)$
windowrulev2 = center, title:^(保存)(.*)$
windowrulev2 = center, title:^(Library)(.*)$
windowrulev2 = center, title:^(File Upload)(.*)$
windowrulev2 = float, title:^(Open File)(.*)$
windowrulev2 = center, title:^(打开文件)(.*)$
windowrulev2 = float, title:^(Select a File)(.*)$
windowrulev2 = center, title:^(选择文件)(.*)$
windowrulev2 = float, title:^(Choose wallpaper)(.*)$
windowrulev2 = float, title:^(Open Folder)(.*)$
windowrulev2 = float, title:^(Save As)(.*)$
windowrulev2 = center, title:^(保存)(.*)$
windowrulev2 = float, title:^(Library)(.*)$
windowrulev2 = float, title:^(File Upload)(.*)$
# Centering pictures preview windows
# Telegram
windowrulev2 = center, title:^(Media viewer)(.*)$
windowrulev2 = float, title:^(Media viewer)(.*)$
windowrulev2 = size 50%, title:^(Media viewer)(.*)$
# WeChat
windowrulev2 = center, title:^(预览)(.*)$
windowrulev2 = float, title:^(预览)(.*)$
windowrulev2 = size 50%, title:^(预览)(.*)$
# QQ
windowrulev2 = center, title:^(图片查看器)(.*)$
windowrulev2 = float, title:^(图片查看器)(.*)$
windowrulev2 = size 50%, title:^(图片查看器)(.*)$
# Pin: Rofi will display in all wsps
windowrulev2 = pin, class:^(Rofi)$
windowrulev2 = stayfocused, class:^(Rofi)$
windowrulev2 = float, class:^(org.pulseaudio.pavucontrol)$
windowrulev2 = move 73% 5%, class:^(org.pulseaudio.pavucontrol)$
windowrulev2 = size 25%, class:^(org.pulseaudio.pavucontrol)$
windowrulev2 = float, class:^(org.pulseaudio.pavucontrol)$
windowrulev2 = pin, class:^(org.pulseaudio.pavucontrol)$

View file

@ -0,0 +1 @@
/home/js0ny/.dotfiles/platforms/linux/hypr/hyprland/dark.conf

View file

@ -0,0 +1,69 @@
# BACKGROUND
background {
monitor =
path = ~/.config/hypr/walls/1.png
# blur_passes = 0
# contrast = 1
# brightness = 1
# vibrancy = 0.2
# vibrancy_darkness = 0.2
}
# GENERAL
general {
no_fade_in = false
no_fade_out = false
hide_cursor = true
grace = 0
disable_loading_bar = true
ignore_empty_input = true
}
# INPUT FIELD
input-field {
monitor =
size = 250, 60
outline_thickness = 2
dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.35 # Scale of dots' absolute size, 0.0 - 1.0
dots_center = true
outer_color = rgba(0, 0, 0, 0)
inner_color = rgba(0, 0, 0, 0.2)
font_color = rgb(205, 214, 244)
fade_on_empty = false
rounding = -1
placeholder_text = <span foreground="##cdd6f4">Password</span>
hide_input = false
position = 0, -200
halign = center
valign = center
check_color = rgb(108, 112, 134)
fail_color = rgb(243, 139, 168) # if authentication failed, changes outer_color and fail message color
fail_text = <b>$ATTEMPTS</b> # can be set to empty
fail_timeout = 2000 # milliseconds before fail_text and fail_color disappears
fail_transition = 300 # transition time in ms between normal outer_color and fail_color
}
# DATE
label {
monitor =
text = cmd[update:1000] date +"%A, %B %d"
color = rgb(205, 214, 244)
font_size = 22
font_family = JetBrains Mono
position = 0, 300
halign = center
valign = center
}
# TIME
label {
monitor =
text = cmd[update:1000] date +"%-I:%M"
color = rgb(205, 214, 244)
font_size = 95
font_family = JetBrains Mono Extrabold
position = 0, 200
halign = center
valign = center
}

View file

@ -0,0 +1,13 @@
# $DOTFILES/platforms/linux/hyprland/hypr/hyprpaper.conf
# Date: 2024-12-22
# Author: js0ny
# Hyprland Wallpaper autoloader
# Location:
# $XDG_CONFIG_HOME/hypr/hyprpaper.conf
# Linking: (Link the whole `hypr` directory)
# ln -sf $DOTFILES/platforms/linux/hypr $XDG_CONFIG_HOME/hypr
preload = ~/Pictures/Wallpaper/current.jpg
preload = ~/Pictures/Wallpaper/current.png
wallpaper = DP-2, ~/Pictures/Wallpaper/current.png

View file

@ -0,0 +1,239 @@
" $DOTFILES/common/ideavimrc
" Date: 2024-12-22
" Author: js0ny
" Location:
" $XDG_CONFIG_HOME/ideavim/ideavimrc
" Linking:
" ln -sf $DOTFILES/common/ideavimrc $XDG_CONFIG_HOME/ideavim/ideavimrc
source ~/.local/share/intellimacs/spacemacs.vim
source ~/.local/share/intellimacs/extra.vim
source ~/.local/share/intellimacs/major.vim
source ~/.local/share/intellimacs/hybrid.vim
source ~/.local/share/intellimacs/which-key.vim
" """ Basic Configs """
let mapleader = " " " set <leader> to <space>
""" Colemak """
noremap n j
noremap e k
noremap i l
" Similar position to i
noremap l i
noremap L I
" ne[k]st
noremap k n
noremap K N
" [j]ump
noremap j e
noremap J E
nnoremap H :bp<CR>
nnoremap I :bn<CR>
noremap N 5j
noremap E 5k
vnoremap H ^
xnoremap H ^
onoremap H ^
vnoremap I $
xnoremap I $
onoremap I $
" Y to yank to end of line
noremap Y y$
""" Options """
" search for actions: :actionlist <patter>
"" Vim Compat ""
set clipboard=unnamedplus,unnamed,ideaput " integrate with system clipboard
set gdefault " substitute all occurrences in line per default
set history=4096 " keep x lines of command line history
set hlsearch
set ignorecase
set incsearch
set keymodel=startsel,stopsel
set matchpairs+=<:>
set showcmd
set smartcase " no ignore case when pattern is uppercase
set wrapscan " searches wrap around the end of the file
"" IDE Settings ""
set scrolloff=5
set sidescrolloff=10
"" IDE Features ""
set relativenumber " Hybrid Line Number shown
"" IdeaVim Only ""
set ideajoin
set ideastatusicon=enabled
""" Plugins """
Plug 'justinmk/vim-sneak'
Plug 'preservim/nerdtree'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'terryma/vim-multiple-cursors'
Plug 'machakann/vim-highlightedyank'
Plug 'easymotion/vim-easymotion'
""" Keybindings """
"" don't lose selection when indenting ""
vnoremap < <gv
vnoremap > >gv
vnoremap = =gv
"" edit ideavim config <leader>v + ""
nnoremap <leader>vv :e ~/.ideavimrc<CR>
nnoremap <leader>vr :source ~/.ideavimrc<CR>
"" NERDTree ""
nnoremap <leader>e :NERDTreeToggle<CR>
"" EasyMotion ""
nmap s <Plug>(easymotion-f)
nmap S <Plug>(easymotion-F)
"" Sneak ""
nmap f <Plug>(sneak-s)
nmap F <Plug>(sneak-S)
"" Language Server Protocol ""
nnoremap gd :action GotoDeclaration<CR>
nnoremap gtd :action GotoTypeDeclaration<CR>
nnoremap gtD :action QuickTypeDefinition<CR>
nnoremap gr :action ShowUsages<CR>
nnoremap gi :action GotoImplementation<CR>
nnoremap gpi :action QuickImplementations<CR>
nnoremap gs :action GotoSuperMethod<CR>
nnoremap ga :action ShowIntentionActions<CR>
nnoremap gq :action ShowIntentionActions<CR>
nnoremap ge :action GotoNextError<CR>
"" Collapse and Expand z + ""
nnoremap zi :action ExpandCollapseToggleAction<CR>
nnoremap zc :action CollapseRegion<CR>
nnoremap zC :action CollapseRegionRecursively<CR>
nnoremap zM :action CollapseAll<CR>
nnoremap zo :action ExpandRegion<CR>
nnoremap zO :action ExpandRegionRecursively<CR>
nnoremap zR :action ExpandAll<CR>
"" Miscs ""
nnoremap <leader>: :action GotoAction<CR>
nnoremap <leader><leader> :action GotoFile<CR>
nnoremap <leader>h :action PrevSplitter<CR>
nnoremap <leader>i :action NextSplitter<CR>
"" AI Related <leader>a + ""
nnoremap <leader>ac :action copilot.chat.show<CR>
nnoremap <leader>ad :action copilot.disableCopilot<CR>
nnoremap <leader>ae :action copilot.enableCopilot<CR>
nnoremap <leader>aa :action copilot.openCopilot<CR>
" <leader>b : +buffer
nnoremap <leader>bb :action Switcher<CR>
noremap <leader>bd :bdelete<CR>
noremap <leader>bh :bprevious<CR>
noremap <leader>bi :bnext<CR>
noremap <leader>bp :bprevious<CR>
noremap <leader>bn :bnext<CR>
" <leader>c : +code/compile
nnoremap <leader>cr :action Run<CR>
nnoremap <leader>cf :action ReformatCode<CR>
nnoremap <leader>cs :action GotoSymbol<CR>
nnoremap <leader>cS :action GotoSymbol<CR>
nnoremap <leader>cR :action RenameElement<CR>
""" Works for Rider only
nnoremap <leader>ce :action ReSharperGotoNextErrorInSolution<CR>
nnoremap <leader>cE :action ReSharperGotoPrevErrorInSolution<CR>
" <leader>d : +debug
" <leader>f : +file
nnoremap <leader>ff :action GotoFile<CR>
nnoremap <leader>fF :action TextSearchAction<CR>
nnoremap <leader>fc :action ShowSettings<CR>
nnoremap <leader>fC :action ShowSettings<CR>
nnoremap <leader>fe :NERDTreeToggle<CR>
nnoremap <leader>fo :OpenInAssociatedApplication<CR>
nnoremap <leader>ft :action ActivateTerminalToolWindow<CR>
nnoremap <leader>fx :action WelcomeScreen.Plugins<CR>
" <leader>g : +git
nnoremap <leader>gp :action Git.Pull<CR>
nnoremap <leader>gP :action Vcs.Push<CR>
nnoremap <leader>gb :action Git.Branches<CR>
nnoremap <leader>gR :action Git.Rebase<CR>
nnoremap <leader>gM :action Git.Merge<CR>
nnoremap <leader>gc :action CheckinProject<CR>
nnoremap <leader>gC :action Git.Clone<CR>
nnoremap <leader>gg :action ActivateVersionControlToolWindow<CR>
nnoremap <leader>gS :action Git.Stash<CR>
" <leader>h : +help
" <leader>p : +project
nnoremap <leader>pr :action Run<CR>
nnoremap <leader>pd :action Debug<CR>
nnoremap <leader>pb :action Build<CR>
" <leader>q : +quit
nnoremap <leader>qq :action Exit<CR>
nnoremap <leader>Q :action Exit<CR>
" <leader>r : +refactor
nnoremap <leader>ri :action Inline<CR>
nnoremap <leader>rr :action RenamElement<CR>
nnoremap <leader>rev :action IntroduceVariable<CR>
vnoremap <leader>rev :action IntroduceVariable<CR>
nnoremap <leader>rem :action ExtractMethod<CR>
vnoremap <leader>rem :action ExtractMethod<CR>
nnoremap <leader>rm :action Move<CR>
nnoremap <leader>ro :action OptimizeImports<CR>
nnoremap <leader>rG :action Generate<CR>
" <leader>t : +test
nnoremap <leader>tt :action RiderUnitTestRunSolutionAction<CR>
nnoremap <leader>tT :action Rider.UnitTesting.MainMenu<CR>
" <leader>u : +ui
nnoremap <leader>ui :action ChangeLaf<CR>
nnoremap <leader>uw :action EditorToggleUseSoftWraps<CR>
" <leader>w : +write/window
nnoremap <leader>ww :write<CR>
nnoremap <leader>wa :wall<CR>
nnoremap <leader>wq :wq<CR>
nnoremap <leader>W :write<CR>
nnoremap <leader>wh :action PrevSplitter<CR>
nnoremap <leader>wi :action NextSplitter<CR>
nnoremap <leader>wH :action SplitHorizontally<CR>
nnoremap <leader>wI :action SplitHorizontally<CR>
nnoremap <leader>wN :action SplitVertically<CR>
nnoremap <leader>wE :action SplitVertically<CR>
nnoremap <leader>w- :action SplitHorizontally<CR>
nnoremap <leader>w| :action SplitVertically<CR>
nnoremap <leader>w\ :action SplitVertically<CR>
nnoremap <C-p> :action ParameterInfo<CR>
inoremap <C-p> <C-o>:action ParameterInfo<CR>
""" Handling Ctrls """
sethandler <C-C> i:ide
sethandler <C-V> n-v:vim i:ide
sethandler <C-.> a:ide
sethandler <A-<CR>> a:ide

View file

@ -0,0 +1,6 @@
# IPython config cache
*/db/
*/log/
*/pid/
*/security/
*/history.sqlite

Binary file not shown.

View file

@ -0,0 +1,43 @@
c.TerminalIPythonApp.display_banner = False
c.TerminalInteractiveShell.editing_mode = 'vi'
c.TerminalInteractiveShell.confirm_exit = False
# Source: https://ipython.readthedocs.io/en/stable/config/details.html#keyboard-shortcuts
def custom_return(shell):
"""This function is required by the API. It takes a reference to
the shell, which is the same thing `get_ipython()` evaluates to.
This function must return a function that handles each keypress
event. That function, named `handle` here, references `shell`
by closure."""
def handle(event):
"""This function is called each time `Enter` is pressed,
and takes a reference to a Prompt Toolkit event object.
If the current input starts with a bang or modulo, then
the input is executed, otherwise a newline is entered,
followed by any spaces needed to auto-indent."""
# set up a few handy references to nested items...
buffer = event.current_buffer
document = buffer.document
text = document.text
if text.startswith('!') or text.startswith('%'): # execute the input...
buffer.accept_action.validate_and_handle(event.cli, buffer)
else: # insert a newline with auto-indentation...
if document.line_count > 1: text = text[:document.cursor_position]
indent = shell.check_complete(text)[1]
buffer.insert_text('\n' + indent)
# if you just wanted a plain newline without any indentation, you
# could use `buffer.insert_text('\n')` instead of the lines above
return handle
c.TerminalInteractiveShell.handle_return = custom_return

View file

@ -0,0 +1,11 @@
This is the IPython startup directory
.py and .ipy files in this directory will be run *prior* to any code or files specified
via the exec_lines or exec_files configurables whenever you load this profile.
Files will be run in lexicographical order, so you can control the execution order of files
with a prefix, e.g.::
00-first.py
50-middle.py
99-last.ipy

View file

@ -0,0 +1,69 @@
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.key_binding.vi_state import InputMode
from prompt_toolkit.filters import Condition
from IPython import get_ipython
ip = get_ipython()
key_bindings = KeyBindings()
@Condition
def in_navigation_mode():
return ip.pt_app.app.vi_state.input_mode == InputMode.NAVIGATION
# colemak keymap hnei
@key_bindings.add("n", filter=in_navigation_mode)
def _(event):
"Move cursor down by visual line"
event.current_buffer.auto_down(count=event.arg)
@key_bindings.add("e", filter=in_navigation_mode)
def _(event):
"Move cursor up by visual line"
event.current_buffer.auto_up(count=event.arg)
@key_bindings.add("i", filter=in_navigation_mode)
def _(event):
"Move cursor right"
event.current_buffer.cursor_right(count=event.arg)
# Insert with 'l' and 'L'
@key_bindings.add("l", filter=in_navigation_mode)
def _(event):
"Enter insert mode (similar position to 'i' in Colemak)"
event.app.vi_state.input_mode = InputMode.INSERT
@key_bindings.add("L", filter=in_navigation_mode)
def _(event):
"Enter insert mode at the beginning of the line"
event.current_buffer.cursor_position += event.current_buffer.document.get_start_of_line_position()
# Ne[k]st
@key_bindings.add("k", filter=in_navigation_mode)
def _(event):
"Find next match"
event.current_buffer.forward_search()
@key_bindings.add("K", filter=in_navigation_mode)
def _(event):
"Find previous match"
event.current_buffer.reverse_search()
# [J]ump
@key_bindings.add("j", filter=in_navigation_mode)
def _(event):
"Move to end of next word"
event.current_buffer.cursor_right_word()
@key_bindings.add("J", filter=in_navigation_mode)
def _(event):
"Move to end of next word with capital E"
event.current_buffer.cursor_right_word(end=True)
# Yank to end of line with 'Y'
@key_bindings.add("Y", filter=in_navigation_mode)
def _(event):
"Yank to the end of the line"
text_to_yank = event.current_buffer.document.text_after_cursor
event.app.clipboard.set_text(text_to_yank)
ip.pt_app.key_bindings = key_bindings

View file

@ -0,0 +1,21 @@
from IPython.core.magic import register_line_magic
@register_line_magic
def ps(cmd):
output = get_ipython().getoutput(f"pwsh -NoProfile -Command {cmd}")
# If no variable is assigned to the output, print it
if get_ipython().last_execution_result is None:
print("\n".join(output))
else:
return "\n".join(output)
@register_line_magic
def nu(cmd):
output = get_ipython().getoutput(f"nu -c {cmd}")
# If no variable is assigned to the output, print it
if get_ipython().last_execution_result is None:
print("\n".join(output))
else:
return "\n".join(output)

View file

@ -0,0 +1,19 @@
[org-telegram-desktop]
alt.j = macro(C-tab)
alt.k = C-S-tab
[wechat]
alt.j = A-down
alt.k = A-up
[qq]
alt.j = C-down
alt.k = C-up
alt.h = C-left
alt.l = enter
[zotero]
alt.j = pagedown
alt.k = pageup

View file

@ -0,0 +1,81 @@
# vim:ft=kitty
## name: Catppuccin-Mocha
## author: Pocco81 (https://github.com/Pocco81)
## license: MIT
## upstream: https://github.com/catppuccin/kitty/blob/main/mocha.conf
## blurb: Soothing pastel theme for the high-spirited!
# Accent: Lavender #B4BEFE
# The basic colors
foreground #CDD6F4
background #1E1E2E
selection_foreground #1E1E2E
selection_background #F5E0DC
# Cursor colors
cursor #F5E0DC
cursor_text_color #1E1E2E
# URL underline color when hovering with mouse
url_color #F5E0DC
# Kitty window border colors
active_border_color #B4BEFE
inactive_border_color #6C7086
bell_border_color #F9E2AF
# OS Window titlebar colors
wayland_titlebar_color system
macos_titlebar_color system
# Tab bar colors
active_tab_foreground #11111B
active_tab_background #B4BEFE
inactive_tab_foreground #CDD6F4
inactive_tab_background #1E1E2E
tab_bar_background #181825
# Colors for marks (marked text in the terminal)
mark1_foreground #1E1E2E
mark1_background #B4BEFE
mark2_foreground #1E1E2E
mark2_background #B4BEFE
mark3_foreground #1E1E2E
mark3_background #74C7EC
# The 16 terminal colors
# black
color0 #45475A
color8 #585B70
# red
color1 #F38BA8
color9 #F38BA8
# green
color2 #A6E3A1
color10 #A6E3A1
# yellow
color3 #F9E2AF
color11 #F9E2AF
# blue
color4 #89B4FA
color12 #89B4FA
# magenta
color5 #F5C2E7
color13 #F5C2E7
# cyan
color6 #94E2D5
color14 #94E2D5
# white
color7 #BAC2DE
color15 #A6ADC8

View file

@ -0,0 +1,82 @@
# vim:fileencoding=utf-8:foldmethod=marker
# Fonts {{{
# Family
font_family family="Maple Mono NF CN"
bold_font auto
italic_font auto
bold_italic_font auto
# Ligature
disable_ligatures never
font_size 12.0
# }}}
# Text Cursor {{{
# Cursor Trail
cursor_trail 1
cursor_trail_decay 0.1 0.4
cursor_trail_start_threshold 2
# }}}
# Tab Bar {{{
tab_bar_edge top
tab_bar_align left
tab_bar_style powerline
# Hide tab bar when there is only one tab
tab_bar_min_tabs 2
tab_title_template "{f'{title[:30]}…' if title.rindex(title[-1]) + 1 > 30 else (title.center(6) if (title.rindex(title[-1]) + 1) % 2 == 0 else title.center(5))}"
active_tab_font_style bold
# }}}
# Color Scheme {{{
# BEGIN_KITTY_THEME
# Rosé Pine Dawn
include current-theme.conf
# END_KITTY_THEME
# }}}
# macOS {{{
macos_option_as_alt yes
macos_quit_when_last_window_closed yes
# }}}
# Keyboard Shortcuts {{{
map alt+t new_tab
map alt+w close_tab
map ctrl+c copy_and_clear_or_interrupt
map alt+1 goto_tab 1
map alt+2 goto_tab 2
map alt+3 goto_tab 3
map alt+4 goto_tab 4
map alt+5 goto_tab 5
map alt+6 goto_tab 6
map alt+7 goto_tab 7
map alt+8 goto_tab 8
map alt+9 goto_tab -1
# Leader: ctrl+q
# https://github.com/sxyazi/dotfiles
map ctrl+q noop
map ctrl+q>| kitten window.py +split right
map ctrl+q>\ kitten window.py +split right
map ctrl+q>- kitten window.py +split bottom
map ctrl+q>h kitten window.py -jump left
map ctrl+q>n kitten window.py -jump bottom
map ctrl+q>e kitten window.py -jump top
map ctrl+q>i kitten window.py -jump right
map alt+shift+h kitten window.py -jump left
map alt+shift+n kitten window.py -jump bottom
map alt+shift+e kitten window.py -jump top
map alt+shift+i kitten window.py -jump right
map ctrl+q>shift+H kitten window.py -resize left
map ctrl+q>shift+N kitten window.py -resize bottom
map ctrl+q>shift+E kitten window.py -resize top
map ctrl+q>shift+I kitten window.py -resize right
map cmd+enter toggle_layout stack
map ctrl+shift+enter toggle_layout stack
# }}}
shell fish

View file

@ -0,0 +1,80 @@
# vim:ft=kitty
## name: Catppuccin-Latte
## author: Pocco81 (https://github.com/Pocco81)
## license: MIT
## upstream: https://github.com/catppuccin/kitty/blob/main/latte.conf
## blurb: Soothing pastel theme for the high-spirited!
# The basic colors
foreground #4C4F69
background #EFF1F5
selection_foreground #EFF1F5
selection_background #DC8A78
# Cursor colors
cursor #DC8A78
cursor_text_color #EFF1F5
# URL underline color when hovering with mouse
url_color #DC8A78
# Kitty window border colors
active_border_color #7287FD
inactive_border_color #9CA0B0
bell_border_color #DF8E1D
# OS Window titlebar colors
wayland_titlebar_color system
macos_titlebar_color system
# Tab bar colors
active_tab_foreground #EFF1F5
active_tab_background #8839EF
inactive_tab_foreground #4C4F69
inactive_tab_background #9CA0B0
tab_bar_background #BCC0CC
# Colors for marks (marked text in the terminal)
mark1_foreground #EFF1F5
mark1_background #7287fD
mark2_foreground #EFF1F5
mark2_background #8839EF
mark3_foreground #EFF1F5
mark3_background #209FB5
# The 16 terminal colors
# black
color0 #5C5F77
color8 #6C6F85
# red
color1 #D20F39
color9 #D20F39
# green
color2 #40A02B
color10 #40A02B
# yellow
color3 #DF8E1D
color11 #DF8E1D
# blue
color4 #1E66F5
color12 #1E66F5
# magenta
color5 #EA76CB
color13 #EA76CB
# cyan
color6 #179299
color14 #179299
# white
color7 #ACB0BE
color15 #BCC0CC

View file

@ -0,0 +1,103 @@
# https://github.com/sxyazi/dotfiles
from kittens.tui.handler import result_handler
directions = {
"top": "u",
"bottom": "e",
"left": "n",
"right": "i",
}
def main(args):
pass
@result_handler(no_ui=True)
def handle_result(args, answer, target_window_id, boss):
window = boss.active_window
if window is None:
return
cmd = window.child.foreground_cmdline[0]
act = args[1] # e.g. -jump
if act[0] == "-" and cmd[-4:] == "nvim":
second = directions[args[2]] if len(args) > 2 else ""
window.write_to_child(f"\x1b[119;8u{act[1]}{second}")
return
if (act == "-close" or act == "-quit") and cmd[-7:] == "joshuto":
window.write_to_child(f"\x1b{act[1]}")
return
def split(direction):
if direction == "top" or direction == "bottom":
boss.launch("--cwd=current", "--location=hsplit")
else:
boss.launch("--cwd=current", "--location=vsplit")
if direction == "top" or direction == "left":
boss.active_tab.move_window(direction)
def close():
boss.close_window()
def quit():
boss.quit()
def jump(direction):
boss.active_tab.neighboring_window(direction)
# https://github.com/chancez/dotfiles/blob/master/kitty/.config/kitty/relative_resize.py
def resize(direction):
neighbors = boss.active_tab.current_layout.neighbors_for_window(
window, boss.active_tab.windows
)
top, bottom = neighbors.get("top"), neighbors.get("bottom")
left, right = neighbors.get("left"), neighbors.get("right")
if direction == "top":
if top and bottom:
boss.active_tab.resize_window("shorter", 10)
elif top:
boss.active_tab.resize_window("taller", 10)
elif bottom:
boss.active_tab.resize_window("shorter", 10)
elif direction == "bottom":
if top and bottom:
boss.active_tab.resize_window("taller", 10)
elif top:
boss.active_tab.resize_window("shorter", 10)
elif bottom:
boss.active_tab.resize_window("taller", 10)
elif direction == "left":
if left and right:
boss.active_tab.resize_window("narrower", 10)
elif left:
boss.active_tab.resize_window("wider", 10)
elif right:
boss.active_tab.resize_window("narrower", 10)
elif direction == "right":
if left and right:
boss.active_tab.resize_window("wider", 10)
elif left:
boss.active_tab.resize_window("narrower", 10)
elif right:
boss.active_tab.resize_window("wider", 10)
def move(direction):
boss.active_tab.move_window(direction)
act = act[1:]
if act == "split":
split(args[2])
elif act == "close":
close()
elif act == "quit":
quit()
elif act == "jump":
jump(args[2])
elif act == "resize":
resize(args[2])
elif act == "move":
move(args[2])

12
home/dot_config/krunnerrc Normal file
View file

@ -0,0 +1,12 @@
[General]
FreeFloating=true
historyBehavior=ImmediateCompletion
[Plugins]
baloosearchEnabled=true
[Plugins][Favorites]
plugins=krunner_dictionary,krunner_services,krunner_systemsettings
[Runners][krunner_dictionary]
triggerWord=d

View file

27
home/dot_config/lesskey Normal file
View file

@ -0,0 +1,27 @@
# $DOTFILES/common/lesskey
# Date: 2024-12-22
# Author: js0ny
# Less the pager.
# Location:
# *nix: $XDG_CONFIG_HOME/lesskey (Or specified by the environment variable $LESSKEYIN)
# Windows: %LESSKEYIN% (environment variable, default: %UserProfile%/_lesskey)
# $Env:LESSKEYIN = $Env:AppData\less\lesskey
# Linking:
# ln -sf $DOTFILES/common/lesskey ~/.config/lesskey
# New-Item -ItemType SymbolicLink -Target $DOTFILES\common\lesskey -Path $Env:LESSKEYIN
# ===========================================================
# work for less -V > 582, for mac, use brew install less to override the system less
# In Windows (current version), the default pager is `more`, should be specifed to `less` by `$Env:Pager = less`
# Format: key action
# Arrow Remap (hnei -> hjkl)
n forw-line
e back-line
N forw-line-force
E back-line-force
# search with k : ne[k]st
k repeat-search
K reverse-search

View file

@ -0,0 +1,155 @@
# Location:
# *nix: $XDG_CONFIG_HOME/lsd/config.yaml
# Windows: %APPDATA%\lsd\config.yaml
# Linking:
# ln -sf $DOTFILES/common/lsd.yaml $XDG_CONFIG_HOME/lsd/config.yaml
# == Classic ==
# This is a shorthand to override some of the options to be backwards compatible
# with `ls`. It affects the "color"->"when", "sorting"->"dir-grouping", "date"
# and "icons"->"when" options.
# Possible values: false, true
classic: false
# == Blocks ==
# This specifies the columns and their order when using the long and the tree
# layout.
# Possible values: permission, user, group, context, size, date, name, inode, links, git
blocks:
- permission
- user
- group
- size
- date
- name
# == Color ==
# This has various color options. (Will be expanded in the future.)
color:
# When to colorize the output.
# When "classic" is set, this is set to "never".
# Possible values: never, auto, always
when: auto
# How to colorize the output.
# When "classic" is set, this is set to "no-color".
# Possible values: default, custom
# When "custom" is set, lsd will look in the config directory for `colors.yaml`.
theme: custom
# == Date ==
# This specifies the date format for the date column. The freeform format
# accepts a strftime like string.
# When "classic" is set, this is set to "date".
# Possible values: date, locale, relative, '+<date_format>'
# `date_format` will be a `strftime` formatted value. e.g. `date: '+%d %b %y %X'` will give you a date like this: 17 Jun 21 20:14:55
date: date
# == Dereference ==
# Whether to dereference symbolic links.
# Possible values: false, true
dereference: false
# == Display ==
# What items to display. Do not specify this for the default behavior.
# Possible values: all, almost-all, directory-only
# display: all
# == Icons ==
icons:
# When to use icons.
# When "classic" is set, this is set to "never".
# Possible values: always, auto, never
when: auto
# Which icon theme to use.
# Possible values: fancy, unicode
theme: fancy
# Separator between icon and the name
# Default to 1 space
separator: " "
# == Ignore Globs ==
# A list of globs to ignore when listing.
ignore-globs:
- .git
- .gitkeep # .gitkeep is for keeping empty directories in git
- .DS_Store
# == Indicators ==
# Whether to add indicator characters to certain listed files.
# Possible values: false, true
indicators: false
# == Layout ==
# Which layout to use. "oneline" might be a bit confusing here and should be
# called "one-per-line". It might be changed in the future.
# Possible values: grid, tree, oneline
layout: grid
# == Recursion ==
recursion:
# Whether to enable recursion.
# Possible values: false, true
enabled: false
# How deep the recursion should go. This has to be a positive integer. Leave
# it unspecified for (virtually) infinite.
# depth: 3
# == Size ==
# Specifies the format of the size column.
# Possible values: default, short, bytes
size: default
# == Permission ==
# Specify the format of the permission column
# Possible value: rwx, octal, attributes (windows only), disable
# permission: rwx
# == Sorting ==
sorting:
# Specify what to sort by.
# Possible values: extension, name, time, size, version
column: name
# Whether to reverse the sorting.
# Possible values: false, true
reverse: false
# Whether to group directories together and where.
# When "classic" is set, this is set to "none".
# Possible values: first, last, none
dir-grouping: none
# == No Symlink ==
# Whether to omit showing symlink targets
# Possible values: false, true
no-symlink: false
# == Total size ==
# Whether to display the total size of directories.
# Possible values: false, true
total-size: false
# == Hyperlink ==
# Attach hyperlink to filenames
# Possible values: always, auto, never
hyperlink: never
# == Symlink arrow ==
# Specifies how the symlink arrow display, chars in both ascii and utf8
symlink-arrow:
# == Header ==
# Whether to display block headers.
# Possible values: false, true
header: false
# == Literal ==
# Whether to show quotes on filenames.
# Possible values: false, true
literal: false
# == Truncate owner ==
# How to truncate the username and group names for a file if they exceed a certain
# number of characters.
truncate-owner:
# Number of characters to keep. By default, no truncation is done (empty value).
after:
# String to be appended to a name if truncated.
marker: ""

View file

@ -0,0 +1,9 @@
# Colors
background-color=#1e1e2e
text-color=#cdd6f4
border-color=#b4befe
progress-color=over #313244
[urgency=high]
border-color=#fab387

View file

@ -0,0 +1,26 @@
# $XDG_CONFIG_HOME/neovide/config.toml
# ln -sf $DOTFILES/mac/neovide.toml $XDG_CONFIG_HOME/neovide/config.toml
# New-Item -ItemType SymbolicLink -Path $Env:XDG_CONFIG_HOME/neovide/config.toml -Value $DOTFILES\mac\neovide.toml (Mac)
# https://neovide.dev/config-file.html?highlight=toml#config-file
# 设置为 fork 默认后台运行,不会占用终端
fork = true
# frame = "full"
idle = true
maximized = false
# neovim-bin = "/opt/homebrew/bin/nvim"
frame = "transparent"
no-multigrid = false
srgb = false
tabs = true
theme = "auto"
title-hidden = true
vsync = true
wsl = false
[font]
normal = [
"Maple Mono NF CN",
"Iosevka Nerd Font",
"霞鹜文楷等宽",
] # Will use the bundled Fira Code Nerd Font by default
size = 14.0

49
home/dot_config/nix-config/flake.lock generated Normal file
View file

@ -0,0 +1,49 @@
{
"nodes": {
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1751313918,
"narHash": "sha256-HsJM3XLa43WpG+665aGEh8iS8AfEwOIQWk3Mke3e7nk=",
"owner": "nix-darwin",
"repo": "nix-darwin",
"rev": "e04a388232d9a6ba56967ce5b53a8a6f713cdfcf",
"type": "github"
},
"original": {
"owner": "nix-darwin",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1753934836,
"narHash": "sha256-G06FmIBj0I5bMW1Q8hAEIl5N7IHMK7+Ta4KA+BmneDA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8679b16e11becd487b45d568358ddf9d5640d860",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -0,0 +1,21 @@
{
description = "My macOS Flake config";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:nix-darwin/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, nix-darwin, ... }: {
darwinConfigurations."zen" = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
modules = [
./hosts/macbook/default.nix
./hosts/macbook/brew.nix
./hosts/macbook/system.nix
];
};
};
}

View file

@ -0,0 +1,70 @@
{ config, pkgs, ...}:
{
homebrew = {
enable = true;
brewPrefix = "/opt/homebrew/bin";
taps = [
"daipeihust/tap"
"felixkratz/formulae"
"koekeishiya/formulae"
"nikitabobko/tap"
"railwaycat/emacsmacport"
"js0ny/tap"
];
brews = [
"folderify"
"coreutils"
];
casks = [
"visual-studio-code"
"kitty"
"vivaldi"
"neovide"
"clash-verge-rev"
"obsidian"
"mullvad-vpn"
"alacritty"
"alt-tab"
"apparency"
"betterdisplay"
"discord"
"dotnet-sdk"
"iina"
"iterm2"
"karabiner-elements"
"keka"
"localsend"
"ltspice"
"orbstack"
"qlcolorcode"
# "qlimagesize" discontinued.
"qlmarkdown"
"qlstephen"
"qlvideo"
"qspace-pro"
"quicklook-json"
"quicklookase"
"raycast"
"rider"
"rustdesk"
"scroll-reverser"
"sioyek"
"skim"
"squirrel"
"steam"
"telegram-desktop"
"Filen"
"TickTick"
"cherry-studio"
"firefox"
"Wireshark"
"LibreWolf"
"brave-browser"
"font-maple-mono-nf-cn"
];
};
}

View file

@ -0,0 +1,54 @@
{ config, pkgs, ... }:
{
# Managed by Determinate
nix.enable = false;
system.stateVersion = 6;
system.primaryUser = "js0ny";
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
git
vim
wget
age
aichat
bat
btop
cmake
coreutils
curlie
dos2unix
duf
dust
duti
fastfetch
fd
ffmpeg
fish
fzf
delta
glow
go
hyperfine
imagemagick
just
lazygit
less
lsd
neovim
nushell
pandoc
procs
pnpm
ripgrep
ripgrep-all
starship
tlrc
tmux
uv
zoxide
];
programs.zsh.enable = true;
}

View file

@ -0,0 +1,114 @@
{ config, pkgs, ... }:
{
time.timeZone = "Asia/Shanghai";
system.defaults = {
dock = {
appswitcher-all-displays = true;
autohide = true;
# Launch Animation
launchanim = false;
# Minimize Animation
mineffect = "suck";
minimize-to-application = true;
persistent-apps = [
{ app = "/Applications/Vivaldi.app"; }
{ app = "/Applications/kitty.app"; }
{ app = "/Applications/Obsidian.app"; }
{ app = "Applications/Visual Studio Code.app"; }
{ app = "/Applications/LibreWolf.app"; }
# { spacer = { small = false; }; }
# { spacer = { small = true; }; }
# { folder = "/System/Applications/Utilities"; }
# { folder = "/Users/js0ny/Downloads/"; }
];
persistent-others = [
"/Users/js0ny/Downloads"
"/Users/js0ny/Source"
];
show-recents = false;
orientation = "bottom";
# tr - Top Right
# tl - Top Left (disable this)
# br - Bottom Right
# bl - Bottom Left
# `1`: Disabled
# `2`: Mission Control
# `3`: Application Windows
# `4`: Desktop
# `5`: Start Screen Saver
# `6`: Disable Screen Saver
# `7`: Dashboard
# `10`: Put Display to Sleep
# `11`: Launchpad
# `12`: Notification Center
# `13`: Lock Screen
# `14`: Quick Note
wvous-tr-corner = 2;
wvous-bl-corner = 11; # Simulate Windows button on Windows
wvous-br-corner = 4;
};
finder = {
AppleShowAllFiles = true;
ShowStatusBar = true;
ShowPathbar = true;
FXRemoveOldTrashItems = true;
AppleShowAllExtensions = true;
QuitMenuItem = true;
ShowExternalHardDrivesOnDesktop = false;
ShowRemovableMediaOnDesktop = false;
# This will look show full path in title bar
# For example: /Users/username/Downloads
# instead of just Downloads
_FXShowPosixPathInTitle = false;
_FXSortFoldersFirst = true;
FXEnableExtensionChangeWarning = false;
# Use `Home` instead of `PfHm`
# nix-darwin won't parse `PfHm`
NewWindowTarget = "Home";
};
trackpad = {
TrackpadRightClick = true;
TrackpadThreeFingerDrag = true;
};
screencapture = {
location = "~/Pictures/Screenshots";
type = "png";
include-date = true;
};
SoftwareUpdate.AutomaticallyInstallMacOSUpdates = false;
".GlobalPreferences" = {
"com.apple.sound.beep.sound" = "/System/Library/Sounds/Blow.aiff";
};
NSGlobalDomain = {
AppleInterfaceStyle = "Dark";
AppleInterfaceStyleSwitchesAutomatically = true;
AppleShowAllExtensions = true;
# Use Fn key as standard function keys instead of media keys
"com.apple.keyboard.fnState" = true;
AppleMeasurementUnits = "Centimeters";
AppleICUForce24HourTime = true;
};
controlcenter.BatteryShowPercentage = true;
# Fn usage:
# 0: Show Emoji & Symbols
# 1: Change Input Source
# 2: Show Emoji & Symbols
# 3: Start Dictation
hitoolbox.AppleFnUsageType = "Change Input Source";
WindowManager = {
EnableTilingByEdgeDrag = true;
EnableTopTilingByEdgeDrag = true;
EnableTilingOptionAccelerator = true;
EnableTiledWindowMargins = true;
};
# universalaccess = {
# mouseDriverCursorSize = 1.5;
# reduceMotion = true;
# reduceTransparency = false;
# };
menuExtraClock = {
ShowSeconds = true;
};
};
}

View file

@ -0,0 +1,12 @@
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.lua]
indent_type = "Spaces"
indent_width = 2
column_width = 120

View file

@ -0,0 +1,36 @@
--[[
-*- coding: utf-8 -*-
@Filename init.lua
@Author js0ny
@Date 2024-11-27
@Description neovim
]]
-- Entry point of neovim configuration
require("config.options")
if vim.g.vscode then -- TODO: VSCode Neovim Integration
require("config.vscode")
else
require("config.plugins")
require("config.colorscheme")
end
require("config.keymaps")
require("config.diagnostics")
require("config.migration")
-- If current session is spawn by neovide, do:
if vim.g.neovide then
-- Enable input method
vim.g.neovide_input_ime = true
vim.g.neovide_transparency = 0.85
vim.g.transparency = 0.85
vim.g.neovide_normal_opacity = 0.85
vim.g.neovide_window_blurred = true -- macOS only
vim.g.neovide_floating_blur_amount_x = 2.0
vim.g.neovide_floating_blur_amount_y = 2.0
vim.g.neovide_floating_shadow = true
vim.g.neovide_floating_z_height = 10
vim.g.neovide_light_angle_degrees = 45
vim.g.neovide_light_radius = 5
vim.g.neovide_input_macos_option_key_is_meta = "only_left"
end

View file

@ -0,0 +1,15 @@
-- Bash
--[[ Installation
brew install bash-language-server
npm i -g bash-language-server
dnf install -y nodejs-bash-language-server # Fedora Linux
--]]
return {
cmd = { "bash-language-server", "start" },
filetypes = { "bash", "sh" },
settings = {
bashIde = {
globPattern = vim.env.GLOB_PATTERN or "*@(.sh|.inc|.bash|.command)",
},
},
}

View file

@ -0,0 +1,16 @@
-- Beancount
--[[ Installation:
Dependency:
uv tool install beancount
LSP:
cargo install beancount-language-server
brew install beancount-language-server
--]]
return {
cmd = { "beancount-language-server" },
filetypes = { "beancount" },
settings = {
},
}

View file

@ -0,0 +1,30 @@
-- C/C++
-- Clangd requires compile_commands.json to work and the easiest way to generate it is to use CMake.
-- How to use clangd C/C++ LSP in any project: https://gist.github.com/Strus/042a92a00070a943053006bf46912ae9
return {
cmd = {
"clangd",
"--clang-tidy",
"--header-insertion=iwyu",
"--completion-style=detailed",
"--function-arg-placeholders",
"--fallback-style=none",
},
filetypes = { "c", "cpp" },
root_markers = {
".clangd",
".clang-format",
"compile_commands.json",
"compile_flags.txt",
".git",
},
capabilities = {
textDocument = {
completion = {
editsNearCursor = true,
},
},
offsetEncoding = { "utf-8", "utf-16" },
},
}

View file

@ -0,0 +1,19 @@
-- Golang
--[[ Installation
go install golang.org/x/tools/gopls@latest
brew install gopls
--]]
return {
cmd = { "gopls" },
filetypes = { "go", "gomod", "gowork", "gotmpl" },
root_markers = { "go.work", "go.mod", ".git" },
settings = {
gopls = {
analyses = {
unusedparams = true,
},
staticcheck = true,
-- semanticTokens = true, -- go's semantic token highlight is not accurate so far
},
},
}

View file

@ -0,0 +1,12 @@
-- Java
--[[ Installation
go install golang.org/x/tools/gopls@latest
brew install gopls
--]]
return {
cmd = { "jdtls" },
filetypes = { "java" },
root_markers = { ".git", "build.gradle", "build.gradle.kts", "build.xml", "pom.xml"},
settings = {
},
}

View file

@ -0,0 +1,18 @@
-- JSON
--[[
npm i vscode-json-languageserver
--]]
return {
cmd = { "vscode-json-language-server", "--stdio" },
filetypes = { "json", "jsonc" },
root_markers = { ".git" },
init_options = {
provideFormatter = true,
},
settings = {
-- See setting options
-- https://github.com/microsoft/vscode/tree/main/extensions/json-language-features/server#settings
json = {
},
},
}

Some files were not shown because too many files have changed in this diff Show more