├── eww ├── todo.md ├── scripts │ ├── togglemute.sh │ ├── getmuted.sh │ ├── go │ │ └── workspaces │ │ │ ├── Makefile │ │ │ ├── main │ │ │ ├── main.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ └── workspaces.go │ ├── workspaces.sh │ ├── lock.sh │ ├── updates.sh │ ├── switch_workspace_by_name.sh │ ├── getvol.sh │ └── network.sh ├── images │ ├── exit.png │ ├── moon.png │ ├── wifi.png │ ├── enpass.png │ ├── internet.png │ ├── no-wifi.png │ ├── padlock.png │ ├── restart.png │ ├── rewind.png │ ├── sys-reboot.png │ ├── sys-sleep.png │ ├── compact-disc.png │ ├── fast-forward.png │ ├── play-button.png │ ├── power-button.png │ ├── sys-powermenu.png │ └── sys-poweroff.png ├── eww.scss └── eww.yuck ├── sway ├── .gitignore ├── lock └── config ├── nvim ├── lua │ ├── plugins │ │ ├── node-repl │ │ │ ├── .gitignore │ │ │ ├── cli.js │ │ │ ├── test.js │ │ │ ├── jsconfig.json │ │ │ ├── package.json │ │ │ ├── repl.js │ │ │ ├── package-lock.json │ │ │ └── repl-connector.lua │ │ ├── yuck.lua │ │ ├── surround.lua │ │ ├── fugitive.lua │ │ ├── diffview.lua │ │ ├── web-devicons.lua │ │ ├── fidget.lua │ │ ├── pinkmare.lua │ │ ├── nvim-autopairs.lua │ │ ├── vim-commentary.lua │ │ ├── markdown-preview.lua │ │ ├── colorizer.lua │ │ ├── luasnip.lua │ │ ├── render-markdown.lua │ │ ├── vim-dadbod-ui.lua │ │ ├── mason.lua │ │ ├── treesitter.lua │ │ ├── conform.lua │ │ ├── lsp-status.lua │ │ ├── lsp-config.lua │ │ ├── oil.lua │ │ ├── nvim-dap.lua │ │ ├── nvim-cmp.lua │ │ ├── snacks.lua │ │ └── nvim-jdtls.lua │ ├── snippets │ │ ├── init.lua │ │ ├── package.json │ │ └── webdev.lua │ └── config │ │ ├── hover.lua │ │ ├── borders.lua │ │ ├── diagnostic.lua │ │ ├── lazy.lua │ │ ├── opts.lua │ │ ├── keymaps.lua │ │ └── statusline.lua ├── init.lua └── lazy-lock.json ├── .profile ├── unixpr_3.png ├── plasma-in-i3.md ├── tools ├── one-hdmi-screen.sh ├── one-hdmi-screen-mirror.sh ├── set-work-screens.sh └── open-dev-setup.sh ├── .luarc.json ├── .Xdefaults ├── jsconfig.json ├── shell ├── setup ├── .env ├── .zsh_setup ├── .zshrc ├── .bashrc ├── .shell_common └── .bashrc_old ├── plasma-i3.service ├── symlink.sh ├── ssh-agent.service ├── init-toolchains.sh ├── .prettierrc ├── .gitconfig ├── xdg-open ├── tsconfig.json ├── kanshi └── config ├── .alacritty.toml ├── ssh-agent.md ├── README.md ├── .tmux.conf ├── .npm_completion ├── ftplugin └── javascript.lua ├── picom-animations.conf ├── .i3 └── config └── picom.conf /eww/todo.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sway/.gitignore: -------------------------------------------------------------------------------- 1 | outputs 2 | workspaces 3 | -------------------------------------------------------------------------------- /nvim/lua/plugins/node-repl/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.profile: -------------------------------------------------------------------------------- 1 | setxkbmap -option caps:escape 2 | . "$HOME/.cargo/env" 3 | -------------------------------------------------------------------------------- /eww/scripts/togglemute.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | amixer set Master toggle 4 | -------------------------------------------------------------------------------- /nvim/lua/plugins/yuck.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "elkowar/yuck.vim" 3 | } 4 | -------------------------------------------------------------------------------- /nvim/lua/plugins/surround.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'tpope/vim-surround' 3 | } 4 | -------------------------------------------------------------------------------- /unixpr_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/unixpr_3.png -------------------------------------------------------------------------------- /nvim/lua/plugins/fugitive.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'tpope/vim-fugitive' 3 | } 4 | -------------------------------------------------------------------------------- /nvim/lua/plugins/node-repl/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import("./repl.js"); 4 | -------------------------------------------------------------------------------- /eww/images/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/exit.png -------------------------------------------------------------------------------- /eww/images/moon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/moon.png -------------------------------------------------------------------------------- /eww/images/wifi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/wifi.png -------------------------------------------------------------------------------- /eww/images/enpass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/enpass.png -------------------------------------------------------------------------------- /eww/images/internet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/internet.png -------------------------------------------------------------------------------- /eww/images/no-wifi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/no-wifi.png -------------------------------------------------------------------------------- /eww/images/padlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/padlock.png -------------------------------------------------------------------------------- /eww/images/restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/restart.png -------------------------------------------------------------------------------- /eww/images/rewind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/rewind.png -------------------------------------------------------------------------------- /eww/images/sys-reboot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/sys-reboot.png -------------------------------------------------------------------------------- /eww/images/sys-sleep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/sys-sleep.png -------------------------------------------------------------------------------- /eww/scripts/getmuted.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | amixer -D pulse sget Master | awk '/Left:/{print $6}' 4 | -------------------------------------------------------------------------------- /nvim/lua/plugins/diffview.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "sindrets/diffview.nvim", 3 | opts = { 4 | }, 5 | } 6 | -------------------------------------------------------------------------------- /plasma-in-i3.md: -------------------------------------------------------------------------------- 1 | # Installation instructions 2 | 3 | https://github.com/heckelson/i3-and-kde-plasma 4 | -------------------------------------------------------------------------------- /eww/images/compact-disc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/compact-disc.png -------------------------------------------------------------------------------- /eww/images/fast-forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/fast-forward.png -------------------------------------------------------------------------------- /eww/images/play-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/play-button.png -------------------------------------------------------------------------------- /eww/images/power-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/power-button.png -------------------------------------------------------------------------------- /eww/images/sys-powermenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/sys-powermenu.png -------------------------------------------------------------------------------- /eww/images/sys-poweroff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/images/sys-poweroff.png -------------------------------------------------------------------------------- /nvim/lua/plugins/web-devicons.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-tree/nvim-web-devicons", 3 | opts = {}, 4 | } 5 | -------------------------------------------------------------------------------- /eww/scripts/go/workspaces/Makefile: -------------------------------------------------------------------------------- 1 | all: build 2 | 3 | build: 4 | go build -o main main.go workspaces.go 5 | -------------------------------------------------------------------------------- /eww/scripts/go/workspaces/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Matsuuu/dotfiles/HEAD/eww/scripts/go/workspaces/main -------------------------------------------------------------------------------- /tools/one-hdmi-screen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | xrandr --output DisplayPort-1 --scale 1.75x1.75 --pos 3360x0 4 | -------------------------------------------------------------------------------- /eww/scripts/workspaces.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | i3-msg -t get_workspaces | jq -c '[.[] | {num: .num, focused: .focused}]' 4 | -------------------------------------------------------------------------------- /tools/one-hdmi-screen-mirror.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | xrandr --output DisplayPort-1 --scale 1.75x1.75 --pos 3360x0 --same-as eDP-1 4 | -------------------------------------------------------------------------------- /nvim/lua/snippets/init.lua: -------------------------------------------------------------------------------- 1 | require("luasnip.loaders.from_vscode").lazy_load({ paths = { "./snippets" } }) 2 | 3 | require("snippets.webdev") 4 | -------------------------------------------------------------------------------- /tools/set-work-screens.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | xrandr --output DisplayPort-8 --pos 0x0 --scale 1.75x1.75 --output DisplayPort-10 --scale 1.75x1.75 --pos 3360x0 4 | 5 | -------------------------------------------------------------------------------- /nvim/lua/plugins/fidget.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "j-hui/fidget.nvim", 3 | opts = { 4 | notification = { 5 | window = { 6 | winblend = 0, 7 | }, 8 | }, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", 3 | "Lua.diagnostics.globals": [ 4 | "vim" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /eww/scripts/lock.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | loginctl lock-session 4 | 5 | # Fallback incase the above doesn't work, like it most likely doesnt with eww 6 | /usr/lib/kscreenlocker_greet & 7 | -------------------------------------------------------------------------------- /.Xdefaults: -------------------------------------------------------------------------------- 1 | !--------------------xdefaults 2 | Xft.dpi: 150 3 | Xft*antialias: true 4 | Xft*hinting: true 5 | Xft*hintstyle: hintfull 6 | URxvt*cursorUnderline: true 7 | URxvt.cursorBlink: true 8 | Xft*rgba: rgb 9 | -------------------------------------------------------------------------------- /eww/scripts/updates.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | UPDATE_COUNT=$(pacman -Qu | wc | awk '{print $1}') 4 | if [[ $UPDATE_COUNT -lt 1 ]]; then 5 | echo "No updates" 6 | else 7 | echo $UPDATE_COUNT Updates available 8 | fi 9 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "esnext", 4 | "target": "esnext", 5 | "checkJs": true, 6 | "moduleResolution": "node" 7 | }, 8 | "exclude": ["node_modules"] 9 | } 10 | 11 | -------------------------------------------------------------------------------- /nvim/lua/plugins/node-repl/test.js: -------------------------------------------------------------------------------- 1 | console.log("Hello!"); 2 | 3 | console.log(1 + 1); 4 | 5 | const foo = "bar"; 6 | 7 | console.log(foo); 8 | 9 | let name = "Matsu"; 10 | 11 | console.log("Hello " + name); 12 | -------------------------------------------------------------------------------- /nvim/lua/plugins/pinkmare.lua: -------------------------------------------------------------------------------- 1 | 2 | return { 3 | "matsuuu/pinkmare", 4 | init = function() 5 | vim.cmd("let g:pinkmare_transparent_background = 1") 6 | vim.cmd [[colorscheme pinkmare]] 7 | end 8 | } 9 | -------------------------------------------------------------------------------- /shell/setup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ln -sf $PWD/.shell_common $HOME/.shell_common 4 | ln -sf $PWD/.bashrc $HOME/.bashrc 5 | ln -sf $PWD/.zshrc $HOME/.zshrc 6 | ln -sf $PWD/.zsh_setup $HOME/.zsh_setup 7 | ln -sf $PWD/.env $HOME/.env 8 | -------------------------------------------------------------------------------- /plasma-i3.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Launch Plasma with i3 3 | Before=plasma-workspace.target 4 | 5 | [Service] 6 | ExecStart=/usr/bin/i3 7 | Restart=on-failure 8 | 9 | [Install] 10 | WantedBy=plasma-workspace.target 11 | -------------------------------------------------------------------------------- /symlink.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ln -sf ~/dotfiles/.bashrc ~/.bashrc 4 | ln -sf ~/dotfiles/.npm_completion ~/.npm_completion 5 | #ln -sf ~/dotfiles/.profile ~/.profile 6 | 7 | mkdir ~/.config 8 | ln -s ~/dotfiles/nvim ~/.config/nvim 9 | -------------------------------------------------------------------------------- /nvim/lua/plugins/nvim-autopairs.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'windwp/nvim-autopairs', 3 | event = "InsertEnter", 4 | config = true 5 | -- use opts = {} for passing setup options 6 | -- this is equalent to setup({}) function 7 | } 8 | -------------------------------------------------------------------------------- /nvim/init.lua: -------------------------------------------------------------------------------- 1 | require("config.opts") 2 | require("config.keymaps") 3 | require("config.lazy") 4 | require("config.hover") 5 | require("config.statusline") 6 | require("config.diagnostic") 7 | require("config.borders") 8 | require("snippets.init") 9 | -------------------------------------------------------------------------------- /eww/scripts/go/workspaces/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | func main() { 9 | apps := GetWorkspaces() 10 | 11 | appsJson, _ := json.Marshal(apps) 12 | fmt.Println(string(appsJson)) 13 | } 14 | -------------------------------------------------------------------------------- /nvim/lua/plugins/node-repl/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "esnext", 4 | "target": "esnext", 5 | "checkJs": true, 6 | "moduleResolution": "node" 7 | }, 8 | "exclude": ["node_modules"] 9 | } 10 | 11 | -------------------------------------------------------------------------------- /ssh-agent.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=SSH key agent 3 | 4 | [Service] 5 | Type=simple 6 | Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket 7 | ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK 8 | 9 | [Install] 10 | WantedBy=default.target 11 | -------------------------------------------------------------------------------- /eww/scripts/switch_workspace_by_name.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Usage: ./switch_workspace_by_name.sh "workspace-name-or-number" 4 | 5 | name="$1" 6 | 7 | if [ -z "$name" ]; then 8 | exit 1 9 | fi 10 | 11 | swaymsg workspace "$name" >/dev/null 12 | 13 | -------------------------------------------------------------------------------- /nvim/lua/plugins/vim-commentary.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_set_keymap("v", "cc", ":Commentary", { noremap = true }) 2 | vim.api.nvim_set_keymap("n", "cs", "{v}:Commentary", { noremap = true }) 3 | 4 | return { 5 | "tpope/vim-commentary" 6 | } 7 | -------------------------------------------------------------------------------- /init-toolchains.sh: -------------------------------------------------------------------------------- 1 | sudo apt update 2 | 3 | sudo apt install build-essential 4 | sudo apt install ripgrep 5 | sudo apt install fzf 6 | 7 | sudo apt install luarocks 8 | 9 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash 10 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "tabWidth": 4, 4 | "useTabs": false, 5 | "semi": true, 6 | "singleQuote": false, 7 | "trailingComma": "all", 8 | "bracketSpacing": true, 9 | "jsxBracketSameLine": false, 10 | "arrowParens": "avoid" 11 | } 12 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [alias] 2 | lol = log --oneline --decorate 3 | graph = log --oneline --graph --decorate 4 | [user] 5 | email = huhta.matias@gmail.com 6 | name = Matsuuu 7 | [init] 8 | defaultBranch = main 9 | [pull] 10 | rebase = false 11 | [push] 12 | autoSetupRemote = true 13 | -------------------------------------------------------------------------------- /tools/open-dev-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | i3-msg "workspace 1; exec google-chrome-stable" 4 | sleep 1.5 5 | i3-msg "workspace 2; exec alacritty" 6 | sleep 1.5 7 | i3-msg "workspace 3; exec google-chrome-stable" 8 | sleep 1.5 9 | i3-msg "workspace 4; exec google-chrome-stable" 10 | sleep 1.5 11 | -------------------------------------------------------------------------------- /eww/scripts/getvol.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if command -v pamixer &>/dev/null; then 4 | if [ true == $(pamixer --get-mute) ]; then 5 | echo 0 6 | exit 7 | else 8 | pamixer --get-volume 9 | fi 10 | else 11 | amixer -D pulse sget Master | awk -F '[^0-9]+' '/Left:/{print $3}' 12 | fi 13 | -------------------------------------------------------------------------------- /xdg-open: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This is a helper that should be put to `/usr/local/bin/` to allow Slack to open it's desktop app from browser. 4 | # Might need expansion with other tools? 5 | 6 | if [[ "${1:-}" = slack://* ]]; then 7 | exec /usr/lib/slack/slack --enable-crashpad "$1" 8 | fi 9 | 10 | exec /usr/bin/xdg-open "$@" 11 | -------------------------------------------------------------------------------- /nvim/lua/config/hover.lua: -------------------------------------------------------------------------------- 1 | local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview 2 | 3 | ---@diagnostic disable-next-line: duplicate-set-field 4 | function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) 5 | opts = opts or {} 6 | opts.border = "rounded" 7 | return orig_util_open_floating_preview(contents, syntax, opts, ...) 8 | end 9 | -------------------------------------------------------------------------------- /nvim/lua/config/borders.lua: -------------------------------------------------------------------------------- 1 | local _border = "single" 2 | 3 | vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { 4 | border = _border, 5 | }) 6 | 7 | vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { 8 | border = _border, 9 | }) 10 | 11 | vim.diagnostic.config({ 12 | float = { border = _border }, 13 | }) 14 | -------------------------------------------------------------------------------- /nvim/lua/plugins/markdown-preview.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'MeanderingProgrammer/render-markdown.nvim', 3 | dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons 4 | ---@module 'render-markdown' 5 | ---@type render.md.UserConfig 6 | opts = { 7 | completions = { lsp = { enabled = true } }, 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /nvim/lua/plugins/colorizer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "catgoose/nvim-colorizer.lua", 3 | event = "BufReadPre", 4 | opts = { -- set to setup table 5 | user_default_options = { 6 | tailwind = "both", 7 | tailwind_opts = { 8 | update_names = true 9 | }, 10 | 11 | rgb_fn = true, 12 | hsl_fn = true, 13 | 14 | mode = "virtualtext", 15 | virtualtext_inline = true 16 | } 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /nvim/lua/plugins/luasnip.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "L3MON4D3/LuaSnip", 3 | dependencies = { 4 | { 5 | "rafamadriz/friendly-snippets", 6 | config = function() 7 | require("luasnip.loaders.from_vscode").lazy_load() 8 | end, 9 | }, 10 | { 11 | "nvim-cmp", 12 | dependencies = { 13 | "saadparwaiz1/cmp_luasnip", 14 | }, 15 | }, 16 | }, 17 | opts = { 18 | history = true, 19 | delete_check_events = "TextChanged", 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /nvim/lua/plugins/node-repl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "virta", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "repl.js", 6 | "type": "module", 7 | "scripts": { 8 | "start": "node repl.js" 9 | }, 10 | "bin": { 11 | "virta": "./cli.js" 12 | }, 13 | "keywords": [], 14 | "author": "", 15 | "license": "ISC", 16 | "devDependencies": { 17 | "@types/node": "^22.10.3" 18 | }, 19 | "dependencies": { 20 | "node-localstorage": "^3.0.5" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /eww/scripts/go/workspaces/go.mod: -------------------------------------------------------------------------------- 1 | module workspaces 2 | 3 | go 1.24.2 4 | 5 | require go.i3wm.org/i3/v4 v4.24.0 6 | 7 | require ( 8 | github.com/BurntSushi/xgb v0.0.0-20210121224620-deaf085860bc // indirect 9 | github.com/BurntSushi/xgbutil v0.0.0-20190907113008-ad855c713046 // indirect 10 | github.com/joshuarubin/go-sway v1.2.0 // indirect 11 | github.com/joshuarubin/lifecycle v1.0.0 // indirect 12 | go.uber.org/atomic v1.3.2 // indirect 13 | go.uber.org/multierr v1.1.0 // indirect 14 | golang.org/x/sync v0.12.0 // indirect 15 | ) 16 | -------------------------------------------------------------------------------- /nvim/lua/plugins/render-markdown.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'MeanderingProgrammer/render-markdown.nvim', 3 | -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, -- if you use the mini.nvim suite 4 | -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.icons' }, -- if you use standalone mini plugins 5 | dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons 6 | ---@module 'render-markdown' 7 | ---@type render.md.UserConfig 8 | opts = {}, 9 | } 10 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "checkJs": true, 5 | "target": "esnext", 6 | "module": "esnext", 7 | "moduleResolution": "bundler", 8 | "esModuleInterop": true, 9 | "skipLibCheck": true, 10 | "lib": [ 11 | "esnext", 12 | "dom", 13 | "dom.iterable" 14 | ], 15 | 16 | "experimentalDecorators": true, 17 | "useDefineForClassFields": false, 18 | 19 | "outDir": "dist", 20 | "sourceMap": true, 21 | "declaration": false 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /nvim/lua/plugins/vim-dadbod-ui.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'kristijanhusak/vim-dadbod-ui', 3 | dependencies = { 4 | { 'tpope/vim-dadbod', lazy = true }, 5 | { 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true }, -- Optional 6 | }, 7 | cmd = { 8 | 'DBUI', 9 | 'DBUIToggle', 10 | 'DBUIAddConnection', 11 | 'DBUIFindBuffer', 12 | }, 13 | init = function() 14 | -- Your DBUI configuration 15 | vim.g.db_ui_use_nerd_fonts = 1 16 | vim.g.db_ui_auto_execute_table_helpers = 1 17 | 18 | vim.keymap.set("n", "db", function() 19 | vim.cmd.tabnew() 20 | vim.cmd("DBUI") 21 | end) 22 | end, 23 | } 24 | -------------------------------------------------------------------------------- /nvim/lua/plugins/mason.lua: -------------------------------------------------------------------------------- 1 | 2 | -- These require manual installation 3 | local ensure_installed = { 4 | "jdtls", 5 | "java-debug-adapter", 6 | "java-test", 7 | "tailwindcss-language-server", 8 | "terraform-ls", 9 | "lua-language-server", 10 | "prettier", 11 | "typescript-language-server", 12 | "html-lsp", 13 | "css-lsp", 14 | "gopls" 15 | } 16 | 17 | 18 | vim.api.nvim_create_user_command("MasonInstallAll", function() 19 | for _, server in ipairs(ensure_installed) do 20 | vim.cmd("MasonInstall " .. server) 21 | end 22 | end, {}) 23 | 24 | return { 25 | "williamboman/mason.nvim", 26 | config = function() 27 | require("mason").setup({}) 28 | 29 | end, 30 | } 31 | -------------------------------------------------------------------------------- /shell/.env: -------------------------------------------------------------------------------- 1 | # PATHS 2 | export PATH="$PATH:$HOME/dotfiles/tools" 3 | export PATH="$PATH:$HOME/.jbang/bin" 4 | export JAVA_HOME="$HOME/.sdkman/candidates/java/current" 5 | export BROWSER=/usr/bin/google-chrome-stable 6 | export PATH="$PATH:$HOME/go/bin" 7 | export PATH=$PATH:/usr/local/go/bin 8 | export PATH="$PATH:$HOME/Tools/clojure-lsp" 9 | export PATH="$PATH:$JAVA_HOME/bin" 10 | export PATH="$PATH:$HOME/Tools/lua-lsp/bin" 11 | 12 | #jdtl support for nvim 13 | export WORKSPACE=$HOME/workspace 14 | 15 | export CAPACITOR_ANDROID_STUDIO_PATH="/usr/bin/android-studio" 16 | export ANDROID_SDK_ROOT="/home/matsu/Android/Sdk" 17 | 18 | export PATH="$PATH:$ANDROID_SDK_ROOT/platform-tools" 19 | export PATH="$PATH:$HOME/.dotnet" 20 | export PATH="$PATH:$HOME/.dotnet/tools" 21 | export DOTNET_ROOT="$HOME/.dotnet" 22 | 23 | . "$HOME/.cargo/env" 24 | -------------------------------------------------------------------------------- /sway/lock: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | swaylock \ 4 | --daemonize \ 5 | --screenshots \ 6 | --clock \ 7 | --indicator \ 8 | --fade-in 0.25 \ 9 | --effect-blur 12x12 \ 10 | --effect-vignette 0.25:0.5 \ 11 | --indicator-radius 90 \ 12 | --indicator-thickness 8 \ 13 | --ring-color 3b4252cc \ 14 | --key-hl-color 88c0d0ff \ 15 | --line-color 00000000 \ 16 | --inside-color 2e3440cc \ 17 | --separator-color 00000000 \ 18 | --text-color eceff4ff \ 19 | --text-clear-color a3be8cff \ 20 | --text-caps-lock-color ebcb8bff \ 21 | --text-ver-color 81a1c1ff \ 22 | --text-wrong-color bf616aff \ 23 | --ring-clear-color a3be8bff \ 24 | --ring-caps-lock-color ebcb8bff \ 25 | --ring-ver-color 81a1c1ff \ 26 | --ring-wrong-color bf616aff \ 27 | --inside-clear-color a3be8bcc \ 28 | --inside-caps-lock-color ebcb8bcc \ 29 | --inside-ver-color 81a1c1cc \ 30 | --inside-wrong-color bf616acc \ 31 | --datestr "%A, %d %B" \ 32 | --timestr "%H:%M" \ 33 | --font "JetBrains Mono" 34 | -------------------------------------------------------------------------------- /eww/scripts/network.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Get the name of the currently active connection using nmcli 4 | active_connection=$(nmcli -t -f NAME,DEVICE,TYPE,STATE connection show --active | head -n1) 5 | device_type=$(echo "$active_connection" | cut -d: -f3) 6 | connection_state=$(echo "$active_connection" | cut -d: -f4) 7 | 8 | # Parse out connection name, device type, and state 9 | if [[ "$connection_state" == "activated" ]]; then 10 | CONNECTION_NAME=$(echo "$active_connection" | cut -d: -f1) 11 | 12 | if [[ "$device_type" == "wifi" ]]; then 13 | ICON="images/wifi.png" 14 | fi 15 | 16 | if [[ "$device_type" == *"wireless" ]]; then 17 | ICON="images/wifi.png" 18 | fi 19 | 20 | if [[ "$device_type" == *"ethernet" ]]; then 21 | ICON="images/internet.png" 22 | fi 23 | else 24 | CONNECTION_NAME="Disconnected" 25 | ICON="images/no-wifi.png" 26 | fi 27 | 28 | case "$1" in 29 | --stat) echo "$CONNECTION_NAME" ;; 30 | --icon) echo "$ICON" ;; 31 | esac 32 | -------------------------------------------------------------------------------- /nvim/lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-treesitter/nvim-treesitter", 3 | build = ":TSUpdate", 4 | config = function () 5 | local configs = require("nvim-treesitter.configs") 6 | 7 | configs.setup({ 8 | ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "typescript", "heex", "javascript", "html", "java" }, 9 | sync_install = false, 10 | highlight = { 11 | enable = true, 12 | -- disable slow treesitter highlight for large files 13 | disable = function(lang, buf) 14 | local max_filesize = 100 * 1024 -- 100 KB 15 | local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) 16 | if ok and stats and stats.size > max_filesize then 17 | return true 18 | end 19 | end, 20 | }, 21 | indent = { enable = true }, 22 | }) 23 | end 24 | } 25 | -------------------------------------------------------------------------------- /kanshi/config: -------------------------------------------------------------------------------- 1 | output "Dell Inc. DELL P2419H 87V1Y9C61T5T" { 2 | mode 1920x1080@60 3 | position 0,0 4 | scale 1 5 | alias $OFFICE_1 6 | } 7 | 8 | output "Dell Inc. DELL P2419H CM4XR13" { 9 | mode 1920x1080@60 10 | position 1920,0 11 | scale 1 12 | alias $OFFICE_2 13 | } 14 | 15 | output "AOC G2490W1G4 TQTMBHA001777" { 16 | mode 1920x1080@144 17 | position 0,0 18 | scale 1 19 | alias $HOME_MAIN 20 | } 21 | 22 | output "Dell Inc. DELL P2419H DHKQH73" { 23 | mode 1920x1080@60 24 | position 1920,0 25 | scale 1 26 | alias $HOME_SECONDARY 27 | } 28 | 29 | output "BOE NE135A1M-NY1 Unknown" { 30 | mode 2880x1920@120 31 | position 0,0 32 | scale 2 33 | alias $LAPTOP 34 | } 35 | 36 | profile undocked { 37 | output eDP-1 enable scale 1.75 38 | } 39 | 40 | profile office_docked { 41 | output eDP-1 disable 42 | output $OFFICE_1 enable 43 | output $OFFICE_2 enable 44 | } 45 | 46 | profile home_docked { 47 | output eDP-1 disable 48 | output $HOME_MAIN enable 49 | output $HOME_SECONDARY enable 50 | } 51 | -------------------------------------------------------------------------------- /.alacritty.toml: -------------------------------------------------------------------------------- 1 | [colors.bright] 2 | black = "0xFAE8B6" 3 | blue = "0xeba4ac" 4 | cyan = "0x87c095" 5 | green = "0x9cd162" 6 | magenta = "0xd9bcef" 7 | red = "0xff38a2" 8 | white = "0xfff0f5" 9 | yellow = "0xffc85b" 10 | 11 | [colors.normal] 12 | black = "0xFAE8B6" 13 | blue = "0xeba4ac" 14 | cyan = "0x87c095" 15 | green = "0x9cd162" 16 | magenta = "0xd9bcef" 17 | red = "0xff38a2" 18 | white = "0xfff0f5" 19 | yellow = "0xffc85b" 20 | 21 | [colors.primary] 22 | background = "0x202330" 23 | foreground = "0xfae8b6" 24 | 25 | [font] 26 | size = 12 27 | 28 | [font.bold] 29 | family = "FantasqueSansM Nerd Font" 30 | style = "Bold" 31 | 32 | [font.italic] 33 | family = "FantasqueSansM Nerd Font" 34 | style = "Italic" 35 | 36 | [font.normal] 37 | family = "FantasqueSansM Nerd Font" 38 | style = "Regular" 39 | 40 | [font.offset] 41 | y = 1 42 | 43 | [terminal.shell] 44 | program = "/bin/zsh" 45 | 46 | [window] 47 | opacity = 1 48 | 49 | [window.dimensions] 50 | columns = 100 51 | lines = 36 52 | 53 | [window.padding] 54 | x = 25 55 | y = 25 56 | 57 | [window.position] 58 | x = 1050 59 | y = 250 60 | 61 | [terminal] 62 | -------------------------------------------------------------------------------- /nvim/lua/plugins/conform.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_autocmd("BufWritePre", { 2 | pattern = "*", 3 | callback = function(args) 4 | require("conform").format({ bufnr = args.buf }) 5 | end, 6 | }) 7 | 8 | return { 9 | "stevearc/conform.nvim", 10 | opts = { 11 | formatters_by_ft = { 12 | -- Conform will run the first available formatter 13 | javascript = { "prettierd", "prettier", stop_after_first = true }, 14 | javascriptreact = { "prettierd", "prettier", stop_after_first = true }, 15 | typescript = { "prettierd", "prettier", stop_after_first = true }, 16 | typescriptreact = { "prettierd", "prettier", stop_after_first = true }, 17 | css = { "prettierd", "prettier", stop_after_first = true }, 18 | html = { "prettierd", "prettier", stop_after_first = true }, 19 | json = { "prettierd", "prettier", stop_after_first = true }, 20 | yaml = { "prettierd", "prettier", stop_after_first = true }, 21 | go = { "gofmt", stop_after_first = true }, 22 | templ = { "templ", stop_after_first = true }, 23 | 24 | terraform = { "terraform_fmt" }, 25 | lua = { "stylua" }, 26 | }, 27 | }, 28 | } 29 | -------------------------------------------------------------------------------- /ssh-agent.md: -------------------------------------------------------------------------------- 1 | On Arch Linux, the following works really great (should work on all systemd-based distros): 2 | 3 | Create a systemd user service, by putting the following to ~/.config/systemd/user/ssh-agent.service: 4 | 5 | ``` 6 | [Unit] 7 | Description=SSH key agent 8 | 9 | [Service] 10 | Type=simple 11 | Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket 12 | ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK 13 | 14 | [Install] 15 | WantedBy=default.target 16 | ``` 17 | 18 | Setup shell to have an environment variable for the socket (.bash_profile, .zshrc, ...): 19 | 20 | ``` 21 | export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" 22 | ``` 23 | 24 | Enable the service, so it'll be started automatically on login, and start it: 25 | 26 | ``` 27 | systemctl --user enable ssh-agent 28 | systemctl --user start ssh-agent 29 | ``` 30 | Add the following configuration setting to your local ssh config file ~/.ssh/config (this works since SSH 7.2): 31 | 32 | ``` 33 | AddKeysToAgent yes 34 | ``` 35 | 36 | This will instruct the ssh client to always add the key to a running agent, so there's no need to ssh-add it beforehand. 37 | -------------------------------------------------------------------------------- /shell/.zsh_setup: -------------------------------------------------------------------------------- 1 | # Set the directory we want to store zinit and plugins 2 | ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" 3 | 4 | # Download Zinit, if it's not there yet 5 | if [ ! -d "$ZINIT_HOME" ]; then 6 | mkdir -p "$(dirname $ZINIT_HOME)" 7 | git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" 8 | fi 9 | 10 | # Source/Load zinit 11 | source "${ZINIT_HOME}/zinit.zsh" 12 | 13 | # Add in zsh plugins 14 | zinit light zsh-users/zsh-syntax-highlighting 15 | zinit light zsh-users/zsh-completions 16 | # zinit light zsh-users/zsh-autosuggestions 17 | zinit light Aloxaf/fzf-tab 18 | 19 | zinit cdreplay -q 20 | 21 | # General styling 22 | 23 | # Remove underlines 24 | (( ${+ZSH_HIGHLIGHT_STYLES} )) || typeset -A ZSH_HIGHLIGHT_STYLES 25 | ZSH_HIGHLIGHT_STYLES[path]=none 26 | ZSH_HIGHLIGHT_STYLES[path_prefix]=none 27 | 28 | # Completion styling 29 | zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' 30 | zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" 31 | zstyle ':completion:*' menu no 32 | zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath' 33 | zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath' 34 | -------------------------------------------------------------------------------- /nvim/lua/config/diagnostic.lua: -------------------------------------------------------------------------------- 1 | local signs = { 2 | DiagnosticSignError = "🔥", 3 | DiagnosticSignWarn = "🚧", 4 | DiagnosticSignHint = "👷", 5 | DiagnosticSignInfo = "🙋", 6 | } 7 | 8 | vim.diagnostic.config({ 9 | virtual_text = { 10 | prefix = function(diagnostic) 11 | if diagnostic.severity == vim.diagnostic.severity.ERROR then 12 | return signs.DiagnosticSignError 13 | elseif diagnostic.severity == vim.diagnostic.severity.WARN then 14 | return signs.DiagnosticSignWarn 15 | elseif diagnostic.severity == vim.diagnostic.severity.INFO then 16 | return signs.DiagnosticSignInfo 17 | else 18 | return signs.DiagnosticSignHint 19 | end 20 | end, 21 | }, 22 | signs = { 23 | text = { 24 | [vim.diagnostic.severity.ERROR] = signs.DiagnosticSignError, 25 | [vim.diagnostic.severity.WARN] = signs.DiagnosticSignWarn, 26 | [vim.diagnostic.severity.INFO] = signs.DiagnosticSignInfo, 27 | [vim.diagnostic.severity.HINT] = signs.DiagnosticSignHint, 28 | }, 29 | numhl = { 30 | [vim.diagnostic.severity.WARN] = "WarningMsg", 31 | }, 32 | }, 33 | }) 34 | -------------------------------------------------------------------------------- /nvim/lua/plugins/lsp-status.lua: -------------------------------------------------------------------------------- 1 | return {} 2 | -- TODO: Replace with fidget.nvim or other. 3 | -- return { 4 | -- "nvim-lua/lsp-status.nvim", 5 | -- init = function () 6 | -- local signs = { 7 | -- { name = "DiagnosticSignError", text = "🔥" }, 8 | -- { name = "DiagnosticSignWarn", text = "🚧" }, 9 | -- { name = "DiagnosticSignHint", text = "👷" }, 10 | -- { name = "DiagnosticSignInfo", text = "🙋" }, 11 | -- } 12 | 13 | -- for _, sign in ipairs(signs) do 14 | -- vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) 15 | -- end 16 | 17 | -- local lsp_status = require('lsp-status') 18 | -- lsp_status.config({ 19 | -- kind_labels = vim.g.completion_customize_lsp_label, 20 | -- current_function = false, 21 | -- status_symbol = '', 22 | -- indicator_errors = '🔥 ', 23 | -- indicator_warnings = '🚧 ', 24 | -- indicator_info = '🙋 ', 25 | -- indicator_hint = '👷 ', 26 | -- indicator_ok = '✅', 27 | -- spinner_frames = { '⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷' }, 28 | -- }) 29 | -- lsp_status.register_progress() 30 | -- end 31 | -- } 32 | -------------------------------------------------------------------------------- /nvim/lua/snippets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Matsuuu's snippets", 3 | "engines": { 4 | "vscode": "^1.11.0" 5 | }, 6 | "contributes": { 7 | "snippets": [ 8 | { 9 | "language": [ 10 | "html", 11 | "jade", 12 | "pug", 13 | "eruby", 14 | "javascriptreact", 15 | "htmldjango", 16 | "astro", 17 | "blade" 18 | ], 19 | "path": "./html.json" 20 | }, 21 | { 22 | "language": [ 23 | "css", 24 | "scss", 25 | "sass", 26 | "less", 27 | "stylus" 28 | ], 29 | "path": "./css.json" 30 | }, 31 | { 32 | "language": [ 33 | "javascript", 34 | "javascriptreact", 35 | "vue", 36 | "svelte" 37 | ], 38 | "path": "./javascript.json" 39 | }, 40 | { 41 | "language": "jsdoc", 42 | "path": "./jsdoc.json" 43 | } 44 | ] 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /nvim/lua/config/lazy.lua: -------------------------------------------------------------------------------- 1 | -- Bootstrap lazy.nvim 2 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 3 | if not (vim.uv or vim.loop).fs_stat(lazypath) then 4 | local lazyrepo = "https://github.com/folke/lazy.nvim.git" 5 | local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) 6 | if vim.v.shell_error ~= 0 then 7 | vim.api.nvim_echo({ 8 | { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, 9 | { out, "WarningMsg" }, 10 | { "\nPress any key to exit..." }, 11 | }, true, {}) 12 | vim.fn.getchar() 13 | os.exit(1) 14 | end 15 | end 16 | vim.opt.rtp:prepend(lazypath) 17 | 18 | -- Make sure to setup `mapleader` and `maplocalleader` before 19 | -- loading lazy.nvim so that mappings are correct. 20 | -- This is also a good place to setup other settings (vim.opt) 21 | vim.g.mapleader = " " 22 | vim.g.maplocalleader = "\\" 23 | 24 | -- Setup lazy.nvim 25 | require("lazy").setup({ 26 | spec = { 27 | -- import your plugins 28 | { import = "plugins" }, 29 | }, 30 | -- Configure any other settings here. See the documentation for more details. 31 | -- colorscheme that will be used when installing plugins. 32 | install = { colorscheme = { "habamax" } }, 33 | -- automatically check for plugin updates 34 | checker = { enabled = false }, 35 | }) 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dotfiles 🎁 2 | 3 | > It didn’t start as a project. 4 | > More like a quiet accumulation. A need to see clearly, to move deliberately, to not depend on what couldn’t be trusted. 5 | > 6 | > So the system was shaped — over time, across late nights and long stretches of silence. Some tools were written out of necessity. Others were pulled in from elsewhere, selected with care, kept because they earned their place. Nothing ornamental, nothing adopted blindly. The goal was always clarity. 7 | > 8 | > A soft pink glow settled over it all. Not decorative — just part of the atmosphere. Something gentle in the corner of the eye, a reminder of focus, of presence. Windows opened like breath. Processes shifted without ceremony. No friction. Just momentum. 9 | > 10 | > It worked, mostly, because it had to. A space to build in, think in, teach from — even if the teaching wasn’t formal. There were people who asked how it was done. When it made sense to share, it was shared. Quietly. Without performance. 11 | > 12 | > It wasn’t about being followed. 13 | > Just: this is how it was made. 14 | > If it helps, take what you need. 15 | > 16 | > And then — back to the work. 17 | 18 | 19 | ### Tools 20 | 21 | - NeoVim 22 | - Bat 23 | - Fzf 24 | - Alacritty 25 | - Ulauncher 26 | - Picom 27 | - Tmux 28 | - i3 29 | 30 | ### Example 31 | 32 | ![Pic](unixpr_3.png) 33 | -------------------------------------------------------------------------------- /nvim/lua/config/opts.lua: -------------------------------------------------------------------------------- 1 | vim.g.mapleader = " " 2 | vim.g.maplocalleader = " " 3 | 4 | vim.opt.mouse = "a" 5 | vim.opt.nu = true 6 | vim.opt.relativenumber = true 7 | vim.opt.signcolumn = "yes" 8 | 9 | vim.opt.hidden = true 10 | vim.opt.errorbells = false 11 | 12 | vim.opt.tabstop = 4 13 | vim.opt.softtabstop = 4 14 | vim.opt.shiftwidth = 4 15 | vim.opt.expandtab = true 16 | 17 | vim.opt.smartindent = true 18 | 19 | vim.opt.wrap = false 20 | 21 | vim.opt.swapfile = false 22 | vim.opt.backup = false 23 | vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" 24 | vim.opt.undofile = true 25 | 26 | vim.opt.hlsearch = false 27 | vim.opt.incsearch = true 28 | 29 | vim.opt.termguicolors = true 30 | 31 | vim.opt.scrolloff = 8 32 | vim.opt.cursorline = true 33 | 34 | -- Give more space for displaying messages. 35 | vim.opt.cmdheight = 1 36 | 37 | -- Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable 38 | -- delays and poor user experience. 39 | vim.opt.updatetime = 50 40 | 41 | -- For obsidian 42 | -- vim.opt_local.conceallevel = 2 43 | 44 | -- Don't pass messages to |ins-completion-menu|. 45 | vim.opt.shortmess:append("c") 46 | 47 | -- Autoread file changes 48 | vim.o.autoread = true 49 | vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "CursorHoldI", "FocusGained" }, { 50 | command = "if mode() != 'c' | checktime | endif", 51 | pattern = { "*" }, 52 | }) 53 | -------------------------------------------------------------------------------- /shell/.zshrc: -------------------------------------------------------------------------------- 1 | ############################################################# 2 | # ZSH ONLY 3 | ############################################################# 4 | 5 | # Load shared config 6 | [ -f ~/.shell_common ] && source ~/.shell_common 7 | [ -f ~/.zsh_setup ] && source ~/.zsh_setup 8 | 9 | # Also enable brew if on mac 10 | if [[ -f "/opt/homebrew/bin/brew" ]] then 11 | eval "$(/opt/homebrew/bin/brew shellenv)" 12 | fi 13 | 14 | ############################################################# 15 | # Enable completion system 16 | ############################################################# 17 | autoload -Uz compinit 18 | compinit 19 | 20 | bindkey -e 21 | 22 | bindkey "^[[1;5D" backward-word 23 | bindkey "^[[1;5C" forward-word 24 | 25 | 26 | ############################################################# 27 | # Zsh history configuration (bash equivalents) 28 | ############################################################# 29 | setopt HIST_IGNORE_SPACE 30 | setopt HIST_IGNORE_DUPS 31 | setopt SHARE_HISTORY 32 | HISTSIZE=5000 33 | SAVEHIST=10000 34 | 35 | ############################################################# 36 | # Prompt (zsh-native) 37 | ############################################################# 38 | PROMPT='%F{208}%n%f【=◈ ◡ ◈ =】%F{87}%m%f:%F{216}%~%f' 39 | 40 | if [[ "$SESSION_TYPE" != "local" ]]; then 41 | PROMPT="$PROMPT %F{155}[${SESSION_TYPE}]%f" 42 | fi 43 | 44 | PROMPT="$PROMPT " 45 | 46 | ############################################################# 47 | # FZF zsh init 48 | ############################################################# 49 | if command -v fzf &> /dev/null; then 50 | eval "$(fzf --zsh)" 51 | fi 52 | 53 | -------------------------------------------------------------------------------- /nvim/lua/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("n", "+", ":vertical resize +5") 2 | vim.keymap.set("n", "-", ":vertical resize -5") 3 | 4 | vim.keymap.set("n", "bn", ":bn") 5 | vim.keymap.set("n", "bp", ":bp") 6 | vim.keymap.set("n", "bh", ":bh") 7 | vim.keymap.set("n", "bl", ":bl") 8 | 9 | -- Undo breakpoints 10 | vim.keymap.set("i", ",", ",u") 11 | vim.keymap.set("i", ".", ".u") 12 | vim.keymap.set("i", "!", "!u") 13 | vim.keymap.set("i", "?", "?u") 14 | vim.keymap.set("i", ":", ":u") 15 | vim.keymap.set("i", ";", ";u") 16 | 17 | vim.keymap.set("n", "", "zz") 18 | vim.keymap.set("n", "", "zz") 19 | vim.keymap.set("n", "n", "nzzzv") 20 | vim.keymap.set("n", "N", "Nzzzv") 21 | 22 | vim.keymap.set("n", "pf", "") 23 | 24 | vim.keymap.set("n", "'", "%") 25 | vim.keymap.set("v", "'", "%") 26 | 27 | vim.keymap.set("n", "rc", ":source ~/.config/nvim/init.lua") 28 | 29 | vim.keymap.set("n", "", vim.lsp.buf.code_action) 30 | -- Typescript action 31 | vim.keymap.set("n", "ta", ":LspTypescriptSourceAction") 32 | 33 | vim.keymap.set("n", "gd", vim.lsp.buf.definition) 34 | vim.keymap.set("n", "gy", vim.lsp.buf.type_definition) 35 | vim.keymap.set("n", "K", vim.lsp.buf.hover) 36 | vim.keymap.set("i", "", vim.lsp.buf.signature_help) 37 | vim.keymap.set("n", "rn", vim.lsp.buf.rename) 38 | vim.keymap.set("n", "ee", vim.diagnostic.open_float) 39 | vim.keymap.set("n", "se", function() 40 | vim.diagnostic.goto_next({ wrap = true }) 41 | end) 42 | 43 | vim.keymap.set("n", "y", '"+y') 44 | vim.keymap.set("v", "y", '"+y') 45 | 46 | vim.keymap.del("n", "grn") 47 | vim.keymap.del("n", "gra") 48 | vim.keymap.del("n", "gri") 49 | vim.keymap.del("n", "grr") 50 | -------------------------------------------------------------------------------- /nvim/lua/plugins/lsp-config.lua: -------------------------------------------------------------------------------- 1 | vim.g.diagnostic_enable_virtual_text = 1 2 | vim.g.diagnostic_virtual_text_prefix = " " 3 | 4 | return { 5 | "neovim/nvim-lspconfig", 6 | dependencies = { "hrsh7th/cmp-nvim-lsp" }, 7 | config = function() 8 | local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) 9 | 10 | local on_attach_vim = function(client) end 11 | 12 | local lspconfig = require("lspconfig") 13 | 14 | vim.lsp.enable("ts_ls") 15 | vim.lsp.enable("jsonls") 16 | vim.lsp.enable("html") 17 | vim.lsp.enable("cssls") 18 | vim.lsp.enable("clojure_lsp") 19 | vim.lsp.enable("gopls") 20 | 21 | vim.lsp.config("lua_ls", { 22 | settings = { 23 | Lua = { 24 | diagnostics = { 25 | globals = { "vim" }, 26 | }, 27 | workspace = { 28 | library = { 29 | [vim.fn.expand("$VIMRUNTIME/lua")] = true, 30 | [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true, 31 | }, 32 | }, 33 | }, 34 | }, 35 | }) 36 | vim.lsp.enable("lua_ls") 37 | vim.lsp.enable("rust_analyzer") 38 | vim.lsp.enable("pyright") 39 | vim.lsp.enable("tailwindcss") 40 | 41 | vim.lsp.config("sqls", { 42 | settings = { 43 | sqls = { 44 | connections = { 45 | { 46 | driver = "postgresql", 47 | dataSourceName = "host=127.0.0.1 port=5432 user=test password=test dbname=test_db sslmode=disable" 48 | } 49 | } 50 | } 51 | } 52 | }) 53 | vim.lsp.enable("sqls") 54 | vim.lsp.enable("astro") 55 | vim.lsp.enable("wc_language_server") 56 | 57 | 58 | end, 59 | } 60 | -------------------------------------------------------------------------------- /nvim/lua/plugins/oil.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "stevearc/oil.nvim", 3 | ---@module "oil" 4 | ---@type oil.SetupOpts 5 | opts = {}, 6 | dependencies = { 7 | -- { "echanovski/mini.icons", opts = {} } 8 | }, 9 | lazy = false, 10 | config = function() 11 | local oil = require("oil") 12 | oil.setup({ 13 | columns = { "icon" }, 14 | watch_for_changes = true, 15 | view_options = { 16 | show_hidden = true, 17 | }, 18 | 19 | -- keymaps 20 | keymaps = { 21 | -- [''] = oil.select({ close = true, tab = true }), 22 | }, 23 | 24 | -- Configuration for the file preview window 25 | preview_win = { 26 | -- Whether the preview window is automatically updated when the cursor is moved 27 | update_on_cursor_moved = true, 28 | -- How to open the preview window "load"|"scratch"|"fast_scratch" 29 | preview_method = "fast_scratch", 30 | -- A function that returns true to disable preview on a file e.g. to avoid lag 31 | disable_preview = function(filename) 32 | return false 33 | end, 34 | -- Window-local options to use for preview window buffers 35 | win_options = {}, 36 | }, 37 | }) 38 | 39 | vim.api.nvim_create_autocmd("User", { 40 | pattern = "OilEnter", 41 | callback = vim.schedule_wrap(function(args) 42 | local oil = require("oil") 43 | if vim.api.nvim_get_current_buf() == args.data.buf and oil.get_cursor_entry() then 44 | oil.open_preview() 45 | end 46 | end), 47 | }) 48 | 49 | local oil = require("oil") 50 | 51 | vim.keymap.set("n", "-", function () 52 | oil.open(nil, { 53 | preview = { 54 | vertical = true 55 | } 56 | }) 57 | end) 58 | end, 59 | } 60 | -------------------------------------------------------------------------------- /nvim/lua/snippets/webdev.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local t = ls.text_node 4 | local i = ls.insert_node 5 | local f = ls.function_node 6 | local extras = require("luasnip.extras") 7 | local rep = extras.rep 8 | local fmt = require("luasnip.extras.fmt").fmt 9 | 10 | local function to_pascal_case(_, snip) 11 | local filename = vim.fn.expand("%:t:r") 12 | -- Convert kebab-case to PascalCase 13 | local pascal = filename:gsub("(%-%a)", function(match) 14 | return match:sub(2, 2):upper() 15 | end) 16 | -- Ensure first letter is uppercase 17 | pascal = pascal:gsub("^%a", string.upper) 18 | return pascal 19 | end 20 | 21 | local function to_custom_element(_, snip) 22 | local filename = vim.fn.expand("%:t:r") 23 | return filename 24 | end 25 | 26 | 27 | ls.add_snippets("javascript", { 28 | s("LitElemTW", { 29 | t('import { html, LitElement } from "lit";'), t({"", ""}), 30 | t('import { customElement, property } from "lit/decorators.js";'), t({"", ""}), 31 | t('import { withTailwind } from "@shared/css/tailwind";'), t({"", "", ""}), 32 | t('@customElement("'), f(to_custom_element), t('")'), t({"", ""}), 33 | t('@withTailwind'), t({"", ""}), 34 | t('export class '), f(to_pascal_case), t(' extends LitElement {'), t({"", " "}), 35 | t('@property({ type: String })'), t({"", " "}), 36 | t('name = "'), t("World"), t('";'), t({"", "", " "}), 37 | t('render() {'), t({"", " "}), 38 | t('return html`

Hello ${this.name}

`;'), t({"", " "}), 39 | t('}'), t({"", "}"}), 40 | }) 41 | }) 42 | 43 | ls.add_snippets("typescript", ls.get_snippets("javascript")) 44 | ls.add_snippets("typescriptreact", ls.get_snippets("javascript")) 45 | ls.add_snippets("javascriptreact", ls.get_snippets("javascript")) 46 | -------------------------------------------------------------------------------- /shell/.bashrc: -------------------------------------------------------------------------------- 1 | ############################################################# 2 | # BASH ONLY 3 | ############################################################# 4 | 5 | # Load shared config 6 | [ -f ~/.shell_common ] && source ~/.shell_common 7 | 8 | ############################################################# 9 | # Bash History 10 | ############################################################# 11 | HISTCONTROL=ignoreboth 12 | HISTSIZE=5000 13 | HISTFILESIZE=10000 14 | 15 | shopt -s histappend 16 | shopt -s checkwinsize 17 | 18 | ############################################################# 19 | # Start bash completion 20 | ############################################################# 21 | if ! shopt -oq posix; then 22 | if [ -f /usr/share/bash-completion/bash_completion ]; then 23 | . /usr/share/bash-completion/bash_completion 24 | elif [ -f /etc/bash_completion ]; then 25 | . /etc/bash_completion 26 | fi 27 | fi 28 | 29 | ############################################################# 30 | # Bash prompt (ANSI safe) 31 | ############################################################# 32 | PS1='${debian_chroot:+($debian_chroot)}\[\033[38;5;208m\]\u\[$(tput sgr0)\]【=◈ ◡ ◈ =】\[$(tput sgr0)\]\[\033[38;5;87m\]\h\[$(tput sgr0)\]:\[$(tput sgr0)\]\[\033[38;5;216m\]\w\[$(tput sgr0)\]' 33 | 34 | if [ "$SESSION_TYPE" != "local" ]; then 35 | PS1="$PS1 \[$(tput setaf 155)\]\[[$SESSION_TYPE]\]\[$(tput sgr0)\]" 36 | fi 37 | 38 | PS1="$PS1$ " 39 | 40 | ############################################################# 41 | # Bash-only readline tweaks 42 | ############################################################# 43 | bind 'set show-all-if-ambiguous on' 44 | 45 | ############################################################# 46 | # fzf bash initialization 47 | ############################################################# 48 | [ -f ~/.fzf.bash ] && source ~/.fzf.bash 49 | eval "$(fzf --bash)" 50 | 51 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | #Reload conf by Ctrl + B, then write :source-file ~/.tmux.conf 2 | set-option -g default-shell "/bin/zsh" 3 | 4 | # For images 5 | set -gq allow-passthrough on 6 | 7 | # Status 8 | set -g message-style bg='#202330',fg='#8be9fd' 9 | set -g status-style bg='#202330',fg='#4cc4c6' 10 | set -g status-interval 1 11 | 12 | set -g status-left '' 13 | set -g status-right '' 14 | 15 | set-window-option -g window-status-style fg='#bd93f9',bg=default 16 | set-window-option -g window-status-current-style fg='#ff79c6',bg='#282a36' 17 | 18 | set -g status-justify centre 19 | 20 | # Status end 21 | 22 | set -g prefix C-b 23 | 24 | set -g base-index 1 25 | set-option -g mouse on 26 | set -g set-clipboard on 27 | set -g history-limit 10000 28 | 29 | #set -g default-terminal "xterm-256color" 30 | #set -g terminal-overrides "xterm-256color" 31 | #set -ga terminal-overrides ",xterm-256color:Tc" 32 | set -g default-terminal "tmux-256color" 33 | set -g terminal-overrides "tmux-256color" 34 | set -ga terminal-overrides ",tmux-256color:Tc" 35 | 36 | 37 | # Keybinds 38 | 39 | # Movement and resize vim controls 40 | bind -r C-k resize-pane -U 41 | bind -r C-j resize-pane -D 42 | bind -r C-h resize-pane -L 43 | bind -r C-l resize-pane -R 44 | 45 | bind -r k select-pane -U 46 | bind -r j select-pane -D 47 | bind -r h select-pane -L 48 | bind -r l select-pane -R 49 | 50 | # Rebind splits 51 | bind v split-window -h -c '#{pane_current_path}' 52 | bind b split-window -v -c '#{pane_current_path}' 53 | 54 | unbind Up 55 | unbind Down 56 | unbind Left 57 | unbind Right 58 | 59 | unbind C-Up 60 | unbind C-Down 61 | unbind C-Left 62 | unbind C-Right 63 | 64 | # Rebind rename to R 65 | bind-key r command-prompt -I "#W" "rename-window '%%'" 66 | 67 | # Plugins 68 | set -g @plugin 'tmux-plugins/tmux-resurrect' 69 | set -g @plugin 'tmux-plugins/tmux-continuum' 70 | 71 | set -g @continuum-restore 'on' 72 | 73 | # Tmux package manager 74 | run '~/.tmux/plugins/tpm/tpm' 75 | -------------------------------------------------------------------------------- /.npm_completion: -------------------------------------------------------------------------------- 1 | ###-begin-npm-completion-### 2 | # 3 | # npm command completion script 4 | # 5 | # Installation: npm completion >> ~/.bashrc (or ~/.zshrc) 6 | # Or, maybe: npm completion > /usr/local/etc/bash_completion.d/npm 7 | # 8 | 9 | if type complete &>/dev/null; then 10 | _npm_completion () { 11 | local words cword 12 | if type _get_comp_words_by_ref &>/dev/null; then 13 | _get_comp_words_by_ref -n = -n @ -n : -w words -i cword 14 | else 15 | cword="$COMP_CWORD" 16 | words=("${COMP_WORDS[@]}") 17 | fi 18 | 19 | local si="$IFS" 20 | IFS=$'\n' COMPREPLY=($(COMP_CWORD="$cword" \ 21 | COMP_LINE="$COMP_LINE" \ 22 | COMP_POINT="$COMP_POINT" \ 23 | npm completion -- "${words[@]}" \ 24 | 2>/dev/null)) || return $? 25 | IFS="$si" 26 | if type __ltrim_colon_completions &>/dev/null; then 27 | __ltrim_colon_completions "${words[cword]}" 28 | fi 29 | } 30 | complete -o default -F _npm_completion npm 31 | elif type compdef &>/dev/null; then 32 | _npm_completion() { 33 | local si=$IFS 34 | compadd -- $(COMP_CWORD=$((CURRENT-1)) \ 35 | COMP_LINE=$BUFFER \ 36 | COMP_POINT=0 \ 37 | npm completion -- "${words[@]}" \ 38 | 2>/dev/null) 39 | IFS=$si 40 | } 41 | compdef _npm_completion npm 42 | elif type compctl &>/dev/null; then 43 | _npm_completion () { 44 | local cword line point words si 45 | read -Ac words 46 | read -cn cword 47 | let cword-=1 48 | read -l line 49 | read -ln point 50 | si="$IFS" 51 | IFS=$'\n' reply=($(COMP_CWORD="$cword" \ 52 | COMP_LINE="$line" \ 53 | COMP_POINT="$point" \ 54 | npm completion -- "${words[@]}" \ 55 | 2>/dev/null)) || return $? 56 | IFS="$si" 57 | } 58 | compctl -K _npm_completion npm 59 | fi 60 | ###-end-npm-completion-### 61 | -------------------------------------------------------------------------------- /eww/scripts/go/workspaces/go.sum: -------------------------------------------------------------------------------- 1 | github.com/BurntSushi/xgb v0.0.0-20210121224620-deaf085860bc h1:7D+Bh06CRPCJO3gr2F7h1sriovOZ8BMhca2Rg85c2nk= 2 | github.com/BurntSushi/xgb v0.0.0-20210121224620-deaf085860bc/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 3 | github.com/BurntSushi/xgbutil v0.0.0-20190907113008-ad855c713046 h1:O/r2Sj+8QcMF7V5IcmiE2sMFV2q3J47BEirxbXJAdzA= 4 | github.com/BurntSushi/xgbutil v0.0.0-20190907113008-ad855c713046/go.mod h1:uw9h2sd4WWHOPdJ13MQpwK5qYWKYDumDqxWWIknEQ+k= 5 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 6 | github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= 7 | github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= 8 | github.com/joshuarubin/go-sway v1.2.0 h1:t3eqW504//uj9PDwFf0+IVfkD+WoOGaDX5gYIe0BHyM= 9 | github.com/joshuarubin/go-sway v1.2.0/go.mod h1:qcDd6f25vJ0++wICwA1BainIcRC67p2Mb4lsrZ0k3/k= 10 | github.com/joshuarubin/lifecycle v1.0.0 h1:N/lPEC8f+dBZ1Tn99vShqp36LwB+LI7XNAiNadZeLUQ= 11 | github.com/joshuarubin/lifecycle v1.0.0/go.mod h1:sRy++ATvR9Ee21tkRdFkQeywAWvDsue66V70K0Dnl54= 12 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 13 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 14 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 15 | go.i3wm.org/i3/v4 v4.24.0 h1:sBVc+EwxO1UMG7SqYGdGmS4XkMagyHA2y2tcs548fTw= 16 | go.i3wm.org/i3/v4 v4.24.0/go.mod h1:Sdg8TVasZI6E7pc6aV7jxwzN4sl/8MUUs5W2+iyvXyo= 17 | go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= 18 | go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 19 | go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= 20 | go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= 21 | golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 22 | golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= 23 | golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= 24 | -------------------------------------------------------------------------------- /nvim/lua/plugins/node-repl/repl.js: -------------------------------------------------------------------------------- 1 | import { LocalStorage } from "node-localstorage"; 2 | import * as readline from "readline"; 3 | import * as vm from "vm"; 4 | 5 | const rl = readline.createInterface({ 6 | input: process.stdin, 7 | output: process.stdout, 8 | }); 9 | 10 | let context = createContext(); 11 | 12 | function createContext(existing) { 13 | return vm.createContext({ 14 | console, 15 | process, 16 | // localStorage: new LocalStorage("./cache/localstorage"), 17 | ...existing, 18 | }); 19 | } 20 | 21 | let debouncedHandler = debounce(handleInput, 100); 22 | let debouncedContent = ""; 23 | 24 | rl.on("line", input => { 25 | // TODO: We need to send some command first as we might want to have different kinds 26 | // of operations coming in here. e.g. Clear repl and run 27 | if (debouncedContent.length > 0) { 28 | debouncedContent += "\n"; 29 | } 30 | debouncedContent += input; 31 | debouncedHandler(debouncedContent); 32 | 33 | if (input.toLowerCase() === "__node_repl_exit") { 34 | console.log("Exiting"); 35 | rl.close(); 36 | } 37 | }); 38 | 39 | function handleInput(input, reRunCount = 0) { 40 | try { 41 | const result = vm.runInContext(input, context); 42 | if (result !== undefined) { 43 | result.split("\n").forEach(line => console.log(line)); 44 | } 45 | } catch (ex) { 46 | const declarationErrorMatch = /Identifier '(.*)' has already been declared/.exec(ex?.message); 47 | if (declarationErrorMatch && reRunCount < 5) { 48 | const variable = declarationErrorMatch[1]; 49 | 50 | delete context[variable]; 51 | context = createContext(context); 52 | 53 | handleInput(input, reRunCount + 1); 54 | return; 55 | } 56 | console.log("ERROR!"); 57 | console.log(""); 58 | ex?.message?.split("\n").forEach(line => console.log(line)); 59 | } 60 | debouncedContent = ""; 61 | } 62 | 63 | /** 64 | * @param {Function} callback 65 | * @param {number} wait 66 | */ 67 | export function debounce(callback, wait) { 68 | let timeoutId = null; 69 | return (...args) => { 70 | clearTimeout(timeoutId); 71 | timeoutId = setTimeout(() => { 72 | callback.apply(null, args); 73 | }, wait); 74 | }; 75 | } 76 | -------------------------------------------------------------------------------- /nvim/lua/plugins/node-repl/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "virta", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "virta", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "node-localstorage": "^3.0.5" 13 | }, 14 | "bin": { 15 | "virta": "cli.js" 16 | }, 17 | "devDependencies": { 18 | "@types/node": "^22.10.3" 19 | } 20 | }, 21 | "node_modules/@types/node": { 22 | "version": "22.10.3", 23 | "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.3.tgz", 24 | "integrity": "sha512-DifAyw4BkrufCILvD3ucnuN8eydUfc/C1GlyrnI+LK6543w5/L3VeVgf05o3B4fqSXP1dKYLOZsKfutpxPzZrw==", 25 | "dev": true, 26 | "dependencies": { 27 | "undici-types": "~6.20.0" 28 | } 29 | }, 30 | "node_modules/imurmurhash": { 31 | "version": "0.1.4", 32 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 33 | "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", 34 | "license": "MIT", 35 | "engines": { 36 | "node": ">=0.8.19" 37 | } 38 | }, 39 | "node_modules/node-localstorage": { 40 | "version": "3.0.5", 41 | "resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-3.0.5.tgz", 42 | "integrity": "sha512-GCwtK33iwVXboZWYcqQHu3aRvXEBwmPkAMRBLeaX86ufhqslyUkLGsi4aW3INEfdQYpUB5M9qtYf3eHvAk2VBg==", 43 | "license": "MIT", 44 | "dependencies": { 45 | "write-file-atomic": "^5.0.1" 46 | }, 47 | "engines": { 48 | "node": ">=0.12" 49 | } 50 | }, 51 | "node_modules/signal-exit": { 52 | "version": "4.1.0", 53 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", 54 | "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", 55 | "license": "ISC", 56 | "engines": { 57 | "node": ">=14" 58 | }, 59 | "funding": { 60 | "url": "https://github.com/sponsors/isaacs" 61 | } 62 | }, 63 | "node_modules/undici-types": { 64 | "version": "6.20.0", 65 | "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", 66 | "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", 67 | "dev": true 68 | }, 69 | "node_modules/write-file-atomic": { 70 | "version": "5.0.1", 71 | "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", 72 | "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", 73 | "license": "ISC", 74 | "dependencies": { 75 | "imurmurhash": "^0.1.4", 76 | "signal-exit": "^4.0.1" 77 | }, 78 | "engines": { 79 | "node": "^14.17.0 || ^16.13.0 || >=18.0.0" 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /nvim/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" }, 3 | "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, 4 | "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, 5 | "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, 6 | "cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" }, 7 | "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, 8 | "conform.nvim": { "branch": "master", "commit": "9b8fa5e0b78168f68bee9bf886dc20f287c61e02" }, 9 | "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, 10 | "fidget.nvim": { "branch": "main", "commit": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a" }, 11 | "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, 12 | "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, 13 | "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, 14 | "nvim-autopairs": { "branch": "master", "commit": "d9e44e54384e5b0f3536339c65484f2e41b528e3" }, 15 | "nvim-cmp": { "branch": "main", "commit": "d97d85e01339f01b842e6ec1502f639b080cb0fc" }, 16 | "nvim-colorizer.lua": { "branch": "master", "commit": "81e676d3203c9eb6e4c0ccf1eba1679296ef923f" }, 17 | "nvim-dap": { "branch": "master", "commit": "5860c7c501eb428d3137ee22c522828d20cca0b3" }, 18 | "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, 19 | "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, 20 | "nvim-jdtls": { "branch": "master", "commit": "f73731b543f5971e0da9665eb1d7ceffe1fde71f" }, 21 | "nvim-lspconfig": { "branch": "master", "commit": "ad95655ec5d13ff7c728d731eb9fd39f34395a03" }, 22 | "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, 23 | "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, 24 | "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, 25 | "oil.nvim": { "branch": "master", "commit": "cbcb3f997f6f261c577b943ec94e4ef55108dd95" }, 26 | "pinkmare": { "branch": "main", "commit": "542b98d0788585bd693fd02181aecf87497c41c0" }, 27 | "render-markdown.nvim": { "branch": "main", "commit": "686af1e08c47a72e1f969ba2b40a424446d882cf" }, 28 | "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, 29 | "vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" }, 30 | "vim-dadbod": { "branch": "master", "commit": "e95afed23712f969f83b4857a24cf9d59114c2e6" }, 31 | "vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" }, 32 | "vim-dadbod-ui": { "branch": "master", "commit": "48c4f271da13d380592f4907e2d1d5558044e4e5" }, 33 | "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, 34 | "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, 35 | "yuck.vim": { "branch": "master", "commit": "9b5e0370f70cc30383e1dabd6c215475915fe5c3" } 36 | } 37 | -------------------------------------------------------------------------------- /nvim/lua/plugins/nvim-dap.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "mfussenegger/nvim-dap", 4 | dependencies = { 5 | "rcarriga/nvim-dap-ui", 6 | "theHamsta/nvim-dap-virtual-text", 7 | "nvim-neotest/nvim-nio", 8 | }, 9 | config = function() 10 | local dap = require("dap") 11 | local ui = require("dapui") 12 | 13 | require("dapui").setup({ 14 | layouts = { 15 | { 16 | elements = { 17 | { 18 | id = "scopes", 19 | size = 0.25, 20 | }, 21 | { 22 | id = "breakpoints", 23 | size = 0.25, 24 | }, 25 | { 26 | id = "stacks", 27 | size = 0.25, 28 | }, 29 | }, 30 | position = "left", 31 | size = 40, 32 | }, 33 | { 34 | elements = { 35 | { 36 | id = "repl", 37 | size = 1, 38 | }, 39 | }, 40 | position = "bottom", 41 | size = 10, 42 | }, 43 | }, 44 | }) 45 | 46 | require("nvim-dap-virtual-text").setup({ 47 | -- This just tries to mitigate the chance that I leak tokens here. Probably won't stop it from happening... 48 | display_callback = function(variable) 49 | local name = string.lower(variable.name) 50 | local value = string.lower(variable.value) 51 | if name:match("secret") or name:match("api") or value:match("secret") or value:match("api") then 52 | return "*****" 53 | end 54 | 55 | if #variable.value > 15 then 56 | return " " .. string.sub(variable.value, 1, 15) .. "... " 57 | end 58 | 59 | return " " .. variable.value 60 | end, 61 | }) 62 | 63 | dap.configurations.java = { 64 | { 65 | type = "java", 66 | request = "attach", 67 | name = "Debug (Attach) - Remote", 68 | hostName = "localhost", 69 | port = "5005", 70 | }, 71 | } 72 | 73 | local sign = vim.fn.sign_define 74 | 75 | sign("DapBreakpoint", { text = "🔴", texthl = "DapBreakpoint", linehl = "", numhl = "" }) 76 | sign( 77 | "DapBreakpointCondition", 78 | { text = "🔴", texthl = "DapBreakpointCondition", linehl = "", numhl = "" } 79 | ) 80 | sign("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = "" }) 81 | sign("DapStopped", { text = "🔴", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }) 82 | 83 | vim.keymap.set("n", "bb", dap.toggle_breakpoint) 84 | vim.keymap.set("n", "gb", dap.run_to_cursor) 85 | vim.keymap.set("n", "dt", function() 86 | ui.toggle({ reset = true }) 87 | end) 88 | 89 | vim.keymap.set("n", "?", function() 90 | require("dapui").eval(nil, { enter = true }) 91 | end) 92 | 93 | vim.keymap.set("n", "", dap.continue) 94 | vim.keymap.set("n", "", dap.step_into) 95 | vim.keymap.set("n", "", dap.step_over) 96 | vim.keymap.set("n", "", dap.step_out) 97 | vim.keymap.set("n", "", dap.restart) 98 | 99 | dap.listeners.before.attach.dapui_config = function() 100 | ui.open() 101 | end 102 | dap.listeners.before.launch.dapui_config = function() 103 | ui.open() 104 | end 105 | dap.listeners.before.event_terminated.dapui_config = function() 106 | ui.close() 107 | end 108 | dap.listeners.before.event_exited.dapui_config = function() 109 | ui.close() 110 | end 111 | end, 112 | }, 113 | } 114 | -------------------------------------------------------------------------------- /nvim/lua/plugins/nvim-cmp.lua: -------------------------------------------------------------------------------- 1 | vim.o.completeopt = "menu,menuone,noselect" 2 | 3 | kind_icons = { 4 | Text = "", 5 | Method = "", 6 | Function = "", 7 | Constructor = "", 8 | Field = "", 9 | Variable = "", 10 | Class = "ﴯ", 11 | Interface = "", 12 | Module = "", 13 | Property = "ﰠ", 14 | Unit = "", 15 | Value = "", 16 | Enum = "", 17 | Keyword = "", 18 | Snippet = "", 19 | Color = "", 20 | File = "", 21 | Reference = "", 22 | Folder = "", 23 | EnumMember = "", 24 | Constant = "", 25 | Struct = "", 26 | Event = "", 27 | Operator = "", 28 | TypeParameter = "", 29 | } 30 | 31 | return { 32 | "hrsh7th/nvim-cmp", 33 | dependencies = { 34 | "saadparwaiz1/cmp_luasnip", 35 | "hrsh7th/cmp-nvim-lsp", 36 | "hrsh7th/cmp-cmdline", 37 | "hrsh7th/cmp-buffer", 38 | "hrsh7th/cmp-nvim-lua", 39 | }, 40 | opts = function(_, opts) 41 | local cmp = require("cmp") 42 | local luasnip = require("luasnip") 43 | 44 | opts.sources = cmp.config.sources({ 45 | { name = "nvim_lsp" }, 46 | { name = "luasnip" }, 47 | { name = "buffer" }, 48 | { name = "nvim_lua" }, 49 | { name = "cmp_dadbod" }, 50 | }) 51 | 52 | opts.snippet = { 53 | expand = function(args) 54 | require("luasnip").lsp_expand(args.body) 55 | end, 56 | } 57 | table.insert(opts.sources, { name = "luasnip" }) 58 | 59 | opts.formatting = { 60 | fields = { "abbr", "kind", "menu" }, 61 | format = function(entry, vim_item) 62 | -- Kind icons 63 | vim_item.kind = string.format("%s %s", kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind 64 | return vim_item 65 | end, 66 | } 67 | opts.window = { 68 | completion = cmp.config.window.bordered(), 69 | documentation = cmp.config.window.bordered(), 70 | } 71 | opts.window.completion.scrollbar = true 72 | 73 | opts.mapping = { 74 | [""] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), 75 | [""] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), 76 | [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), 77 | [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. 78 | [""] = cmp.mapping({ 79 | i = cmp.mapping.abort(), 80 | c = cmp.mapping.close(), 81 | }), 82 | [""] = cmp.mapping.select_prev_item(), 83 | [""] = cmp.mapping.select_next_item(), 84 | [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. 85 | [""] = cmp.mapping(function(fallback) 86 | if cmp.visible() then 87 | cmp.select_next_item() 88 | elseif luasnip.locally_jumpable(1) then 89 | luasnip.jump(1) 90 | else 91 | fallback() 92 | end 93 | end, { "i", "s" }), 94 | 95 | [""] = cmp.mapping(function(fallback) 96 | if cmp.visible() then 97 | cmp.select_prev_item() 98 | elseif luasnip.jumpable(-1) then 99 | luasnip.jump(-1) 100 | else 101 | fallback() 102 | end 103 | end, { "i", "s" }), 104 | } 105 | 106 | -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). 107 | cmp.setup.cmdline({ "/", "?" }, { 108 | sources = { 109 | { name = "buffer" }, 110 | }, 111 | }) 112 | 113 | -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). 114 | cmp.setup.cmdline(":", { 115 | sources = cmp.config.sources({ 116 | { name = "path" }, 117 | }, { 118 | { name = "cmdline" }, 119 | }), 120 | }) 121 | end, 122 | } 123 | -------------------------------------------------------------------------------- /nvim/lua/plugins/snacks.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_autocmd("User", { 2 | pattern = "OilActionsPost", 3 | callback = function(event) 4 | if event.data.actions[1].type == "move" then 5 | Snacks.rename.on_rename_file(event.data.actions[1].src_url, event.data.actions[1].dest_url) 6 | end 7 | end, 8 | }) 9 | 10 | return { 11 | "folke/snacks.nvim", 12 | priority = 1000, 13 | lazy = false, 14 | ---@type snacks.Config 15 | opts = { 16 | dashboard = { 17 | enabled = true, 18 | sections = { 19 | { section = "header" }, 20 | { section = "keys", gap = 1, padding = 1 }, 21 | { pane = 2, icon = " ", title = "Recent Files", section = "recent_files", indent = 2, padding = 1 }, 22 | { pane = 2, icon = " ", title = "Projects", section = "projects", indent = 2, padding = 1 }, 23 | { 24 | pane = 2, 25 | icon = " ", 26 | title = "Git Status", 27 | section = "terminal", 28 | enabled = function() 29 | return Snacks.git.get_root() ~= nil 30 | end, 31 | cmd = "git status --short --branch --renames", 32 | height = 5, 33 | padding = 1, 34 | ttl = 5 * 60, 35 | indent = 3, 36 | }, 37 | { section = "startup" }, 38 | }, 39 | 40 | }, 41 | picker = { 42 | enabled = true, 43 | sources = { 44 | files = { 45 | hidden = true 46 | }, 47 | grep = { 48 | hidden = true 49 | } 50 | } 51 | }, 52 | notifier = { enabled = true }, 53 | gh = { enabled = true }, 54 | rename = { enabled = true }, 55 | 56 | }, 57 | keys = { 58 | -- Github cli 59 | { "gi", function() Snacks.picker.gh_issue() end, desc = "GitHub Issues (open)" }, 60 | { "gI", function() Snacks.picker.gh_issue({ state = "all" }) end, desc = "GitHub Issues (all)" }, 61 | { "gp", function() Snacks.picker.gh_pr() end, desc = "GitHub Pull Requests (open)" }, 62 | { "gP", function() Snacks.picker.gh_pr({ state = "all" }) end, desc = "GitHub Pull Requests (all)" }, 63 | 64 | -- File findings 65 | { "", function() Snacks.picker.smart() end, desc = "Smart Find Files" }, 66 | { "", function() Snacks.picker.buffers() end, desc = "Buffers" }, 67 | { "", function() Snacks.picker.files() end, desc = "Find Files" }, 68 | { "", function() Snacks.picker.grep() end, desc = "Grep" }, 69 | { ":", function() Snacks.picker.command_history() end, desc = "Command History" }, 70 | { "n", function() Snacks.picker.notifications() end, desc = "Notification History" }, 71 | { "", function() Snacks.picker.recent() end, desc = "Recent" }, 72 | 73 | -- LSP 74 | { "gd", function() Snacks.picker.lsp_definitions() end, desc = "Goto Definition" }, 75 | { "gD", function() Snacks.picker.lsp_declarations() end, desc = "Goto Declaration" }, 76 | { "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" }, 77 | { "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" }, 78 | { "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" }, 79 | -- Show symbols 80 | { "ss", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols" }, 81 | { "sS", function() Snacks.picker.lsp_workspace_symbols() end, desc = "LSP Workspace Symbols" }, 82 | }, 83 | } 84 | -------------------------------------------------------------------------------- /ftplugin/javascript.lua: -------------------------------------------------------------------------------- 1 | -- Be like REPL my friend 2 | -- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3 | -- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 4 | -- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 5 | -- &&&&&&&&&&&&&&&&&&&&&&&&%%%%%%%%%%%%%%%%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 6 | -- &&&&&&&&&&&&&&&&&&&&&&&&%%%%%%%%%#//(#%%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 7 | -- &&&&&&&&&&&&&&&&&&&&&&&%%##%%%%/...,*(#(%%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 8 | -- &&&&&&&&&&&&&&&&&&&&%%#/,,.... ....,#%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 9 | -- &&&&&&&&&&&&&&&&%#(/**,.. ../(((/*//,#%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 10 | -- &&&&&&&&&&&&&&%%#((///*,,,...,*///*.....,.,(%%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 11 | -- &&&&&&&&&&&&&&%%%%%%%%%%%%#(*****/(####/*...(%%#(%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 12 | -- &&&&&&&&&&&&&&%%%%#(//(#####/ ....... ,##..%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&& 13 | -- &&&&&&&&&&&&&&%%%%%%%(//*,,,,. ..(( *%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&& 14 | -- &&&&&&&&&&&&&&%#####(/*,...,,. ,.. ..**#%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&& 15 | -- &&&&&&&&&&&&&&&%##(**,,...*/*.. .,. ....(#%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&& 16 | -- &&&&&&&&&&&&&&&&%###(/**/(#(#####(,.. .*%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&& 17 | -- &&&&&&&&&&&&%#%%%%%%%###((((((*. ...,. .,#%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&& 18 | -- &&&&&&&&&&&&&&&&&%%###(((((((###(. /(,. .....##%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&& 19 | -- &&&&&&&&&&&&&&&&&&%####((((/**/*,.. ....,#%%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&& 20 | -- &&&&&&&&&&&&&&&&&&&%%%#####(*/(((##(*. .,..#%%%%&%&&&&&&&&&&&&&&&&&&&&&&&&&&& 21 | -- &&&&&&&&&&&&&&&&%%&%##%%####((*,. .,...((#%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&& 22 | -- &&&&&&&&&%%&&&%&&&&&####%%%%#((/,... ..,*,..../#((/(#%%&&&&&&&&&&&#%%%%%%%#&&&&& 23 | -- &&&&&&%&&&&&&&&&&&&&%#####%%%%%%%%%#(##**,...,(#####((######%&&&&&(%%%###%%&&&&& 24 | -- &###%%&&&&&&&&&&&&&&&%######%%%%%%%%%///*,..,,(#%%####(##########%%&&&&&&&&&&&&& 25 | -- %%%%%%%&&&&&&&&&&&&&&&%########%%%%%%#(*,,..,*#(%%%%#########%##%%%######%%%%&&& 26 | -- 27 | -- Run current file 28 | -- nnoremap rr :!node % 29 | vim.keymap.set('n', 'rf', ':!node %') 30 | -- Run current line 31 | -- nnoremap rl :exec '!node' '-e' shellescape(getline('.')) 32 | -- Run current line, print it below it, and comment it 33 | -- nnoremap rp :exec ':r' '!node' '-e' shellescape(getline('.')) :Commentary 34 | local inspect = require("rcfiles.lua-convenience.inspect") 35 | 36 | local run_selection = function() 37 | local esc = vim.api.nvim_replace_termcodes('', true, false, true) 38 | vim.api.nvim_feedkeys(esc, 'x', false) 39 | 40 | local s_start = vim.fn.getpos("'<") 41 | local s_end = vim.fn.getpos("'>") 42 | local n_lines = math.abs(s_end[2] - s_start[2]) + 1 43 | local lines = vim.api.nvim_buf_get_lines(0, s_start[2] - 1, s_end[2], false) 44 | lines[1] = string.sub(lines[1], s_start[3], -1) 45 | if n_lines == 1 then 46 | lines[n_lines] = string.sub(lines[n_lines], 1, s_end[3] - s_start[3] + 1) 47 | else 48 | lines[n_lines] = string.sub(lines[n_lines], 1, s_end[3]) 49 | end 50 | 51 | 52 | local code = table.concat(lines, ' ') 53 | 54 | vim.cmd("!node -e 'console.log(`\\n`); " .. code .. "'") 55 | end 56 | 57 | vim.keymap.set('v', 'rs', run_selection) 58 | 59 | 60 | -- TODO: Do I need these anymore? 61 | vim.g.javascript_plugin_jsdoc = 1 62 | ----- LIT highlighting and autclosing 63 | vim.g.htl_css_templates = 1 64 | vim.g.htl_all_templates = 1 65 | vim.g.closetag_filetypes = 'html,xhtml,phtml,javascript,typescript' 66 | --vim.g.closetag_regions = { 67 | -- 'typescript.tsx': 'jsxRegion,tsxRegion,litHtmlRegion', 68 | -- 'javascript.jsx': 'jsxRegion,litHtmlRegion', 69 | -- 'javascript': 'litHtmlRegion', 70 | -- 'typescript': 'litHtmlRegion', 71 | -- } 72 | 73 | -------------------------------------------------------------------------------- /nvim/lua/plugins/node-repl/repl-connector.lua: -------------------------------------------------------------------------------- 1 | local uv = vim.loop 2 | 3 | local buf, win 4 | local handle, pid 5 | local stdin_pipe = uv.new_pipe(false) 6 | local stdout_pipe = uv.new_pipe(false) 7 | 8 | local function on_stdout(err, data) 9 | assert(not err, err) 10 | 11 | vim.schedule(function() 12 | if data then 13 | vim.api.nvim_buf_call(buf, function() 14 | data = string.gsub(data, "\0", "") 15 | data = string.gsub(data, "\n", "") 16 | 17 | vim.api.nvim_put({data}, "l", true, true) 18 | vim.api.nvim_win_set_cursor(win, { vim.api.nvim_buf_line_count(buf), 0 }) 19 | end) 20 | end 21 | end) 22 | end 23 | 24 | local function create_window() 25 | local width = 50 26 | local height = 10 27 | 28 | buf = vim.api.nvim_create_buf(false, true) 29 | local ui = vim.api.nvim_list_uis()[1] 30 | 31 | local opts = { 32 | ["relative"] = "win", 33 | ["width"] = width, 34 | ["height"] = height, 35 | ["col"] = ui.width - 0, 36 | ["row"] = ui.height - 15, 37 | ["anchor"] = "NE", 38 | ["style"] = "minimal", 39 | } 40 | 41 | win = vim.api.nvim_open_win(buf, 1, opts) 42 | end 43 | 44 | local function create_handle() 45 | handle, pid = uv.spawn("virta", { 46 | args = { "" }, 47 | stdio = { stdin_pipe, stdout_pipe, nil } 48 | }, function (code, signal) 49 | print("Nodejs process exited. Code: ", code, ", Signal:", signal) 50 | stdin_pipe:close() 51 | stdout_pipe:close() 52 | handle:close() 53 | end) 54 | 55 | 56 | if not handle then 57 | error("Failed to start Node.js process") 58 | end 59 | 60 | uv.read_start(stdout_pipe, on_stdout) 61 | end 62 | 63 | 64 | local function send_input(input) 65 | stdin_pipe:write(input .. "\n") 66 | end 67 | 68 | local function get_visual_selection() 69 | -- Get the start and end positions of the visual selection 70 | local start_pos = vim.fn.getpos("'<") 71 | local end_pos = vim.fn.getpos("'>") 72 | 73 | -- print(vim.inspect({ start_pos, end_pos })) 74 | 75 | local start_line, start_col = start_pos[2], start_pos[3] 76 | local end_line, end_col = end_pos[2], end_pos[3] 77 | 78 | -- If the selection is invalid, return early 79 | if start_line == 0 or end_line == 0 then 80 | return 81 | end 82 | 83 | local lines = vim.fn.getline(start_line, end_line); 84 | if #lines == 0 then return end 85 | 86 | -- Adjust selection for first and last line 87 | lines[1] = string.sub(lines[1], start_col) 88 | lines[#lines] = string.sub(lines[#lines], 1, end_col) 89 | 90 | return lines 91 | end 92 | 93 | 94 | local function virta_visual_eval() 95 | local mode = vim.fn.mode() 96 | local input 97 | 98 | -- Let's just use this until we find a better one. 99 | vim.cmd("normal! :") 100 | 101 | if mode =="v" or mode == "V" then 102 | input = get_visual_selection() 103 | else 104 | input = { vim.api.nvim_get_current_line() } 105 | end 106 | 107 | if input == nil then 108 | print("Could not find selection") 109 | return 110 | end 111 | -- print(vim.inspect(input)) 112 | 113 | local input_string = table.concat(input, "\n") 114 | 115 | if input == "__node_repl_exit" then 116 | stdin_pipe:close() 117 | handle:close() 118 | print("Exiting Node.js program.") 119 | else 120 | send_input(input_string) 121 | end 122 | end 123 | 124 | local function virta_normal_eval() 125 | virta_visual_eval() 126 | end 127 | 128 | local function virta_buffer_eval() 129 | print("Not implemented") 130 | end 131 | 132 | create_handle() 133 | create_window() 134 | 135 | vim.keymap.set("v", "ev", virta_visual_eval) 136 | vim.keymap.set("n", "ev", virta_normal_eval) 137 | vim.keymap.set("n", "eb", virta_buffer_eval) 138 | -------------------------------------------------------------------------------- /picom-animations.conf: -------------------------------------------------------------------------------- 1 | # Animations for NORMAL windows. 2 | { 3 | match = "window_type = 'normal'"; 4 | animations = ( 5 | { 6 | triggers = ["close"]; 7 | opacity = { 8 | curve = "cubic-bezier(0,1,1,1)"; 9 | duration = 0.3; 10 | start = "window-raw-opacity-before"; 11 | end = 0; 12 | }; 13 | blur-opacity = "opacity"; 14 | shadow-opacity = "opacity"; 15 | 16 | scale-x = { 17 | curve = "cubic-bezier(0,1.1,1,1)"; 18 | duration = 0.3; 19 | start = 1; 20 | end = 0.6; 21 | }; 22 | scale-y = "scale-x"; 23 | 24 | offset-x = "(1 - scale-x) / 2 * window-width"; 25 | offset-y = "(1 - scale-y) / 2 * window-height"; 26 | 27 | shadow-scale-x = "scale-x"; 28 | shadow-scale-y = "scale-y"; 29 | shadow-offset-x = "offset-x"; 30 | shadow-offset-y = "offset-y"; 31 | }, 32 | 33 | { 34 | triggers = ["open"]; 35 | opacity = { 36 | curve = "cubic-bezier(0,1,1,1)"; 37 | duration = 0.2; 38 | start = 0; 39 | end = "window-raw-opacity"; 40 | }; 41 | blur-opacity = "opacity"; 42 | shadow-opacity = "opacity"; 43 | 44 | scale-x = { 45 | curve = "cubic-bezier(0,1.1,1,1)"; 46 | duration = 0.2; 47 | start = 0.6; 48 | end = 1; 49 | }; 50 | scale-y = "scale-x"; 51 | 52 | offset-x = "(1 - scale-x) / 2 * window-width"; 53 | offset-y = "(1 - scale-y) / 2 * window-height"; 54 | 55 | shadow-scale-x = "scale-x"; 56 | shadow-scale-y = "scale-y"; 57 | shadow-offset-x = "offset-x"; 58 | shadow-offset-y = "offset-y"; 59 | }, 60 | 61 | { 62 | triggers = ["geometry"]; 63 | scale-x = { 64 | curve = "cubic-bezier(0,0,0,1.1)"; 65 | duration = 0.3; 66 | start = "window-width-before / window-width"; 67 | end = 1; 68 | }; 69 | 70 | scale-x-reverse = { 71 | curve = "cubic-bezier(0,0,0,1.1)"; 72 | duration = 0.3; 73 | start = "window-width / window-width-before"; 74 | end = 1; 75 | }; 76 | scale-y = { 77 | curve = "cubic-bezier(0,0,0,1.1)"; 78 | duration = 0.3; 79 | start = "window-height-before / window-height"; 80 | end = 1; 81 | }; 82 | scale-y-reverse = { 83 | curve = "cubic-bezier(0,0,0,1.1)"; 84 | duration = 0.3; 85 | start = "window-height / window-height-before"; 86 | end = 1; 87 | }; 88 | offset-x = { 89 | curve = "cubic-bezier(0,0,0,1.1)"; 90 | duration = 0.3; 91 | start = "window-x-before - window-x"; 92 | end = 0; 93 | }; 94 | offset-y = { 95 | curve = "cubic-bezier(0,0,0,1.1)"; 96 | duration = 0.3; 97 | start = "window-y-before - window-y"; 98 | end = 0; 99 | }; 100 | shadow-scale-x = "scale-x"; 101 | shadow-scale-y = "scale-y"; 102 | shadow-offset-x = "offset-x"; 103 | shadow-offset-y = "offset-y"; 104 | } 105 | ) 106 | } 107 | -------------------------------------------------------------------------------- /eww/eww.scss: -------------------------------------------------------------------------------- 1 | * { 2 | all: unset; // Unsets everything so you can style everything from scratch 3 | } 4 | 5 | tooltip { 6 | background-color: #222; 7 | color: #fff; 8 | border-radius: 6px; 9 | padding: 6px 8px; 10 | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); 11 | } 12 | 13 | tooltip label { 14 | color: #fff; 15 | } 16 | 17 | .content-box { 18 | background-color: #202330; 19 | margin: 0.625rem 1.25rem 0.3125rem 1.25rem; 20 | padding: 0px 1.25rem; 21 | border-radius: 10px; 22 | color: #fff0f5; 23 | 24 | min-width: 0px; 25 | min-height: 2.5rem; 26 | font-size: 0.875rem; 27 | } 28 | 29 | .shadow { 30 | box-shadow: 0 5px 15px -3px rgba(71, 37, 65, 0.75); 31 | } 32 | 33 | .music-box, 34 | .tray-box { 35 | padding: 0.125rem 0.625rem; 36 | margin: 0.625rem 1.25rem 0.3125rem 1.5rem; 37 | } 38 | 39 | .tray-box { 40 | font-size: 1rem; 41 | } 42 | 43 | .music-box { 44 | padding: 0.125rem 1.25rem; 45 | } 46 | 47 | .workspaces { 48 | font-size: 2rem; 49 | min-height: 2.5rem; 50 | } 51 | 52 | .workspace-icons > * { 53 | margin: 0 0.2rem; 54 | min-height: 2.5rem; 55 | min-width: 1.6rem; 56 | background-size: 1.3rem; 57 | background-repeat: no-repeat; 58 | background-position: center; 59 | } 60 | 61 | .workspace-box.focused { 62 | border-bottom: 2px solid #D35D6E; 63 | border-radius: 10px 10px 5px 5px; 64 | } 65 | 66 | .workspace-box { 67 | background-color: rgba(32,35,48, 0.9); 68 | border: 1px solid #202330; 69 | margin: 10px 5px 0; 70 | border-radius: 10px; 71 | color: #fff0f5; 72 | 73 | min-width: 0px; 74 | min-height: 40px; 75 | font-size: 1rem; 76 | } 77 | 78 | .workspace-eventbox > * { 79 | padding: 0px 10px; 80 | } 81 | 82 | .workspaces button.active { 83 | color: #D35D6E; 84 | font-weight: bold; 85 | } 86 | 87 | .workspaces button:hover { 88 | color: #D35D6E; 89 | } 90 | 91 | .music, .datetime { 92 | padding: 5px 0; 93 | font-size: 0.75rem; 94 | } 95 | 96 | 97 | // Powermenu 98 | .powermenu { 99 | font-family: Material Design Icons Desktop; 100 | font-size: 1.4em; 101 | font-weight: bold; 102 | } 103 | 104 | .powericons { 105 | margin: 0.2rem 0 0.2rem 0; 106 | } 107 | 108 | .left-box > *:first-child { 109 | padding: 0 10px 0 0; 110 | } 111 | 112 | .left-box > * { 113 | padding: 0 10px; 114 | } 115 | 116 | .networkbutton { 117 | margin: 0 1rem; 118 | } 119 | 120 | // Styles on classes (see eww.yuck for more information) 121 | 122 | .sidestuff slider { 123 | color: #ffd5cd; 124 | } 125 | 126 | .metric scale trough highlight { 127 | background-color: #D35D6E; 128 | color: #000000; 129 | border-radius: 10px; 130 | } 131 | 132 | .metric scale trough { 133 | background-color: #4e4e4e; 134 | border-radius: 3.125rem; 135 | min-height: 0.1875rem; 136 | min-width: 3.125rem; 137 | margin-left: 0.625rem; 138 | margin-right: 1.25rem; 139 | } 140 | 141 | .label-ram { 142 | font-size: large; 143 | } 144 | 145 | .music-image { 146 | padding-right: 1rem; 147 | } 148 | 149 | .music-artist { 150 | font-weight: 600; 151 | } 152 | 153 | .datetime-time { 154 | font-size: 0.75rem; 155 | font-weight: 600; 156 | margin-right: 1rem; 157 | } 158 | 159 | .datetime-date { 160 | font-size: 0.75rem; 161 | font-weight: 500; 162 | } 163 | 164 | .datetime-hour, 165 | .datetime-day { 166 | margin-top: 2px; 167 | margin-bottom: -5px; 168 | } 169 | 170 | .music-controls { 171 | margin-left: 1rem; 172 | } 173 | 174 | .music-control-button { 175 | background-repeat: no-repeat; 176 | background-size: 1.4rem; 177 | min-height: 1.4rem; 178 | min-width: 1.4rem; 179 | margin: 0 0.4rem; 180 | } 181 | 182 | .powermenu-wrap { 183 | margin-top: 0.675rem; 184 | margin-right: 1.5rem; 185 | } 186 | 187 | .powermenu-button { 188 | background-repeat: no-repeat; 189 | background-size: 1.4rem; 190 | background-position: center; 191 | min-height: 1.6rem; 192 | min-width: 1.4rem; 193 | margin: 0rem 5px; 194 | background-color: #202330; 195 | border-radius: 10px; 196 | padding: 0.5rem 0.625rem; 197 | } 198 | 199 | .powermenu-main-button { 200 | margin: 0; 201 | } 202 | -------------------------------------------------------------------------------- /nvim/lua/config/statusline.lua: -------------------------------------------------------------------------------- 1 | local modes = { 2 | ["n"] = "NORMAL", 3 | ["no"] = "NORMAL", 4 | ["v"] = "VISUAL", 5 | ["V"] = "VISUAL LINE", 6 | [""] = "VISUAL BLOCK", 7 | ["s"] = "SELECT", 8 | ["S"] = "SELECT LINE", 9 | ["i"] = "INSERT", 10 | ["ic"] = "INSERT", 11 | ["R"] = "REPLACE", 12 | ["Rv"] = "VISUAL REPLACE", 13 | ["c"] = "COMMAND", 14 | ["cv"] = "VIM EX", 15 | ["ce"] = "EX", 16 | ["r"] = "PROMPT", 17 | ["rm"] = "MOAR", 18 | ["r?"] = "CONFIRM", 19 | ["!"] = "SHELL", 20 | ["t"] = "TERMINAL", 21 | } 22 | 23 | vim.api.nvim_set_hl(0, "ClearColor", { fg = "", bg = "" }) 24 | vim.api.nvim_set_hl(0, "LightBackground", { fg = "#fff0f5", bg = "#2d2f42" }) 25 | vim.api.nvim_set_hl(0, "NormalColor", { fg = "#fff0f5", bg = "#2d2f42" }) 26 | vim.api.nvim_set_hl(0, "VisualColor", { fg = "#202330", bg = "#fff0f5" }) 27 | vim.api.nvim_set_hl(0, "InsertColor", { fg = "#fff0f5", bg = "#472541" }) 28 | vim.api.nvim_set_hl(0, "CommandColor", { fg = "#fff0f5", bg = "#6d7a72" }) 29 | 30 | vim.api.nvim_set_hl(0, "StatusLine", { fg = "", bg = "" }) 31 | vim.api.nvim_set_hl(0, "StatusLineNC", { fg = "", bg = "" }) 32 | 33 | local no_statusline_types = { 34 | "NvimTree", 35 | } 36 | 37 | local function no_statusline() 38 | local filetype = vim.bo.filetype 39 | for key, val in pairs(no_statusline_types) do 40 | if val == filetype then 41 | return true 42 | end 43 | end 44 | return false 45 | end 46 | 47 | local function get_mode() 48 | local current_mode = vim.api.nvim_get_mode().mode 49 | return string.format(" %s ", modes[current_mode]):upper() 50 | end 51 | 52 | local function get_mode_color() 53 | local mode = vim.api.nvim_get_mode().mode 54 | if mode == "n" or mode == "no" then 55 | return "%#NormalColor#" 56 | end 57 | if mode == "v" or mode == "V" then 58 | return "%#VisualColor#" 59 | end 60 | if mode == "i" or mode == "ic" then 61 | return "%#InsertColor#" 62 | end 63 | if mode == "c" then 64 | return "%#CommandColor#" 65 | end 66 | 67 | return "%#NormalColor#" 68 | end 69 | 70 | local function get_filepath() 71 | local filepath = vim.fn.fnamemodify(vim.fn.expand("%"), ":~:.:h") 72 | if filepath == "" or filepath == "." then 73 | return " " 74 | end 75 | 76 | return string.format(" %%<%s/", filepath) 77 | end 78 | 79 | local function get_filename() 80 | local filename = vim.fn.expand("%:t") 81 | if filename == "" then 82 | return "" 83 | end 84 | 85 | return filename .. " " 86 | end 87 | 88 | local function get_filetype() 89 | local icon = require("nvim-web-devicons").get_icon(vim.fn.expand("%:t"), vim.bo.filetype, { default = true }) 90 | return table.concat({ 91 | vim.bo.filetype, 92 | " ", 93 | icon, 94 | }) 95 | end 96 | 97 | local function get_line_info() 98 | if vim.bo.filetype == "alpha" then 99 | return "" 100 | end 101 | return table.concat({ 102 | "%l ", 103 | "/ ", 104 | "%L ", 105 | "|", 106 | " ", 107 | "%c", 108 | }) 109 | end 110 | 111 | local function get_file_and_line_info() 112 | return table.concat({ 113 | "%#LightBackground#", 114 | " ", 115 | get_filetype(), 116 | " | ", 117 | get_line_info(), 118 | " ", 119 | "%#ClearColor#", 120 | }) 121 | end 122 | 123 | local function get_lsp_status() 124 | return "" 125 | -- return table.concat({ 126 | -- require("lsp-status").status() 127 | -- }) 128 | end 129 | 130 | StatusLine = {} 131 | 132 | StatusLine.active = function() 133 | return table.concat({ 134 | get_mode_color(), 135 | get_mode(), 136 | "%#ClearColor#", 137 | "%=", -- Above, left side, below center 138 | "", 139 | get_filepath(), 140 | get_filename(), 141 | "%=", -- Above, center, below, right 142 | get_lsp_status(), 143 | get_file_and_line_info(), 144 | }) 145 | end 146 | 147 | StatusLine.inactive = function() 148 | return "%#ClearColor#" 149 | end 150 | 151 | StatusLine.init = function() 152 | vim.opt.showmode = false 153 | vim.opt.laststatus = 3 154 | 155 | local StatusLineGroup = vim.api.nvim_create_augroup("StatusLine", {}) 156 | 157 | vim.api.nvim_create_autocmd( 158 | { "ModeChanged", "WinEnter", "BufEnter", "FocusGained", "InsertLeave", "InsertEnter" }, 159 | { 160 | pattern = "*", 161 | callback = function(ev) 162 | if no_statusline() then 163 | vim.wo.statusline = StatusLine.inactive() 164 | else 165 | vim.wo.statusline = StatusLine.active() 166 | end 167 | end, 168 | group = StatusLineGroup, 169 | } 170 | ) 171 | end 172 | 173 | StatusLine.init() 174 | 175 | return StatusLine 176 | -------------------------------------------------------------------------------- /shell/.shell_common: -------------------------------------------------------------------------------- 1 | ############################################################# 2 | # SHARED SHELL SETTINGS (Used by both bash and zsh) 3 | ############################################################# 4 | 5 | # Only run in interactive shells 6 | [[ $- != *i* ]] && return 7 | 8 | ############################################################# 9 | # Detect local vs SSH session 10 | ############################################################# 11 | SESSION_TYPE=local 12 | if [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then 13 | SESSION_TYPE=remote/ssh 14 | fi 15 | 16 | ############################################################# 17 | # Environment Variables 18 | ############################################################# 19 | export NVM_DIR="${XDG_CONFIG_HOME:-$HOME/.nvm}" 20 | export FZF_DEFAULT_COMMAND='rg --files --hidden --no-ignore-vcs -g "!{node_modules,.git,.idea,target,dist,out-tsc}"' 21 | export LANGUAGE=en_US.UTF-8 22 | export LANG=en_US.UTF-8 23 | export TERM=xterm-256color 24 | export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" 25 | export PNPM_HOME="$HOME/.local/share/pnpm" 26 | export SDKMAN_DIR="$HOME/.sdkman" 27 | export NPM_PACKAGES="$HOME/.npm-packages" 28 | 29 | [[ -s "$SDKMAN_DIR/bin/sdkman-init.sh" ]] && source "$SDKMAN_DIR/bin/sdkman-init.sh" 30 | 31 | # Add pnpm to PATH if not present 32 | case ":$PATH:" in 33 | *":$PNPM_HOME:"*) ;; 34 | *) export PATH="$PNPM_HOME:$PATH" ;; 35 | esac 36 | 37 | if [[ -v TMUX ]]; then 38 | # inside tmux, we don't know if Sway got restarted 39 | swaymsg(){ 40 | export SWAYSOCK=$XDG_RUNTIME_DIR/sway-ipc.$UID.$(pgrep -x sway).sock 41 | command swaymsg "$@" 42 | } 43 | 44 | # Also run it at start 45 | export SWAYSOCK=$XDG_RUNTIME_DIR/sway-ipc.$UID.$(pgrep -x sway).sock 46 | fi 47 | 48 | ############################################################# 49 | # Tmux 50 | ############################################################# 51 | # 52 | # Auto-attach tmux if: 53 | # - not already in tmux 54 | # - tmux exists 55 | # - we are in an interactive shell 56 | if command -v tmux >/dev/null 2>&1; then 57 | if [ -z "$TMUX" ] && [ -n "$PS1" ]; then 58 | tmux attach -t default || tmux new -s default 59 | fi 60 | fi 61 | 62 | ############################################################# 63 | # Editor selection 64 | ############################################################# 65 | if [[ -f ~/nvim.appimage ]]; then 66 | export EDITOR="~/nvim.appimage" 67 | else 68 | export EDITOR="nvim" 69 | fi 70 | 71 | ############################################################# 72 | # External tools 73 | ############################################################# 74 | [ -f ~/.env ] && source ~/.env 75 | 76 | ############################################################# 77 | # Functions 78 | ############################################################# 79 | catclip() { 80 | #cat "$1" | xclip -selection clipboard $OUTPUT 81 | cat "$1" | wl-copy 82 | } 83 | 84 | mp4towebp() { 85 | ffmpeg -i "$1" -vcodec libwebp \ 86 | -filter:v fps=fps=20 \ 87 | -lossless 0 \ 88 | -loop 0 \ 89 | -preset "${2:-default}" \ 90 | -an \ 91 | -compression_level 6 \ 92 | -vsync 0 \ 93 | "${1/mp4/webp}" 94 | } 95 | 96 | ############################################################# 97 | # Aliases (shell agnostic) 98 | ############################################################# 99 | 100 | # Software 101 | alias realvim="vim" 102 | test -f ~/nvim.appimage && alias vim="~/nvim.appimage" 103 | [ ! -f ~/nvim.appimage ] && alias vim="nvim" 104 | 105 | test -f ~/nvim.appimage && alias nvim="~/nvim.appimage" 106 | [ ! -f ~/nvim.appimage ] && alias nvim="nvim" 107 | 108 | # Open fugitive from shell 109 | alias :G="nvim -c :G" 110 | 111 | # Frequent commands 112 | alias filesize="du -sh" 113 | alias whoisusingports="sudo lsof -i -P -n | grep LISTEN" 114 | alias tmus="tmux" 115 | 116 | # Dev aliases 117 | alias devserver="npx @web/dev-server --node-resolve --watch" 118 | alias gentypes="tsc --declaration --emitDeclarationOnly --allowJs" 119 | 120 | # Git 121 | alias prettylog="git log --graph --decorate --oneline" 122 | alias whathaveibeenupto="git log --author=\"$(git config user.email)\" --pretty=format:\"%C(magenta)%an%Creset %C(green)%<(20)%ar%Creset %C(blue) %s %Creset\" --no-merges" 123 | 124 | # Vim helpers 125 | alias vimplugins="vim ~/.config/nvim/rcfiles/plugins.lua" 126 | alias vimrc="vim ~/dotfiles/init.lua" 127 | 128 | # Misc 129 | alias nrb="npm run build" 130 | alias fixkdebar="cp ~/.config/plasma-org.kde.plasma.desktop-appletsrc ~/.config/plasma-org.kde.plasma.desktop-appletsrc.backup" 131 | alias screenkeystream="screenkey -s small --timeout 0.3 --opacity 0.6 -g 500x100+50%+120% -p fixed" 132 | alias todo="vim ~/vaults/todo.md && cd ~/vaults/ && ./sync && cd -" 133 | alias j!=jbang 134 | alias tsctypes="npx -p typescript tsc --declaration --checkJs --allowJs --emitDeclarationOnly --lib esnext,DOM --outDir types " 135 | alias updateneovim="wget https://github.com/neovim/neovim/releases/download/stable/nvim-linux-x86_64.appimage -O ~/nvim.appimage && chmod +x ~/nvim.appimage" 136 | alias randompassword="openssl rand -hex 32" 137 | alias randomkey="openssl rand -base64 32" 138 | alias removecapslock="python -c 'from ctypes import *; X11 = cdll.LoadLibrary(\"libX11.so.6\"); X11.XOpenDisplay.restype = POINTER(c_ubyte); display = X11.XOpenDisplay(None); X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(2), c_uint(0)); X11.XCloseDisplay(display)'" 139 | 140 | ############################################################# 141 | # Smart ls aliases (logo-ls or fallback) 142 | ############################################################# 143 | if command -v logo-ls &> /dev/null; then 144 | alias ll='logo-ls -al' 145 | alias la='logo-ls -A' 146 | alias l='logo-ls' 147 | alias ls='logo-ls' 148 | else 149 | alias ll='ls -alF' 150 | alias la='ls -A' 151 | alias l='ls -CF' 152 | fi 153 | 154 | ############################################################# 155 | # Google Cloud SDK (shared if available) 156 | ############################################################# 157 | [ -f '/tmp/google-cloud-sdk/path.inc' ] && source '/tmp/google-cloud-sdk/path.inc' 158 | [ -f '/tmp/google-cloud-sdk/completion.inc' ] && source '/tmp/google-cloud-sdk/completion.inc' 159 | -------------------------------------------------------------------------------- /nvim/lua/plugins/nvim-jdtls.lua: -------------------------------------------------------------------------------- 1 | java_filetypes = { "java" } 2 | 3 | -- https://www.lazyvim.org/extras/lang/java 4 | return { 5 | "mfussenegger/nvim-jdtls", 6 | dependencies = { 7 | "mfussenegger/nvim-dap", 8 | }, 9 | ft = java_filetypes, 10 | opts = function() 11 | return { 12 | -- How to find the root dir for a given filename. The default comes from 13 | -- lspconfig which provides a function specifically for java projects. 14 | -- root_dir = LazyVim.lsp.get_raw_config("jdtls").default_config.root_dir, 15 | root_dir = function() 16 | return vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]) 17 | -- return vim.fs.root(0, { ".git", "mvnw", "gradlew", "pom.xml" }) 18 | end, 19 | 20 | -- How to find the project name for a given root dir. 21 | project_name = function(root_dir) 22 | return root_dir and vim.fs.basename(root_dir) 23 | end, 24 | 25 | -- Where are the config and workspace dirs for a project? 26 | jdtls_config_dir = function(project_name) 27 | return vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/config" 28 | end, 29 | jdtls_workspace_dir = function(project_name) 30 | return vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/workspace" 31 | end, 32 | 33 | -- How to run jdtls. This can be overridden to a full java command-line 34 | -- if the Python wrapper script doesn't suffice. 35 | cmd = { 36 | vim.fn.exepath("jdtls"), 37 | }, 38 | full_cmd = function(opts) 39 | local fname = vim.api.nvim_buf_get_name(0) 40 | local root_dir = opts.root_dir(fname) 41 | local project_name = opts.project_name(root_dir) 42 | local cmd = vim.deepcopy(opts.cmd) 43 | if project_name then 44 | vim.list_extend(cmd, { 45 | "-configuration", 46 | opts.jdtls_config_dir(project_name), 47 | "-data", 48 | opts.jdtls_workspace_dir(project_name), 49 | }) 50 | end 51 | return cmd 52 | end, 53 | 54 | -- These depend on nvim-dap, but can additionally be disabled by setting false here. 55 | dap = { 56 | hotcodereplace = "auto", 57 | config_overrides = { 58 | filters = { 59 | static = true, 60 | synthetic = true, 61 | names = { "this", "$$_hibernate_*", "handler", "interceptor" }, 62 | } 63 | }, 64 | }, 65 | dap_main = {}, 66 | test = true, 67 | settings = { 68 | java = { 69 | inlayHints = { 70 | parameterNames = { 71 | enabled = "all", 72 | }, 73 | }, 74 | configuration = { 75 | updateBuildConfiguration = "automatic", 76 | }, 77 | maven = { 78 | downloadSources = true, 79 | }, 80 | autobuild = { 81 | enabled = true, 82 | }, 83 | import = { 84 | maven = { 85 | enabled = true, 86 | }, 87 | }, 88 | }, 89 | }, 90 | } 91 | end, 92 | config = function(_, opts) 93 | -- Find the extra bundles that should be passed on the jdtls command-line 94 | -- if nvim-dap is enabled with java debug/test. 95 | local dap_installed = true 96 | local mason_registry = require("mason-registry") 97 | local bundles = {} ---@type string[] 98 | if mason_registry then 99 | if opts.dap and dap_installed and mason_registry.is_installed("java-debug-adapter") then 100 | local java_dbg_pkg = mason_registry.get_package("java-debug-adapter") 101 | -- TODO(matsu): For some reason this is broke atm. 102 | if type(java_dbg_pkg.get_install_path) == "function" then 103 | local java_dbg_path = java_dbg_pkg:get_install_path() 104 | local jar_patterns = { 105 | java_dbg_path .. "/extension/server/com.microsoft.java.debug.plugin-*.jar", 106 | } 107 | -- java-test also depends on java-debug-adapter. 108 | if opts.test and mason_registry.is_installed("java-test") then 109 | local java_test_pkg = mason_registry.get_package("java-test") 110 | local java_test_path = java_test_pkg:get_install_path() 111 | vim.list_extend(jar_patterns, { 112 | java_test_path .. "/extension/server/*.jar", 113 | }) 114 | end 115 | for _, jar_pattern in ipairs(jar_patterns) do 116 | for _, bundle in ipairs(vim.split(vim.fn.glob(jar_pattern), "\n")) do 117 | table.insert(bundles, bundle) 118 | end 119 | end 120 | end 121 | end 122 | end 123 | 124 | local function attach_jdtls() 125 | local fname = vim.api.nvim_buf_get_name(0) 126 | 127 | -- Configuration can be augmented and overridden by opts.jdtls 128 | local config = { 129 | cmd = opts.full_cmd(opts), 130 | root_dir = opts.root_dir(fname), 131 | init_options = { 132 | bundles = bundles, 133 | }, 134 | settings = opts.settings, 135 | -- enable CMP capabilities 136 | capabilities = require("cmp_nvim_lsp").default_capabilities() or nil, 137 | } 138 | 139 | -- Existing server will be reused if the root_dir matches. 140 | require("jdtls").start_or_attach(config) 141 | -- not need to require("jdtls.setup").add_commands(), start automatically adds commands 142 | vim.keymap.set("n", "jtc", require("jdtls").test_class) 143 | vim.keymap.set("n", "jtm", require("jdtls").test_nearest_method) 144 | -- Organize imports 145 | vim.keymap.set("n", "oi", function() 146 | require("jdtls").organize_imports() 147 | end, { desc = "Organize imports" }) 148 | 149 | -- Extract variable (normal mode) 150 | vim.keymap.set("n", "ev", function() 151 | require("jdtls").extract_variable() 152 | end, { desc = "Extract variable" }) 153 | 154 | -- Extract variable (visual mode) 155 | vim.keymap.set("v", "ev", function() 156 | require("jdtls").extract_variable(true) 157 | end, { desc = "Extract variable with selection" }) 158 | 159 | -- Extract constant (normal mode) 160 | vim.keymap.set("n", "ec", function() 161 | require("jdtls").extract_constant() 162 | end, { desc = "Extract constant" }) 163 | 164 | -- Extract constant (visual mode) 165 | vim.keymap.set("v", "ec", function() 166 | require("jdtls").extract_constant(true) 167 | end, { desc = "Extract constant with selection" }) 168 | 169 | -- Extract method (visual mode) 170 | vim.keymap.set("v", "em", function() 171 | require("jdtls").extract_method(true) 172 | end, { desc = "Extract method with selection" }) 173 | end 174 | 175 | -- Attach the jdtls for each java buffer. HOWEVER, this plugin loads 176 | -- depending on filetype, so this autocmd doesn't run for the first file. 177 | -- For that, we call directly below. 178 | vim.api.nvim_create_autocmd("FileType", { 179 | pattern = java_filetypes, 180 | callback = attach_jdtls, 181 | }) 182 | 183 | -- Avoid race condition by calling attach the first time, since the autocmd won't fire. 184 | attach_jdtls() 185 | end, 186 | } 187 | -------------------------------------------------------------------------------- /eww/scripts/go/workspaces/workspaces.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "context" 6 | "os" 7 | "path/filepath" 8 | "strings" 9 | 10 | "github.com/joshuarubin/go-sway" 11 | ) 12 | 13 | var DEFAULT_APP_ICON = "" 14 | 15 | var DESKTOP_PATHS = []string{ 16 | "/usr/share/applications/", 17 | "/usr/local/share/applications/", 18 | os.Getenv("HOME") + "/.local/share/applications/", 19 | os.Getenv("HOME") + "/.local/share/flatpak/exports/share/applications/", 20 | "/var/lib/flatpak/exports/share/applications/", 21 | } 22 | 23 | var POSSIBLE_ICON_PATHS = []string{ 24 | "/usr/share/icons/hicolor/scalable/apps/", 25 | "/usr/share/icons/hicolor/256x256/apps/", 26 | "/usr/share/icons/hicolor/128x128/apps/", 27 | "/usr/share/pixmaps/", 28 | os.Getenv("HOME") + "/.local/share/icons/hicolor/scalable/apps/", 29 | os.Getenv("HOME") + "/.local/share/icons/hicolor/128x128/apps/", 30 | os.Getenv("HOME") + "/.local/share/flatpak/exports/share/icons/hicolor/scalable/apps/", 31 | os.Getenv("HOME") + "/.local/share/flatpak/exports/share/icons/hicolor/256x256/apps/", 32 | "/var/lib/flatpak/exports/share/icons/hicolor/scalable/apps/", 33 | "/var/lib/flatpak/exports/share/icons/hicolor/256x256/apps/", 34 | } 35 | 36 | var POSSIBLE_ICON_FORMATS = []string{ 37 | ".svg", 38 | ".png", 39 | } 40 | 41 | var iconCache = make(map[string]string) 42 | 43 | type Workspace struct { 44 | ID int64 45 | Name string 46 | Focused bool 47 | Apps []*App 48 | } 49 | 50 | type App struct { 51 | Name string 52 | Instance string 53 | Icon string 54 | } 55 | 56 | func getSwayClient() sway.Client { 57 | client, err := sway.New(context.Background()) 58 | if err != nil { 59 | panic(err) 60 | } 61 | return client 62 | } 63 | 64 | func GetWorkspaces() []Workspace { 65 | var workspaces []Workspace 66 | 67 | client := getSwayClient() 68 | tree, err := client.GetTree(context.Background()) 69 | if err != nil { 70 | panic(err) 71 | } 72 | 73 | walkNode(tree, nil, &workspaces) 74 | return workspaces 75 | } 76 | 77 | func walkNode(node *sway.Node, currentWorkspace *sway.Node, workspaces *[]Workspace) { 78 | if node == nil { 79 | return 80 | } 81 | 82 | // Track current workspace 83 | if node.Type == "workspace" { 84 | currentWorkspace = node 85 | } 86 | 87 | // App container 88 | if node.Type == "con" && currentWorkspace != nil && 89 | (node.AppID != nil || node.WindowProperties != nil) { 90 | handleApp(node, currentWorkspace, workspaces) 91 | } 92 | 93 | for _, n := range node.Nodes { 94 | walkNode(n, currentWorkspace, workspaces) 95 | } 96 | } 97 | 98 | func handleApp(node *sway.Node, workspaceNode *sway.Node, workspaces *[]Workspace) { 99 | workspace := findWorkspaceById(workspaceNode.ID, workspaces) 100 | if workspace == nil { 101 | *workspaces = append(*workspaces, Workspace{ 102 | ID: workspaceNode.ID, 103 | Name: workspaceNode.Name, 104 | Focused: workspaceNode.Focused, 105 | }) 106 | workspace = &(*workspaces)[len(*workspaces)-1] 107 | } 108 | 109 | if node.Focused { 110 | workspace.Focused = true 111 | } 112 | 113 | inst := "" 114 | 115 | if node.AppID != nil { 116 | inst = *node.AppID 117 | } else if node.WindowProperties != nil { 118 | if node.WindowProperties.Class != "" { 119 | inst = node.WindowProperties.Class 120 | } else if node.WindowProperties.Instance != "" { 121 | inst = node.WindowProperties.Instance 122 | } 123 | } 124 | icon := determineAppIcon(inst) 125 | 126 | app := App{ 127 | Name: node.Name, 128 | Instance: inst, 129 | Icon: icon, 130 | } 131 | 132 | workspace.Apps = append(workspace.Apps, &app) 133 | } 134 | 135 | func findWorkspaceById(id int64, workspaces *[]Workspace) *Workspace { 136 | for i := range *workspaces { 137 | if (*workspaces)[i].ID == id { 138 | return &(*workspaces)[i] 139 | } 140 | } 141 | return nil 142 | } 143 | 144 | func normalize(s string) string { 145 | s = strings.ToLower(s) 146 | s = strings.ReplaceAll(s, "-", " ") 147 | s = strings.ReplaceAll(s, "_", " ") 148 | s = strings.ReplaceAll(s, ".", " ") 149 | 150 | if strings.Contains(s, " ") { 151 | parts := strings.Fields(s) 152 | s = parts[len(parts)-1] 153 | } 154 | return s 155 | } 156 | 157 | func fileExists(path string) bool { 158 | _, err := os.Stat(path) 159 | return err == nil 160 | } 161 | 162 | func determineAppIcon(instance string) string { 163 | if instance == "" { 164 | return DEFAULT_APP_ICON 165 | } 166 | 167 | key := strings.ToLower(instance) 168 | if cached, ok := iconCache[key]; ok { 169 | return cached 170 | } 171 | 172 | instNorm := normalize(instance) 173 | var iconName string 174 | var absIconPath string 175 | 176 | for _, dir := range DESKTOP_PATHS { 177 | filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { 178 | if err != nil || info.IsDir() || !strings.HasSuffix(info.Name(), ".desktop") { 179 | return nil 180 | } 181 | 182 | f, err := os.Open(path) 183 | if err != nil { 184 | return nil 185 | } 186 | defer f.Close() 187 | 188 | scanner := bufio.NewScanner(f) 189 | 190 | var nameVal, execVal, wmClassVal, iconVal string 191 | 192 | for scanner.Scan() { 193 | line := scanner.Text() 194 | lower := strings.ToLower(line) 195 | 196 | switch { 197 | case strings.HasPrefix(lower, "name="): 198 | nameVal = strings.TrimSpace(line[5:]) 199 | case strings.HasPrefix(lower, "exec="): 200 | execVal = strings.TrimSpace(line[5:]) 201 | case strings.HasPrefix(lower, "startupwmclass="): 202 | wmClassVal = strings.TrimSpace(line[len("StartupWMClass="):]) 203 | case strings.HasPrefix(lower, "icon="): 204 | iconVal = strings.TrimSpace(line[5:]) 205 | } 206 | } 207 | 208 | baseName := strings.TrimSuffix(strings.ToLower(info.Name()), ".desktop") 209 | 210 | matched := 211 | strings.Contains(normalize(wmClassVal), instNorm) || 212 | strings.Contains(normalize(execVal), instNorm) || 213 | strings.Contains(normalize(nameVal), instNorm) || 214 | strings.Contains(normalize(baseName), instNorm) 215 | 216 | if !matched || iconVal == "" { 217 | return nil 218 | } 219 | 220 | if strings.HasPrefix(iconVal, "/") && fileExists(iconVal) { 221 | absIconPath = iconVal 222 | return filepath.SkipDir 223 | } 224 | 225 | iconName = iconVal 226 | return filepath.SkipDir 227 | }) 228 | 229 | if absIconPath != "" || iconName != "" { 230 | break 231 | } 232 | } 233 | 234 | if absIconPath != "" { 235 | iconCache[key] = absIconPath 236 | return absIconPath 237 | } 238 | 239 | if iconName != "" { 240 | for _, base := range POSSIBLE_ICON_PATHS { 241 | for _, ext := range POSSIBLE_ICON_FORMATS { 242 | p := base + iconName + ext 243 | if fileExists(p) { 244 | iconCache[key] = p 245 | return p 246 | } 247 | } 248 | } 249 | } 250 | 251 | result := findIconByFuzzyName(instNorm) 252 | if result != "" { 253 | iconCache[key] = result 254 | return result 255 | } 256 | 257 | return DEFAULT_APP_ICON 258 | } 259 | 260 | func findIconByFuzzyName(instNorm string) string { 261 | var result string 262 | 263 | for _, base := range POSSIBLE_ICON_PATHS { 264 | filepath.Walk(base, func(path string, info os.FileInfo, err error) error { 265 | if err != nil || info.IsDir() || result != "" { 266 | return nil 267 | } 268 | 269 | for _, ext := range POSSIBLE_ICON_FORMATS { 270 | if strings.HasSuffix(info.Name(), ext) { 271 | name := normalize(strings.TrimSuffix(info.Name(), ext)) 272 | if strings.Contains(name, instNorm) { 273 | result = path 274 | return filepath.SkipDir 275 | } 276 | } 277 | } 278 | return nil 279 | }) 280 | 281 | if result != "" { 282 | break 283 | } 284 | } 285 | 286 | return result 287 | } 288 | -------------------------------------------------------------------------------- /sway/config: -------------------------------------------------------------------------------- 1 | #i3 config file (v4) 2 | set $sup Mod4 3 | set $mod Mod1 4 | set $ctrl Control 5 | 6 | set $inner 20 7 | set $outerTop 48 8 | set $outerBottom 0 9 | set $radius 12 10 | 11 | corner_radius $radius 12 | 13 | 14 | gaps inner $inner 15 | gaps top $outerTop 16 | gaps bottom $outerBottom 17 | focus_follows_mouse no 18 | 19 | bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% 20 | bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% 21 | bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle 22 | 23 | bindsym XF86MonBrightnessUp exec brightnessctl set 5%+ 24 | bindsym XF86MonBrightnessDown exec brightnessctl set 5%- 25 | 26 | 27 | set $up k 28 | set $down j 29 | set $left h 30 | set $right l 31 | 32 | # use Mouse+$sup to drag floating windows to their wanted position 33 | floating_modifier $sup 34 | 35 | # kill focused window 36 | bindsym $sup+Shift+q kill 37 | 38 | # Autorandr 39 | bindsym $sup+$ctrl+w exec autorandr --change work 40 | bindsym $sup+$ctrl+p exec autorandr --change presentation 41 | 42 | # change focus 43 | bindsym $sup+$left focus left 44 | bindsym $sup+$down focus down 45 | bindsym $sup+$up focus up 46 | bindsym $sup+$right focus right 47 | 48 | # alternatively, you can use the cursor keys: 49 | bindsym $sup+Left focus left 50 | bindsym $sup+Down focus down 51 | bindsym $sup+Up focus up 52 | bindsym $sup+Right focus right 53 | 54 | # move focused window 55 | bindsym $sup+Shift+$left move left 56 | bindsym $sup+Shift+$down move down 57 | bindsym $sup+Shift+$up move up 58 | bindsym $sup+Shift+$right move right 59 | 60 | # alternatively, you can use the cursor keys: 61 | bindsym $sup+Shift+Left move left 62 | bindsym $sup+Shift+Down move down 63 | bindsym $sup+Shift+Up move up 64 | bindsym $sup+Shift+Right move right 65 | 66 | # split in horizontal orientation 67 | bindsym $sup+b split h 68 | 69 | # split in vertical orientation 70 | bindsym $sup+v split v 71 | 72 | # enter fullscreen mode for the focused container 73 | bindsym $sup+f fullscreen toggle 74 | 75 | # change container layout (stacked, tabbed, toggle split) 76 | bindsym $sup+s layout stacking 77 | bindsym $sup+w layout tabbed 78 | bindsym $sup+e layout toggle split 79 | 80 | # toggle tiling / floating 81 | bindsym $sup+d floating toggle 82 | 83 | # change focus between tiling / floating windows 84 | bindsym $sup+space focus mode_toggle 85 | 86 | # Screenshot 87 | bindsym $sup+Shift+s exec sway-screenshot -m region 88 | 89 | 90 | 91 | # Define names for default workspaces for which we configure key bindings later on. 92 | # We use variables to avoid repeating the names in multiple places. 93 | set $ws1 "1" 94 | set $ws2 "2" 95 | set $ws3 "3" 96 | set $ws4 "4" 97 | set $ws5 "5" 98 | set $ws6 "6" 99 | set $ws7 "7" 100 | set $ws8 "8" 101 | set $ws9 "9" 102 | set $ws10 "10" 103 | 104 | # switch to workspace 105 | bindsym $ctrl+1 workspace number $ws1 106 | bindsym $ctrl+2 workspace number $ws2 107 | bindsym $ctrl+3 workspace number $ws3 108 | bindsym $ctrl+4 workspace number $ws4 109 | bindsym $ctrl+5 workspace number $ws5 110 | bindsym $ctrl+6 workspace number $ws6 111 | bindsym $ctrl+7 workspace number $ws7 112 | bindsym $ctrl+8 workspace number $ws8 113 | bindsym $ctrl+9 workspace number $ws9 114 | bindsym $ctrl+0 workspace number $ws10 115 | 116 | # move focused container to workspace 117 | bindsym $ctrl+Shift+1 move container to workspace number $ws1 118 | bindsym $ctrl+Shift+2 move container to workspace number $ws2 119 | bindsym $ctrl+Shift+3 move container to workspace number $ws3 120 | bindsym $ctrl+Shift+4 move container to workspace number $ws4 121 | bindsym $ctrl+Shift+5 move container to workspace number $ws5 122 | bindsym $ctrl+Shift+6 move container to workspace number $ws6 123 | bindsym $ctrl+Shift+7 move container to workspace number $ws7 124 | bindsym $ctrl+Shift+8 move container to workspace number $ws8 125 | bindsym $ctrl+Shift+9 move container to workspace number $ws9 126 | bindsym $ctrl+Shift+0 move container to workspace number $ws10 127 | 128 | # reload the configuration file 129 | bindsym $sup+Shift+c reload 130 | 131 | bindsym $sup+$ctrl+h resize shrink width 5 px or 5 ppt 132 | bindsym $sup+$ctrl+j resize shrink height 5 px or 5 ppt 133 | bindsym $sup+$ctrl+k resize grow height 5 px or 5 ppt 134 | bindsym $sup+$ctrl+l resize grow width 5 px or 5 ppt 135 | 136 | for_window [class="Albert"] border none 137 | 138 | 139 | # ________ ________ _____ 140 | # | ____\ \ / / ____/ ____| 141 | # | |__ \ V /| |__ | | 142 | # | __| > < | __|| | 143 | # | |____ / . \| |___| |____ 144 | # |______/_/ \_\______\_____| 145 | # 146 | 147 | exec_always systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP SWAYSOCK 148 | exec_always --no-startup-id swaybg -i /home/matsu/Pictures/alena-aenami-far-from-tomorrow-1080px.jpg -m fill 149 | exec_always --no-startup-id eww open bar 150 | exec_always kanshi 151 | 152 | # _____ _ _ _ 153 | # / ____| | | | | | 154 | # | (___ | |__ ___ _ __| |_ ___ _ _| |_ 155 | # \___ \| '_ \ / _ \| '__| __/ __| | | | __| 156 | # ____) | | | | (_) | | | || (__| |_| | |_ 157 | # |_____/|_| |_|\___/|_| \__\___|\__,_|\__| 158 | # 159 | # bindsym $mod+space exec albert show 160 | bindsym $mod+space exec ulauncher 161 | bindsym $sup+Return exec alacritty 162 | 163 | # Displays 164 | # Disable laptop screen when lid is closed 165 | bindswitch --locked lid:on output eDP-1 disable 166 | 167 | # Re-enable laptop screen when lid is opened 168 | bindswitch --locked lid:off output eDP-1 enable 169 | 170 | #Query the lid state and apply the correct output state every reload. 171 | exec_always { 172 | if grep -q closed /proc/acpi/button/lid/*/state; then 173 | swaymsg output eDP-1 disable 174 | fi 175 | } 176 | 177 | # layout 178 | workspace 1 output eDP-1 179 | workspace 2 output eDP-1 180 | workspace 3 output eDP-1 181 | workspace 4 output eDP-1 182 | 183 | workspace 1 output DP-9 184 | workspace 2 output DP-9 185 | workspace 3 output DP-11 186 | workspace 4 output DP-11 187 | 188 | 189 | # Includes 190 | include ~/.config/sway/outputs 191 | include ~/.config/sway/workspaces 192 | 193 | # Screens 194 | 195 | output * adaptive_sync off 196 | 197 | # Inputs 198 | 199 | input * { 200 | xkb_layout "fi" 201 | 202 | xkb_options caps:escape 203 | } 204 | 205 | input type:pointer { 206 | accel_profile flat 207 | pointer_accel 0.3 208 | } 209 | 210 | input type:touchpad { 211 | click_method clickfinger 212 | } 213 | 214 | # Borders 215 | default_border none 216 | default_floating_border none 217 | 218 | ############################ 219 | # SwayFX: Shadows / Glow 220 | ############################ 221 | 222 | shadows enable 223 | shadow_blur_radius 14 224 | shadow_color #473a407f 225 | 226 | 227 | # Shadow offset (negative = up/left) 228 | shadow_offset -3 -4 229 | 230 | 231 | ############################ 232 | # Opacity / Transparency 233 | ############################ 234 | 235 | default_dim_inactive 0.1 236 | 237 | 238 | ############################ 239 | # Exclusions (Picom shadow-exclude) 240 | ############################ 241 | 242 | # Notifications 243 | for_window [title="Notification"] shadow disable 244 | 245 | # App exclusions 246 | for_window [app_id="ulauncher"] border none shadow disable 247 | for_window [app_id="conky"] shadow disable 248 | for_window [app_id="eww"] shadow disable 249 | 250 | # GTK CSD windows 251 | for_window [shell="gtk"] shadow disable 252 | 253 | # Floating windows 254 | for_window [app_id="google-chrome" title="^Meet –"] floating enable, \ 255 | resize set 800 450, \ 256 | move position 1000 40 257 | 258 | 259 | # Cursor 260 | seat seat0 xcursor_theme Bibata-Modern-Ice 14 261 | 262 | # Sway Locking 263 | exec swayidle -w \ 264 | timeout 300 '~/.config/sway/lock' \ 265 | before-sleep '~/.config/sway/lock' 266 | 267 | 268 | # Sway notifications 269 | exec swaync 270 | 271 | -------------------------------------------------------------------------------- /shell/.bashrc_old: -------------------------------------------------------------------------------- 1 | case $- in 2 | *i*) ;; 3 | *) return;; 4 | esac 5 | 6 | 7 | SESSION_TYPE=local 8 | 9 | if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then 10 | SESSION_TYPE=remote/ssh 11 | fi 12 | 13 | # enable bash completion in interactive shells 14 | if ! shopt -oq posix; then 15 | if [ -f /usr/share/bash-completion/bash_completion ]; then 16 | . /usr/share/bash-completion/bash_completion 17 | elif [ -f /etc/bash_completion ]; then 18 | . /etc/bash_completion 19 | fi 20 | fi 21 | 22 | # don't put duplicate lines or lines starting with space in the history. 23 | # See bash(1) for more options 24 | HISTCONTROL=ignoreboth 25 | # append to the history file, don't overwrite it 26 | HISTSIZE=5000 27 | HISTFILESIZE=10000 28 | 29 | shopt -s histappend 30 | shopt -s checkwinsize 31 | 32 | PS1='${debian_chroot:+($debian_chroot)}\[\033[38;5;208m\]\u\[$(tput sgr0)\]【=◈ ◡ ◈ =】\[$(tput sgr0)\]\[\033[38;5;87m\]\h\[$(tput sgr0)\]:\[$(tput sgr0)\]\[\033[38;5;216m\]\w\[$(tput sgr0)\]' 33 | 34 | if [ "$SESSION_TYPE" != "local" ]; then 35 | PS1="$PS1 \[$(tput setaf 155)\]\[[$SESSION_TYPE]\]\[$(tput sgr0)\]" 36 | fi 37 | 38 | PS1="$PS1$ " 39 | 40 | # enable color support of ls and also add handy aliases 41 | if [ -x /usr/bin/dircolors ]; then 42 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" 43 | alias ls='ls --color=auto' 44 | alias grep='grep --color=auto' 45 | alias fgrep='fgrep --color=auto' 46 | alias egrep='egrep --color=auto' 47 | fi 48 | # some more ls aliases 49 | if command -v logo-ls &> /dev/null 50 | then 51 | alias ll='logo-ls -al' 52 | alias la='logo-ls -A' 53 | alias l='logo-ls' 54 | alias ls='logo-ls' 55 | else 56 | alias ll='ls -alF' 57 | alias la='ls -A' 58 | alias l='ls -CF' 59 | fi 60 | 61 | bind 'set show-all-if-ambiguous on' 62 | 63 | export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" 64 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 65 | 66 | # EXPORTS 67 | [ -f ~/.fzf.bash ] && source ~/.fzf.bash 68 | export FZF_DEFAULT_COMMAND='rg --files --hidden --no-ignore-vcs -g "!{node_modules,.git,.idea,target,dist,out-tsc}"' 69 | export LANGUAGE=en_US.UTF-8 70 | export LANG=en_US.UTF-8 71 | # export LC_ALL=en_US.UTF-8 72 | #export VISUAL=vim 73 | 74 | test -f ~/nvim.appimage && export EDITOR="~/nvim.appimage" 75 | [ ! -f ~/nvim.appimage ] && export EDITOR="nvim" 76 | 77 | 78 | export NPM_PACKAGES="${HOME}/.npm-packages" 79 | export TERM=xterm-256color 80 | 81 | # Helper functions 82 | 83 | function catclip() { 84 | cat $1 | xclip -selection clipboard $OUTPUT 85 | } 86 | 87 | function mp4towebp() { 88 | ffmpeg -i "$1" -vcodec libwebp -filter:v fps=fps=20 -lossless 0 -loop 0 -preset ${2:-default} -an -compression_level 6 -vsync 0 "${1/mp4/webp}" 89 | } 90 | 91 | ### IF NOT SSH START 92 | 93 | if [ "$SESSION_TYPE" != "remote/ssh" ]; then 94 | # Tmux on startup 95 | if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then 96 | tmux attach -t default || tmux new -s default 97 | fi 98 | 99 | # Caps is esc 100 | setxkbmap -option caps:escape 101 | setxkbmap fi 102 | 103 | # Commands 104 | eval "$(fzf --bash)" 105 | 106 | source ~/.env 107 | # 108 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 109 | source ~/.npm_completion 110 | 111 | # The next line updates PATH for the Google Cloud SDK. 112 | if [ -f '/home/matsu/Tools/google-cloud-sdk/path.bash.inc' ]; then . '/home/matsu/Tools/google-cloud-sdk/path.bash.inc'; fi 113 | 114 | # The next line enables shell command completion for gcloud. 115 | if [ -f '/home/matsu/Tools/google-cloud-sdk/completion.bash.inc' ]; then . '/home/matsu/Tools/google-cloud-sdk/completion.bash.inc'; fi 116 | fi 117 | 118 | ## IF NOT SSH END 119 | 120 | # ALIASES 121 | # Software overrides 122 | #alias python=python3.8 123 | alias realvim="vim" 124 | test -f ~/nvim.appimage && alias vim="~/nvim.appimage" 125 | [ ! -f ~/nvim.appimage ] && alias vim="nvim" 126 | # 127 | # I forget about how to do stuff aliases 128 | alias filesize="du -sh" 129 | alias whoisusingports="sudo lsof -i -P -n | grep LISTEN" 130 | # 131 | # Git aliases 132 | alias prettylog="git log --graph --decorate --oneline" 133 | alias whathaveibeenupto="git log --author=\"$(git config user.email)\" --pretty=format:\"%C(magenta)%an%Creset %C(green)%<(20)%ar%Creset %C(blue) %s %Creset\" --no-merges" 134 | # I'm a sloppy shit aliases 135 | alias tmus="tmux" 136 | # 137 | # Dev aliases 138 | alias devserver="npx @web/dev-server --node-resolve --watch" 139 | alias installanalyzer="npm i -D @custom-elements-manifest/analyzer" 140 | alias gentypes="tsc --declaration --emitDeclarationOnly --allowJs" 141 | 142 | # Vim aliases 143 | alias vimplugins="vim ~/.config/nvim/rcfiles/plugins.lua" 144 | alias vimrc="vim ~/dotfiles/init.lua" 145 | 146 | alias nrb="npm run build" 147 | 148 | alias fixkdebar="cp ~/.config/plasma-org.kde.plasma.desktop-appletsrc ~/.config/plasma-org.kde.plasma.desktop-appletsrc.backup" 149 | 150 | # Screenkey 151 | alias screenkeystream="screenkey -s small --timeout 0.3 --opacity 0.6 -g 500x100+50%+120% -p fixed" 152 | 153 | # Todo 154 | alias todo="vim ~/vaults/todo.md && cd ~/vaults/ && ./sync && cd -" 155 | 156 | # Add JBang to environment 157 | alias j!=jbang 158 | 159 | # Types 160 | alias tsctypes="npx -p typescript tsc --declaration --checkJs --allowJs --emitDeclarationOnly --lib esnext,DOM --outDir types " 161 | 162 | # Update neovim 163 | alias updateneovim="wget https://github.com/neovim/neovim/releases/download/stable/nvim-linux-x86_64.appimage -O ~/nvim.appimage && chmod +x ~/nvim.appimage" 164 | 165 | # Remove capslock 166 | alias removecapslock="python -c 'from ctypes import *; X11 = cdll.LoadLibrary("libX11.so.6"); X11.XOpenDisplay.restype = POINTER(c_ubyte); display = X11.XOpenDisplay(None); X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(2), c_uint(0)); X11.XCloseDisplay(display)'" 167 | 168 | # Random passwords 169 | alias randompassword="openssl rand -hex 32" 170 | alias randomkey="openssl rand -base64 32" 171 | 172 | #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! 173 | export SDKMAN_DIR="$HOME/.sdkman" 174 | [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" 175 | ###-begin-pm2-completion-### 176 | ### credits to npm for the completion file model 177 | # 178 | # Installation: pm2 completion >> ~/.bashrc (or ~/.zshrc) 179 | # 180 | 181 | COMP_WORDBREAKS=${COMP_WORDBREAKS/=/} 182 | COMP_WORDBREAKS=${COMP_WORDBREAKS/@/} 183 | export COMP_WORDBREAKS 184 | 185 | if type complete &>/dev/null; then 186 | _pm2_completion () { 187 | local si="$IFS" 188 | IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \ 189 | COMP_LINE="$COMP_LINE" \ 190 | COMP_POINT="$COMP_POINT" \ 191 | pm2 completion -- "${COMP_WORDS[@]}" \ 192 | 2>/dev/null)) || return $? 193 | IFS="$si" 194 | } 195 | complete -o default -F _pm2_completion pm2 196 | elif type compctl &>/dev/null; then 197 | _pm2_completion () { 198 | local cword line point words si 199 | read -Ac words 200 | read -cn cword 201 | let cword-=1 202 | read -l line 203 | read -ln point 204 | si="$IFS" 205 | IFS=$'\n' reply=($(COMP_CWORD="$cword" \ 206 | COMP_LINE="$line" \ 207 | COMP_POINT="$point" \ 208 | pm2 completion -- "${words[@]}" \ 209 | 2>/dev/null)) || return $? 210 | IFS="$si" 211 | } 212 | compctl -K _pm2_completion + -f + pm2 213 | fi 214 | ###-end-pm2-completion-### 215 | 216 | export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" 217 | 218 | # pnpm 219 | export PNPM_HOME="/home/matsu/.local/share/pnpm" 220 | case ":$PATH:" in 221 | *":$PNPM_HOME:"*) ;; 222 | *) export PATH="$PNPM_HOME:$PATH" ;; 223 | esac 224 | # pnpm end 225 | 226 | # The next line updates PATH for the Google Cloud SDK. 227 | if [ -f '/tmp/google-cloud-sdk/path.bash.inc' ]; then . '/tmp/google-cloud-sdk/path.bash.inc'; fi 228 | 229 | # The next line enables shell command completion for gcloud. 230 | if [ -f '/tmp/google-cloud-sdk/completion.bash.inc' ]; then . '/tmp/google-cloud-sdk/completion.bash.inc'; fi 231 | -------------------------------------------------------------------------------- /.i3/config: -------------------------------------------------------------------------------- 1 | #i3 config file (v4) 2 | set $sup Mod4 3 | set $mod Mod1 4 | set $ctrl Control 5 | 6 | set $inner 20 7 | set $outerTop 0 8 | set $outerBottom 0 9 | set $radius 6 10 | 11 | gaps inner $inner 12 | gaps top $outerTop 13 | gaps bottom $outerBottom 14 | focus_follows_mouse no 15 | smart_borders on 16 | #border_radius $radius 17 | 18 | #set $borderSize 3 19 | set $borderSize 0 20 | set $focusBorder #FE7C8E 21 | set $unFocusBorder #7658a8 22 | set $bg #ed6f81 23 | set $fg #FFFFFF 24 | 25 | for_window [class="^.*"] border pixel $borderSize 26 | 27 | # Borders 28 | # CLASS BORDER BACK TEXT INDICATOR 29 | client.focused $focusBorder $focusBorder $focusBorder $bg 30 | client.focused_inactive $unFocusBorder $unFocusBorder $unFocusBorder $unFocusBorder 31 | client.unfocused $unFocusBorder $unFocusBorder $unFocusBorder $unFocusBorder 32 | client.urgent $unFocusBorder $unFocusBorder $unFocusBorder $unFocusBorder 33 | 34 | font pango:monospace 8 35 | 36 | bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% 37 | bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% 38 | bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle 39 | 40 | set $up k 41 | set $down j 42 | set $left h 43 | set $right l 44 | 45 | # use Mouse+$sup to drag floating windows to their wanted position 46 | floating_modifier $sup 47 | 48 | # kill focused window 49 | bindsym $sup+Shift+q kill 50 | 51 | # Autorandr 52 | bindsym $sup+$ctrl+w exec autorandr --change work 53 | bindsym $sup+$ctrl+p exec autorandr --change presentation 54 | 55 | # change focus 56 | bindsym $sup+$left focus left 57 | bindsym $sup+$down focus down 58 | bindsym $sup+$up focus up 59 | bindsym $sup+$right focus right 60 | 61 | # alternatively, you can use the cursor keys: 62 | bindsym $sup+Left focus left 63 | bindsym $sup+Down focus down 64 | bindsym $sup+Up focus up 65 | bindsym $sup+Right focus right 66 | 67 | # move focused window 68 | bindsym $sup+Shift+$left move left 69 | bindsym $sup+Shift+$down move down 70 | bindsym $sup+Shift+$up move up 71 | bindsym $sup+Shift+$right move right 72 | 73 | # alternatively, you can use the cursor keys: 74 | bindsym $sup+Shift+Left move left 75 | bindsym $sup+Shift+Down move down 76 | bindsym $sup+Shift+Up move up 77 | bindsym $sup+Shift+Right move right 78 | 79 | # split in horizontal orientation 80 | bindsym $sup+b split h 81 | 82 | # split in vertical orientation 83 | bindsym $sup+v split v 84 | 85 | # enter fullscreen mode for the focused container 86 | bindsym $sup+f fullscreen toggle 87 | 88 | # change container layout (stacked, tabbed, toggle split) 89 | bindsym $sup+s layout stacking 90 | bindsym $sup+w layout tabbed 91 | bindsym $sup+e layout toggle split 92 | 93 | # toggle tiling / floating 94 | bindsym $sup+d floating toggle 95 | 96 | # change focus between tiling / floating windows 97 | bindsym $sup+space focus mode_toggle 98 | 99 | 100 | # Define names for default workspaces for which we configure key bindings later on. 101 | # We use variables to avoid repeating the names in multiple places. 102 | set $ws1 "1" 103 | set $ws2 "2" 104 | set $ws3 "3" 105 | set $ws4 "4" 106 | set $ws5 "5" 107 | set $ws6 "6" 108 | set $ws7 "7" 109 | set $ws8 "8" 110 | set $ws9 "9" 111 | set $ws10 "10" 112 | 113 | # switch to workspace 114 | bindsym $ctrl+1 workspace number $ws1 115 | bindsym $ctrl+2 workspace number $ws2 116 | bindsym $ctrl+3 workspace number $ws3 117 | bindsym $ctrl+4 workspace number $ws4 118 | bindsym $ctrl+5 workspace number $ws5 119 | bindsym $ctrl+6 workspace number $ws6 120 | bindsym $ctrl+7 workspace number $ws7 121 | bindsym $ctrl+8 workspace number $ws8 122 | bindsym $ctrl+9 workspace number $ws9 123 | bindsym $ctrl+0 workspace number $ws10 124 | 125 | # move focused container to workspace 126 | bindsym $ctrl+Shift+1 move container to workspace number $ws1 127 | bindsym $ctrl+Shift+2 move container to workspace number $ws2 128 | bindsym $ctrl+Shift+3 move container to workspace number $ws3 129 | bindsym $ctrl+Shift+4 move container to workspace number $ws4 130 | bindsym $ctrl+Shift+5 move container to workspace number $ws5 131 | bindsym $ctrl+Shift+6 move container to workspace number $ws6 132 | bindsym $ctrl+Shift+7 move container to workspace number $ws7 133 | bindsym $ctrl+Shift+8 move container to workspace number $ws8 134 | bindsym $ctrl+Shift+9 move container to workspace number $ws9 135 | bindsym $ctrl+Shift+0 move container to workspace number $ws10 136 | 137 | # reload the configuration file 138 | bindsym $sup+Shift+c reload 139 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 140 | bindsym $sup+Shift+r restart 141 | 142 | bindsym $sup+$ctrl+h resize shrink width 5 px or 5 ppt 143 | bindsym $sup+$ctrl+j resize shrink height 5 px or 5 ppt 144 | bindsym $sup+$ctrl+k resize grow height 5 px or 5 ppt 145 | bindsym $sup+$ctrl+l resize grow width 5 px or 5 ppt 146 | 147 | # >>> Plasma Integration <<< 148 | # Try to kill the wallpaper set by Plasma (it takes up the entire workspace 149 | # and hides everythiing) 150 | exec_always --no-startup-id wmctrl -c Plasma 151 | #for_window [title="Desktop — Plasma"] kill; floating enable; border none 152 | for_window [title="Desktop — Plasma"] kill 153 | for_window [class="ksplash"] kill 154 | for_window [class="Albert"] border none 155 | for_window [class="ulauncher"] border none 156 | 157 | # Avoid tiling popups, dropdown windows from plasma 158 | for_window [class="plasmashell"] floating enable 159 | for_window [class="Plasma"] floating enable 160 | for_window [class="krunner"] floating enable 161 | for_window [class="Kmix"] floating enable 162 | for_window [class="Klipper"] floating enable 163 | for_window [class="Plasmoidviewer"] floating enable 164 | for_window [class="spectacle"] floating enable 165 | 166 | # >>> Window Rules <<< 167 | 168 | # From wiki https://userbase.kde.org/Tutorials/Using_Other_Window_Managers_with_Plasma 169 | for_window [title="Desktop — Plasma"] kill; floating enable; border none 170 | for_window [class="plasmashell"] floating enable; 171 | for_window [class="Plasma"] floating enable; border none 172 | for_window [title="plasma-desktop"] floating enable; border none 173 | for_window [title="win7"] floating enable; border none 174 | for_window [class="krunner"] floating enable; border none 175 | for_window [class="Kmix"] floating enable; border none 176 | for_window [class="Klipper"] floating enable; border none 177 | for_window [class="Plasmoidviewer"] floating enable; border none 178 | for_window [class="(?i)*nextcloud*"] floating disable 179 | no_focus [class="plasmashell" window_type="notification"] 180 | # Plasma compatibility improvements 181 | for_window [window_role="pop-up"] floating enable 182 | for_window [window_role="task_dialog"] floating enable 183 | 184 | for_window [class="yakuake"] floating enable 185 | for_window [class="systemsettings"] floating enable 186 | for_window [class="plasmashell"] floating enable; 187 | for_window [class="plasmashell" window_type="notification"] border none, move position 70 ppt 81 ppt 188 | no_focus [class="plasmashell" window_type="notification"] 189 | 190 | # Kills the window 191 | for_window [title="Desktop @ QRect.*"] kill; floating enable; border none 192 | 193 | 194 | #no_focus [class=”plasmashell”] 195 | 196 | # ________ ________ _____ 197 | # | ____\ \ / / ____/ ____| 198 | # | |__ \ V /| |__ | | 199 | # | __| > < | __|| | 200 | # | |____ / . \| |___| |____ 201 | # |______/_/ \_\______\_____| 202 | # 203 | 204 | exec --no-startup-id /usr/lib/pam_kwallet_init 205 | exec --no-startup-id /usr/lib/polkit-kde-authentication-agent-1 206 | 207 | exec_always --no-startup-id feh --bg-fill /home/matsu/Pictures/alena-aenami-far-from-tomorrow-1080px.jpg 208 | exec_always --no-startup-id picom 209 | 210 | exec_always --no-startup-id eww open bar 211 | 212 | # _____ _ _ _ 213 | # / ____| | | | | | 214 | # | (___ | |__ ___ _ __| |_ ___ _ _| |_ 215 | # \___ \| '_ \ / _ \| '__| __/ __| | | | __| 216 | # ____) | | | | (_) | | | || (__| |_| | |_ 217 | # |_____/|_| |_|\___/|_| \__\___|\__,_|\__| 218 | # 219 | # bindsym $mod+space exec albert show 220 | bindsym $mod+space exec ulauncher 221 | bindsym $sup+Return exec alacritty 222 | 223 | # Gaming m 224 | 225 | mode "gaming" { 226 | bindsym Scroll_Lock exec i3-msg mode "default"; exec notify-send "i3" "Exiting gaming mode" 227 | } 228 | bindsym Scroll_Lock exec i3-msg mode "gaming"; exec notify-send "i3" "Entering gaming mode" 229 | 230 | # layout 231 | 232 | workspace 1 output DisplayPort-8 233 | workspace 2 output DisplayPort-8 234 | workspace 3 output DisplayPort-10 235 | workspace 4 output DisplayPort-10 236 | -------------------------------------------------------------------------------- /eww/eww.yuck: -------------------------------------------------------------------------------- 1 | (defvar power false) 2 | 3 | (defwindow bar 4 | :monitor '["primary", "eDP-1", "DisplayPort-8", 0]' 5 | :layer "top" 6 | :exclusive true 7 | :exclusive-zone 32 8 | :focusable false 9 | :anchor "top center" 10 | :geometry (geometry :x "0%" 11 | :y "0%" 12 | :width "100%" 13 | :anchor "top left") 14 | (box 15 | (box 16 | :halign "start" 17 | :space-evenly false 18 | (tray-win) 19 | (music-win) 20 | (workspaces-win) 21 | ) 22 | (box 23 | :space-evenly false 24 | :halign "end" 25 | (specs-win) 26 | (date-win) 27 | (power-win) 28 | ) 29 | ) 30 | ) 31 | 32 | (defwidget workspaces-win [] 33 | (box :space-evenly false :class "workspaces" :valign "center" 34 | (for ws in workspace-data 35 | (box 36 | :class `workspace-box shadow ${ws.Focused == true ? "focused" : ""}` 37 | (eventbox 38 | :class "workspace-eventbox" 39 | :cursor "pointer" 40 | (button 41 | :onclick "scripts/switch_workspace_by_name.sh \"${ws.Name}\"" 42 | (box 43 | :class "workspace-icons" 44 | "${ws.Name}" 45 | (for app in {ws.Apps} 46 | (button :style "background-image: url('${app.Icon}');") 47 | ) 48 | ) 49 | ) 50 | ) 51 | ) 52 | ) 53 | ) 54 | ) 55 | 56 | (defwidget tray-win [] 57 | (box :space-evenly false :class "tray-box content-box shadow" :valign "center" 58 | (systemtray) 59 | ) 60 | ) 61 | 62 | (defwidget music-win [] 63 | (box 64 | :visible { music != ""} 65 | :space-evenly false :class "content-box music-box" :valign "center" 66 | (music) 67 | ) 68 | ) 69 | 70 | (defwidget specs-win [] 71 | (box :space-evenly false :class "content-box shadow" :valign "center" 72 | (wifi) 73 | (button 74 | :onclick "scripts/togglemute.sh" 75 | (metric :label "${muted == "[on]" ? "🔊" : "🔇"}" 76 | :value volume 77 | :tooltip volume 78 | :onchange "amixer -D pulse sset Master {}%" 79 | ) 80 | ) 81 | 82 | (metric :label "⚙️" 83 | :value {round(EWW_CPU.avg, 0)} 84 | :tooltip "${round(EWW_CPU.avg, 0)}%" 85 | :onchange "") 86 | 87 | (metric :label "💿" 88 | :value {EWW_RAM.used_mem_perc} 89 | :tooltip "${round(EWW_RAM.used_mem / 1000000000, 2)} / ${round(EWW_RAM.total_mem / 1000000000, 2)}" 90 | :onchange "") 91 | (battery) 92 | ) 93 | ) 94 | 95 | (defwidget date-win [] 96 | (box :space-evenly false :class "content-box shadow" :valign "center" 97 | (datetime) 98 | ) 99 | ) 100 | 101 | (defwidget power-win [] 102 | (powermenu) 103 | ) 104 | 105 | (defwidget datetime [] 106 | (box :class "datetime" :orientation "h" :halign "start" :valign "center" :space-evenly false 107 | (box :class "datetime-time" :orientation "v" :space-evenly false 108 | (label :class "datetime-hour" :text hours :halign "start") 109 | (label :class "datetime-minute" :text minutes :halign "start") 110 | ) 111 | 112 | (box :class "datetime-date" :orientation "v" :space-evenly false 113 | (label :class "datetime-day" :text date :halign "start") 114 | (label :class "" :text datemonth :halign "start") 115 | ) 116 | )) 117 | 118 | (defwidget battery [] 119 | (box :orientation "h" 120 | :visible { EWW_BATTERY != "" } 121 | :class "metric" 122 | :tooltip "${EWW_BATTERY}" 123 | :space-evenly false 124 | (box :class "label" {EWW_BATTERY.BAT1.capacity == 100 || EWW_BATTERY.BAT1.status == "Charging" ? "🔌" : "🔋"}) 125 | (scale :min 0 126 | :max 100 127 | :value {EWW_BATTERY.BAT1.capacity == "" ? 100 : EWW_BATTERY.BAT1.capacity} 128 | ) 129 | )) 130 | 131 | (defwidget wifi [] 132 | (box :orientation "v" 133 | (eventbox :cursor "pointer" 134 | (button 135 | :class "trayicon" 136 | :tooltip "${NETSTAT}" 137 | (box :orientation "h" :class "networkbutton" :spacing 5 :space-evenly false 138 | (image 139 | :path WIFIICON 140 | :image-width 18 141 | :image-height 18) 142 | NETSTAT 143 | ) 144 | ) 145 | ) 146 | ) 147 | ) 148 | 149 | 150 | (defwidget music [] 151 | (box 152 | :visible { music != ""} 153 | :space-evenly false 154 | (box :class "music" 155 | :space-evenly false 156 | (image :class "music-image" :path "images/compact-disc.png" :image-height 30 :valign "center") 157 | (box 158 | :orientation "v" 159 | :space-evenly false 160 | :halign "start" 161 | :valign "center" 162 | (label :class "music-artist" :text "${music.artist}" :halign "start") 163 | (label :class "music-title" :text "${music.title}" :truncate true :limit-width 30 :halign "start") 164 | ) 165 | ) 166 | (box 167 | :class "music-controls" 168 | :space-evenly false 169 | :valign "center" 170 | (eventbox :cursor "pointer" 171 | (button 172 | :class "music-control-button" 173 | :style "background-image: url('images/rewind.png');" 174 | :tooltip "Previous" 175 | :onclick "playerctl previous")) 176 | (eventbox :cursor "pointer" 177 | (button 178 | :class "music-control-button" 179 | :style "background-image: url('images/play-button.png');" 180 | :tooltip "Play" 181 | :onclick "playerctl play-pause")) 182 | (eventbox :cursor "pointer" 183 | (button 184 | :class "music-control-button" 185 | :style "background-image: url('images/fast-forward.png');" 186 | :tooltip "Next" 187 | :onclick "playerctl next")) 188 | ) 189 | ) 190 | ) 191 | 192 | 193 | (defwidget metric [label value tooltip onchange] 194 | (box :orientation "h" 195 | :class "metric" 196 | :space-evenly false 197 | (box :class "label" :tooltip tooltip label) 198 | (scale :min 0 199 | :max 101 200 | :active {onchange != ""} 201 | :value value 202 | :onchange onchange))) 203 | 204 | (defwidget systemtray [] 205 | (box :orientation "v" :halign "start" 206 | (systray :class "tray" :orientation "h" :icon-size 18 :spacing 5) 207 | ) 208 | ) 209 | 210 | (defwidget powermenu [] 211 | (box :orientation "v" :halign "start" :class "powermenu-wrap" :space-evenly false 212 | (eventbox :onhover "${EWW_CMD} update power=true" 213 | :onhoverlost "${EWW_CMD} update power=false" 214 | :cursor "pointer" 215 | 216 | (box :orientation "h" 217 | :space-evenly false 218 | :vexpand false 219 | :class "powermenu" 220 | 221 | (revealer :transition "slideleft" 222 | :reveal power 223 | :duration "550ms" 224 | 225 | (box :orientation "h" 226 | :space-evenly false 227 | 228 | ; Commented for now due to it being quite broken 229 | ; (button :style "background-image: url('images/exit.png');" 230 | ; :class "powermenu-button" 231 | ; :tooltip "Log out" 232 | ; :onclick "qdbus org.kde.Shutdown /Shutdown logout") 233 | 234 | (button :style "background-image: url('images/exit.png');" 235 | :class "powermenu-button" 236 | :tooltip "Log out" 237 | :onclick "swaymsg exit") 238 | 239 | (button :style "background-image: url('images/padlock.png');" 240 | :class "powermenu-button" 241 | :tooltip "Lock Screen" 242 | :onclick "~/.config/sway/lock") 243 | 244 | (button :style "background-image: url('images/moon.png');" 245 | :class "powermenu-button" 246 | :tooltip "Suspend computer" 247 | :onclick "systemctl suspend") 248 | 249 | (button :style "background-image: url('images/restart.png');" 250 | :class "powermenu-button" 251 | :tooltip "Reboot" 252 | :onclick "reboot") 253 | )) 254 | 255 | (button :style "background-image: url('images/power-button.png');" 256 | :class "powermenu-button powermenu-main-button" 257 | :tooltip "Shutdown" 258 | :onclick "shutdown now" 259 | )) 260 | ) 261 | )) 262 | 263 | ;;; Polls 264 | 265 | (deflisten music :initial "" 266 | "playerctl --follow metadata --format '{ \"artist\": \"{{ artist }}\", \"title\": \"{{ title }}\", \"image\": \"{{ mpris:artUrl }}\" }' || true") 267 | 268 | (defpoll volume :interval "1s" 269 | "scripts/getvol.sh") 270 | 271 | (defpoll muted :interval "1s" 272 | "scripts/getmuted.sh") 273 | 274 | (defpoll currentworkspaces :interval "1s" 275 | "scripts/workspaces.sh") 276 | 277 | (defpoll workspace-data :interval "1s" 278 | "scripts/go/workspaces/main") 279 | 280 | (defpoll date :interval "10s" 281 | "date '+%A'") 282 | 283 | (defpoll datemonth :interval "10s" 284 | "date '+%d. %B'") 285 | 286 | (defpoll hours :interval "10s" 287 | "date '+%H'") 288 | 289 | (defpoll minutes :interval "10s" 290 | "date '+%M'") 291 | 292 | ;; Network 293 | (defpoll WIFIICON :interval "15s" `scripts/network.sh --icon`) 294 | (defpoll NETSTAT :interval "15s" `scripts/network.sh --stat`) 295 | -------------------------------------------------------------------------------- /picom.conf: -------------------------------------------------------------------------------- 1 | ################################# 2 | # Animations # 3 | ################################# 4 | 5 | rules: ( 6 | @include "picom-animations.conf", 7 | { 8 | match = "window_type = 'dock'"; 9 | shadow = false; 10 | }, 11 | { match = "window_type = 'tooltip'"; shadow = false; }, 12 | { match = "window_type = 'menu'"; shadow = false; }, 13 | { match = "window_type = 'dropdown_menu'"; shadow = false; }, 14 | { match = "window_type = 'popup_menu'"; shadow = false; }, 15 | { 16 | match = "window_type = 'normal'", 17 | dim = 0.1 18 | }, 19 | { 20 | match = "focused", 21 | dim = 0; 22 | }, 23 | { 24 | match = "name = 'Ulauncher - Application Launcher'", 25 | shadow = false, 26 | animations = ( 27 | { 28 | # Disable the global geometry animation 29 | triggers = ["geometry"]; 30 | } 31 | ) 32 | }, 33 | ) 34 | 35 | ################################# 36 | # Corners # 37 | ################################# 38 | # requires: https://github.com/sdhand/compton 39 | corner-radius = 12; 40 | 41 | rounded-corners-exclude = [ 42 | "class_g = 'Rofi'", 43 | "name = 'Notification area'", 44 | "class_g = 'Polybar'", 45 | "class_g = 'firefox'" 46 | ]; 47 | round-borders = 1; 48 | round-borders-exclude = [ 49 | ]; 50 | 51 | # Specify a list of border width rules, in the format `PIXELS:PATTERN`, 52 | # Note we don't make any guarantee about possible conflicts with the 53 | # border_width set by the window manager. 54 | # 55 | # example: 56 | # round-borders-rule = [ "2:class_g = 'URxvt'" ]; 57 | # 58 | round-borders-rule = [ 59 | "3:class_g = 'XTerm'", 60 | "3:class_g = 'URxvt'", 61 | "10:class_g = 'Alacritty'", 62 | "15:class_g = 'Signal'" 63 | ]; 64 | 65 | ################################# 66 | # Shadows # 67 | ################################# 68 | 69 | 70 | # Enabled client-side shadows on windows. Note desktop windows 71 | # (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, 72 | # unless explicitly requested using the wintypes option. 73 | # 74 | shadow = true; 75 | 76 | # The blur radius for shadows, in pixels. (defaults to 12) 77 | shadow-radius = 14; 78 | 79 | # The opacity of shadows. (0.0 - 1.0, defaults to 0.75) 80 | shadow-opacity = 0.75 81 | 82 | # The left offset for shadows, in pixels. (defaults to -15) 83 | shadow-offset-x = -9; 84 | 85 | # The top offset for shadows, in pixels. (defaults to -15) 86 | shadow-offset-y = -7; 87 | 88 | # Red color value of shadow (0.0 - 1.0, defaults to 0). 89 | shadow-red = 0.278 90 | 91 | # Green color value of shadow (0.0 - 1.0, defaults to 0). 92 | shadow-green = 0.145 93 | 94 | # Blue color value of shadow (0.0 - 1.0, defaults to 0). 95 | shadow-blue = 0.254 96 | 97 | # Specify a list of conditions of windows that should have no shadow. 98 | # 99 | shadow-exclude = [ 100 | "name = 'Notification'", 101 | "class_g = 'Ulauncher'", 102 | "class_g = 'Conky'", 103 | "class_g ?= 'Notify-osd'", 104 | "class_g = 'Cairo-clock'", 105 | "class_g = 'slop'", 106 | "class_g = 'Polybar'", 107 | "class_g = 'eww'", 108 | "_GTK_FRAME_EXTENTS@:c" 109 | ]; 110 | 111 | 112 | ################################# 113 | # Fading # 114 | ################################# 115 | 116 | 117 | # Fade windows in/out when opening/closing and when opacity changes, 118 | # unless no-fading-openclose is used. 119 | fading = true; 120 | 121 | # Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) 122 | fade-in-step = 0.05; 123 | 124 | # Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) 125 | fade-out-step = 0.05; 126 | 127 | # Specify a list of conditions of windows that should not be faded. 128 | # don't need this, we disable fading for all normal windows with wintypes: {} 129 | fade-exclude = [ 130 | "class_g = 'slop'" # maim 131 | ] 132 | 133 | 134 | ################################# 135 | # Transparency / Opacity # 136 | ################################# 137 | 138 | # Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) 139 | inactive-opacity = 1.0; 140 | 141 | # Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) 142 | frame-opacity = 1.0; 143 | 144 | # Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0) 145 | # menu-opacity = 1.0 146 | 147 | # Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows. 148 | # inactive-opacity-override = true 149 | inactive-opacity-override = false; 150 | 151 | # Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) 152 | active-opacity = 1; 153 | 154 | # Dim inactive windows. (0.0 - 1.0, defaults to 0.0) 155 | inactive-dim = 0.1 156 | 157 | # Specify a list of conditions of windows that should always be considered focused. 158 | # focus-exclude = [] 159 | focus-exclude = [ 160 | "class_g = 'Cairo-clock'", 161 | "class_g = 'Bar'", # lemonbar 162 | "class_g = 'slop'", # maim 163 | "class_g = 'plasmashell'" 164 | ]; 165 | 166 | ################################# 167 | # General Settings # 168 | ################################# 169 | 170 | # Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers. 171 | # daemon = false 172 | 173 | # Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. 174 | # `xrender` is the default one. 175 | # 176 | experimental-backends = true; 177 | backend = "glx"; 178 | 179 | 180 | # Enable/disable VSync. 181 | vsync = false 182 | #vsync = true 183 | 184 | # Enable remote control via D-Bus. See the *D-BUS API* section below for more details. 185 | # dbus = false 186 | 187 | # Try to detect WM windows (a non-override-redirect window with no 188 | # child that has 'WM_STATE') and mark them as active. 189 | # 190 | # mark-wmwin-focused = false 191 | mark-wmwin-focused = true; 192 | 193 | # Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused. 194 | # mark-ovredir-focused = false 195 | mark-ovredir-focused = true; 196 | 197 | # Try to detect windows with rounded corners and don't consider them 198 | # shaped windows. The accuracy is not very high, unfortunately. 199 | # 200 | # detect-rounded-corners = false 201 | detect-rounded-corners = true 202 | 203 | # Detect '_NET_WM_OPACITY' on client windows, useful for window managers 204 | # not passing '_NET_WM_OPACITY' of client windows to frame windows. 205 | # 206 | # detect-client-opacity = false 207 | detect-client-opacity = true; 208 | 209 | # Specify refresh rate of the screen. If not specified or 0, picom will 210 | # try detecting this with X RandR extension. 211 | # 212 | # refresh-rate = 60 213 | refresh-rate = 0 214 | 215 | # Use 'WM_TRANSIENT_FOR' to group windows, and consider windows 216 | # in the same group focused at the same time. 217 | # 218 | # detect-transient = false 219 | detect-transient = true 220 | 221 | # Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same 222 | # group focused at the same time. 'WM_TRANSIENT_FOR' has higher priority if 223 | # detect-transient is enabled, too. 224 | # 225 | # detect-client-leader = false 226 | detect-client-leader = true 227 | 228 | 229 | # Disable the use of damage information. 230 | # This cause the whole screen to be redrawn everytime, instead of the part of the screen 231 | # has actually changed. Potentially degrades the performance, but might fix some artifacts. 232 | # The opposing option is use-damage 233 | # 234 | # no-use-damage = false 235 | use-damage = true 236 | 237 | # Set the log level. Possible values are: 238 | # "trace", "debug", "info", "warn", "error" 239 | # in increasing level of importance. Case doesn't matter. 240 | # If using the "TRACE" log level, it's better to log into a file 241 | # using *--log-file*, since it can generate a huge stream of logs. 242 | # 243 | # log-level = "debug" 244 | log-level = "info"; 245 | 246 | # Set the log file. 247 | # If *--log-file* is never specified, logs will be written to stderr. 248 | # Otherwise, logs will to written to the given file, though some of the early 249 | # logs might still be written to the stderr. 250 | # When setting this option from the config file, it is recommended to use an absolute path. 251 | # 252 | # log-file = '/path/to/your/log/file' 253 | 254 | # Show all X errors (for debugging) 255 | # show-all-xerrors = false 256 | 257 | # Write process ID to a file. 258 | # write-pid-path = '/path/to/your/log/file' 259 | 260 | # Window type settings 261 | # 262 | # 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard: 263 | # "unknown", "desktop", "dock", "toolbar", "menu", "utility", 264 | # "splash", "dialog", "normal", "dropdown_menu", "popup_menu", 265 | # "tooltip", "notification", "combo", and "dnd". 266 | # 267 | # Following per window-type options are available: :: 268 | # 269 | # fade, shadow::: 270 | # Controls window-type-specific shadow and fade settings. 271 | # 272 | # opacity::: 273 | # Controls default opacity of the window type. 274 | # 275 | # focus::: 276 | # Controls whether the window of this type is to be always considered focused. 277 | # (By default, all window types except "normal" and "dialog" has this on.) 278 | # 279 | # full-shadow::: 280 | # Controls whether shadow is drawn under the parts of the window that you 281 | # normally won't be able to see. Useful when the window has parts of it 282 | # transparent, and you want shadows in those areas. 283 | # 284 | # redir-ignore::: 285 | # Controls whether this type of windows should cause screen to become 286 | # redirected again after been unredirected. If you have unredir-if-possible 287 | # set, and doesn't want certain window to cause unnecessary screen redirection, 288 | # you can set this to `true`. 289 | # 290 | wintypes: 291 | { 292 | normal = { full-shadow = true; }; 293 | menu = { full-shadow = true; }; 294 | tooltip = { fade = true; shadow = false; focus = true;}; 295 | dock = { shadow = false; }; 296 | dnd = { shadow = false; }; 297 | popup_menu = { full-shadow = true; }; 298 | utility = { full-shadow = true; }; 299 | toolbar = { full-shadow = true; }; 300 | notification = { opacity = 1; } 301 | }; 302 | --------------------------------------------------------------------------------