├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── install ├── gnome-settings ├── notes.md ├── packages │ ├── arch │ │ ├── aur.list │ │ └── pac.list │ ├── snaps │ │ └── snap.list │ └── ubuntu │ │ └── pkg.list ├── windows │ ├── windows-setup.md │ ├── windows-terminal.json │ └── wsl-clipboard.sh └── x │ ├── dotfiles.sh │ ├── macos.sh │ ├── neovim.sh │ ├── nerdfonts.sh │ └── system.sh └── src ├── .config ├── X11 │ ├── xinitrc │ └── xresources ├── alacritty │ └── alacritty.yml ├── awesome │ ├── .stylua.toml │ ├── modules │ │ ├── config.lua │ │ └── keymaps.lua │ └── rc.lua ├── bookmarks │ └── urls.conf ├── fontconfig │ └── fonts.conf ├── ghostty │ └── config ├── git │ └── config ├── gtk-2.0 │ ├── gtkfilechooser.ini │ └── gtkrc-2.0 ├── gtk-3.0 │ ├── bookmarks │ └── settings.ini ├── htop │ └── htoprc ├── kitty │ ├── fonts │ │ ├── FiraCode.conf │ │ ├── Iosevka.conf │ │ ├── JetBrainsMono.conf │ │ └── UbuntuMono.conf │ ├── kitty.conf │ └── themes │ │ ├── custom.conf │ │ ├── dracula.conf │ │ ├── gruvbox.conf │ │ ├── monokai.conf │ │ ├── onedark.conf │ │ └── tokyonight.conf ├── nvim │ ├── init.lua │ ├── lazy-lock.json │ └── lua │ │ ├── config │ │ ├── autocmd.lua │ │ ├── keymaps.lua │ │ ├── lazy.lua │ │ ├── options.lua │ │ └── telescope.lua │ │ └── plugins │ │ ├── ai.lua │ │ ├── autoformat.lua │ │ ├── colorscheme.lua │ │ ├── editor.lua │ │ ├── lsp.lua │ │ ├── telescope.lua │ │ └── treesitter.lua ├── ranger │ ├── plugins │ │ ├── __init__.py │ │ └── icons │ │ │ ├── __init__.py │ │ │ └── devicons.py │ ├── rc.conf │ └── scope.sh ├── tmux │ ├── tmux.conf │ └── tmux.conf.bak ├── user-dirs.dirs ├── wget │ └── wgetrc ├── zathura │ └── zathurarc ├── zed │ ├── keymap.json │ └── settings.json └── zsh │ ├── .zshrc │ └── config │ ├── alias.sh │ ├── exports.sh │ └── scripts.sh ├── .local ├── bin │ ├── dmenu │ │ ├── dm-bookmarks │ │ └── dm-maim │ ├── maimscript │ ├── notion.sh │ ├── npm │ │ └── package.json │ ├── scripts │ │ └── remap │ └── statusbar │ │ ├── sb-battery │ │ ├── sb-clock │ │ ├── sb-cpuavg │ │ ├── sb-disk │ │ ├── sb-internet │ │ ├── sb-memory │ │ ├── sb-volume │ │ └── sb-weather └── src │ ├── dwm │ ├── Makefile │ ├── config.h │ ├── config.mk │ ├── drw.c │ ├── drw.h │ ├── dwm.1 │ ├── dwm.c │ ├── patches │ │ ├── dwm-actualfullscreen-20191112-cb3f58a.diff │ │ ├── dwm-alpha-20201019-61bb8b2.diff │ │ ├── dwm-alwaysfullscreen-6.1.diff │ │ ├── dwm-attachaside-20180126-db22360.diff │ │ ├── dwm-cfacts-vanitygaps-6.2_combo.diff │ │ ├── dwm-hide_vacant_tags-6.2.diff │ │ └── dwm-pertag-20200914-61bb8b2.diff │ ├── transient.c │ ├── util.c │ ├── util.h │ └── vanitygaps.c │ └── dwmblocks │ ├── Makefile │ ├── blocks.h │ └── dwmblocks.c ├── .zshrc └── Library └── Application Support └── Cursor └── User ├── keybindings.json └── settings.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.env 2 | *.log 3 | *.o 4 | *.orig 5 | *.rej 6 | *.zcompdump* 7 | *__pycache__ 8 | *packer_compiled* 9 | .DS_Store 10 | node_modules 11 | src/.config/zed/conversations 12 | src/.config/zed/prompts 13 | src/.config/zed/themes 14 | src/.config/zsh/.zsh_history 15 | src/.config/zsh/plugins 16 | src/.local/bin/npm/package-lock.json 17 | src/.local/src/dwm/dwm 18 | src/.local/src/dwmblocks/dwmblocks 19 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "zsh-syntax-highlighting"] 2 | path = src/.config/zsh/plugins/zsh-syntax-highlighting 3 | url = https://github.com/zsh-users/zsh-syntax-highlighting 4 | [submodule "zsh-autosuggestions"] 5 | path = src/.config/zsh/plugins/zsh-autosuggestions 6 | url = https://github.com/zsh-users/zsh-autosuggestions 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Martin Sione 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Setup MacOS from a clean install 2 | 3 | 1. Set up SSH keys for github 4 | 5 | ```bash 6 | 7 | ssh-keygen -t ed25519 -C 8 | 9 | # Add this to https://github.com/settings/keys 10 | pbcopy < ~/.ssh/id_ed25519.pub 11 | 12 | ``` 13 | 14 | 2. Clone repo and symlink files 15 | 16 | ```bash 17 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/martinsione/dotfiles/refs/heads/macos/install/x/macos.sh)" 18 | ``` 19 | 20 | 3. Install packages 21 | a App Store - Bitwarden (so that safari can use web extension) 22 | b Homebrew 23 | 24 | ```bash 25 | 26 | # Install executable 27 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 28 | # After installation, make it executable 29 | echo >> /Users/$USER/.zprofile echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/$USER/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" 30 | 31 | ``` 32 | 33 | ```bash 34 | 35 | brew install --cask \ 36 | 1password \ 37 | cursor \ 38 | discord \ 39 | font-jetbrains-mono-nerd-font \ 40 | font-zed-mono \ 41 | ghostty \ 42 | google-chrome \ 43 | raycast \ 44 | slack \ 45 | spotify \ 46 | whatsapp \ 47 | zed \ 48 | zoom 49 | 50 | brew install \ 51 | eza \ 52 | fnm \ 53 | neovim \ 54 | ripgrep \ 55 | starship \ 56 | tmux 57 | 58 | ``` 59 | 60 | 4. UI/UX tweaks 61 | - Disable hot corners 62 | - Automatically hide and show the Dock 63 | - Add ⌃ + number to switch desktops 64 | 1. Create 9 desktops 65 | 2. Go to System Preferences > Keyboard > Keyboard Shortcuts > Mission Control > Mission Control (enable all) 66 | - Replace Spotlight with Raycast 67 | - Enable "Magnet" preset for window management 68 | - Remap CAPS Lock to Control. (Settings > Keyboard > Keyboard Shortcuts) 69 | - Increase mouse and trackpad speed 70 | - Increase Key Repetition Speed and Remove Delay 71 | 72 | ```bash 73 | 74 | # Set key repeat rate to maximum (fastest) 75 | defaults write -g KeyRepeat -int 1 76 | 77 | # Set initial delay before repetition to minimum (no delay) 78 | defaults write -g InitialKeyRepeat -int 10 79 | 80 | # Disable press-and-hold for keys in favor of key repeat 81 | defaults write -g ApplePressAndHoldEnabled -bool false 82 | ``` 83 | -------------------------------------------------------------------------------- /install/gnome-settings: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # https://askubuntu.com/questions/1195081/increase-number-of-workspace-with-shortcuts-on-ubuntu-18-04 4 | # https://blog.programster.org/using-the-cli-to-set-custom-keyboard-shortcuts 5 | 6 | 7 | gsettings set org.gnome.desktop.wm.keybindings close "['q']" 8 | 9 | gsettings set org.gnome.mutter dynamic-workspaces false 10 | gsettings set org.gnome.desktop.wm.preferences num-workspaces 5 11 | # 1 12 | gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['1']" 13 | gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-1 "['1']" 14 | # 2 15 | gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-2 "['2']" 16 | gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-2 "['2']" 17 | # 3 18 | gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-3 "['3']" 19 | gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-3 "['3']" 20 | # 4 21 | gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-4 "['4']" 22 | gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-4 "['4']" 23 | # 5 24 | gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['5']" 25 | gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-5 "['5']" 26 | 27 | # Switch caps to ctrl 28 | gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:nocaps']" 29 | 30 | # Hide mounted drives on dock 31 | gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false 32 | 33 | ## Set custom keybindings 34 | BEGINNING="gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings" 35 | KEY_PATH="/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings" 36 | 37 | gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings \ 38 | "['$KEY_PATH/custom0/', '$KEY_PATH/custom1/', '$KEY_PATH/custom2/']" 39 | 40 | # Launch Terminal 41 | $BEGINNING/custom0/ name "Kitty" 42 | $BEGINNING/custom0/ command "kitty" 43 | $BEGINNING/custom0/ binding "Return" 44 | 45 | # screenshot the current active window 46 | $BEGINNING/custom1/ name "Browser" 47 | $BEGINNING/custom1/ command "brave" 48 | $BEGINNING/custom1/ binding "w" 49 | 50 | # Open up file browser 51 | $BEGINNING/custom2/ name "Nautilus" 52 | $BEGINNING/custom2/ command "nautilus --new-window" 53 | $BEGINNING/custom2/ binding "e" 54 | -------------------------------------------------------------------------------- /install/notes.md: -------------------------------------------------------------------------------- 1 | ## Create ssh keys 2 | 3 | ```sh 4 | ssh-keygen -t rsa -b 4096 -C "name@mail.com" 5 | sudo systemctl restart ssh 6 | 7 | # Linux 8 | xclip -sel clip < ~/.ssh/id_rsa.pub 9 | 10 | # MacOS 11 | cat ~/.ssh/id_rsa.pub | pbcopy 12 | 13 | # WSL 14 | clip.exe < ~/.ssh/id_rsa.pub 15 | ``` 16 | 17 | ## Create a user 18 | 19 | ```sh 20 | useradd -mg wheel martin 21 | passwd martin 22 | # echo '%wheel ALL=(ALL) ALL' 23 | ``` 24 | 25 | ## Setup notion api keys in $HOME/.config/zsh/config/.env 26 | 27 | ```sh 28 | export NOTION_API_KEY="" 29 | export NOTION_DATABASE_ID="" 30 | ``` 31 | 32 | ## Neovim dependencies 33 | 34 | ```sh 35 | sudo apt-get install libtool libtool-bin autoconf automake cmake libncurses5-dev g++ 36 | ``` 37 | 38 | ## Gnome base install 39 | 40 | ```sh 41 | firefox 42 | gdm 43 | gnome-shell 44 | gnome-control-center 45 | ``` 46 | 47 | ## Workaround for redshift 48 | 49 | ```sh 50 | redshift-gtk -l -34.6:-58.3 & disown 51 | ``` 52 | 53 | ## Get qemu/virt-manager to work 54 | 55 | ```sh 56 | sudo pacman -Syu ebtables dnsmasq 57 | sudo systemctl enable libvirtd 58 | sudo systemctl start libvirtd 59 | ``` 60 | 61 | ## Gdrive with rclone 62 | 63 | ```sh 64 | rclone config 65 | sudo mkdir /mnt/gdrive 66 | sudo chmod 775 o 777 /mnt/gdrive 67 | rclone mount --daemon gdrive: /mnt/gdrive 68 | # To unmount: fusermount -uz /path/to/drive 69 | ``` 70 | -------------------------------------------------------------------------------- /install/packages/arch/aur.list: -------------------------------------------------------------------------------- 1 | authy 2 | brave-bin 3 | visual-studio-code-bin 4 | zoom 5 | -------------------------------------------------------------------------------- /install/packages/arch/pac.list: -------------------------------------------------------------------------------- 1 | alacritty 2 | alsa-utils 3 | amd-ucode 4 | autoconf 5 | automake 6 | base 7 | bat 8 | binutils 9 | bison 10 | cloc 11 | cmake 12 | ctags 13 | curl 14 | dialog 15 | discord 16 | dmenu 17 | dnsmasq 18 | docker 19 | dosfstools 20 | dunst 21 | edk2-ovmf 22 | efibootmgr 23 | exa 24 | fakeroot 25 | fd 26 | file 27 | findutils 28 | firefox 29 | flatpak 30 | flex 31 | fuse2 32 | fzf 33 | gawk 34 | gcc 35 | gdb 36 | gettext 37 | git 38 | go 39 | grep 40 | groff 41 | grub 42 | gvfs 43 | gzip 44 | htop 45 | kitty 46 | lib32-mesa-demos 47 | lib32-nvidia-utils 48 | libreoffice-fresh 49 | libtool 50 | libva-vdpau-driver 51 | linux-firmware 52 | linux-lts 53 | linux-lts-headers 54 | lsb-release 55 | lua 56 | luarocks 57 | lxappearance 58 | lxsession 59 | m4 60 | maim 61 | make 62 | man-db 63 | materia-gtk-theme 64 | mpv 65 | mtools 66 | neofetch 67 | neovim 68 | networkmanager 69 | ninja 70 | nitrogen 71 | noto-fonts-emoji 72 | npm 73 | ntfs-3g 74 | nvidia-lts 75 | nvidia-settings 76 | nvidia-utils 77 | obs-studio 78 | octave 79 | os-prober 80 | otf-cascadia-code 81 | pacman 82 | pamixer 83 | papirus-icon-theme 84 | patch 85 | pcmanfm 86 | pkgconf 87 | pulseaudio-alsa 88 | pulsemixer 89 | python-pip 90 | python-pynvim 91 | qemu 92 | ranger 93 | redshift 94 | ripgrep 95 | sed 96 | steam 97 | stow 98 | sudo 99 | sxiv 100 | texinfo 101 | tmux 102 | trash-cli 103 | tree 104 | ttf-dejavu 105 | ttf-joypixels 106 | ttf-liberation 107 | ttf-ubuntu-font-family 108 | ueberzug 109 | unclutter 110 | unrar 111 | unzip 112 | virt-manager 113 | which 114 | wmname 115 | xclip 116 | xcompmgr 117 | xdotool 118 | xorg-server 119 | xorg-xdpyinfo 120 | xorg-xinit 121 | xorg-xwininfo 122 | xsel 123 | xsensors 124 | yarn 125 | zathura 126 | zathura-pdf-mupdf 127 | zsh 128 | -------------------------------------------------------------------------------- /install/packages/snaps/snap.list: -------------------------------------------------------------------------------- 1 | authy --beta 2 | bitwarden 3 | code --clasic 4 | discord 5 | spotify 6 | telegram-desktop 7 | zoom-client 8 | -------------------------------------------------------------------------------- /install/packages/ubuntu/pkg.list: -------------------------------------------------------------------------------- 1 | apt-transport-https/focal-updates,focal-updates,now 2.0.5 all [installed] 2 | autoconf/focal,focal,now 2.69-11.1 all [installed] 3 | automake/focal,focal,now 1:1.16.1-4ubuntu6 all [installed] 4 | base-passwd/focal,now 3.5.47 amd64 [installed] 5 | brave-browser/stable,now 1.25.68 amd64 [installed] 6 | build-essential/focal-updates,now 12.8ubuntu1.1 amd64 [installed] 7 | cargo/focal-updates,focal-security,now 0.47.0-1~exp1ubuntu1~20.04.1 amd64 [installed] 8 | cmake/focal,now 3.16.3-1ubuntu1 amd64 [installed] 9 | curl/focal-updates,focal-security,now 7.68.0-1ubuntu2.5 amd64 [installed] 10 | dash/focal,now 0.5.10.2-6 amd64 [installed] 11 | diffutils/focal,now 1:3.7-3 amd64 [installed] 12 | ffmpeg/focal-updates,focal-security,now 7:4.2.4-1ubuntu0.1 i386 [installed] 13 | findutils/focal,now 4.7.0-1ubuntu1 amd64 [installed] 14 | firefox-locale-en/focal-updates,focal-security,now 88.0.1+build1-0ubuntu0.20.04.2 amd64 [installed] 15 | fonts-indic/focal,focal,now 2:1.3 all [installed] 16 | fzf/focal,now 0.20.0-1 amd64 [installed] 17 | g++/focal,now 4:9.3.0-1ubuntu2 amd64 [installed] 18 | gdb/focal-updates,now 9.2-0ubuntu1~20.04 amd64 [installed] 19 | geogebra/focal,focal,now 4.0.34.0+dfsg1-7 all [installed] 20 | gettext/focal,now 0.19.8.1-10build1 amd64 [installed] 21 | git/focal-updates,focal-security,now 1:2.25.1-1ubuntu3.1 amd64 [installed] 22 | grep/focal,now 3.4-1 amd64 [installed] 23 | grub-common/focal-updates,now 2.04-1ubuntu26.11 amd64 [installed] 24 | grub-efi-amd64-signed/focal-updates,now 1.167+2.04-1ubuntu44 amd64 [installed] 25 | grub-gfxpayload-lists/focal,now 0.7 amd64 [installed] 26 | grub-pc-bin/focal-updates,now 2.04-1ubuntu26.11 amd64 [installed] 27 | grub-pc/focal-updates,now 2.04-1ubuntu26.11 amd64 [installed] 28 | grub2-common/focal-updates,now 2.04-1ubuntu26.11 amd64 [installed] 29 | gzip/focal,now 1.10-0ubuntu4 amd64 [installed] 30 | hostname/focal,now 3.23 amd64 [installed] 31 | htop/focal,now 2.2.0-2build1 amd64 [installed] 32 | init/focal,now 1.57 amd64 [installed] 33 | kitty/focal,now 0.15.0-1build1 amd64 [installed] 34 | language-pack-en-base/focal-updates,focal-updates,now 1:20.04+20210121 all [installed] 35 | language-pack-en/focal-updates,focal-updates,now 1:20.04+20210121 all [installed] 36 | language-pack-gnome-en-base/focal-updates,focal-updates,now 1:20.04+20210121 all [installed] 37 | language-pack-gnome-en/focal-updates,focal-updates,now 1:20.04+20210121 all [installed] 38 | libdebconfclient0/focal,now 0.251ubuntu1 amd64 [installed] 39 | libfprint-2-tod1/focal-updates,now 1:1.90.2+tod1-0ubuntu1~20.04.4 amd64 [installed] 40 | libglfw3-dev/focal,now 3.3.2-1 amd64 [installed] 41 | libgtk2.0-0/focal,now 2.24.32-4ubuntu4 i386 [installed] 42 | libllvm9/focal,now 1:9.0.1-12 amd64 [installed] 43 | libncurses5-dev/focal,now 6.2-0ubuntu2 amd64 [installed] 44 | libnvidia-gl-460/focal-updates,focal-security,now 460.73.01-0ubuntu0.20.04.1 i386 [installed] 45 | libpulse0/focal-updates,now 1:13.99.1-1ubuntu3.10 i386 [installed] 46 | libsdl2-dev/focal,now 2.0.10+dfsg1-3 amd64 [installed] 47 | libsm6/focal,now 2:1.2.3-1 i386 [installed] 48 | libtool-bin/focal,now 2.4.6-14 amd64 [installed] 49 | libtool/focal,focal,now 2.4.6-14 all [installed] 50 | libx11-dev/focal-updates,focal-security,now 2:1.6.9-2ubuntu1.2 amd64 [installed] 51 | libxft-dev/focal,now 2.3.3-0ubuntu1 amd64 [installed] 52 | libxinerama-dev/focal,now 2:1.1.4-2 amd64 [installed] 53 | libxrandr2/focal,now 2:1.5.2-0ubuntu1 i386 [installed] 54 | libxtst6/focal,now 2:1.2.3-1 i386 [installed] 55 | linux-generic-hwe-20.04/focal-updates,focal-security,now 5.8.0.53.60~20.04.37 amd64 [installed] 56 | linux-modules-nvidia-460-generic-hwe-20.04/focal-updates,focal-security,now 5.8.0-53.60~20.04.1 amd64 [installed] 57 | make/focal,now 4.2.1-1.2 amd64 [installed] 58 | mokutil/focal,now 0.3.0+1538710437.fb6250f-1 amd64 [installed] 59 | ncurses-base/focal,focal,now 6.2-0ubuntu2 all [installed] 60 | ncurses-bin/focal,now 6.2-0ubuntu2 amd64 [installed] 61 | neofetch/focal,focal,now 7.0.0-1 all [installed] 62 | ninja-build/focal,now 1.10.0-1build1 amd64 [installed] 63 | nvidia-driver-460/focal-updates,focal-security,now 460.73.01-0ubuntu0.20.04.1 amd64 [installed] 64 | os-prober/focal,now 1.74ubuntu2 amd64 [installed] 65 | patchelf/focal,now 0.10-2build1 amd64 [installed] 66 | pcmanfm/focal,now 1.3.1-1 amd64 [installed] 67 | pkg-config/focal,now 0.29.1-0ubuntu4 amd64 [installed] 68 | python-dev-is-python2/focal,focal,now 2.7.17-4 all [installed] 69 | python3-dev/focal,now 3.8.2-0ubuntu2 amd64 [installed] 70 | python3-pip/focal-updates,focal-updates,focal-security,focal-security,now 20.0.2-5ubuntu1.5 all [installed] 71 | python3/focal,now 3.8.2-0ubuntu2 amd64 [installed] 72 | sharutils/focal,now 1:4.15.2-4build1 amd64 [installed] 73 | shim-signed/focal-updates,now 1.40.4+15+1552672080.a4a1fbe-0ubuntu2 amd64 [installed] 74 | steam/focal,now 1:1.0.0.61-2ubuntu3 i386 [installed] 75 | stow/focal,focal,now 2.3.1-1 all [installed] 76 | tree/focal,now 1.8.0-1 amd64 [installed] 77 | ubuntu-desktop-minimal/focal-updates,now 1.450.2 amd64 [installed] 78 | ubuntu-desktop/focal-updates,now 1.450.2 amd64 [installed] 79 | ubuntu-minimal/focal-updates,now 1.450.2 amd64 [installed] 80 | ubuntu-standard/focal-updates,now 1.450.2 amd64 [installed] 81 | ubuntu-wallpapers/focal,focal,now 20.04.2-0ubuntu1 all [installed] 82 | unzip/focal,now 6.0-25ubuntu1 amd64 [installed] 83 | x11-xserver-utils/focal,now 7.7+8 amd64 [installed] 84 | xclip/focal,now 0.13-1 amd64 [installed] 85 | zlib1g-dev/focal-updates,now 1:1.2.11.dfsg-2ubuntu1.2 amd64 [installed] 86 | zsh/focal,now 5.8-3ubuntu1 amd64 [installed] 87 | -------------------------------------------------------------------------------- /install/windows/windows-setup.md: -------------------------------------------------------------------------------- 1 | ## Keymaps config 2 | 3 | https://superuser.com/questions/949385/map-capslock-to-control-in-windows-10 4 | 5 | https://superuser.com/questions/940342/how-to-change-shortcut-key-for-switching-between-virtual-desktops-in-windows-10 6 | 7 | Download https://github.com/martinsione/windows-desktop-switcher and put it in super + r shell:startup 8 | 9 | ## Realtek drivers 10 | 11 | https://www.microsoft.com/en-us/p/realtek-audio-control/9p2b8mcsvpln 12 | -------------------------------------------------------------------------------- /install/windows/windows-terminal.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/terminal-profiles-schema", 3 | "copyFormatting": "none", 4 | "copyOnSelect": false, 5 | "startOnUserLogin": false, 6 | "defaultProfile": "{2c4de342-38b7-51cf-b940-2309a097f518}", 7 | "profiles": { 8 | "defaults": { 9 | "colorScheme": "One Dark", 10 | "acrylicOpacity": 0.8, 11 | "useAcrylic": true, 12 | "bellStyle": "none", 13 | "closeOnExit": true, 14 | "faceFace": "CaskaydiaCove NF", 15 | // "fontFace": "FiraCode NF", 16 | "fontSize": 15, 17 | "scrollbarState": "hidden" 18 | }, 19 | "list": [ 20 | { 21 | "commandline": "powershell.exe", 22 | "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", 23 | "hidden": false, 24 | "name": "Windows PowerShell" 25 | }, 26 | { 27 | "commandline": "cmd.exe", 28 | "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", 29 | "hidden": false, 30 | "name": "S\u00edmbolo del sistema" 31 | }, 32 | { 33 | "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}", 34 | "hidden": false, 35 | "name": "Azure Cloud Shell", 36 | "source": "Windows.Terminal.Azure" 37 | }, 38 | { 39 | "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}", 40 | "hidden": false, 41 | "name": "Ubuntu", 42 | "source": "Windows.Terminal.Wsl" 43 | } 44 | ] 45 | }, 46 | "schemes": [ 47 | { 48 | "name": "One Dark", 49 | "background": "#1E2127", 50 | "black": "#000000", 51 | "blue": "#61AFEF", 52 | "brightBlack": "#5C6370", 53 | "brightBlue": "#61AFEF", 54 | "brightCyan": "#56B6C2", 55 | "brightGreen": "#98C379", 56 | "brightPurple": "#C678DD", 57 | "brightRed": "#E06C75", 58 | "brightWhite": "#FFFFFF", 59 | "brightYellow": "#D19A66", 60 | "cyan": "#56B6C2", 61 | "foreground": "#ccd0d8", 62 | "green": "#98C379", 63 | "purple": "#C678DD", 64 | "red": "#E06C75", 65 | "white": "#ABB2BF", 66 | "yellow": "#D19A66" 67 | }, 68 | { 69 | "name": "Gruvbox Dark", 70 | "background": "#282828", 71 | "black": "#282828", 72 | "blue": "#458588", 73 | "brightBlack": "#928374", 74 | "brightBlue": "#83A598", 75 | "brightCyan": "#8EC07C", 76 | "brightGreen": "#B8BB26", 77 | "brightPurple": "#D3869B", 78 | "brightRed": "#FB4934", 79 | "brightWhite": "#EBDBB2", 80 | "brightYellow": "#FABD2F", 81 | "cyan": "#689D6A", 82 | "foreground": "#EBDBB2", 83 | "green": "#98971A", 84 | "purple": "#B16286", 85 | "red": "#CC241D", 86 | "white": "#A89984", 87 | "yellow": "#D79921" 88 | } 89 | ], 90 | "actions": [ 91 | { 92 | "command": "copy", 93 | "keys": "ctrl+shift+c" 94 | }, 95 | { 96 | "command": "paste", 97 | "keys": "ctrl+shift+v" 98 | } 99 | ] 100 | } 101 | -------------------------------------------------------------------------------- /install/windows/wsl-clipboard.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## Get nvim clipboard in wsl to work 4 | # https://github.com/neovim/neovim/wiki/FAQ#how-to-use-the-windows-clipboard-from-wsl 5 | curl -sLo/tmp/win32yank.zip https://github.com/equalsraf/win32yank/releases/download/v0.0.4/win32yank-x64.zip 6 | unzip -p /tmp/win32yank.zip win32yank.exe > /tmp/win32yank.exe 7 | chmod +x /tmp/win32yank.exe 8 | sudo mv /tmp/win32yank.exe /usr/local/bin/ 9 | -------------------------------------------------------------------------------- /install/x/dotfiles.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Script name: dotfiles 4 | # Description: Script to deploy my dotfiles easily. 5 | # Dependencies: git, curl, zsh 6 | 7 | export repo_host="https://github.com/" 8 | export repo_path="martinsione/dotfiles.git" 9 | export dotfiles_dir="$HOME/.dotfiles" 10 | 11 | dirs=( 12 | ~/.cache/zsh 13 | ~/.config 14 | ~/.local 15 | ~/Repos 16 | ) 17 | 18 | symlinks=( 19 | .config/git 20 | .config/htop 21 | .config/kitty 22 | .config/nvim 23 | .config/ranger 24 | .config/tmux 25 | .config/zsh 26 | # .local/bin 27 | .zshrc 28 | ) 29 | 30 | ## End of configuration 31 | set -e 32 | 33 | install_dependencies() { 34 | local progs="git curl zsh" 35 | if [ "$(uname)" = "Darwin" ]; then 36 | echo "Skipping installation of dependencies on macOS" 37 | 38 | # /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 39 | # 40 | # brew install exa fnm neovim pnpm ripgrep starship tmux 41 | # brew install --cask brave-browser docker iterm2 raycast scroll-reverser slack spotify tableplus visual-studio-code zoom 42 | # 43 | # brew tap homebrew/cask-fonts 44 | # brew install —cask font-jetbrains-mono-nerd-font 45 | 46 | elif [ -x "$(command -v pacman)" ]; then 47 | sudo pacman -Syy && sudo pacman -S --noconfirm $progs 48 | elif [ -x "$(command -v apt-get)" ]; then 49 | sudo apt update && sudo apt install -y $progs 50 | fi 51 | } 52 | 53 | clone_repo() { 54 | if [ -d "$HOME/dotfiles" ]; then 55 | mv "$HOME/dotfiles" "${dotfiles_dir}"; 56 | elif [ ! -d "${dotfiles_dir}" ]; then 57 | git clone "${repo_host}/${repo_path}" "${dotfiles_dir}" 58 | fi 59 | 60 | if [ -d "${dotfiles_dir}" ]; then 61 | cd ${dotfiles_dir} && git submodule update --init --recursive 62 | ## Change to ssh url 63 | git remote set-url origin git@github.com:${repo_path} 64 | fi 65 | } 66 | 67 | create_dirs() { 68 | for name in "${dirs[@]}"; do mkdir -p "${name}"; done 69 | } 70 | 71 | symlink_files() { 72 | for name in "${symlinks[@]}"; do 73 | if [ ! -e "$name" ]; then 74 | ln -sfv "${dotfiles_dir}/src/${name}" "$HOME/${name}" 75 | else 76 | echo "${name} already exists." 77 | fi 78 | done 79 | } 80 | 81 | change_shell() { 82 | if [ "$(echo $SHELL)" = "$(which zsh)" ]; then 83 | echo "zsh is already the default shell" 84 | else 85 | chsh -s $(which zsh) 86 | fi 87 | 88 | if [ -x "$(command -v starship)" ]; then 89 | echo "starship is already installed" 90 | elif [ -x "$(command -v brew)" ]; then 91 | brew install starship 92 | else 93 | sh -c "$(curl -fsSL https://starship.rs/install.sh)" 94 | fi 95 | } 96 | 97 | 98 | ## Start of the script 99 | install_dependencies 100 | clone_repo 101 | create_dirs 102 | symlink_files 103 | change_shell 104 | -------------------------------------------------------------------------------- /install/x/macos.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | repo_url="https://github.com/martinsione/dotfiles.git" 6 | dotfiles_dir="$HOME/Developer/martinsione/dotfiles" 7 | symlinks=( 8 | src/.config/ghostty 9 | src/.config/git 10 | src/.config/nvim 11 | src/.config/tmux 12 | src/.config/zed 13 | src/.config/zsh 14 | src/.zshrc 15 | src/Library/Application\ Support/Cursor/User/keybindings.json 16 | src/Library/Application\ Support/Cursor/User/settings.json 17 | ) 18 | 19 | # Colors for better visibility 20 | GREEN='\033[0;32m' 21 | YELLOW='\033[1;33m' 22 | NC='\033[0m' # No Color 23 | 24 | # Helper functions 25 | log() { 26 | echo -e "${GREEN}[+]${NC} $1" 27 | } 28 | 29 | warn() { 30 | echo -e "${YELLOW}[!]${NC} $1" 31 | } 32 | 33 | clone_repo() { 34 | # Clone repository if it doesn't exist 35 | if [ ! -d "$dotfiles_dir" ]; then 36 | log "Cloning dotfiles repository..." 37 | git clone "${repo_url}" "$dotfiles_dir" 38 | else 39 | log "Dotfiles directory already exists, skipping clone" 40 | fi 41 | 42 | # Change to dotfiles directory 43 | cd "$dotfiles_dir" 44 | 45 | # Update submodules 46 | log "Initializing and updating submodules..." 47 | git submodule update --init --recursive 48 | } 49 | 50 | create_symlink() { 51 | local src="$dotfiles_dir/$1" 52 | local dst="$HOME/${1#src/}" 53 | 54 | # Check if destination already exists 55 | if [ -L "$dst" ]; then 56 | local current_target=$(readlink "$dst") 57 | if [ "$current_target" = "$src" ]; then 58 | warn "Symlink already exists and points to correct target: $dst -> $src" 59 | return 60 | else 61 | warn "Symlink exists but points elsewhere, updating: $dst" 62 | rm "$dst" 63 | fi 64 | elif [ -e "$dst" ]; then 65 | warn "File/directory exists at $dst, removing..." 66 | rm -rf "$dst" 67 | fi 68 | 69 | # Create parent directory if it doesn't exist 70 | mkdir -p "$(dirname "$dst")" 71 | 72 | # Create symlink 73 | ln -sf "$src" "$dst" 74 | log "Created symlink: $dst -> $src" 75 | } 76 | 77 | 78 | # Clone repository 79 | clone_repo 80 | 81 | # Create symlinks 82 | log "Creating symlinks..." 83 | for link in "${symlinks[@]}"; do 84 | create_symlink "$link" 85 | done 86 | 87 | log "Installation complete! ✨" 88 | -------------------------------------------------------------------------------- /install/x/neovim.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) 4 | cd /tmp 5 | curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage 6 | chmod u+x nvim.appimage 7 | sudo mv nvim.appimage /usr/bin/nvim 8 | cd $SCRIPT_DIR 9 | -------------------------------------------------------------------------------- /install/x/nerdfonts.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | fonts=( 4 | FiraCode 5 | JetBrainsMono 6 | SourceCodePro 7 | ) 8 | 9 | install_nerd_fonts() { 10 | for font in "${fonts[@]}"; do 11 | local font_path="$HOME/.local/share/fonts/${font}" 12 | if [[ ! -d "${font_path}" ]]; then 13 | curl -L --create-dirs "https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/${font}.zip" -o "${font_path}.zip" 14 | unzip "${font_path}.zip" -d "${font_path}" 15 | rm -rf "${font_path}.zip" 16 | else 17 | echo "${font} is already on your system" 18 | fi 19 | done 20 | } 21 | 22 | install_nerd_fonts 23 | -------------------------------------------------------------------------------- /install/x/system.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # https://unix.stackexchange.com/questions/46081/identifying-the-system-package-manager 4 | 5 | export aurhelper=paru 6 | export package_manager="" 7 | 8 | if [ -x "$(command -v pacman)" ]; then package_manager="pacman" 9 | elif [ -x "$(command -v apt-get)" ]; then package_manager="apt-get"; fi 10 | 11 | install_aur_helper() { 12 | # needs base-devel to be installed 13 | cd /tmp 14 | git clone https://aur.archlinux.org/$aurhelper 15 | cd $aurhelper 16 | makepkg --noconfirm -si 17 | } 18 | 19 | update_system() { 20 | if [ $package_manager=="pacman" ]; then 21 | # echo -e '[options]\nColor\nParallelDownloads = 12\n[multilib]\nInclude = /etc/pacman.d/mirrorlist' | sudo tee -a /etc/pacman.conf 22 | sudo pacman -Sy && sudo pacman -S --noconfirm --needed base-devel git 23 | elif [ $package_manager=="apt-get" ]; then 24 | # apt-get not tested 25 | sudo apt update && sudo apt upgrade && sudo apt install build-essential git -y 26 | fi 27 | } 28 | 29 | install_packages() { 30 | local packages_dir="https://raw.githubusercontent.com/martinsione/dotfiles/master/install/packages" 31 | if [[ $package_manager == "pacman" ]]; then 32 | [ ! -x $(command -v "$aurhelper") ] && install_aur_helper 33 | sudo pacman -S --noconfirm --needed $(comm -12 <(pacman -Slq | sort) <(sort | curl "${packages_dir}/arch/pac.list" )) 34 | # yes | sudo -u $(whoami) $aurhelper -S libxft-bgra-git >/dev/null 2>&1 # otherwise it doesn't install due to conflicts 35 | ${aurhelper} -S --noconfirm --needed $(comm -12 <(${aurhelper} -Slq | sort) <(sort | curl "${packages_dir}/arch/aur.list" )) 36 | fi 37 | } 38 | 39 | 40 | add_echo_cancelation() { 41 | sudo tee -a /etc/pulse/default.pa > /dev/null </dev/null 2>&1 16 | done 17 | 18 | dwm 19 | -------------------------------------------------------------------------------- /src/.config/X11/xresources: -------------------------------------------------------------------------------- 1 | *.foreground: #D8DEE9 2 | *.background: #282C34 3 | *.cursorColor: #d8dee9 4 | 5 | ! black 6 | *.color0: #3B4252 7 | *.color8: #3B4252 8 | 9 | ! red 10 | *.color1: #D54646 11 | *.color9: #D54646 12 | 13 | ! green 14 | *.color2: #23D18B 15 | *.color10: #23D18B 16 | 17 | ! yellow 18 | *.color3: #D7BA7D 19 | *.color11: #D7BA7D 20 | 21 | ! blue 22 | *.color4: #569CD6 23 | *.color12: #569CD6 24 | 25 | ! magenta 26 | *.color5: #C586C0 27 | *.color13: #C586C0 28 | 29 | ! cyan 30 | *.color6: #29B8DB 31 | *.color14: #29B8DB 32 | 33 | ! white 34 | *.color7: #ECEFF4 35 | *.color15: #ECEFF4 36 | -------------------------------------------------------------------------------- /src/.config/alacritty/alacritty.yml: -------------------------------------------------------------------------------- 1 | env: 2 | TERM: xterm-256color 3 | 4 | # Set colorscheme 5 | colors: 6 | cursor: 7 | text: "#191919" 8 | cursor: "#d8dee9" 9 | primary: 10 | background: "#282C34" 11 | foreground: "#D8DEE9" 12 | normal: 13 | black: "#3B4252" 14 | red: "#D54646" 15 | green: "#23D18B" 16 | yellow: "#D7BA7D" 17 | blue: "#569CD6" 18 | magenta: "#C586C0" 19 | cyan: "#29B8DB" 20 | white: "#ECEFF4" 21 | bright: 22 | black: "#3B4252" 23 | red: "#D54646" 24 | green: "#23D18B" 25 | yellow: "#D7BA7D" 26 | blue: "#569CD6" 27 | magenta: "#C586C0" 28 | cyan: "#29B8DB" 29 | white: "#ECEFF4" 30 | 31 | # background_opacity: 0.95 32 | 33 | font: 34 | normal: 35 | family: "Cascadia Code PL" 36 | style: Regular 37 | bold: 38 | family: "Cascadia Code PL" 39 | style: Bold 40 | italic: 41 | family: "Cascadia Code PL" 42 | style: Italic 43 | bold_italic: 44 | style: Bold Italic 45 | family: "Cascadia Code PL" 46 | 47 | size: 15.0 48 | 49 | glyph_offset: 50 | x: 0 51 | y: 0 52 | 53 | offset: 54 | x: 0 55 | y: 0 56 | 57 | window: 58 | padding: 59 | x: 0 60 | y: 0 61 | 62 | scrolling: 63 | history: 10000 64 | multiplier: 10 65 | 66 | draw_bold_text_with_bright_colors: true 67 | 68 | selection: 69 | semantic_escape_chars: ',│`|:"'' ()[]{}<>' 70 | save_to_clipboard: true 71 | live_config_reload: true 72 | 73 | key_bindings: 74 | - { key: Key0, mods: Control, action: ResetFontSize } 75 | - { key: Equals, mods: Control, action: IncreaseFontSize } 76 | - { key: Minus, mods: Control, action: DecreaseFontSize } 77 | # Fix for detecting and 78 | - { key: Return, mods: Shift, chars: "\x1b[13;2u" } 79 | - { key: Return, mods: Control, chars: "\x1b[13;5u" } 80 | -------------------------------------------------------------------------------- /src/.config/awesome/.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | indent_type = "Spaces" 3 | indent_width = 2 4 | line_endings = "Unix" 5 | no_call_parentheses = false 6 | quote_style = "AutoPreferSingle" 7 | -------------------------------------------------------------------------------- /src/.config/awesome/modules/config.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M = { 4 | modkey = 'Mod1', 5 | } 6 | 7 | M.programs = { 8 | browser = 'brave', 9 | editor_cmd = 'kitty -e nvim', 10 | file = 'nautilus', 11 | rofi = 'rofi -combi-modi window,drun -show combi -modi combi', 12 | terminal = 'kitty', 13 | screenshot = 'maim -i $(xdotool getactivewindow) ${XDG_PICTURES_HOME}/Screenshot-$(date "+%Y-%m-%d-%H%M%S").png', 14 | screenshot_full = 'maim ${XDG_PICTURES_HOME}/Screenshot-$(date "+%Y-%m-%d-%H%M%S").png', 15 | } 16 | 17 | M.autostart = { 18 | 'xset r rate 300 50', 19 | 'setxkbmap -option ctrl:nocaps', 20 | 'xcompmgr', 21 | 'unclutter', 22 | 'lxsession', 23 | 'redshift-gtk -l -34.603683:-58.381557', 24 | 'nitrogen --restore', 25 | } 26 | 27 | return M 28 | -------------------------------------------------------------------------------- /src/.config/awesome/modules/keymaps.lua: -------------------------------------------------------------------------------- 1 | local awesome = _G.awesome 2 | local client = _G.client 3 | local gears = require('gears') 4 | local awful = require('awful') 5 | 6 | -- Custom 7 | local M = {} 8 | local modkey = require('modules.config').modkey 9 | local programs = require('modules.config').programs 10 | 11 | M.taglist_buttons = gears.table.join( 12 | awful.button({}, 1, function(t) 13 | t:view_only() 14 | end), 15 | awful.button({ modkey }, 1, function(t) 16 | if client.focus then 17 | client.focus:move_to_tag(t) 18 | end 19 | end), 20 | awful.button({}, 3, awful.tag.viewtoggle), 21 | awful.button({ modkey }, 3, function(t) 22 | if client.focus then 23 | client.focus:toggle_tag(t) 24 | end 25 | end), 26 | awful.button({}, 4, function(t) 27 | awful.tag.viewnext(t.screen) 28 | end), 29 | awful.button({}, 5, function(t) 30 | awful.tag.viewprev(t.screen) 31 | end) 32 | ) 33 | 34 | M.tasklist_buttons = gears.table.join( 35 | awful.button({}, 1, function(c) 36 | if c == client.focus then 37 | c.minimized = true 38 | else 39 | c:emit_signal('request::activate', 'tasklist', { raise = true }) 40 | end 41 | end), 42 | awful.button({}, 3, function() 43 | awful.menu.client_list({ theme = { width = 250 } }) 44 | end), 45 | awful.button({}, 4, function() 46 | awful.client.focus.byidx(1) 47 | end), 48 | awful.button({}, 5, function() 49 | awful.client.focus.byidx(-1) 50 | end) 51 | ) 52 | 53 | M.mouse = gears.table.join( 54 | awful.button({}, 3, function() 55 | mymainmenu:toggle() 56 | end), 57 | awful.button({}, 4, awful.tag.viewnext), 58 | awful.button({}, 5, awful.tag.viewprev) 59 | ) 60 | 61 | M.globalkeys = gears.table.join( 62 | awful.key({}, 'Print', function() 63 | awful.spawn('flameshot gui') 64 | end), 65 | awful.key({ 'Shift' }, 'Print', function() 66 | awful.spawn('maim -i $(xdotool getactivewindow) $HOME/Pictures/Screenshot-$(date "+%Y-%m-%d-%H%M%S").png') 67 | end), 68 | awful.key({ modkey, 'Control' }, 'r', awesome.restart), -- Reload awesome 69 | awful.key({ modkey, 'Shift' }, 'q', awesome.quit), -- Quit awesome 70 | awful.key({ modkey }, 'Left', awful.tag.viewprev), -- view previous (tag) 71 | awful.key({ modkey }, 'Right', awful.tag.viewnext), -- view next (tag) 72 | awful.key({ modkey }, 'Escape', awful.tag.history.restore), -- go back (tag) 73 | -- Movement 74 | awful.key({ modkey }, 'j', function() 75 | awful.client.focus.byidx(1) -- focus next by index (client) 76 | end), 77 | awful.key({ modkey }, 'k', function() 78 | awful.client.focus.byidx(-1) -- focus previous by index (client) 79 | end), 80 | awful.key({ modkey, 'Shift' }, 'j', function() 81 | awful.client.swap.byidx(1) -- swap with next client by index (client) 82 | end), 83 | awful.key({ modkey, 'Shift' }, 'k', function() 84 | awful.client.swap.byidx(-1) -- swap with previous client by index (client) 85 | end), 86 | awful.key({ modkey, 'Control' }, 'l', function() 87 | awful.tag.incmwfact(0.05) -- increase master width factor (layout) 88 | end), 89 | awful.key({ modkey, 'Control' }, 'h', function() 90 | awful.tag.incmwfact(-0.05) -- decrease master width factor (layout) 91 | end), 92 | -- Standard program 93 | awful.key({ modkey }, 'Return', function() 94 | awful.spawn(programs.terminal) -- Open a terminal 95 | end), 96 | awful.key({ modkey }, 'p', function() 97 | awful.spawn(programs.rofi) -- Run rofi 98 | end), 99 | awful.key({ modkey }, 'w', function() 100 | awful.spawn(programs.browser) -- Open a browser 101 | end), 102 | awful.key({ modkey }, 'e', function() 103 | awful.spawn(programs.file) -- Open a file manager 104 | end) 105 | ) 106 | 107 | M.clientkeys = gears.table.join( 108 | awful.key({ modkey }, 'q', function(c) 109 | c:kill() -- Kill window 110 | end), 111 | awful.key({ modkey }, 'f', function(c) 112 | c.fullscreen = not c.fullscreen -- Toggle fullscreen 113 | c:raise() 114 | end), 115 | awful.key({ modkey, 'Shift' }, 'space', awful.client.floating.toggle), -- Toggle floating mode 116 | awful.key({ modkey, 'Control' }, 'space', function(c) 117 | c:swap(awful.client.getmaster()) -- Move to master 118 | end), 119 | awful.key({ modkey }, 'n', function(c) 120 | c.minimized = true -- Minimize (client) 121 | end), 122 | awful.key({ modkey }, 'm', function(c) 123 | c.maximized = not c.maximized -- Maximize (client) 124 | c:raise() 125 | end) 126 | ) 127 | 128 | -- Bind all key numbers to tags. 129 | -- Be careful: we use keycodes to make it work on any keyboard layout. 130 | -- This should map on the top row of your keyboard, usually 1 to 9. 131 | for i = 1, 9 do 132 | M.globalkeys = gears.table.join( 133 | M.globalkeys, 134 | -- View tag only. 135 | awful.key({ modkey }, '#' .. i + 9, function() 136 | local screen = awful.screen.focused() 137 | local tag = screen.tags[i] 138 | if tag then 139 | tag:view_only() 140 | end 141 | end), 142 | -- Toggle tag display. 143 | awful.key({ modkey, 'Shift' }, '#' .. i + 9, function() 144 | local screen = awful.screen.focused() 145 | local tag = screen.tags[i] 146 | if tag then 147 | awful.tag.viewtoggle(tag) 148 | end 149 | end), 150 | -- Move client to tag. 151 | awful.key({ modkey, 'Control' }, '#' .. i + 9, function() 152 | if client.focus then 153 | local tag = client.focus.screen.tags[i] 154 | if tag then 155 | client.focus:move_to_tag(tag) 156 | end 157 | end 158 | end), 159 | -- Toggle tag on focused client. 160 | awful.key({ modkey, 'Control', 'Shift' }, '#' .. i + 9, function() 161 | if client.focus then 162 | local tag = client.focus.screen.tags[i] 163 | if tag then 164 | client.focus:toggle_tag(tag) 165 | end 166 | end 167 | end) 168 | ) 169 | end 170 | 171 | M.clientbuttons = gears.table.join( 172 | awful.button({}, 1, function(c) 173 | c:emit_signal('request::activate', 'mouse_click', { raise = true }) 174 | end), 175 | awful.button({ modkey }, 1, function(c) 176 | c:emit_signal('request::activate', 'mouse_click', { raise = true }) 177 | awful.mouse.client.move(c) 178 | end), 179 | awful.button({ modkey }, 3, function(c) 180 | c:emit_signal('request::activate', 'mouse_click', { raise = true }) 181 | awful.mouse.client.resize(c) 182 | end) 183 | ) 184 | 185 | return M 186 | -------------------------------------------------------------------------------- /src/.config/awesome/rc.lua: -------------------------------------------------------------------------------- 1 | -- If LuaRocks is installed, make sure that packages installed through it are 2 | -- found (e.g. lgi). If LuaRocks is not installed, do nothing. 3 | pcall(require, 'luarocks.loader') 4 | local awesome = _G.awesome 5 | local client = _G.client 6 | local root = _G.root 7 | -- Standard awesome library 8 | local gears = require('gears') 9 | local awful = require('awful') 10 | require('awful.autofocus') 11 | -- Widget and layout library 12 | local wibox = require('wibox') 13 | -- Theme handling library 14 | local beautiful = require('beautiful') 15 | -- Notification library 16 | local naughty = require('naughty') 17 | 18 | -- Custom 19 | local keymaps = require('modules.keymaps') 20 | 21 | -- Error handling 22 | if awesome.startup_errors then 23 | local msg = 'Oops, there were errors during startup!' 24 | naughty.notify({ preset = naughty.config.presets.critical, title = msg, text = awesome.startup_errors }) 25 | end 26 | 27 | -- Handle runtime errors after startup 28 | do 29 | local in_error = false 30 | awesome.connect_signal('debug::error', function(err) 31 | -- Make sure we don't go into an endless error loop 32 | if in_error then 33 | return 34 | end 35 | in_error = true 36 | local msg = 'Oops, an error happened!' 37 | naughty.notify({ preset = naughty.config.presets.critical, title = msg, text = tostring(err) }) 38 | in_error = false 39 | end) 40 | end 41 | 42 | -- Table of layouts to cover with awful.layout.inc, order matters. 43 | awful.layout.layouts = { 44 | -- awful.layout.suit.floating, 45 | awful.layout.suit.tile, 46 | -- awful.layout.suit.tile.left, 47 | -- awful.layout.suit.tile.bottom, 48 | -- awful.layout.suit.tile.top, 49 | -- awful.layout.suit.fair, 50 | -- awful.layout.suit.fair.horizontal, 51 | -- awful.layout.suit.spiral, 52 | -- awful.layout.suit.spiral.dwindle, 53 | -- awful.layout.suit.max, 54 | -- awful.layout.suit.max.fullscreen, 55 | -- awful.layout.suit.magnifier, 56 | -- awful.layout.suit.corner.nw, 57 | -- awful.layout.suit.corner.ne, 58 | -- awful.layout.suit.corner.sw, 59 | -- awful.layout.suit.corner.se, 60 | } 61 | 62 | -- Themes define colours, icons, font and wallpapers. 63 | beautiful.init(gears.filesystem.get_themes_dir() .. 'default/theme.lua') 64 | local mytextclock = wibox.widget.textclock() 65 | awful.screen.connect_for_each_screen(function(s) 66 | awful.tag({ '1', '2', '3', '4', '5', '6', '7', '8', '9' }, s, awful.layout.layouts[1]) 67 | s.mytaglist = awful.widget.taglist({ 68 | screen = s, 69 | filter = awful.widget.taglist.filter.all, 70 | buttons = keymaps.taglist_buttons, 71 | }) 72 | 73 | -- -- Create a tasklist widget 74 | s.mytasklist = awful.widget.tasklist({ 75 | screen = s, 76 | filter = awful.widget.tasklist.filter.currenttags, 77 | buttons = keymaps.tasklist_buttons, 78 | }) 79 | 80 | -- -- Create the wibox 81 | s.mywibox = awful.wibar({ position = 'top', screen = s }) 82 | 83 | -- -- Add widgets to the wibox 84 | s.mywibox:setup({ 85 | layout = wibox.layout.align.horizontal, 86 | { -- Left widgets 87 | layout = wibox.layout.fixed.horizontal, 88 | s.mytaglist, 89 | s.mypromptbox, 90 | }, 91 | s.mytasklist, -- Middle widget 92 | { -- Right widgets 93 | layout = wibox.layout.fixed.horizontal, 94 | wibox.widget.systray(), 95 | mytextclock, 96 | s.mylayoutbox, 97 | }, 98 | }) 99 | end) 100 | 101 | -- Keymaps 102 | root.buttons(keymaps.mouse) 103 | root.keys(keymaps.globalkeys) 104 | 105 | -- Rules 106 | awful.rules.rules = { 107 | -- All clients will match this rule. 108 | { 109 | rule = {}, 110 | properties = { 111 | border_width = beautiful.border_width, 112 | border_color = beautiful.border_normal, 113 | focus = awful.client.focus.filter, 114 | raise = true, 115 | keys = keymaps.clientkeys, 116 | buttons = keymaps.clientbuttons, 117 | screen = awful.screen.preferred, 118 | placement = awful.placement.no_overlap + awful.placement.no_offscreen, 119 | }, 120 | }, 121 | 122 | -- Add titlebars to normal clients and dialogs 123 | -- { rule_any = {type = { "normal", "dialog" } }, properties = { titlebars_enabled = false } }, 124 | { rule = { class = 'browser' }, properties = { screen = 1, tag = '2' } }, 125 | } 126 | -- }}} 127 | 128 | -- Signals 129 | -- Signal function to execute when a new client appears. 130 | client.connect_signal('manage', function(c) 131 | -- Set the windows at the slave, 132 | if not awesome.startup then 133 | awful.client.setslave(c) 134 | end 135 | 136 | if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then 137 | -- Prevent clients from being unreachable after screen count changes. 138 | awful.placement.no_offscreen(c) 139 | end 140 | end) 141 | 142 | -- Enable sloppy focus, so that focus follows mouse. 143 | client.connect_signal('mouse::enter', function(c) 144 | c:emit_signal('request::activate', 'mouse_enter', { raise = false }) 145 | end) 146 | 147 | client.connect_signal('focus', function(c) 148 | c.border_color = beautiful.border_focus 149 | end) 150 | client.connect_signal('unfocus', function(c) 151 | c.border_color = beautiful.border_normal 152 | end) 153 | -- }}} 154 | 155 | -- Autostart programs 156 | local function run_once(cmd_arr) 157 | for _, cmd in ipairs(cmd_arr) do 158 | require('awful').spawn.with_shell(string.format("pgrep -u $USER -fx '%s' > /dev/null || (%s)", cmd, cmd)) 159 | end 160 | end 161 | 162 | local autostart_programs = require('modules.config').autostart 163 | run_once(autostart_programs) 164 | -------------------------------------------------------------------------------- /src/.config/bookmarks/urls.conf: -------------------------------------------------------------------------------- 1 | ## File can be commented with ## 2 | BookDepository https://bookdepository.com 3 | Calendar https://calendar.google.com 4 | CoinMarketCap https://coinmarketcap.com 5 | Docs https://docs.google.com 6 | Drive https://drive.google.com 7 | Efich http://e-fich.unl.edu.ar 8 | Flow https://web.flow.com.ar 9 | Futbol https://futbollibre.net 10 | Github https://github.com 11 | Gmail https://gmail.com 12 | Instagram https://instagram.com 13 | LinkedIn https://linkedin.com 14 | Mercadolibre https://mercadolibre.com.ar 15 | Netflix https://netflix.com 16 | Outlook https://outlook.com 17 | Reddit https://reddit.com 18 | Sheets https://sheets.google.com 19 | Symbolab https://symbolab.com 20 | Twitter https://twitter.com 21 | Website https://martinsione.com 22 | Whatsapp https://web.whatsapp.com 23 | Youtube https://www.youtube.com/feed/subscriptions 24 | 25 | ## News 26 | Ambito https://www.ambito.com 27 | InfoTechnology https://www.infotechnology.com 28 | Infobae https://www.infobae.com 29 | 30 | ## Github Repos 31 | gh/neovim https://github.com/neovim/neovim 32 | 33 | ## Subreddits 34 | r/nba https://reddit.com/r/nba 35 | r/neovim https://reddit.com/r/neovim 36 | r/vim https://reddit.com/r/vim 37 | -------------------------------------------------------------------------------- /src/.config/fontconfig/fonts.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | serif 6 | 7 | SF Pro Text 8 | Cantarell 9 | Noto Color Emoji 10 | Joy Pixels 11 | 12 | 13 | 14 | sans 15 | 16 | SF Pro Text 17 | Cantarell 18 | Noto Color Emoji 19 | Joy Pixels 20 | 21 | 22 | 23 | sans-serif 24 | 25 | SF Pro Text 26 | Cantarell 27 | Noto Color Emoji 28 | Joy Pixels 29 | 30 | 31 | 32 | monospace 33 | 34 | SF Mono 35 | Cantarell 36 | Noto Color Emoji 37 | Joy Pixels 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/.config/ghostty/config: -------------------------------------------------------------------------------- 1 | confirm-close-surface = false 2 | copy-on-select = clipboard 3 | cursor-style = block 4 | font-family = JetBrainsMono Nerd Font Mono 5 | font-size=18 6 | macos-titlebar-style = hidden 7 | shell-integration-features = no-cursor 8 | theme= light:rose-pine-dawn,dark:rose-pine 9 | window-height = 100000 10 | window-padding-x = 8 11 | window-padding-y = 8 12 | window-width = 100000 13 | -------------------------------------------------------------------------------- /src/.config/git/config: -------------------------------------------------------------------------------- 1 | [user] 2 | email = martinsione03@gmail.com 3 | name = Martin Sione 4 | 5 | [alias] 6 | lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative 7 | st = status --short --branch -M 8 | 9 | [core] 10 | editor = nvim 11 | 12 | [pull] 13 | rebase = true 14 | 15 | [rebase] 16 | autoStash = true 17 | 18 | [push] 19 | default = current 20 | -------------------------------------------------------------------------------- /src/.config/gtk-2.0/gtkfilechooser.ini: -------------------------------------------------------------------------------- 1 | [Filechooser Settings] 2 | LocationMode=path-bar 3 | ShowHidden=false 4 | ShowSizeColumn=true 5 | GeometryX=570 6 | GeometryY=256 7 | GeometryWidth=780 8 | GeometryHeight=585 9 | SortColumn=name 10 | SortOrder=ascending 11 | StartupMode=recent 12 | -------------------------------------------------------------------------------- /src/.config/gtk-2.0/gtkrc-2.0: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT! This file will be overwritten by LXAppearance. 2 | # Any customization should be done in ~/.gtkrc-2.0.mine instead. 3 | 4 | include "/home/martin/.gtkrc-2.0.mine" 5 | gtk-theme-name="Materia-dark" 6 | gtk-icon-theme-name="Papirus-Dark" 7 | gtk-font-name="Sans 10" 8 | gtk-cursor-theme-name="Adwaita" 9 | gtk-cursor-theme-size=0 10 | gtk-toolbar-style=GTK_TOOLBAR_BOTH 11 | gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR 12 | gtk-button-images=1 13 | gtk-menu-images=1 14 | gtk-enable-event-sounds=1 15 | gtk-enable-input-feedback-sounds=1 16 | gtk-xft-antialias=1 17 | gtk-xft-hinting=1 18 | gtk-xft-hintstyle="hintfull" 19 | -------------------------------------------------------------------------------- /src/.config/gtk-3.0/bookmarks: -------------------------------------------------------------------------------- 1 | file:///home/martin/Documents Documents 2 | file:///home/martin/Downloads Downloads 3 | file:///home/martin/Pictures Pictures 4 | file:///mnt/s Storage 5 | file:///mnt/s/Martin/Study/Courses Courses 6 | file:///mnt/s/Martin/Study/Facu/Materias Facu 7 | -------------------------------------------------------------------------------- /src/.config/gtk-3.0/settings.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | gtk-theme-name=Materia-dark 3 | gtk-icon-theme-name=Papirus-Dark 4 | gtk-font-name=Sans 10 5 | gtk-cursor-theme-name=Adwaita 6 | gtk-cursor-theme-size=0 7 | gtk-toolbar-style=GTK_TOOLBAR_BOTH 8 | gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR 9 | gtk-button-images=1 10 | gtk-menu-images=1 11 | gtk-enable-event-sounds=1 12 | gtk-enable-input-feedback-sounds=1 13 | gtk-xft-antialias=1 14 | gtk-xft-hinting=1 15 | gtk-xft-hintstyle=hintfull 16 | -------------------------------------------------------------------------------- /src/.config/htop/htoprc: -------------------------------------------------------------------------------- 1 | # Beware! This file is rewritten by htop when settings are changed in the interface. 2 | # The parser is also very primitive, and not human-friendly. 3 | htop_version=3.2.2 4 | config_reader_min_version=3 5 | fields=0 48 17 18 38 39 2 46 47 49 1 6 | hide_kernel_threads=1 7 | hide_userland_threads=1 8 | hide_running_in_container=0 9 | shadow_other_users=0 10 | show_thread_names=0 11 | show_program_path=1 12 | highlight_base_name=0 13 | highlight_deleted_exe=1 14 | shadow_distribution_path_prefix=0 15 | highlight_megabytes=1 16 | highlight_threads=1 17 | highlight_changes=0 18 | highlight_changes_delay_secs=5 19 | find_comm_in_cmdline=1 20 | strip_exe_from_cmdline=1 21 | show_merged_command=0 22 | header_margin=1 23 | screen_tabs=0 24 | detailed_cpu_time=0 25 | cpu_count_from_one=1 26 | show_cpu_usage=1 27 | show_cpu_frequency=0 28 | update_process_names=0 29 | account_guest_in_cpu_meter=0 30 | color_scheme=6 31 | enable_mouse=1 32 | delay=15 33 | hide_function_bar=0 34 | header_layout=two_50_50 35 | column_meters_0=LeftCPUs2 Blank Memory CPU 36 | column_meter_modes_0=1 2 1 1 37 | column_meters_1=RightCPUs2 Blank Tasks Uptime 38 | column_meter_modes_1=1 2 2 2 39 | tree_view=0 40 | sort_key=1 41 | tree_sort_key=0 42 | sort_direction=1 43 | tree_sort_direction=1 44 | tree_view_always_by_pid=0 45 | all_branches_collapsed=0 46 | screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command 47 | .sort_key=Command 48 | .tree_sort_key=PID 49 | .tree_view=0 50 | .tree_view_always_by_pid=0 51 | .sort_direction=1 52 | .tree_sort_direction=1 53 | .all_branches_collapsed=0 54 | -------------------------------------------------------------------------------- /src/.config/kitty/fonts/FiraCode.conf: -------------------------------------------------------------------------------- 1 | font_family Fira Code Regular Nerd Font Complete Mono 2 | bold_font Fira Code Bold Nerd Font Complete Mono 3 | italic_font Fira Code Regular Nerd Font Complete Mono 4 | bold_italic_font Fira Code Bold Nerd Font Complete Mono 5 | -------------------------------------------------------------------------------- /src/.config/kitty/fonts/Iosevka.conf: -------------------------------------------------------------------------------- 1 | font_family Iosevka Term Nerd Font Complete Mono 2 | bold_font Iosevka Term Bold Nerd Font Complete Mono 3 | italic_font Iosevka Term Italic Nerd Font Complete Mono 4 | bold_italic_font Iosevka Term Bold Italic Nerd Font Complete Mono 5 | -------------------------------------------------------------------------------- /src/.config/kitty/fonts/JetBrainsMono.conf: -------------------------------------------------------------------------------- 1 | font_family JetBrains Mono Regular Nerd Font Complete Mono 2 | bold_font JetBrains Mono Bold Nerd Font Complete Mono 3 | italic_font JetBrains Mono Italic Nerd Font Complete Mono 4 | bold_italic_font JetBrains Mono Bold Italic Nerd Font Complete Mono 5 | -------------------------------------------------------------------------------- /src/.config/kitty/fonts/UbuntuMono.conf: -------------------------------------------------------------------------------- 1 | font_family Ubuntu Mono Nerd Font Complete Mono 2 | bold_font Ubuntu Mono Bold Nerd Font Complete Mono 3 | italic_font Ubuntu Mono Italic Nerd Font Complete Mono 4 | bold_italic_font Ubuntu Mono Bold Italic Nerd Font Complete Mono 5 | -------------------------------------------------------------------------------- /src/.config/kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | ## Theme 2 | include ./themes/onedark.conf 3 | 4 | include ./fonts/JetBrainsMono.conf 5 | font_size 15.0 6 | 7 | # adjust_line_height 4 8 | # adjust_column_width 0 9 | # disable_ligatures never 10 | 11 | # Cursor customization 12 | # cursor_shape block 13 | # cursor_blink_interval -1 14 | # scrollback_lines 10000 15 | 16 | # Terminal bell 17 | # enable_audio_bell no 18 | 19 | # Window 20 | window_margin_width 0 21 | window_padding_width 0 22 | 23 | # Change window opacity dynamically 24 | dynamic_background_opacity yes 25 | background_opacity 1 26 | 27 | # # Keymaps 28 | # kitty_mod ctrl+alt 29 | 30 | # Zoom 31 | map ctrl+minus decrease_font_size 32 | map ctrl+equal increase_font_size 33 | map ctrl+plus restore_font_size 34 | 35 | # Background opacity 36 | map kitty_mod+minus set_background_opacity -0.05 37 | map kitty_mod+equal set_background_opacity +0.05 38 | map kitty_mod+plus set_background_opacity default 39 | 40 | # Fix for detecting and 41 | map shift+enter send_text all \x1b[13;2u 42 | map ctrl+enter send_text all \x1b[13;5u 43 | -------------------------------------------------------------------------------- /src/.config/kitty/themes/custom.conf: -------------------------------------------------------------------------------- 1 | #: Color scheme 2 | foreground #D8DEE9 3 | background #282C34 4 | selection_foreground #3B4252 5 | selection_background #ECEFF4 6 | #: black 7 | color0 #3B4252 8 | color8 #3B4252 9 | 10 | #: red 11 | color1 #D54646 12 | color9 #D54646 13 | 14 | #: green 15 | color2 #23D18B 16 | color10 #23D18B 17 | 18 | #: yellow 19 | color3 #D7BA7D 20 | color11 #D7BA7D 21 | 22 | #: blue 23 | color4 #569CD6 24 | color12 #569CD6 25 | 26 | #: magenta 27 | color5 #C586C0 28 | color13 #C586C0 29 | 30 | #: cyan 31 | color6 #29B8DB 32 | color14 #29B8DB 33 | 34 | #: white 35 | color7 #ECEFF4 36 | color15 #ECEFF4 37 | -------------------------------------------------------------------------------- /src/.config/kitty/themes/dracula.conf: -------------------------------------------------------------------------------- 1 | # https://draculatheme.com/kitty 2 | # 3 | # Installation instructions: 4 | # 5 | # cp dracula.conf ~/.config/kitty/ 6 | # echo "include dracula.conf" >> ~/.config/kitty/kitty.conf 7 | # 8 | # Then reload kitty for the config to take affect. 9 | # Alternatively copy paste below directly into kitty.conf 10 | 11 | foreground #f8f8f2 12 | background #282a36 13 | selection_foreground #ffffff 14 | selection_background #44475a 15 | 16 | url_color #8be9fd 17 | 18 | # black 19 | color0 #21222c 20 | color8 #6272a4 21 | 22 | # red 23 | color1 #ff5555 24 | color9 #ff6e6e 25 | 26 | # green 27 | color2 #50fa7b 28 | color10 #69ff94 29 | 30 | # yellow 31 | color3 #f1fa8c 32 | color11 #ffffa5 33 | 34 | # blue 35 | color4 #bd93f9 36 | color12 #d6acff 37 | 38 | # magenta 39 | color5 #ff79c6 40 | color13 #ff92df 41 | 42 | # cyan 43 | color6 #8be9fd 44 | color14 #a4ffff 45 | 46 | # white 47 | color7 #f8f8f2 48 | color15 #ffffff 49 | 50 | # Cursor colors 51 | cursor #f8f8f2 52 | cursor_text_color background 53 | 54 | # Tab bar colors 55 | active_tab_foreground #282a36 56 | active_tab_background #f8f8f2 57 | inactive_tab_foreground #282a36 58 | inactive_tab_background #6272a4 59 | 60 | # Marks 61 | mark1_foreground #282a36 62 | mark1_background #ff5555 63 | -------------------------------------------------------------------------------- /src/.config/kitty/themes/gruvbox.conf: -------------------------------------------------------------------------------- 1 | # gruvbox-dark colorscheme for kitty 2 | foreground #ebdbb2 3 | background #272727 4 | selection_foreground #655b53 5 | selection_background #ebdbb2 6 | url_color #d65c0d 7 | 8 | # black 9 | color0 #272727 10 | color8 #928373 11 | 12 | # red 13 | color1 #cc231c 14 | color9 #fb4833 15 | 16 | # green 17 | color2 #989719 18 | color10 #b8ba25 19 | 20 | # yellow 21 | color3 #d79920 22 | color11 #fabc2e 23 | 24 | # blue 25 | color4 #448488 26 | color12 #83a597 27 | 28 | # magenta 29 | color5 #b16185 30 | color13 #d3859a 31 | 32 | # cyan 33 | color6 #689d69 34 | color14 #8ec07b 35 | 36 | # white 37 | color7 #a89983 38 | color15 #ebdbb2 39 | -------------------------------------------------------------------------------- /src/.config/kitty/themes/monokai.conf: -------------------------------------------------------------------------------- 1 | # Monokai-pro for Kitty 2 | # Based on https://www.monokai.pro/ 3 | 4 | foreground #fcfcfa 5 | background #2d2a2e 6 | selection_foreground #19181a 7 | selection_background #ffd866 8 | url_color #78dce8 9 | cursor #fcfcfa 10 | cursor_text_color #2d2a2e 11 | 12 | active_tab_background #ffd866 13 | active_tab_foreground #19181a 14 | active_tab_font_style bold 15 | inactive_tab_background #2d2a2e 16 | inactive_tab_foreground #fcfcfa 17 | inactive_tab_font_style normal 18 | tab_fade 0.1 0.2 0.8 1 19 | tab_bar_margin_width 1.0 20 | 21 | dim_opacity 0.5 22 | inactive_text_alpha 0.5 23 | active_border_color #19181a 24 | draw_minimal_borders yes 25 | window_padding_width 10 26 | window_margin_width 0 27 | macos_titlebar_color background 28 | 29 | # black 30 | color0 #19181a 31 | color8 #19181a 32 | 33 | # red 34 | color1 #FF5C57 35 | color9 #FF5C57 36 | 37 | # green 38 | color2 #a9dc76 39 | color10 #a9dc76 40 | 41 | # yellow 42 | color3 #ffd866 43 | color11 #ffd866 44 | 45 | # blue 46 | color4 #3399cc 47 | color12 #3399cc 48 | 49 | # magenta 50 | color5 #ff6188 51 | color13 #ff6188 52 | 53 | # cyan 54 | color6 #78dce8 55 | color14 #78dce8 56 | 57 | # white 58 | color7 #fcfcfa 59 | color15 #fcfcfa 60 | -------------------------------------------------------------------------------- /src/.config/kitty/themes/onedark.conf: -------------------------------------------------------------------------------- 1 | # Colors 2 | foreground #979eab 3 | background #282c34 4 | 5 | color0 #282c34 6 | color1 #e06c75 7 | color2 #98c379 8 | color3 #e5c07b 9 | color4 #61afef 10 | color5 #be5046 11 | color6 #56b6c2 12 | color7 #979eab 13 | color8 #393e48 14 | color9 #d19a66 15 | color10 #56b6c2 16 | color11 #e5c07b 17 | color12 #61afef 18 | color13 #be5046 19 | color14 #56b6c2 20 | color15 #abb2bf 21 | 22 | # Tab Bar 23 | active_tab_foreground #282c34 24 | active_tab_background #979eab 25 | inactive_tab_foreground #abb2bf 26 | inactive_tab_background #282c34 27 | -------------------------------------------------------------------------------- /src/.config/kitty/themes/tokyonight.conf: -------------------------------------------------------------------------------- 1 | # TokyoNight colors for Kitty 2 | 3 | background #1a1b26 4 | foreground #c0caf5 5 | selection_background #33467C 6 | selection_foreground #c0caf5 7 | url_color #73daca 8 | cursor #c0caf5 9 | 10 | # Tabs 11 | active_tab_background #7aa2f7 12 | active_tab_foreground #1f2335 13 | inactive_tab_background #292e42 14 | inactive_tab_foreground #545c7e 15 | #tab_bar_background #15161E 16 | 17 | # normal 18 | color0 #15161E 19 | color1 #f7768e 20 | color2 #9ece6a 21 | color3 #e0af68 22 | color4 #7aa2f7 23 | color5 #bb9af7 24 | color6 #7dcfff 25 | color7 #a9b1d6 26 | 27 | # bright 28 | color8 #414868 29 | color9 #f7768e 30 | color10 #9ece6a 31 | color11 #e0af68 32 | color12 #7aa2f7 33 | color13 #bb9af7 34 | color14 #7dcfff 35 | color15 #c0caf5 36 | 37 | # extended colors 38 | color16 #ff9e64 39 | color17 #db4b4b 40 | 41 | -------------------------------------------------------------------------------- /src/.config/nvim/init.lua: -------------------------------------------------------------------------------- 1 | local function auto_dark_mode(interval) 2 | local function check_system_mode() 3 | local system = vim.loop.os_uname().sysname 4 | local cmd = nil 5 | if system == "Darwin" then 6 | cmd = { "defaults", "read", "-g", "AppleInterfaceStyle" } 7 | end 8 | 9 | if cmd == nil then 10 | return 11 | end 12 | 13 | -- Use sync job to ensure this runs before other configs 14 | local output = vim.fn.system(cmd) 15 | local is_dark = output and string.match(output, "Dark") 16 | if is_dark then 17 | vim.o.background = "dark" 18 | else 19 | vim.o.background = "light" 20 | end 21 | end 22 | 23 | check_system_mode() 24 | 25 | -- Set up timer for subsequent checks if interval is provided 26 | if interval then 27 | local timer_id = vim.fn.timer_start(interval, function() 28 | check_system_mode() 29 | end, { ["repeat"] = -1 }) 30 | -- vim.fn.timer_stop(timer_id) 31 | end 32 | end 33 | 34 | auto_dark_mode() 35 | 36 | require("config.options") 37 | require("config.keymaps") 38 | require("config.autocmd") 39 | require("config.lazy") 40 | -------------------------------------------------------------------------------- /src/.config/nvim/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, 3 | "avante.nvim": { "branch": "main", "commit": "b20b2caf220cd988b026d5981475bf8928afa27e" }, 4 | "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, 5 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 6 | "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, 7 | "conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" }, 8 | "copilot.lua": { "branch": "master", "commit": "30321e33b03cb924fdcd6a806a0dc6fa0b0eafb9" }, 9 | "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, 10 | "gitsigns.nvim": { "branch": "main", "commit": "8b00147519d6f8353867d5d0b55f587306b0cfb6" }, 11 | "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, 12 | "lazydev.nvim": { "branch": "main", "commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" }, 13 | "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, 14 | "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, 15 | "neo-tree.nvim": { "branch": "main", "commit": "0ead8aaa301347b3555a1453ba3d36231cfff749" }, 16 | "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, 17 | "nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" }, 18 | "nvim-lint": { "branch": "master", "commit": "ec9fda13a5254783a80b37563ed5eb97b75c28b7" }, 19 | "nvim-lspconfig": { "branch": "master", "commit": "7af2c37192deae28d1305ae9e68544f7fb5408e1" }, 20 | "nvim-treesitter": { "branch": "master", "commit": "2cade9e3d105732b794bc37e7cb2dc53b1cf99dc" }, 21 | "nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" }, 22 | "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, 23 | "render-markdown.nvim": { "branch": "main", "commit": "f6c9e1841cf644a258eb037dae587e3cf407d696" }, 24 | "rose-pine": { "branch": "main", "commit": "20c7940da844aa4f162a64e552ae3c7e9fdc3b93" }, 25 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "2a5ceff981501cff8f46871d5402cd3378a8ab6a" }, 26 | "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" } 27 | } 28 | -------------------------------------------------------------------------------- /src/.config/nvim/lua/config/autocmd.lua: -------------------------------------------------------------------------------- 1 | local autocmd = vim.api.nvim_create_autocmd 2 | local augroup = vim.api.nvim_create_augroup 3 | 4 | autocmd("TextYankPost", { 5 | desc = "Highlight when yanking (copying) text", 6 | group = augroup("HighlightYank", { clear = true }), 7 | callback = function() 8 | vim.highlight.on_yank({ higroup = "IncSearch", timeout = 150 }) 9 | end, 10 | }) 11 | -------------------------------------------------------------------------------- /src/.config/nvim/lua/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | local map = vim.keymap.set 2 | 3 | map({ "n", "v", "x", "i" }, "", "") 4 | map({ "n", "v" }, "", "", { silent = true }) 5 | map("n", "Q", "") 6 | map("n", "q:", "") 7 | map("n", "", "w") 8 | map("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) 9 | map("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) 10 | map("n", "", '{->v:hlsearch ? ":nohl\\" : "\\"}()', { expr = true }) 11 | map("v", "J", ":m '>+1gv=gv") 12 | map("v", "K", ":m '<-2gv=gv") 13 | 14 | map("n", "", "cnext") 15 | map("n", "", "cprev") 16 | 17 | map("n", "xx", "source %") 18 | 19 | -- Buffers 20 | map("n", "]b", "bn") 21 | map("n", "[b", "bp") 22 | map("n", "bd", "bd") 23 | 24 | -- Visual 25 | map("x", "<", "", ">gv") 27 | map("x", "K", ":move '<-2gv-gv") 28 | map("x", "J", ":move '>+1gv-gv") 29 | -------------------------------------------------------------------------------- /src/.config/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 | error("Error cloning lazy.nvim:\n" .. out) 8 | end 9 | end 10 | vim.opt.rtp:prepend(lazypath) 11 | 12 | require("lazy").setup({ 13 | install = { colorscheme = { "rose-pine" } }, 14 | checker = { enabled = false }, 15 | spec = { 16 | { import = "plugins" }, -- custom.plugins 17 | }, 18 | change_detection = { 19 | enabled = false, -- automatically check for config file changes and reload the ui 20 | notify = true, -- get a notification when changes are found 21 | }, 22 | }) 23 | -------------------------------------------------------------------------------- /src/.config/nvim/lua/config/options.lua: -------------------------------------------------------------------------------- 1 | -- disable netrw 2 | vim.g.loaded_netrw = 1 3 | vim.g.loaded_netrwPlugin = 1 4 | 5 | vim.g.mapleader = " " 6 | vim.g.autoformat = true 7 | 8 | local opt = vim.opt 9 | opt.clipboard = vim.env.SSH_TTY and "" or "unnamedplus" -- Sync with system clipboard 10 | opt.cmdheight = 0 11 | opt.completeopt = "menu,menuone,noselect" 12 | opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions 13 | -- opt.confirm = true -- Confirm to save changes before exiting modified buffer 14 | opt.cursorline = true -- Enable highlighting of the current line 15 | opt.expandtab = true -- Use spaces instead of tabs 16 | opt.fillchars = { foldopen = "", foldclose = "", fold = " ", foldsep = " ", diff = "╱", eob = " " } 17 | opt.foldlevel = 99 18 | opt.formatoptions = "jcroqlnt" -- tcqj 19 | opt.grepformat = "%f:%l:%c:%m" 20 | opt.grepprg = "rg --vimgrep" 21 | opt.ignorecase = true -- Ignore case 22 | opt.inccommand = "nosplit" -- preview incremental substitute 23 | opt.jumpoptions = "view" 24 | opt.laststatus = 3 -- global statusline 25 | opt.linebreak = true -- Wrap lines at convenient points 26 | opt.list = false -- Show some invisible characters (tabs... opt.number = true -- Print line number 27 | -- opt.mouse = "" -- Disable mouse 28 | opt.relativenumber = true -- Relative line numbers 29 | opt.ruler = false -- Disable the default ruler 30 | opt.scrolloff = 8 -- Lines of context 31 | opt.shiftround = true -- Round indent 32 | opt.shiftwidth = 2 -- Size of an indent 33 | opt.shortmess:append({ W = true, I = true, c = true, C = true }) 34 | 35 | vim.opt.shortmess:append("c") 36 | opt.showmode = false -- Dont show mode since we have a statusline 37 | opt.sidescrolloff = 8 -- Columns of context 38 | opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time 39 | opt.smartcase = true -- Don't ignore case with capitals 40 | opt.smartindent = true -- Insert indents automatically 41 | opt.spelllang = { "en" } 42 | opt.splitbelow = true -- Put new windows below current 43 | opt.splitkeep = "screen" 44 | opt.splitright = true -- Put new windows right of current 45 | -- opt.statuscolumn = [[%!v:lua.require'snacks.statuscolumn'.get()]] 46 | opt.tabstop = 2 -- Number of spaces tabs count for 47 | opt.termguicolors = true -- True color support 48 | opt.undofile = true 49 | opt.undolevels = 10000 50 | opt.updatetime = 200 -- Save swap file and trigger CursorHold 51 | opt.virtualedit = "block" -- Allow cursor to move where there is no text in visual block mode 52 | opt.wildmode = "longest:full,full" -- Command-line completion mode 53 | opt.winminwidth = 5 -- Minimum window width 54 | opt.wrap = false -- Disable line wrap 55 | -------------------------------------------------------------------------------- /src/.config/nvim/lua/config/telescope.lua: -------------------------------------------------------------------------------- 1 | local has_telescope, telescope = pcall(require, "telescope") 2 | if not has_telescope then 3 | error("This script requires nvim-telescope/telescope.nvim") 4 | end 5 | 6 | local action_state = require("telescope.actions.state") 7 | local actions = require("telescope.actions") 8 | local conf = require("telescope.config").values 9 | local finders = require("telescope.finders") 10 | local make_entry = require("telescope.make_entry") 11 | local pickers = require("telescope.pickers") 12 | local builtin = require("telescope.builtin") 13 | 14 | local find_projects_command = function(opts) 15 | --[[ Example find command 16 | find ~/Developer -type d \( -name node_modules -o -name build -o -name dist \) -prune -o \( -name .git -prune -print \) | sed 's/\/\.git$//' 17 | --]] 18 | opts = opts or {} 19 | opts.cwd = opts.cwd or os.getenv("HOME") .. "/Developer" 20 | opts.ignore = opts.ignore or { "node_modules", "dist", "build" } 21 | 22 | local find_cmd = { "find", opts.cwd, "-mindepth", "1", "-maxdepth", opts.maxdepth or "5" } 23 | 24 | for _, ignore_dir in ipairs(opts.ignore) do 25 | table.insert(find_cmd, "-type") 26 | table.insert(find_cmd, "d") 27 | table.insert(find_cmd, "-name") 28 | table.insert(find_cmd, ignore_dir) 29 | table.insert(find_cmd, "-prune") 30 | table.insert(find_cmd, "-o") 31 | end 32 | 33 | table.insert(find_cmd, "-type") 34 | table.insert(find_cmd, "d") 35 | table.insert(find_cmd, "-name") 36 | table.insert(find_cmd, ".git") 37 | table.insert(find_cmd, "-prune") 38 | table.insert(find_cmd, "-print") 39 | 40 | return find_cmd 41 | end 42 | 43 | local M = {} 44 | 45 | M.project_search = function() 46 | local is_git_repo = vim.fn.systemlist("git rev-parse --is-inside-work-tree")[1] == "true" 47 | if is_git_repo then 48 | builtin.git_files() 49 | else 50 | builtin.find_files() 51 | end 52 | end 53 | 54 | M.live_multigrep = function(opts) 55 | opts = opts or {} 56 | opts.cwd = opts.cwd or vim.uv.cwd() 57 | 58 | local finder = finders.new_async_job({ 59 | command_generator = function(prompt) 60 | if not prompt or prompt == "" then 61 | return nil 62 | end 63 | 64 | local pieces = vim.split(prompt, " ") 65 | local args = { "rg" } 66 | if pieces[1] then 67 | table.insert(args, "-e") 68 | table.insert(args, pieces[1]) 69 | end 70 | 71 | if pieces[2] then 72 | table.insert(args, "-g") 73 | table.insert(args, pieces[2]) 74 | end 75 | 76 | ---@diagnostic disable-next-line: deprecated 77 | return vim.tbl_flatten({ 78 | args, 79 | { 80 | "--color=never", 81 | "--column", 82 | "--hidden", -- include dotfiles 83 | "--line-number", 84 | "--no-heading", 85 | "--smart-case", 86 | "--with-filename", 87 | }, 88 | }) 89 | end, 90 | entry_maker = make_entry.gen_from_vimgrep(opts), 91 | cwd = opts.cwd, 92 | }) 93 | 94 | pickers 95 | .new(opts, { 96 | debounce = 100, 97 | prompt_title = "Multi Grep", 98 | finder = finder, 99 | previewer = conf.grep_previewer(opts), 100 | sorter = require("telescope.sorters").empty(), 101 | }) 102 | :find() 103 | end 104 | 105 | M.projects = function(opts) 106 | pickers 107 | .new(opts, { 108 | prompt_title = "Projects", 109 | sorter = conf.generic_sorter(opts), 110 | finder = finders.new_oneshot_job(find_projects_command(opts), { 111 | entry_maker = function(line) 112 | local dir = line:gsub("/%.git$", "") 113 | return { 114 | display = vim.fn.fnamemodify(dir, ":~"), -- Show path relative to home 115 | ordinal = dir, 116 | value = dir, 117 | } 118 | end, 119 | }), 120 | attach_mappings = function(prompt_bufnr, _) 121 | actions.select_default:replace(function() 122 | local selection = action_state.get_selected_entry() 123 | 124 | local cd_scope = { tab = "tcd", window = "lcd", global = "cd" } 125 | vim.fn.execute(cd_scope.tab .. " " .. selection.value, "silent") 126 | builtin.git_files({ cwd = selection.value }) 127 | end) 128 | return true 129 | end, 130 | }) 131 | :find() 132 | end 133 | 134 | vim.keymap.set("n", "ss", function() 135 | builtin.find_files({ 136 | attach_mappings = function(prompt_bufnr) 137 | local actions = require("telescope.actions") 138 | local action_state = require("telescope.actions.state") 139 | actions.select_default:replace(function() 140 | local current_picker = action_state.get_current_picker(prompt_bufnr) 141 | local selections = current_picker:get_multi_selection() 142 | -- if no multi-selection, leverage current selection 143 | if vim.tbl_isempty(selections) then 144 | table.insert(selections, action_state.get_selected_entry()) 145 | end 146 | local paths = vim.tbl_map(function(e) 147 | return e.path 148 | end, selections) 149 | actions.close(prompt_bufnr) 150 | builtin.live_grep({ 151 | search_dirs = paths, 152 | }) 153 | end) 154 | -- true: attach default mappings; false: don't attach default mappings 155 | return true 156 | end, 157 | }) 158 | end) 159 | 160 | return M 161 | -------------------------------------------------------------------------------- /src/.config/nvim/lua/plugins/ai.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | { 4 | "zbirenbaum/copilot.lua", 5 | lazy = true, 6 | cmd = "Copilot", 7 | event = "InsertEnter", 8 | config = function() 9 | require("copilot").setup({ 10 | suggestion = { 11 | enabled = true, 12 | auto_trigger = true, 13 | debounce = 75, 14 | keymap = { dismiss = "" }, 15 | }, 16 | copilot_node_command = "node", -- Node.js version must be > 16.x 17 | server_opts_overrides = {}, 18 | filetypes = { ["."] = false }, 19 | }) 20 | 21 | local suggestion = require("copilot.suggestion") 22 | vim.keymap.set("i", "", function() 23 | if suggestion.is_visible() then 24 | suggestion.accept() 25 | else 26 | vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "n", false) 27 | end 28 | end, { silent = true }) 29 | end, 30 | }, 31 | { 32 | "yetone/avante.nvim", 33 | event = "VeryLazy", 34 | opts = { 35 | provider = "copilot", 36 | auto_suggestions_provider = "copilot", 37 | mappings = { 38 | edit = "ae", 39 | submit = { insert = "", normal = "" }, 40 | }, 41 | }, 42 | build = "make", 43 | dependencies = { 44 | { "MunifTanjim/nui.nvim", lazy = true }, 45 | { "nvim-lua/plenary.nvim", lazy = true }, 46 | { "stevearc/dressing.nvim", lazy = true }, 47 | }, 48 | }, 49 | }, 50 | } 51 | -------------------------------------------------------------------------------- /src/.config/nvim/lua/plugins/autoformat.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { -- Autoformat 3 | "stevearc/conform.nvim", 4 | event = { "BufWritePre" }, 5 | cmd = { "ConformInfo" }, 6 | keys = { 7 | { 8 | "fd", 9 | function() 10 | require("conform").format({ async = true, lsp_format = "fallback" }) 11 | end, 12 | mode = "", 13 | desc = "[F]ormat document", 14 | }, 15 | }, 16 | opts = { 17 | notify_on_error = false, 18 | format_on_save = function(bufnr) 19 | -- Disable "format_on_save lsp_fallback" for languages that don't 20 | -- have a well standardized coding style. You can add additional 21 | -- languages here or re-enable it for the disabled ones. 22 | local disable_filetypes = { c = true, cpp = true } 23 | local lsp_format_opt 24 | if disable_filetypes[vim.bo[bufnr].filetype] then 25 | lsp_format_opt = "never" 26 | else 27 | lsp_format_opt = "fallback" 28 | end 29 | return { 30 | timeout_ms = 500, 31 | lsp_format = lsp_format_opt, 32 | } 33 | end, 34 | formatters_by_ft = { 35 | lua = { "stylua" }, 36 | -- Conform can also run multiple formatters sequentially 37 | -- python = { "isort", "black" }, 38 | javascript = { "prettierd", "prettier", stop_after_first = true }, 39 | }, 40 | }, 41 | }, 42 | } 43 | -------------------------------------------------------------------------------- /src/.config/nvim/lua/plugins/colorscheme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "rose-pine/neovim", 3 | name = "rose-pine", 4 | config = function() 5 | vim.cmd("colorscheme rose-pine") 6 | end, 7 | } 8 | -------------------------------------------------------------------------------- /src/.config/nvim/lua/plugins/editor.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "MeanderingProgrammer/render-markdown.nvim", 4 | opts = { file_types = { "markdown", "Avante" } }, 5 | ft = { "markdown", "Avante" }, 6 | }, 7 | { 8 | "lewis6991/gitsigns.nvim", 9 | event = { "VeryLazy" }, 10 | keys = { 11 | { "]g", "Gitsigns next_hunk", desc = "Next Git Hunk" }, 12 | { "[g", "Gitsigns prev_hunk", desc = "Previous Git Hunk" }, 13 | }, 14 | opts = { 15 | current_line_blame = true, 16 | current_line_blame_formatter = ", - ", 17 | current_line_blame_opts = { delay = 300 }, 18 | signs = { 19 | add = { text = "▎" }, 20 | change = { text = "▎" }, 21 | delete = { text = "" }, 22 | topdelete = { text = "" }, 23 | changedelete = { text = "▎" }, 24 | untracked = { text = "▎" }, 25 | }, 26 | }, 27 | }, 28 | { 29 | "nvim-neo-tree/neo-tree.nvim", 30 | cmd = "Neotree", 31 | keys = { 32 | { "", "Neotree toggle", desc = "NeoTree" }, 33 | }, 34 | opts = { 35 | close_if_last_window = true, 36 | filesystem = { 37 | bind_to_cwd = true, 38 | filtered_items = { hide_dotfiles = false, hide_gitignored = false, hide_hidden = false }, 39 | follow_current_file = { enabled = true }, 40 | use_libuv_file_watcher = true, 41 | window = { 42 | mappings = { 43 | ["l"] = "open", 44 | }, 45 | }, 46 | }, 47 | window = { position = "right" }, 48 | }, 49 | dependencies = { 50 | { "MunifTanjim/nui.nvim", lazy = true }, 51 | { "nvim-lua/plenary.nvim", lazy = true }, 52 | { "nvim-tree/nvim-web-devicons", lazy = true, enabled = vim.g.have_nerd_font }, 53 | }, 54 | }, 55 | } 56 | -------------------------------------------------------------------------------- /src/.config/nvim/lua/plugins/lsp.lua: -------------------------------------------------------------------------------- 1 | local function ensure_installed_tools(tools) 2 | local mlsp = require("mason-lspconfig") 3 | local mr = require("mason-registry") 4 | for _, tool in ipairs(tools) do 5 | -- @see https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim/blob/c5e07b8ff54187716334d585db34282e46fa2932/lua/mason-tool-installer/init.lua#L157-L165 6 | local mason_name = mlsp.get_mappings().lspconfig_to_mason[tool] or tool 7 | local p = mr.get_package(mason_name) 8 | if not p:is_installed() then 9 | p:install() 10 | end 11 | end 12 | end 13 | 14 | return { 15 | { 16 | "neovim/nvim-lspconfig", 17 | dependencies = { 18 | "hrsh7th/cmp-nvim-lsp", 19 | "williamboman/mason-lspconfig.nvim", 20 | "williamboman/mason.nvim", 21 | { 22 | "folke/lazydev.nvim", 23 | ft = "lua", 24 | opts = { library = { { path = "${3rd}/luv/library", words = { "vim%.uv" } } } }, 25 | }, 26 | }, 27 | config = function() 28 | local autocmd = vim.api.nvim_create_autocmd 29 | autocmd("LspAttach", { 30 | group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }), 31 | callback = function(event) 32 | local map = function(keys, func, desc, mode) 33 | mode = mode or "n" 34 | vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc }) 35 | end 36 | 37 | local builtin = require("telescope.builtin") 38 | 39 | map("gd", builtin.lsp_definitions, "[G]oto [D]efinition") 40 | map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") 41 | map("gr", builtin.lsp_references, "[G]oto [R]eferences") 42 | map("gI", builtin.lsp_implementations, "[G]oto [I]mplementation") 43 | map("D", builtin.lsp_type_definitions, "Type [D]efinition") 44 | map("ds", builtin.lsp_document_symbols, "[D]ocument [S]ymbols") 45 | map("ws", builtin.lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols") 46 | map("rn", vim.lsp.buf.rename, "[R]e[n]ame") 47 | map("ca", vim.lsp.buf.code_action, "[C]ode [A]ction", { "n", "x" }) 48 | 49 | -- The following two autocommands are used to highlight references of the 50 | -- word under your cursor when your cursor rests there for a little while. 51 | -- See `:help CursorHold` for information about when this is executed 52 | -- 53 | -- When you move your cursor, the highlights will be cleared (the second autocommand). 54 | local client = vim.lsp.get_client_by_id(event.data.client_id) 55 | if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then 56 | local augroup = vim.api.nvim_create_augroup("lsp-highlight", { clear = false }) 57 | autocmd({ "CursorHold", "CursorHoldI" }, { 58 | group = augroup, 59 | buffer = event.buf, 60 | callback = vim.lsp.buf.document_highlight, 61 | }) 62 | 63 | autocmd({ "CursorMoved", "CursorMovedI" }, { 64 | group = augroup, 65 | buffer = event.buf, 66 | callback = vim.lsp.buf.clear_references, 67 | }) 68 | 69 | autocmd("LspDetach", { 70 | group = vim.api.nvim_create_augroup("lsp-detach", { clear = true }), 71 | callback = function(ev) 72 | vim.lsp.buf.clear_references() 73 | vim.api.nvim_clear_autocmds({ group = augroup, buffer = ev.buf }) 74 | end, 75 | }) 76 | end 77 | 78 | -- The following code creates a keymap to toggle inlay hints in your 79 | -- code, if the language server you are using supports them 80 | -- 81 | -- This may be unwanted, since they displace some of your code 82 | if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then 83 | map("th", function() 84 | vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf })) 85 | end, "[T]oggle Inlay [H]ints") 86 | end 87 | end, 88 | }) 89 | 90 | -- LSP servers and clients are able to communicate to each other what features they support. 91 | -- By default, Neovim doesn't support everything that is in the LSP specification. 92 | -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities. 93 | -- So, we create new capabilities with nvim cmp, and then broadcast that to the servers. 94 | local capabilities = vim.lsp.protocol.make_client_capabilities() 95 | capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities()) 96 | 97 | require("mason").setup() 98 | 99 | local servers = { 100 | lua_ls = { 101 | settings = { 102 | Lua = { 103 | completion = { 104 | callSnippet = "Replace", 105 | }, 106 | diagnostics = { globals = { "vim" } }, 107 | }, 108 | }, 109 | }, 110 | } 111 | 112 | local ensure_installed = vim.tbl_keys(servers or {}) 113 | vim.list_extend(ensure_installed, { 114 | "eslint_d", 115 | "prettierd", 116 | "stylua", 117 | "tailwindcss-language-server", 118 | "vtsls", 119 | }) 120 | 121 | ensure_installed_tools(ensure_installed) 122 | 123 | require("mason-lspconfig").setup({ 124 | handlers = { 125 | function(server_name) 126 | local server = servers[server_name] or {} 127 | -- This handles overriding only values explicitly passed 128 | -- by the server configuration above. Useful when disabling 129 | -- certain features of an LSP (for example, turning off formatting for tsserver) 130 | server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) 131 | require("lspconfig")[server_name].setup(server) 132 | end, 133 | }, 134 | }) 135 | end, 136 | }, 137 | { -- Autocompletion 138 | "hrsh7th/nvim-cmp", 139 | event = "InsertEnter", 140 | dependencies = { 141 | { "hrsh7th/cmp-nvim-lsp", lazy = true }, 142 | { "hrsh7th/cmp-path", lazy = true }, 143 | { "saadparwaiz1/cmp_luasnip", lazy = true }, 144 | { 145 | "L3MON4D3/LuaSnip", 146 | build = (function() 147 | -- Build Step is needed for regex support in snippets. 148 | -- This step is not supported in many windows environments. 149 | -- Remove the below condition to re-enable on windows. 150 | if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then 151 | return 152 | end 153 | return "make install_jsregexp" 154 | end)(), 155 | dependencies = { 156 | -- `friendly-snippets` contains a variety of premade snippets. 157 | -- See the README about individual language/framework/plugin snippets: 158 | -- https://github.com/rafamadriz/friendly-snippets 159 | -- { 160 | -- 'rafamadriz/friendly-snippets', 161 | -- config = function() 162 | -- require('luasnip.loaders.from_vscode').lazy_load() 163 | -- end, 164 | -- }, 165 | }, 166 | }, 167 | }, 168 | config = function() 169 | local cmp = require("cmp") 170 | local luasnip = require("luasnip") 171 | local copilot = require("copilot") 172 | luasnip.config.setup({}) 173 | 174 | cmp.setup({ 175 | snippet = { 176 | expand = function(args) 177 | luasnip.lsp_expand(args.body) 178 | end, 179 | }, 180 | completion = { 181 | keyword_length = 3, 182 | completeopt = "menu,menuone,noinsert", 183 | }, 184 | mapping = cmp.mapping.preset.insert({ 185 | [""] = cmp.mapping.select_next_item(), 186 | [""] = cmp.mapping.select_prev_item(), 187 | [""] = cmp.mapping.scroll_docs(-4), 188 | [""] = cmp.mapping.scroll_docs(4), 189 | [""] = cmp.mapping.confirm({ select = true }), 190 | [""] = cmp.mapping.confirm({ select = true }), 191 | [""] = cmp.mapping.complete({}), 192 | -- Think of as moving to the right of your snippet expansion. 193 | -- So if you have a snippet that's like: 194 | -- function $name($args) 195 | -- $body 196 | -- end 197 | -- 198 | -- will move you to the right of each of the expansion locations. 199 | -- is similar, except moving you backwards. 200 | [""] = cmp.mapping(function() 201 | if luasnip.expand_or_locally_jumpable() then 202 | luasnip.expand_or_jump() 203 | end 204 | end, { "i", "s" }), 205 | [""] = cmp.mapping(function() 206 | if luasnip.locally_jumpable(-1) then 207 | luasnip.jump(-1) 208 | end 209 | end, { "i", "s" }), 210 | 211 | -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: 212 | -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps 213 | }), 214 | sources = { 215 | -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it 216 | { name = "lazydev", group_index = 0 }, 217 | { name = "nvim_lsp" }, 218 | { name = "luasnip" }, 219 | { name = "path" }, 220 | }, 221 | }) 222 | end, 223 | }, 224 | { -- Linting 225 | "mfussenegger/nvim-lint", 226 | enabled = false, 227 | event = { "BufReadPre", "BufNewFile" }, 228 | config = function() 229 | local lint = require("lint") 230 | -- lint.linters_by_ft = { markdown = { "markdownlint" } } 231 | -- To allow other plugins to add linters to require('lint').linters_by_ft, 232 | -- instead set linters_by_ft like this: 233 | -- lint.linters_by_ft = lint.linters_by_ft or {} 234 | -- lint.linters_by_ft['markdown'] = { 'markdownlint' } 235 | -- 236 | -- However, note that this will enable a set of default linters, 237 | -- which will cause errors unless these tools are available: 238 | -- { 239 | -- clojure = { "clj-kondo" }, 240 | -- dockerfile = { "hadolint" }, 241 | -- inko = { "inko" }, 242 | -- janet = { "janet" }, 243 | -- json = { "jsonlint" }, 244 | -- markdown = { "vale" }, 245 | -- rst = { "vale" }, 246 | -- ruby = { "ruby" }, 247 | -- terraform = { "tflint" }, 248 | -- text = { "vale" } 249 | -- } 250 | -- 251 | -- You can disable the default linters by setting their filetypes to nil: 252 | -- lint.linters_by_ft['clojure'] = nil 253 | -- lint.linters_by_ft['dockerfile'] = nil 254 | -- lint.linters_by_ft['inko'] = nil 255 | -- lint.linters_by_ft['janet'] = nil 256 | -- lint.linters_by_ft['json'] = nil 257 | -- lint.linters_by_ft['markdown'] = nil 258 | -- lint.linters_by_ft['rst'] = nil 259 | -- lint.linters_by_ft['ruby'] = nil 260 | -- lint.linters_by_ft['terraform'] = nil 261 | -- lint.linters_by_ft['text'] = nil 262 | 263 | -- Create autocommand which carries out the actual linting 264 | -- on the specified events. 265 | local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) 266 | vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { 267 | group = lint_augroup, 268 | callback = function() 269 | if vim.opt_local.modifiable:get() then 270 | lint.try_lint() 271 | end 272 | end, 273 | }) 274 | end, 275 | }, 276 | } 277 | -------------------------------------------------------------------------------- /src/.config/nvim/lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { -- Fuzzy Finder (files, lsp, etc) 3 | "nvim-telescope/telescope.nvim", 4 | tag = "0.1.8", 5 | dependencies = { 6 | { "nvim-lua/plenary.nvim", lazy = true }, 7 | { 8 | "nvim-telescope/telescope-fzf-native.nvim", 9 | lazy = true, 10 | build = "make", 11 | cond = function() 12 | return vim.fn.executable("make") == 1 13 | end, 14 | }, 15 | { "nvim-tree/nvim-web-devicons", lazy = true, enabled = vim.g.have_nerd_font }, 16 | }, 17 | config = function() 18 | require("telescope").setup({ 19 | extensions = { fzf = {} }, 20 | pickers = { 21 | git_files = { show_untracked = true }, 22 | live_grep = { additional_args = { "--hidden" } }, 23 | }, 24 | defaults = require("telescope.themes").get_ivy({ 25 | mappings = { 26 | i = { 27 | [""] = false, 28 | [""] = "move_selection_next", 29 | [""] = "move_selection_previous", 30 | [""] = function(prompt_bufnr) 31 | local actions = require("telescope.actions") 32 | local action_state = require("telescope.actions.state") 33 | local current_picker = action_state.get_current_picker(prompt_bufnr) 34 | local selections = current_picker:get_multi_selection() 35 | -- -- if no multi-selection, leverage current selection 36 | -- if vim.tbl_isempty(selections) then 37 | -- table.insert(selections, action_state.get_selected_entry()) 38 | -- end 39 | -- local paths = vim.tbl_map(function(e) 40 | -- return e.path 41 | -- end, selections) 42 | print(vim.inspect(current_picker:get_multi_selection())) 43 | actions.close(prompt_bufnr) 44 | require("telescope.builtin").live_grep({ 45 | search_dirs = paths, 46 | -- additional_args = function() 47 | -- return { 48 | -- "--color=never", 49 | -- "--column", 50 | -- "--hidden", -- include dotfiles 51 | -- "--line-number", 52 | -- "--no-heading", 53 | -- "--smart-case", 54 | -- "--with-filename", 55 | -- } 56 | -- end, 57 | }) 58 | end, 59 | }, 60 | n = { 61 | [""] = "close", 62 | }, 63 | }, 64 | }), 65 | }) 66 | 67 | pcall(require("telescope").load_extension, "fzf") 68 | 69 | local map = vim.keymap.set 70 | local custom_pickers = require("config.telescope") 71 | local builtin = require("telescope.builtin") 72 | -- Live multigrep 73 | map("n", "fa", function() 74 | custom_pickers.live_multigrep({ cwd = "~/Developer/aleph" }) 75 | end, { desc = "Search aleph" }) 76 | map("n", "fw", custom_pickers.live_multigrep, { desc = "Search words" }) 77 | map("n", "fp", custom_pickers.projects, { desc = "Search projects" }) 78 | map("n", "", builtin.buffers, { desc = "Search buffers" }) 79 | map("n", "ff", builtin.find_files, { desc = "Search files" }) 80 | map("n", "fh", builtin.help_tags, { desc = "Search for help" }) 81 | map("n", "gs", builtin.git_status, { desc = "Search for modified files" }) 82 | map("n", "", custom_pickers.project_search, { desc = "Search git project" }) 83 | 84 | -- Neovim stuff 85 | map("n", "fnd", function() 86 | builtin.find_files({ cwd = vim.fn.stdpath("config") }) 87 | end, { desc = "Search neovim directory" }) 88 | 89 | map("n", "fnp", function() 90 | builtin.find_files({ cwd = vim.fs.joinpath(vim.fn.stdpath("data"), "lazy") }) 91 | end, { desc = "Search neovim plugins" }) 92 | end, 93 | }, 94 | } 95 | -------------------------------------------------------------------------------- /src/.config/nvim/lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | build = ":TSUpdate", 5 | event = { "VeryLazy" }, 6 | lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline 7 | init = function(plugin) 8 | require("lazy.core.loader").add_to_rtp(plugin) 9 | require("nvim-treesitter.query_predicates") 10 | end, 11 | cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" }, 12 | keys = { 13 | { "", desc = "Increment Selection" }, 14 | { "", desc = "Decrement Selection", mode = "x" }, 15 | }, 16 | opts = { 17 | highlight = { enable = true }, 18 | indent = { enable = true }, 19 | ensure_installed = { 20 | "bash", 21 | "c", 22 | "diff", 23 | "html", 24 | "javascript", 25 | "jsdoc", 26 | "json", 27 | "jsonc", 28 | "lua", 29 | "luadoc", 30 | "luap", 31 | "markdown", 32 | "markdown_inline", 33 | "printf", 34 | "python", 35 | "query", 36 | "regex", 37 | "toml", 38 | "tsx", 39 | "typescript", 40 | "vim", 41 | "vimdoc", 42 | "xml", 43 | "yaml", 44 | }, 45 | incremental_selection = { 46 | enable = true, 47 | keymaps = { 48 | init_selection = "", 49 | node_incremental = "", 50 | scope_incremental = false, 51 | node_decremental = "", 52 | }, 53 | }, 54 | textobjects = { 55 | move = { 56 | enable = true, 57 | goto_next_start = { 58 | ["]f"] = "@function.outer", 59 | ["]c"] = "@class.outer", 60 | ["]a"] = "@parameter.inner", 61 | }, 62 | goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer", ["]A"] = "@parameter.inner" }, 63 | goto_previous_start = { 64 | ["[f"] = "@function.outer", 65 | ["[c"] = "@class.outer", 66 | ["[a"] = "@parameter.inner", 67 | }, 68 | goto_previous_end = { 69 | ["[F"] = "@function.outer", 70 | ["[C"] = "@class.outer", 71 | ["[A"] = "@parameter.inner", 72 | }, 73 | }, 74 | }, 75 | }, 76 | config = function(_, opts) 77 | require("nvim-treesitter.configs").setup(opts) 78 | end, 79 | }, 80 | } 81 | -------------------------------------------------------------------------------- /src/.config/ranger/plugins/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martinsione/dotfiles/667d8528f5b656e359c56c123d59b4b42b70511b/src/.config/ranger/plugins/__init__.py -------------------------------------------------------------------------------- /src/.config/ranger/plugins/icons/__init__.py: -------------------------------------------------------------------------------- 1 | import ranger.api 2 | from ranger.core.linemode import LinemodeBase 3 | from .devicons import * 4 | 5 | @ranger.api.register_linemode 6 | class DevIconsLinemode(LinemodeBase): 7 | name = "devicons" 8 | 9 | uses_metadata = False 10 | 11 | def filetitle(self, file, metadata): 12 | return devicon(file) + ' ' + file.relative_path 13 | -------------------------------------------------------------------------------- /src/.config/ranger/plugins/icons/devicons.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # coding=UTF-8 3 | # These glyphs, and the mapping of file extensions to glyphs 4 | # has been copied from the vimscript code that is present in 5 | # https://github.com/ryanoasis/vim-devicons 6 | import re; 7 | import os; 8 | 9 | # all those glyphs will show as weird squares if you don't have the correct patched font 10 | # My advice is to use NerdFonts which can be found here: 11 | # https://github.com/ryanoasis/nerd-fonts 12 | file_node_extensions = { 13 | '7z' : '', 14 | 'a' : '', 15 | 'ai' : '', 16 | 'apk' : '', 17 | 'asm' : '', 18 | 'asp' : '', 19 | 'aup' : '', 20 | 'avi' : '', 21 | 'awk' : '', 22 | 'bash' : '', 23 | 'bat' : '', 24 | 'bmp' : '', 25 | 'bz2' : '', 26 | 'c' : '', 27 | 'c++' : '', 28 | 'cab' : '', 29 | 'cbr' : '', 30 | 'cbz' : '', 31 | 'cc' : '', 32 | 'class' : '', 33 | 'clj' : '', 34 | 'cljc' : '', 35 | 'cljs' : '', 36 | 'cmake' : '', 37 | 'coffee' : '', 38 | 'conf' : '', 39 | 'cp' : '', 40 | 'cpio' : '', 41 | 'cpp' : '', 42 | 'cs' : '', 43 | 'csh' : '', 44 | 'css' : '', 45 | 'cue' : '', 46 | 'cvs' : '', 47 | 'cxx' : '', 48 | 'd' : '', 49 | 'dart' : '', 50 | 'db' : '', 51 | 'deb' : '', 52 | 'diff' : '', 53 | 'dll' : '', 54 | 'doc' : '', 55 | 'docx' : '', 56 | 'dump' : '', 57 | 'edn' : '', 58 | 'eex' : '', 59 | 'efi' : '', 60 | 'ejs' : '', 61 | 'elf' : '', 62 | 'elm' : '', 63 | 'epub' : '', 64 | 'erl' : '', 65 | 'ex' : '', 66 | 'exe' : '', 67 | 'exs' : '', 68 | 'f#' : '', 69 | 'fifo' : 'ﳣ', 70 | 'fish' : '', 71 | 'flac' : '', 72 | 'flv' : '', 73 | 'fs' : '', 74 | 'fsi' : '', 75 | 'fsscript' : '', 76 | 'fsx' : '', 77 | 'gem' : '', 78 | 'gemspec' : '', 79 | 'gif' : '', 80 | 'go' : '', 81 | 'gz' : '', 82 | 'gzip' : '', 83 | 'h' : '', 84 | 'haml' : '', 85 | 'hbs' : '', 86 | 'hh' : '', 87 | 'hpp' : '', 88 | 'hrl' : '', 89 | 'hs' : '', 90 | 'htaccess' : '', 91 | 'htm' : '', 92 | 'html' : '', 93 | 'htpasswd' : '', 94 | 'hxx' : '', 95 | 'ico' : '', 96 | 'img' : '', 97 | 'ini' : '', 98 | 'iso' : '', 99 | 'jar' : '', 100 | 'java' : '', 101 | 'jl' : '', 102 | 'jpeg' : '', 103 | 'jpg' : '', 104 | 'js' : '', 105 | 'json' : '', 106 | 'jsx' : '', 107 | 'key' : '', 108 | 'ksh' : '', 109 | 'leex' : '', 110 | 'less' : '', 111 | 'lha' : '', 112 | 'lhs' : '', 113 | 'log' : '', 114 | 'lua' : '', 115 | 'lzh' : '', 116 | 'lzma' : '', 117 | 'm4a' : '', 118 | 'm4v' : '', 119 | 'markdown' : '', 120 | 'md' : '', 121 | 'mdx' : '', 122 | 'mjs' : '', 123 | 'mkv' : '', 124 | 'ml' : 'λ', 125 | 'mli' : 'λ', 126 | 'mov' : '', 127 | 'mp3' : '', 128 | 'mp4' : '', 129 | 'mpeg' : '', 130 | 'mpg' : '', 131 | 'msi' : '', 132 | 'mustache' : '', 133 | 'nix' : '', 134 | 'o' : '', 135 | 'ogg' : '', 136 | 'pdf' : '', 137 | 'php' : '', 138 | 'pl' : '', 139 | 'pm' : '', 140 | 'png' : '', 141 | 'pp' : '', 142 | 'ppt' : '', 143 | 'pptx' : '', 144 | 'ps1' : '', 145 | 'psb' : '', 146 | 'psd' : '', 147 | 'pub' : '', 148 | 'py' : '', 149 | 'pyc' : '', 150 | 'pyd' : '', 151 | 'pyo' : '', 152 | 'r' : 'ﳒ', 153 | 'rake' : '', 154 | 'rar' : '', 155 | 'rb' : '', 156 | 'rc' : '', 157 | 'rlib' : '', 158 | 'rmd' : '', 159 | 'rom' : '', 160 | 'rpm' : '', 161 | 'rproj' : '鉶', 162 | 'rs' : '', 163 | 'rss' : '', 164 | 'rtf' : '', 165 | 's' : '', 166 | 'sass' : '', 167 | 'scala' : '', 168 | 'scss' : '', 169 | 'sh' : '', 170 | 'slim' : '', 171 | 'sln' : '', 172 | 'so' : '', 173 | 'sql' : '', 174 | 'styl' : '', 175 | 'suo' : '', 176 | 'swift' : '', 177 | 't' : '', 178 | 'tar' : '', 179 | 'tex' : 'ﭨ', 180 | 'tgz' : '', 181 | 'toml' : '', 182 | 'ts' : '', 183 | 'tsx' : '', 184 | 'twig' : '', 185 | 'vim' : '', 186 | 'vimrc' : '', 187 | 'vue' : '﵂', 188 | 'wav' : '', 189 | 'webm' : '', 190 | 'webmanifest' : '', 191 | 'webp' : '', 192 | 'xbps' : '', 193 | 'xcplayground' : '', 194 | 'xhtml' : '', 195 | 'xls' : '', 196 | 'xlsx' : '', 197 | 'xml' : '', 198 | 'xul' : '', 199 | 'xz' : '', 200 | 'yaml' : '', 201 | 'yml' : '', 202 | 'zip' : '', 203 | 'zsh' : '', 204 | } 205 | 206 | dir_node_exact_matches = { 207 | # English 208 | '.git' : '', 209 | 'Desktop' : '', 210 | 'Documents' : '', 211 | 'Downloads' : '', 212 | 'Dotfiles' : '', 213 | 'Dropbox' : '', 214 | 'Music' : '', 215 | 'Pictures' : '', 216 | 'Public' : '', 217 | 'Templates' : '', 218 | 'Videos' : '', 219 | # Spanish 220 | 'Escritorio' : '', 221 | 'Documentos' : '', 222 | 'Descargas' : '', 223 | 'Música' : '', 224 | 'Imágenes' : '', 225 | 'Público' : '', 226 | 'Plantillas' : '', 227 | 'Vídeos' : '', 228 | # French 229 | 'Bureau' : '', 230 | 'Documents' : '', 231 | 'Images' : '', 232 | 'Musique' : '', 233 | 'Publique' : '', 234 | 'Téléchargements' : '', 235 | 'Vidéos' : '', 236 | # Portuguese 237 | 'Documentos' : '', 238 | 'Imagens' : '', 239 | 'Modelos' : '', 240 | 'Música' : '', 241 | 'Público' : '', 242 | 'Vídeos' : '', 243 | 'Área de trabalho' : '', 244 | # Italian 245 | 'Documenti' : '', 246 | 'Immagini' : '', 247 | 'Modelli' : '', 248 | 'Musica' : '', 249 | 'Pubblici' : '', 250 | 'Scaricati' : '', 251 | 'Scrivania' : '', 252 | 'Video' : '', 253 | # German 254 | 'Bilder' : '', 255 | 'Dokumente' : '', 256 | 'Musik' : '', 257 | 'Schreibtisch' : '', 258 | 'Vorlagen' : '', 259 | 'Öffentlich' : '', 260 | # Hungarian 261 | 'Dokumentumok' : '', 262 | 'Képek' : '', 263 | 'Modelli' : '', 264 | 'Zene' : '', 265 | 'Letöltések' : '', 266 | 'Számítógép' : '', 267 | 'Videók' : '', 268 | } 269 | 270 | file_node_exact_matches = { 271 | '.bash_aliases' : '', 272 | '.bash_history' : '', 273 | '.bash_logout' : '', 274 | '.bash_profile' : '', 275 | '.bashprofile' : '', 276 | '.bashrc' : '', 277 | '.dmrc' : '', 278 | '.DS_Store' : '', 279 | '.fasd' : '', 280 | '.fehbg' : '', 281 | '.gitattributes' : '', 282 | '.gitconfig' : '', 283 | '.gitignore' : '', 284 | '.gitlab-ci.yml' : '', 285 | '.gvimrc' : '', 286 | '.inputrc' : '', 287 | '.jack-settings' : '', 288 | '.mime.types' : '', 289 | '.ncmpcpp' : '', 290 | '.nvidia-settings-rc' : '', 291 | '.pam_environment' : '', 292 | '.profile' : '', 293 | '.recently-used' : '', 294 | '.selected_editor' : '', 295 | '.vim' : '', 296 | '.viminfo' : '', 297 | '.vimrc' : '', 298 | '.Xauthority' : '', 299 | '.Xdefaults' : '', 300 | '.xinitrc' : '', 301 | '.xinputrc' : '', 302 | '.Xresources' : '', 303 | '.zshrc' : '', 304 | '_gvimrc' : '', 305 | '_vimrc' : '', 306 | 'a.out' : '', 307 | 'authorized_keys' : '', 308 | 'bspwmrc' : '', 309 | 'cmakelists.txt' : '', 310 | 'config' : '', 311 | 'config.ac' : '', 312 | 'config.m4' : '', 313 | 'config.mk' : '', 314 | 'config.ru' : '', 315 | 'configure' : '', 316 | 'docker-compose.yml' : '', 317 | 'dockerfile' : '', 318 | 'Dockerfile' : '', 319 | 'dropbox' : '', 320 | 'exact-match-case-sensitive-1.txt' : 'X1', 321 | 'exact-match-case-sensitive-2' : 'X2', 322 | 'favicon.ico' : '', 323 | 'gemfile' : '', 324 | 'gruntfile.coffee' : '', 325 | 'gruntfile.js' : '', 326 | 'gruntfile.ls' : '', 327 | 'gulpfile.coffee' : '', 328 | 'gulpfile.js' : '', 329 | 'gulpfile.ls' : '', 330 | 'ini' : '', 331 | 'known_hosts' : '', 332 | 'ledger' : '', 333 | 'license' : '', 334 | 'LICENSE' : '', 335 | 'LICENSE.md' : '', 336 | 'LICENSE.txt' : '', 337 | 'Makefile' : '', 338 | 'makefile' : '', 339 | 'Makefile.ac' : '', 340 | 'Makefile.in' : '', 341 | 'mimeapps.list' : '', 342 | 'mix.lock' : '', 343 | 'node_modules' : '', 344 | 'package-lock.json' : '', 345 | 'package.json' : '', 346 | 'playlists' : '', 347 | 'procfile' : '', 348 | 'Rakefile' : '', 349 | 'rakefile' : '', 350 | 'react.jsx' : '', 351 | 'README' : '', 352 | 'README.markdown' : '', 353 | 'README.md' : '', 354 | 'README.rst' : '', 355 | 'README.txt' : '', 356 | 'sxhkdrc' : '', 357 | 'user-dirs.dirs' : '', 358 | 'webpack.config.js' : '', 359 | } 360 | 361 | def devicon(file): 362 | if file.is_directory: return dir_node_exact_matches.get(file.relative_path, '') 363 | return file_node_exact_matches.get(os.path.basename(file.relative_path), file_node_extensions.get(file.extension, '')) 364 | -------------------------------------------------------------------------------- /src/.config/ranger/rc.conf: -------------------------------------------------------------------------------- 1 | ## How to copy any ranger config file 2 | # https://unix.stackexchange.com/questions/329451/scope-sh-is-lacking-for-ranger-file-manager 3 | # autoupdate_cumulative_size true 4 | # display_size_in_main_column true 5 | # display_size_in_status_bar true 6 | 7 | # Icons 8 | default_linemode devicons 9 | 10 | # Draw borders around columns? (separators, outline, both, or none) 11 | set draw_borders both 12 | set column_ratios 1,3,4 13 | set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$ 14 | set show_hidden true 15 | 16 | # One of: size, natural, basename, atime, ctime, mtime, type, random 17 | set sort natural 18 | set sort_reverse false 19 | set sort_case_insensitive true 20 | set sort_directories_first true 21 | set sort_unicode false 22 | 23 | # set preview_script ~/.config/ranger/scope.sh 24 | # set use_preview_script true 25 | set preview_images true 26 | set preview_images_method ueberzug 27 | set preview_files true 28 | set preview_directories true 29 | set collapse_preview true 30 | 31 | 32 | ## Mappings 33 | map console shell%space 34 | map T console shell trash-restore%space 35 | map R console rename%space 36 | map r rename_append 37 | map i display_file 38 | map yy copy 39 | map cc cut 40 | map cu uncut 41 | map dd shell -s trash-put %s 42 | map pp paste 43 | map ss get_cumulative_size 44 | map mkd console mkdir%space 45 | map tab_new ~ 46 | map tab_close 47 | 48 | ## Custom mappings 49 | map V console shell nvim%space 50 | # map ot console shell (tabbed -c zathura %s -e & disown) >/dev/null 2>&1 51 | map ot console shell (tabbed -c zathura s -e & disown) >/dev/null 2>&1 52 | 53 | 54 | ## Bookmarks 55 | map bh cd ~/ 56 | map bP cd ~/Pictures 57 | map bD cd ~/Downloads 58 | map bd cd ~/dotfiles 59 | map bW cd ~/Workspace 60 | 61 | 62 | ## ~/.config 63 | map bcd cd ~/.config 64 | map bcn cd ~/.config/nvim 65 | map bcr cd ~/.config/rc.conf 66 | ## ~/.local 67 | map bld cd ~/.local 68 | ## ~/.local/bin 69 | map blb cd ~/.local/bin 70 | map blbs cd ~/.local/bin/statusbar 71 | ## ~/.local/share 72 | map bls cd ~/.local/share 73 | map bln cd ~/.local/share/nvim 74 | map blt cd ~/.local/share/Trash/files 75 | ## ~/.local/src 76 | map blS cd ~/.local/src 77 | 78 | ## storage 79 | map bss cd /mnt/s 80 | map bsf cd /mnt/s/Martin/Study/Facu/Cuatrimestres/1 81 | -------------------------------------------------------------------------------- /src/.config/tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | ## 2 | ## -- Settings -- 3 | ## 4 | set -g base-index 1 # start windows numbering at 1 5 | set -g default-terminal "screen-256color" 6 | set -g mode-keys vi # vim like keys 7 | set -g mouse on # Enable mouse 8 | set -g pane-base-index 1 # make pane numbering consistent with windows 9 | # set -g pane-border-format "#P: #{pane_current_path}" 10 | # set -g pane-border-status top # off|top|bottom 11 | set -g renumber-windows on # renumber windows when a window is closed 12 | set -g set-titles on 13 | set -g status-bg black 14 | set -g status-fg white 15 | set -g status-right "%R %d-%h-%y" 16 | 17 | ## 18 | ## -- Mappings -- 19 | ## 20 | set -g prefix C-a 21 | 22 | bind c new-window -c "#{pane_current_path}" 23 | bind v split-window -h -c "#{pane_current_path}" 24 | bind V split-window -c "#{pane_current_path}" 25 | 26 | ## Pane navigation 27 | bind h select-pane -L 28 | bind j select-pane -D 29 | bind k select-pane -U 30 | bind l select-pane -R 31 | 32 | bind r command-prompt -I "#{window_name}" "rename-window '%%'" 33 | 34 | ## Reload configuration 35 | bind R source-file ~/.config/tmux/tmux.conf \; display 'tmux.conf sourced' 36 | 37 | -------------------------------------------------------------------------------- /src/.config/tmux/tmux.conf.bak: -------------------------------------------------------------------------------- 1 | ## set is short for set-option | bind is short for bindkey 2 | ## -g = global | -a = append | -s = ? 3 | 4 | ## -- Settings ------------------------------------------------------------------ 5 | set -g automatic-rename off # rename window to reflect current program 6 | set -g base-index 1 # start windows numbering at 1 7 | set -g display-panes-time 800 # slightly longer pane indicators display time 8 | set -g display-time 1000 # slightly longer status messages display time 9 | set -g history-limit 5000 # boost history 10 | set -g mode-keys vi # vim like keys 11 | set -g monitor-activity on 12 | set -g mouse on # Enable mouse 13 | set -g pane-base-index 1 # make pane numbering consistent with windows 14 | set -g renumber-windows on # renumber windows when a window is closed 15 | set -g status-interval 10 # redraw status line every 10 seconds 16 | set -g visual-activity off 17 | set -g visual-bell off # disable annoying bells 18 | set -g xterm-keys on 19 | set -s escape-time 0 # faster command sequences 20 | set -s focus-events on # needed as on tmux 1.9 and up (defaults to off). 21 | set -sg repeat-time 100 # increase repeat timeout 22 | # set -g default-terminal "tmux-256color" 23 | # set -ga terminal-overrides ',xterm-256color:Tc' 24 | 25 | ## -- Color palette ----------------------------------------------------------- 26 | 27 | # ## Custom 28 | # bg="#413654" 29 | # fg="#888889" 30 | # c1="#c678dd" 31 | 32 | # ## Gruvbox 33 | # bg="#303030" 34 | # fg="#a89983" 35 | # c1="#d79920" 36 | 37 | ## Tokyonight 38 | bg="#1a1b26" 39 | fg="#a9b1d6" 40 | c1="#bb9af7" 41 | 42 | ## -- Appearance -------------------------------------------------------------- 43 | set -g status-position top 44 | set -g status-justify centre # Center window names 45 | # set -g pane-border-status top # Display a border below status line 46 | # set -g pane-border-format '-' 47 | set -g window-status-current-format " #[bold]#I #W " # Active window (format) 48 | set -g window-status-format " #I #W " # Inactive windows (format) 49 | 50 | ## Panes and windows colors 51 | set -g pane-active-border-style fg=$bg 52 | set -g pane-border-style fg=$c1 53 | set -g window-status-current-style fg=$bg,bg=$c1 54 | set -g window-status-style fg=$fg 55 | 56 | ## Status colors 57 | set -g status-style bg=$bg 58 | set -g status-left "#[bold fg=$c1] #S → " 59 | set -g status-right "#[bold fg=$c1] %d %h  %R " 60 | set -g message-style bg=$bg,fg=$fg # message text 61 | 62 | ## -- Mappings ----------------------------------------------------------------- 63 | unbind C-b; unbind h; unbind j; unbind k; unbind l; unbind C-t; unbind '"'; unbind % 64 | 65 | set -g prefix C-a 66 | bind C-a send-prefix 67 | bind c new-window 68 | bind C new-window -c "#{pane_current_path}" # split current window horizontally 69 | bind x confirm kill-pane 70 | bind X confirm kill-window 71 | bind - split-window -v -c "#{pane_current_path}" # split current window horizontally 72 | bind v split-window -h -c "#{pane_current_path}" # split current window vertically 73 | bind space last-window # Toggle between current and last window 74 | 75 | ## Pane navigation 76 | bind h select-pane -L 77 | bind j select-pane -D 78 | bind k select-pane -U 79 | bind l select-pane -R 80 | 81 | ## Window navigation 82 | bind -n M-j select-pane -t :.+ 83 | bind -n M-k select-pane -t :.- 84 | bind -n M-h previous-window 85 | bind -n M-l next-window 86 | 87 | ## Pane resizing 88 | bind C-h resize-pane -L 5 89 | bind C-j resize-pane -D 5 90 | bind C-k resize-pane -U 5 91 | bind C-l resize-pane -R 5 92 | 93 | ## Pane swapping 94 | bind -r '<' swap-window -d -t '{previous}' # Move window left. 95 | bind -r '>' swap-window -d -t '{next}' # Move window right. 96 | # bind > swap-pane -D # swap current pane with the next one 97 | # bind < swap-pane -U # swap current pane with the previous one 98 | 99 | bind -T copy-mode-vi v send-keys -X begin-selection 100 | bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' 101 | 102 | ## Reload configuration 103 | bind r source-file ~/.config/tmux/tmux.conf \; display ' ~/.config/tmux/tmux.conf sourced' 104 | 105 | # bind l send-keys 'C-l' 106 | # bind C-l send-keys 'C-l' 107 | 108 | 109 | ## Plugins 110 | # https://github.com/christoomey/vim-tmux-navigator 111 | # is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" 112 | # bind -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' 113 | # bind -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' 114 | # bind -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' 115 | # bind -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' 116 | # bind -T copy-mode-vi 'C-h' select-pane -L 117 | # bind -T copy-mode-vi 'C-j' select-pane -D 118 | # bind -T copy-mode-vi 'C-k' select-pane -U 119 | # bind -T copy-mode-vi 'C-l' select-pane -R 120 | -------------------------------------------------------------------------------- /src/.config/user-dirs.dirs: -------------------------------------------------------------------------------- 1 | XDG_DESKTOP_DIR="$HOME/Desktop" 2 | XDG_DOWNLOAD_DIR="$HOME/Downloads" 3 | XDG_DOCUMENTS_DIR="$HOME/Documents" 4 | XDG_MUSIC_DIR="$HOME/Music" 5 | XDG_PICTURES_DIR="$HOME/Pictures" 6 | XDG_VIDEOS_DIR="$HOME/Videos" 7 | XDG_TEMPLATES_DIR="$HOME/Templates" 8 | XDG_PUBLICSHARE_DIR="$HOME/Public" 9 | -------------------------------------------------------------------------------- /src/.config/wget/wgetrc: -------------------------------------------------------------------------------- 1 | hsts-file=~/.cache/wget-hsts 2 | -------------------------------------------------------------------------------- /src/.config/zathura/zathurarc: -------------------------------------------------------------------------------- 1 | set font "inconsolata 10" 2 | set sandbox none # Fix some weird link issue 3 | set statusbar-h-padding 0 4 | set statusbar-v-padding 0 5 | set page-padding 1 6 | set selection-clipboard clipboard 7 | set guioptions v 8 | set window-title-page # Display page number 9 | set window-title-basename # Display just the file name 10 | # set statusbar-basename # Display just the file name 11 | 12 | set default-bg '#1d2021' 13 | 14 | unmap r 15 | map u scroll half-up 16 | map d scroll half-down 17 | map D toggle_page_mode 18 | map r recolor 19 | map R rotate 20 | map b toggle_statusbar 21 | map zoom out 22 | map zoom in 23 | -------------------------------------------------------------------------------- /src/.config/zed/keymap.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "use_key_equivalents": true, 4 | "bindings": { 5 | "cmd-b": "workspace::ToggleRightDock", 6 | "cmd-l": "assistant::ToggleFocus", 7 | "ctrl-`": "workspace::ToggleBottomDock", 8 | "ctrl-w h": ["workspace::ActivatePaneInDirection", "Left"], 9 | "ctrl-w j": ["workspace::ActivatePaneInDirection", "Down"], 10 | "ctrl-w k": ["workspace::ActivatePaneInDirection", "Up"], 11 | "ctrl-w l": ["workspace::ActivatePaneInDirection", "Right"] 12 | } 13 | }, 14 | { 15 | "context": "Editor && mode == full", 16 | "use_key_equivalents": true, 17 | "bindings": { 18 | "cmd-k": "assistant::InlineAssist" 19 | } 20 | }, 21 | { 22 | "context": "ProjectPanel && not_editing", 23 | "use_key_equivalents": true, 24 | "bindings": { 25 | "a": "project_panel::NewFile", 26 | "l": "project_panel::OpenPermanent", 27 | "r": "project_panel::Rename", 28 | "space e": "workspace::ToggleRightDock" 29 | } 30 | }, 31 | { 32 | "context": "vim_mode == normal", 33 | "bindings": { 34 | "[ b": "pane::ActivatePrevItem", 35 | "] b": "pane::ActivateNextItem", 36 | "space g r": "editor::FindAllReferences", 37 | "space r n": "editor::Rename", 38 | "space b d": "pane::CloseActiveItem", 39 | "space b u": "pane::ReopenClosedItem", 40 | "space e": "workspace::ToggleRightDock" 41 | } 42 | } 43 | ] 44 | -------------------------------------------------------------------------------- /src/.config/zed/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "features": { 3 | "inline_completion_provider": "zed" 4 | }, 5 | "assistant": { 6 | "default_model": { "provider": "openai", "model": "o1-mini" }, 7 | "dock": "left", 8 | "version": "2" 9 | }, 10 | "buffer_font_size": 15.0, 11 | "chat_panel": { "button": "when_in_call" }, 12 | "collaboration_panel": { "button": false }, 13 | "cursor_blink": false, 14 | "notification_panel": { "button": false }, 15 | "outline_panel": { "button": false }, 16 | "project_panel": { "dock": "right", "auto_fold_dirs": false }, 17 | "relative_line_numbers": true, 18 | "scrollbar": { "git_diff": false }, 19 | "tab_bar": { "show_nav_history_buttons": false }, 20 | "terminal": { "button": false }, 21 | "theme": { "mode": "system", "light": "One Light", "dark": "Vercel Dark" }, 22 | "toolbar": { "breadcrumbs": true, "quick_actions": false }, 23 | "ui_font_size": 15, 24 | "unstable.ui_density": "compact", 25 | "vim_mode": true, 26 | "wrap_guides": [80] 27 | } 28 | -------------------------------------------------------------------------------- /src/.config/zsh/.zshrc: -------------------------------------------------------------------------------- 1 | ZSH_CONFIG_DIR=$HOME/.config/zsh 2 | 3 | source $ZSH_CONFIG_DIR/config/alias.sh 4 | source $ZSH_CONFIG_DIR/config/exports.sh 5 | source $ZSH_CONFIG_DIR/config/scripts.sh 6 | 7 | ## Plugins 8 | source $ZSH_CONFIG_DIR/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 9 | source $ZSH_CONFIG_DIR/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh 10 | 11 | ### Load Prompt 12 | eval "$(starship init zsh)" 13 | 14 | ### Completion 15 | # Enable case-insensitive path completion 16 | zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' 17 | # Make completion menu selection visible 18 | zstyle ':completion:*' menu select 19 | # Initialize completion system 20 | autoload -Uz compinit && compinit 21 | 22 | # bun completions 23 | [ -s "/Users/martin-aleph/.bun/_bun" ] && source "/Users/martin-aleph/.bun/_bun" 24 | 25 | # bun 26 | export BUN_INSTALL="$HOME/.bun" 27 | export PATH="$BUN_INSTALL/bin:$PATH" 28 | 29 | # Added by Windsurf 30 | export PATH="/Users/martin-aleph/.codeium/windsurf/bin:$PATH" 31 | -------------------------------------------------------------------------------- /src/.config/zsh/config/alias.sh: -------------------------------------------------------------------------------- 1 | [ -x "$(command -v nvim)" ] && alias vim="nvim" 2 | alias v="nvim" 3 | alias c="open $1 -a \"Cursor\"" 4 | 5 | alias ..="cd .." 6 | alias ls="eza --group-directories-first" 7 | alias ll="eza -la --group-directories-first" 8 | 9 | # Files 10 | alias cp="cp -iv" 11 | alias md="mkdir -pv" 12 | alias mv="mv -iv" 13 | alias rm="rm -iv" 14 | 15 | function kill_port() { kill -9 $(lsof -t -i:"$1"); } 16 | alias kp=kill_port 17 | 18 | # Git 19 | alias g="git" 20 | alias ga="git add" 21 | alias gb="git branch" 22 | alias gco="git checkout" 23 | alias gc!="git commit -v --amend" 24 | alias gcm="git commit -m" 25 | alias gcam="git commit -am" 26 | alias gd="git diff" 27 | alias gcl="git clone" 28 | alias glg="git lg" 29 | alias gp='git push' 30 | alias gP='git pull' 31 | alias gr='git remote' 32 | alias gm='git merge' 33 | alias gs="git st" 34 | 35 | ## Tmux 36 | alias t="tmux -u" 37 | alias ta="tmux -u a" 38 | alias tls="tmux ls" 39 | alias tks="tmux kill-session -t" 40 | alias taleph='tmux attach-session -t aleph || tmux new-session -s aleph -c ~/Developer/aleph' 41 | -------------------------------------------------------------------------------- /src/.config/zsh/config/exports.sh: -------------------------------------------------------------------------------- 1 | # node 2 | export PATH=/home/martin/.fnm:$PATH 3 | eval "`fnm env`" 4 | 5 | ## python 6 | [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" 7 | export PYENV_ROOT="$HOME/.pyenv" 8 | eval "$(pyenv init - zsh)" 9 | -------------------------------------------------------------------------------- /src/.config/zsh/config/scripts.sh: -------------------------------------------------------------------------------- 1 | function find_projects() { 2 | local selected_dir=$(find ~/Developer \ 3 | -type d \( -name node_modules -o -name build -o -name dist \) -prune \ 4 | -o \( -name .git -prune -print \) \ 5 | | sed 's/\/\.git$//' | fzf --layout=reverse --height 40%) 6 | 7 | if [[ -n "$selected_dir" ]]; then 8 | cd "$selected_dir" 9 | fi 10 | } 11 | 12 | bindkey -s '^F' 'find_projects\n' 13 | 14 | aleph() { 15 | if ! tmux has-session -t aleph 2>/dev/null; then 16 | tmux split-pane 17 | tmux split-pane 18 | tmux select-layout even-vertical 19 | 20 | tmux select-pane -t 0 21 | tmux send-keys 'cd ~/Developer/aleph/monorepo && yarn start:gs-addin:dev' C-m 22 | tmux select-pane -t 0 23 | tmux rename-window 'monorepo' 24 | 25 | tmux select-pane -t 1 26 | tmux send-keys 'cd ~/Developer/aleph/server && npm run start:dev' C-m 27 | tmux select-pane -t 1 28 | tmux rename-window 'server' 29 | 30 | tmux select-pane -t 2 31 | tmux send-keys 'cd ~/Developer/aleph/url-service && npm run start:dev' C-m 32 | tmux select-pane -t 2 33 | tmux rename-window 'url-service' 34 | fi 35 | # Attach to the session 36 | tmux attach-session -t aleph 37 | } 38 | 39 | # aleph() { 40 | # # Start a new tmux session named 'aleph' 41 | # tmux new-session -d -s aleph 42 | # 43 | # # Split the window into three panes 44 | # tmux split-window -h # Create a vertical split 45 | # tmux split-window -v # Split the first pane horizontally 46 | # tmux select-pane -t 0 47 | # tmux split-window -v # Split the second pane horizontally 48 | # 49 | # # Name each pane accordingly 50 | # tmux select-pane -t 0 51 | # tmux send-keys 'cd ~/Developer/aleph/monorepo && yarn start:gs-addin:dev' C-m 52 | # tmux select-pane -t 0 53 | # tmux rename-window 'monorepo' 54 | # 55 | # tmux select-pane -t 1 56 | # tmux send-keys 'cd ~/Developer/aleph/server && npm run start:dev' C-m 57 | # tmux select-pane -t 1 58 | # tmux rename-window 'server' 59 | # 60 | # tmux select-pane -t 2 61 | # tmux send-keys 'cd ~/Developer/aleph/url-service && npm run start:dev' C-m 62 | # tmux select-pane -t 2 63 | # tmux rename-window 'url-service' 64 | # fi 65 | # # Attach to the session 66 | # tmux attach-session -t aleph 67 | # } 68 | -------------------------------------------------------------------------------- /src/.local/bin/dmenu/dm-bookmarks: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script name: dm-bookmarks 4 | # Description: Search your bookmarks. 5 | # Dependencies: dmenu, browser 6 | 7 | set -euo pipefail 8 | 9 | main() { 10 | local bookmark_file="$HOME/.config/bookmarks/urls.conf" 11 | local list=$(awk '!/^ *#/ && NF {print $1 " - " $NF}' "${bookmark_file}") 12 | local list_size=$(awk '!/^ *#/ && NF {print $1}' "${bookmark_file}" | wc -l) 13 | 14 | # Piping the lists into dmenu. 15 | # local choice=$( printf '%s\n' "${list}" | ${DMENU} -i -l 10 -p "${BROWSER} open:" "$@" ) 16 | local choice=$( printf '%s\n' "${list}" | ${DMENU} -i -p "${BROWSER} open: [${list_size}]" "$@" ) 17 | 18 | # Launch $BROWSER with URL argument. 19 | if [ -n "$choice" ]; then 20 | url=$(echo "${choice}" | awk '{print $NF}') || exit 1 21 | nohup "${BROWSER}" "${url}" >/dev/null 2>&1 & 22 | else 23 | # What to do if we just escape without choosing anything. 24 | echo "Program terminated." && exit 1 25 | fi 26 | } 27 | 28 | [[ "${BASH_SOURCE[0]}" == "${0}" ]] && main "$@" 29 | -------------------------------------------------------------------------------- /src/.local/bin/dmenu/dm-maim: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script name: dm-maim 4 | # Description: Choose type of screenshot to take with maim. 5 | # Dependencies: dmenu, maim, tee, xdotool, xclip, xrandr 6 | 7 | set -euo pipefail 8 | 9 | export DMENU="dmenu" 10 | 11 | get_timestamp() { 12 | date '+%Y-%m-%d_%H%M%S' 13 | } 14 | 15 | 16 | main() { 17 | local _maim_args="" 18 | local _file_type="" 19 | # Makes sure the directory exists. 20 | # shellcheck disable=SC2154 21 | mkdir -p "${XDG_PICTURES_HOME}" 22 | 23 | declare -a modes=( 24 | "Fullscreen" 25 | "Active window" 26 | "Selected region" 27 | ) 28 | # Get monitors and their settings for maim 29 | _displays=$(xrandr --listactivemonitors | grep '+' | awk '{print $4, $3}' | awk -F'[x/+* ]' '{print $1,$2"x"$4"+"$6"+"$7}') 30 | 31 | 32 | # Add monitor data 33 | IFS=$'\n' 34 | declare -A _display_mode 35 | for i in ${_displays}; do 36 | name=$(echo "${i}" | awk '{print $1}') 37 | rest="$(echo "${i}" | awk '{print $2}')" 38 | modes[${#modes[@]}]="${name}" 39 | _display_mode[${name}]="${rest}" 40 | done 41 | unset IFS 42 | 43 | target=$(printf '%s\n' "${modes[@]}" | ${DMENU} -i -l 20 -p 'Take screenshot of:' "$@") || exit 1 44 | case "$target" in 45 | 'Fullscreen') 46 | ;; 47 | 'Active window') 48 | active_window=$(xdotool getactivewindow) 49 | _maim_args="-i ${active_window}" 50 | ;; 51 | 'Selected region') 52 | _maim_args="-s" 53 | ;; 54 | *) 55 | _maim_args="-g ${_display_mode[${target}]}" 56 | _file_type="${target}" 57 | ;; 58 | esac 59 | 60 | maim ${_maim_args} | tee "${XDG_PICTURES_HOME}/$(get_timestamp).png" | xclip -selection clipboard -t image/png 61 | notify-send "Saved Screenshot" "${XDG_PICTURES_HOME} And Clipboard" 62 | } 63 | 64 | [[ "${BASH_SOURCE[0]}" == "${0}" ]] && main "$@" 65 | -------------------------------------------------------------------------------- /src/.local/bin/maimscript: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | main() { 6 | mkdir -p "${XDG_PICTURES_HOME}" 7 | SCREENSHOT_DIR="${XDG_PICTURES_HOME}/Screenshot-$(date '+%Y-%m-%d-%H%M%S').png" 8 | 9 | message="" 10 | 11 | case "$@" in 12 | "window") 13 | maim -i $(xdotool getactivewindow) SCREENSHOT_DIR 14 | message="Window" 15 | ;; 16 | "fullscreen") 17 | maim SCREENSHOT_DIR 18 | message="Fullscreen" 19 | ;; 20 | *) 21 | echo "Error: Unknown argument '$*'" && return 1 22 | ;; 23 | esac 24 | 25 | 26 | notify-send "Saved Screenshot ($message)" "${XDG_PICTURES_HOME} And Clipboard" 27 | } 28 | 29 | [[ "${BASH_SOURCE[0]}" == "${0}" ]] && main "$@" 30 | -------------------------------------------------------------------------------- /src/.local/bin/notion.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function main() { 4 | # | xargs removes trailing whitespace 5 | local input=$((printf '%s' | dmenu -i -p "add todo: ") | xargs) 6 | 7 | # If input="" then return 8 | if [[ -z "$input" ]]; then 9 | return 10 | fi 11 | 12 | source $HOME/.config/zsh/config/.env 13 | 14 | curl -X POST https://api.notion.com/v1/pages \ 15 | -H "Authorization: Bearer $NOTION_API_KEY" \ 16 | -H "Content-Type: application/json" \ 17 | -H "Notion-Version: 2021-08-16" \ 18 | --data "{ 19 | \"parent\": { \"database_id\": \"$NOTION_DATABASE_ID\" }, 20 | \"properties\": { 21 | \"Name\": { 22 | \"title\": [ 23 | { 24 | \"text\": { 25 | \"content\": \"$input\" 26 | } 27 | } 28 | ] 29 | } 30 | } 31 | }" 32 | } 33 | 34 | [[ "${BASH_SOURCE[0]}" == "${0}" ]] && main "$@" 35 | 36 | -------------------------------------------------------------------------------- /src/.local/bin/npm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@fsouza/prettierd": "^0.18.1", 4 | "ls_emmet": "^1.0.8", 5 | "nodemon": "^2.0.15", 6 | "yarn": "^1.22.18" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/.local/bin/scripts/remap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Increase key speed via a rate change 4 | xset r rate 300 50 5 | 6 | # Set the variant (EN Intl Altgr dead keys) 7 | # setxkbmap -variant altgr-intl 8 | 9 | # Set CapsLock to Control 10 | setxkbmap -option ctrl:nocaps 11 | 12 | # Set Control to Escape 13 | # xmodmap -e 'keycode 66 = Escape' 14 | -------------------------------------------------------------------------------- /src/.local/bin/statusbar/sb-battery: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Prints all batteries, their percentage remaining and an emoji corresponding 4 | # to charge status (🔌 for plugged up, 🔋 for discharging on battery, etc.). 5 | 6 | case $BLOCK_BUTTON in 7 | 3) notify-send "🔋 Battery module" "🔋: discharging 8 | 🛑: not charging 9 | ♻: stagnant charge 10 | 🔌: charging 11 | ⚡: charged 12 | ❗: battery very low! 13 | - Scroll to change adjust xbacklight." ;; 14 | 4) xbacklight -inc 10 ;; 15 | 5) xbacklight -dec 10 ;; 16 | 6) "$TERMINAL" -e "$EDITOR" "$0" ;; 17 | esac 18 | 19 | # acpi alternative 20 | # acpi | sed "s/Battery [0-9]: //;s/[Dd]ischarging, /🔋/;s/[Nn]ot charging, /🛑/;s/[Cc]harging, /🔌/;s/[Uu]nknown, /♻️/;s/[Ff]ull, /⚡/;s/ \(remaining\|until charged\)//"; exit 21 | 22 | # Loop through all attached batteries. 23 | for battery in /sys/class/power_supply/BAT? 24 | do 25 | # Get its remaining capacity and charge status. 26 | capacity=$(cat "$battery"/capacity 2>/dev/null) || break 27 | status=$(sed "s/[Dd]ischarging/🔋/;s/[Nn]ot charging/🛑/;s/[Cc]harging/🔌/;s/[Uu]nknown/♻️/;s/[Ff]ull/⚡/" "$battery"/status) 28 | 29 | # If it is discharging and 25% or less, we will add a ❗ as a warning. 30 | [ "$capacity" -le 25 ] && [ "$status" = "🔋" ] && warn="❗" 31 | 32 | printf "%s%s%s%% " "$status" "$warn" "$capacity" 33 | unset warn 34 | done | sed 's/ *$//' 35 | -------------------------------------------------------------------------------- /src/.local/bin/statusbar/sb-clock: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | clock=$(date '+%I') 4 | # 🗓️ 5 | case "$clock" in 6 | "00") icon="🕛" ;; 7 | "01") icon="🕐" ;; 8 | "02") icon="🕑" ;; 9 | "03") icon="🕒" ;; 10 | "04") icon="🕓" ;; 11 | "05") icon="🕔" ;; 12 | "06") icon="🕕" ;; 13 | "07") icon="🕖" ;; 14 | "08") icon="🕗" ;; 15 | "09") icon="🕘" ;; 16 | "10") icon="🕙" ;; 17 | "11") icon="🕚" ;; 18 | "12") icon="🕛" ;; 19 | esac 20 | 21 | calendar="🗓️ " 22 | # calendar=" " 23 | # icon = " " 24 | 25 | case $BLOCK_BUTTON in 26 | 1) notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; 27 | 2) setsid -f "$TERMINAL" -e calcurse ;; 28 | 3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` 29 | - Middle click opens calcurse if installed" ;; 30 | 6) "$TERMINAL" -e "$EDITOR" "$0" ;; 31 | esac 32 | 33 | date "+$calendar%b %d (%a) %H:%M" 34 | -------------------------------------------------------------------------------- /src/.local/bin/statusbar/sb-cpuavg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | read cpu a b c previdle rest < /proc/stat 3 | prevtotal=$((a+b+c+previdle)) 4 | sleep 0.5 5 | read cpu a b c idle rest < /proc/stat 6 | total=$((a+b+c+idle)) 7 | cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) )) 8 | icon="🖥" 9 | printf "%s%s\\n" "$icon ""$cpu%" 10 | -------------------------------------------------------------------------------- /src/.local/bin/statusbar/sb-disk: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Status bar module for disk space 4 | # $1 should be drive mountpoint, otherwise assumed /. 5 | 6 | location=${1:-/} 7 | 8 | [ -d "$location" ] || exit 9 | 10 | case $BLOCK_BUTTON in 11 | 1) notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;; 12 | 3) notify-send "💽 Disk module" "\- Shows used hard drive space. 13 | - Click to show all disk info." ;; 14 | 6) "$TERMINAL" -e "$EDITOR" "$0" ;; 15 | esac 16 | 17 | case "$location" in 18 | "/home"* ) icon="🏠" ;; 19 | "/mnt"* ) icon="💾" ;; 20 | *) icon=" 💽";; 21 | esac 22 | 23 | printf "%s%s\n" "$icon ""$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')" 24 | -------------------------------------------------------------------------------- /src/.local/bin/statusbar/sb-internet: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Show wifi 📶 and percent strength or 📡 if none. 4 | # Show 🌐 if connected to ethernet or ❎ if none. 5 | 6 | case $BLOCK_BUTTON in 7 | 1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;; 8 | 3) notify-send "🌐 Internet module" "\- Click to connect 9 | 📡: no wifi connection 10 | 📶: wifi connection with quality 11 | ❎: no ethernet 12 | 🌐: ethernet working 13 | " ;; 14 | 6) "$TERMINAL" -e "$EDITOR" "$0" ;; 15 | esac 16 | 17 | case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in 18 | down) wifiicon="📡 " ;; 19 | up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;; 20 | esac 21 | 22 | printf "%s%s\n" "$wifiicon" "$(sed "s/down/❎ |/;s/up/🌐 |/" /sys/class/net/e*/operstate 2>/dev/null)" 23 | -------------------------------------------------------------------------------- /src/.local/bin/statusbar/sb-memory: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | case $BLOCK_BUTTON in 4 | 1) notify-send "🧠 Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; 5 | 2) setsid -f "$TERMINAL" -e htop ;; 6 | 3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total. 7 | - Click to show memory hogs. 8 | - Middle click to open htop." ;; 9 | 6) "$TERMINAL" -e "$EDITOR" "$0" ;; 10 | esac 11 | 12 | free --mebi | sed -n '2{p;q}' | awk '{printf ("🧠 %2.2f/%2.2fG\n", ( $3 / 1024), ($2 / 1024))}' 13 | -------------------------------------------------------------------------------- /src/.local/bin/statusbar/sb-volume: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Prints the current volume or 🔇 if muted. 4 | 5 | case $BLOCK_BUTTON in 6 | 1) setsid -f "$TERMINAL" -e pulsemixer ;; 7 | 2) pamixer -t ;; 8 | 4) pamixer --allow-boost -i 1 ;; 9 | 5) pamixer --allow-boost -d 1 ;; 10 | 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. 11 | - Middle click to mute. 12 | - Scroll to change." ;; 13 | 6) "$TERMINAL" -e "$EDITOR" "$0" ;; 14 | esac 15 | 16 | [ $(pamixer --get-mute) = true ] && echo 🔇 && exit 17 | 18 | vol="$(pamixer --get-volume)" 19 | 20 | if [ "$vol" -gt "70" ]; then 21 | icon="🔊" 22 | elif [ "$vol" -lt "30" ]; then 23 | icon="🔈" 24 | else 25 | icon="🔉" 26 | fi 27 | 28 | echo "$icon $vol%" 29 | -------------------------------------------------------------------------------- /src/.local/bin/statusbar/sb-weather: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Displays todays precipication chance (☔) and daily low (🥶) and high (🌞). 4 | # Usually intended for the statusbar. 5 | 6 | # If we have internet, get a weather report from wttr.in and store it locally. 7 | # You could set up a shell alias to view the full file in a pager in the 8 | # terminal if desired. This function will only be run once a day when needed. 9 | weatherreport="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" 10 | getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;} 11 | 12 | # Some very particular and terse stream manipulation. We get the maximum 13 | # precipitation chance and the daily high and low from the downloaded file and 14 | # display them with coresponding emojis. 15 | showweather() { printf "%s" "$(sed '16q;d' "$weatherreport" | 16 | grep -wo "[0-9]*%" | sort -rn | sed "s/^/| ☔/g;1q" | tr -d '\n')" 17 | sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶" $1 "°","🌞" $2 "°"}' ;} 18 | 19 | case $BLOCK_BUTTON in 20 | 1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;; 21 | 2) getforecast && showweather ;; 22 | 3) notify-send "🌈 Weather module" "\- Left click for full forecast. 23 | - Middle click to update forecast. 24 | ☔: Chance of rain/snow 25 | 🥶: Daily low 26 | 🌞: Daily high" ;; 27 | 6) "$TERMINAL" -e "$EDITOR" "$0" ;; 28 | esac 29 | 30 | # The test if our forcecast is updated to the day. If it isn't download a new 31 | # weather report from wttr.in with the above function. 32 | [ "$(stat -c %y "$weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || 33 | getforecast 34 | 35 | showweather 36 | -------------------------------------------------------------------------------- /src/.local/src/dwm/Makefile: -------------------------------------------------------------------------------- 1 | # dwm - dynamic window manager 2 | # See LICENSE file for copyright and license details. 3 | 4 | include config.mk 5 | 6 | SRC = drw.c dwm.c util.c 7 | OBJ = ${SRC:.c=.o} 8 | 9 | all: options dwm 10 | 11 | options: 12 | @echo dwm build options: 13 | @echo "CFLAGS = ${CFLAGS}" 14 | @echo "LDFLAGS = ${LDFLAGS}" 15 | @echo "CC = ${CC}" 16 | 17 | .c.o: 18 | ${CC} -c ${CFLAGS} $< 19 | 20 | ${OBJ}: config.h config.mk 21 | 22 | config.h: 23 | cp config.def.h $@ 24 | 25 | dwm: ${OBJ} 26 | ${CC} -o $@ ${OBJ} ${LDFLAGS} 27 | 28 | clean: 29 | rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz 30 | 31 | dist: clean 32 | mkdir -p dwm-${VERSION} 33 | cp -R LICENSE Makefile README config.def.h config.mk\ 34 | dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION} 35 | tar -cf dwm-${VERSION}.tar dwm-${VERSION} 36 | gzip dwm-${VERSION}.tar 37 | rm -rf dwm-${VERSION} 38 | 39 | install: all 40 | mkdir -p ${DESTDIR}${PREFIX}/bin 41 | cp -f dwm ${DESTDIR}${PREFIX}/bin 42 | chmod 755 ${DESTDIR}${PREFIX}/bin/dwm 43 | mkdir -p ${DESTDIR}${MANPREFIX}/man1 44 | sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 45 | chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 46 | 47 | uninstall: 48 | rm -f ${DESTDIR}${PREFIX}/bin/dwm\ 49 | ${DESTDIR}${MANPREFIX}/man1/dwm.1 50 | 51 | .PHONY: all options clean dist install uninstall 52 | -------------------------------------------------------------------------------- /src/.local/src/dwm/config.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | #define TERMINAL "$TERMINAL" 3 | 4 | /* Appearance */ 5 | static const unsigned int borderpx = 1; /* border pixel of windows */ 6 | static const unsigned int snap = 32; /* snap pixel */ 7 | static const unsigned int gappih = 5; /* horiz inner gap between windows */ 8 | static const unsigned int gappiv = 5; /* vert inner gap between windows */ 9 | static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */ 10 | static const unsigned int gappov = 10; /* vert outer gap between windows and screen edge */ 11 | static int smartgaps = 0; /* 1 means no outer gap when there is only one window */ 12 | static const int showbar = 1; /* 0 means no bar */ 13 | static const int topbar = 1; /* 0 means bottom bar */ 14 | 15 | // Fonts 16 | /* static const char *fonts[] = { "monospace:size=10", "JoyPixels:size=8:antialias=true:autohint=true" }; */ 17 | /* static const char dmenufont[] = "monospace:size=10"; */ 18 | static const char *fonts[] = {"UbuntuMono:size=12:antialias=true:autohint:true", "JoyPixels:size=8:antialias=true:autohint=true"}; 19 | static const char dmenufont[] = "UbuntuMono:size=12:antialias=true:autohint:true"; 20 | 21 | // Opacity 22 | static const unsigned int baralpha = 0xd0; 23 | static const unsigned int borderalpha = OPAQUE; 24 | 25 | // Colorscheme 26 | static const char col_gray1[] = "#222222"; // Title bar color 27 | static const char col_gray2[] = "#444444"; // Border of non-focus windows 28 | static const char col_gray3[] = "#eaeaeb"; // Tags and xsetroot text 29 | static const char col_gray4[] = "#eaeaeb"; // Window title and selected tag 30 | static const char col_cyan[] = "#444444"; // Window border and center-bar color 31 | static const char *colors[][3] = { 32 | /* fg bg border */ 33 | [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, 34 | [SchemeSel] = { col_gray4, col_cyan, col_cyan }, 35 | }; 36 | static const unsigned int alphas[][3] = { 37 | /* fg bg border */ 38 | [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, 39 | [SchemeSel] = { OPAQUE, baralpha, borderalpha }, 40 | }; 41 | 42 | 43 | /* tagging */ 44 | /* static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; */ 45 | static const char *tags[] = { " ", " ", " ", " ", " ", " ", " ", " ", " " }; 46 | 47 | static const Rule rules[] = { 48 | /* xprop(1): 49 | * WM_CLASS(STRING) = instance, class 50 | * WM_NAME(STRING) = title 51 | */ 52 | /* class instance title tags mask isfloating monitor */ 53 | { "VSCodium", NULL, NULL, 1 << 0, 0, -1 }, 54 | { "Brave-browser", NULL, NULL, 1 << 1, 0, -1 }, 55 | { "zoom", NULL, NULL, 1 << 2, 0, -1 }, 56 | { "mpv", NULL, NULL, 1 << 2, 0, -1 }, 57 | { "Zathura", NULL, NULL, 1 << 2, 0, -1 }, 58 | { "Spotify", NULL, NULL, 1 << 3, 0, -1 }, 59 | { "Gimp", NULL, NULL, 1 << 3, 0, -1 }, 60 | { "Steam", NULL, NULL, 1 << 4, 0, -1 }, 61 | { "Virt-manager", NULL, NULL, 1 << 6, 0, -1 }, 62 | { "discord", NULL, NULL, 1 << 7, 0, -1 }, 63 | { "Pcmanfm", NULL, NULL, 1 << 8, 0, -1 }, 64 | }; 65 | 66 | /* layout(s) */ 67 | static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */ 68 | static const int nmaster = 1; /* number of clients in master area */ 69 | static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ 70 | 71 | #define FORCE_VSPLIT 1 /* nrowgrid layout: force two clients to always split vertically */ 72 | #include "vanitygaps.c" 73 | 74 | static const Layout layouts[] = { 75 | /* symbol arrange function */ 76 | { "[]=", tile }, /* first entry is default */ 77 | { "[M]", monocle }, 78 | { "[@]", spiral }, 79 | { "[\\]", dwindle }, 80 | { "H[]", deck }, 81 | { "TTT", bstack }, 82 | { "===", bstackhoriz }, 83 | { "HHH", grid }, 84 | { "###", nrowgrid }, 85 | { "---", horizgrid }, 86 | { ":::", gaplessgrid }, 87 | { "|M|", centeredmaster }, 88 | { ">M>", centeredfloatingmaster }, 89 | { "><>", NULL }, /* no layout function means floating behavior */ 90 | { NULL, NULL }, 91 | 92 | // Esthetic layouts 93 | /* { "| tile |", tile }, /1* first entry is default *1/ */ 94 | /* { "| monocle |", monocle }, */ 95 | /* { "| spiral |", spiral }, */ 96 | /* { "| dwindle |", dwindle }, */ 97 | /* { "| deck |", deck }, */ 98 | /* { "| bstack |", bstack }, */ 99 | /* { "| bstackh |", bstackhoriz }, */ 100 | /* { "| grid |", grid }, */ 101 | /* { "| rgrid |", nrowgrid }, */ 102 | /* { "| hgrid |", horizgrid }, */ 103 | /* { "| ggrid |", gaplessgrid }, */ 104 | /* { "| cmaster |", centeredmaster }, */ 105 | /* { "| cfmaster |", centeredfloatingmaster }, */ 106 | /* { "| floating |", NULL }, /1* no layout function means floating behavior *1/ */ 107 | /* { NULL, NULL }, */ 108 | }; 109 | 110 | /* key definitions */ 111 | #define MODKEY Mod1Mask 112 | #define TAGKEYS(KEY,TAG) \ 113 | { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 114 | { MODKEY|Mod4Mask, KEY, toggleview, {.ui = 1 << TAG} }, \ 115 | { MODKEY|ControlMask, KEY, tag, {.ui = 1 << TAG} }, \ 116 | { MODKEY|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 117 | 118 | /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 119 | #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 120 | 121 | 122 | /* Include Audio controls */ 123 | #include 124 | 125 | /* commands */ 126 | static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 127 | static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; 128 | 129 | static Key keys[] = { 130 | /* modifier key function argument */ 131 | 132 | //-------------------------- Defaults ------------------------------ 133 | 134 | // Move around windows 135 | { MODKEY, XK_j, focusstack, {.i = +1 } }, 136 | { MODKEY, XK_k, focusstack, {.i = -1 } }, 137 | 138 | // Change how windows are displayed 139 | { MODKEY|ShiftMask, XK_i, incnmaster, {.i = +1 } }, 140 | { MODKEY|ShiftMask, XK_o, incnmaster, {.i = -1 } }, 141 | 142 | // Change windows X size 143 | { MODKEY|ControlMask, XK_h, setmfact, {.f = -0.05} }, 144 | { MODKEY|ControlMask, XK_l, setmfact, {.f = +0.05} }, 145 | 146 | // Change windows Y size 147 | { MODKEY|ControlMask, XK_j, setcfact, {.f = +0.25} }, 148 | { MODKEY|ControlMask, XK_k, setcfact, {.f = -0.25} }, 149 | { MODKEY|ControlMask, XK_o, setcfact, {.f = 0.00} }, 150 | 151 | // Toggle status bar 152 | { MODKEY, XK_b, togglebar, {0} }, 153 | 154 | // Toggle client to master place 155 | { MODKEY, XK_space, zoom, {0} }, 156 | 157 | // Go to last used workspace 158 | { MODKEY, XK_Tab, view, {0} }, 159 | 160 | // Kill a client 161 | { MODKEY, XK_q, killclient, {0} }, 162 | 163 | // Exit dwm 164 | { MODKEY|ControlMask, XK_q, quit, {0} }, 165 | 166 | 167 | //-------------------------- Layouts ------------------------------- 168 | /* { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, */ 169 | /* { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, */ 170 | /* { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, */ 171 | 172 | // Toggle layout / toggle floating 173 | { MODKEY|ShiftMask, XK_space, setlayout, {0} }, 174 | { MODKEY|ControlMask, XK_space, togglefloating, {0} }, 175 | 176 | // Toggle fullscreen 177 | { MODKEY, XK_f, togglefullscr, {0} }, 178 | 179 | // View tags 180 | /* { MODKEY, XK_0, view, {.ui = ~0 } }, */ 181 | /* { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, */ 182 | 183 | // Multiple monitors 184 | { MODKEY, XK_comma, focusmon, {.i = -1 } }, 185 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 186 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 187 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 188 | 189 | 190 | //-------------------------- Tags ---------------------------------- 191 | TAGKEYS( XK_1, 0) 192 | TAGKEYS( XK_2, 1) 193 | TAGKEYS( XK_3, 2) 194 | TAGKEYS( XK_4, 3) 195 | TAGKEYS( XK_5, 4) 196 | TAGKEYS( XK_6, 5) 197 | TAGKEYS( XK_7, 6) 198 | TAGKEYS( XK_8, 7) 199 | TAGKEYS( XK_9, 8) 200 | 201 | 202 | //-------------------------- Gaps ---------------------------------- 203 | 204 | { Mod4Mask, XK_0, togglegaps, {0} }, 205 | { Mod4Mask, XK_u, incrgaps, {.i = +1 } }, 206 | { Mod4Mask|ShiftMask, XK_u, incrgaps, {.i = -1 } }, 207 | { Mod4Mask, XK_i, incrigaps, {.i = +1 } }, 208 | { Mod4Mask|ShiftMask, XK_i, incrigaps, {.i = -1 } }, 209 | { Mod4Mask, XK_o, incrogaps, {.i = +1 } }, 210 | { Mod4Mask|ShiftMask, XK_o, incrogaps, {.i = -1 } }, 211 | { Mod4Mask, XK_6, incrihgaps, {.i = +1 } }, 212 | { Mod4Mask|ShiftMask, XK_6, incrihgaps, {.i = -1 } }, 213 | { Mod4Mask, XK_7, incrivgaps, {.i = +1 } }, 214 | { Mod4Mask|ShiftMask, XK_7, incrivgaps, {.i = -1 } }, 215 | { Mod4Mask, XK_8, incrohgaps, {.i = +1 } }, 216 | { Mod4Mask|ShiftMask, XK_8, incrohgaps, {.i = -1 } }, 217 | { Mod4Mask, XK_9, incrovgaps, {.i = +1 } }, 218 | { Mod4Mask|ShiftMask, XK_9, incrovgaps, {.i = -1 } }, 219 | { Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} }, 220 | 221 | 222 | //-------------------------- Apps ---------------------------------- 223 | 224 | // Alt + Key 225 | { MODKEY, XK_Return, spawn, SHCMD("$TERMINAL") }, 226 | { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 227 | { MODKEY, XK_d, spawn, SHCMD("discord") }, 228 | { MODKEY, XK_s, spawn, SHCMD("com.spotify.Client") }, 229 | { MODKEY, XK_w, spawn, SHCMD("$BROWSER") }, 230 | { MODKEY, XK_v, spawn, SHCMD("$GEDITOR") }, 231 | { MODKEY, XK_e, spawn, SHCMD("$GFILE") }, 232 | { MODKEY, XK_m, spawn, SHCMD("$MAIL") }, 233 | { ControlMask|ShiftMask, XK_b, spawn, SHCMD("dm-bookmarks") }, 234 | { MODKEY, XK_r, spawn, SHCMD(TERMINAL " -e $FILE") }, 235 | 236 | // Alt + Ctrl + Key 237 | { MODKEY|ControlMask, XK_r , spawn, SHCMD(TERMINAL " -e htop") }, 238 | { MODKEY|ControlMask, XK_e, spawn, SHCMD(TERMINAL " -e alsamixer") }, 239 | { MODKEY|ControlMask, XK_p , spawn, SHCMD(TERMINAL " -e pulsemixer") }, 240 | 241 | // Screenshot 242 | { 0, XK_Print, spawn, SHCMD("dm-maim") }, 243 | { ShiftMask, XK_Print, spawn, SHCMD("maim -i $(xdotool getactivewindow) ~/Pictures/$(date '+%Y-%m-%d_%H%M%S').png") }, 244 | 245 | //-------------------------- Hardware ------------------------------ 246 | { 0, XF86XK_AudioMute, spawn, SHCMD("pamixer -t; kill -44 $(pidof dwmblocks)") }, 247 | { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer --allow-boost -i 5; kill -44 $(pidof dwmblocks)") }, 248 | { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pamixer --allow-boost -d 5; kill -44 $(pidof dwmblocks)") }, 249 | 250 | 251 | }; 252 | 253 | /* button definitions */ 254 | /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 255 | static Button buttons[] = { 256 | /* click event mask button function argument */ 257 | { ClkLtSymbol, 0, Button1, setlayout, {0} }, 258 | { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[0]} }, 259 | { ClkWinTitle, 0, Button2, zoom, {0} }, 260 | { ClkStatusText, 0, Button2, spawn, SHCMD("$TERMINAL") }, 261 | { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 262 | { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 263 | { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 264 | { ClkTagBar, 0, Button1, view, {0} }, 265 | { ClkTagBar, 0, Button3, toggleview, {0} }, 266 | { ClkTagBar, MODKEY, Button1, tag, {0} }, 267 | { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 268 | }; 269 | -------------------------------------------------------------------------------- /src/.local/src/dwm/config.mk: -------------------------------------------------------------------------------- 1 | # dwm version 2 | VERSION = 6.2 3 | 4 | # Customize below to fit your system 5 | 6 | # paths 7 | PREFIX = /usr/local 8 | MANPREFIX = ${PREFIX}/share/man 9 | 10 | X11INC = /usr/X11R6/include 11 | X11LIB = /usr/X11R6/lib 12 | 13 | # Xinerama, comment if you don't want it 14 | XINERAMALIBS = -lXinerama 15 | XINERAMAFLAGS = -DXINERAMA 16 | 17 | # freetype 18 | FREETYPELIBS = -lfontconfig -lXft 19 | FREETYPEINC = /usr/include/freetype2 20 | # OpenBSD (uncomment) 21 | #FREETYPEINC = ${X11INC}/freetype2 22 | 23 | # includes and libs 24 | INCS = -I${X11INC} -I${FREETYPEINC} 25 | LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lXrender 26 | 27 | # flags 28 | CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} 29 | #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} 30 | CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} 31 | LDFLAGS = ${LIBS} 32 | 33 | # Solaris 34 | #CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" 35 | #LDFLAGS = ${LIBS} 36 | 37 | # compiler and linker 38 | CC = cc 39 | -------------------------------------------------------------------------------- /src/.local/src/dwm/drw.c: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "drw.h" 9 | #include "util.h" 10 | 11 | #define UTF_INVALID 0xFFFD 12 | #define UTF_SIZ 4 13 | 14 | static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; 15 | static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; 16 | static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; 17 | static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; 18 | 19 | static long 20 | utf8decodebyte(const char c, size_t *i) 21 | { 22 | for (*i = 0; *i < (UTF_SIZ + 1); ++(*i)) 23 | if (((unsigned char)c & utfmask[*i]) == utfbyte[*i]) 24 | return (unsigned char)c & ~utfmask[*i]; 25 | return 0; 26 | } 27 | 28 | static size_t 29 | utf8validate(long *u, size_t i) 30 | { 31 | if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) 32 | *u = UTF_INVALID; 33 | for (i = 1; *u > utfmax[i]; ++i) 34 | ; 35 | return i; 36 | } 37 | 38 | static size_t 39 | utf8decode(const char *c, long *u, size_t clen) 40 | { 41 | size_t i, j, len, type; 42 | long udecoded; 43 | 44 | *u = UTF_INVALID; 45 | if (!clen) 46 | return 0; 47 | udecoded = utf8decodebyte(c[0], &len); 48 | if (!BETWEEN(len, 1, UTF_SIZ)) 49 | return 1; 50 | for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { 51 | udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); 52 | if (type) 53 | return j; 54 | } 55 | if (j < len) 56 | return 0; 57 | *u = udecoded; 58 | utf8validate(u, len); 59 | 60 | return len; 61 | } 62 | 63 | Drw * 64 | drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap) 65 | { 66 | Drw *drw = ecalloc(1, sizeof(Drw)); 67 | 68 | drw->dpy = dpy; 69 | drw->screen = screen; 70 | drw->root = root; 71 | drw->w = w; 72 | drw->h = h; 73 | drw->visual = visual; 74 | drw->depth = depth; 75 | drw->cmap = cmap; 76 | drw->drawable = XCreatePixmap(dpy, root, w, h, depth); 77 | drw->gc = XCreateGC(dpy, drw->drawable, 0, NULL); 78 | XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); 79 | 80 | return drw; 81 | } 82 | 83 | void 84 | drw_resize(Drw *drw, unsigned int w, unsigned int h) 85 | { 86 | if (!drw) 87 | return; 88 | 89 | drw->w = w; 90 | drw->h = h; 91 | if (drw->drawable) 92 | XFreePixmap(drw->dpy, drw->drawable); 93 | drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth); 94 | } 95 | 96 | void 97 | drw_free(Drw *drw) 98 | { 99 | XFreePixmap(drw->dpy, drw->drawable); 100 | XFreeGC(drw->dpy, drw->gc); 101 | drw_fontset_free(drw->fonts); 102 | free(drw); 103 | } 104 | 105 | /* This function is an implementation detail. Library users should use 106 | * drw_fontset_create instead. 107 | */ 108 | static Fnt * 109 | xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) 110 | { 111 | Fnt *font; 112 | XftFont *xfont = NULL; 113 | FcPattern *pattern = NULL; 114 | 115 | if (fontname) { 116 | /* Using the pattern found at font->xfont->pattern does not yield the 117 | * same substitution results as using the pattern returned by 118 | * FcNameParse; using the latter results in the desired fallback 119 | * behaviour whereas the former just results in missing-character 120 | * rectangles being drawn, at least with some fonts. */ 121 | if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) { 122 | fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname); 123 | return NULL; 124 | } 125 | if (!(pattern = FcNameParse((FcChar8 *) fontname))) { 126 | fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname); 127 | XftFontClose(drw->dpy, xfont); 128 | return NULL; 129 | } 130 | } else if (fontpattern) { 131 | if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) { 132 | fprintf(stderr, "error, cannot load font from pattern.\n"); 133 | return NULL; 134 | } 135 | } else { 136 | die("no font specified."); 137 | } 138 | 139 | /* Do not allow using color fonts. This is a workaround for a BadLength 140 | * error from Xft with color glyphs. Modelled on the Xterm workaround. See 141 | * https://bugzilla.redhat.com/show_bug.cgi?id=1498269 142 | * https://lists.suckless.org/dev/1701/30932.html 143 | * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349 144 | * and lots more all over the internet. 145 | */ 146 | /* FcBool iscol; */ 147 | /* if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) { */ 148 | /* XftFontClose(drw->dpy, xfont); */ 149 | /* return NULL; */ 150 | /* } */ 151 | 152 | font = ecalloc(1, sizeof(Fnt)); 153 | font->xfont = xfont; 154 | font->pattern = pattern; 155 | font->h = xfont->ascent + xfont->descent; 156 | font->dpy = drw->dpy; 157 | 158 | return font; 159 | } 160 | 161 | static void 162 | xfont_free(Fnt *font) 163 | { 164 | if (!font) 165 | return; 166 | if (font->pattern) 167 | FcPatternDestroy(font->pattern); 168 | XftFontClose(font->dpy, font->xfont); 169 | free(font); 170 | } 171 | 172 | Fnt* 173 | drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount) 174 | { 175 | Fnt *cur, *ret = NULL; 176 | size_t i; 177 | 178 | if (!drw || !fonts) 179 | return NULL; 180 | 181 | for (i = 1; i <= fontcount; i++) { 182 | if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) { 183 | cur->next = ret; 184 | ret = cur; 185 | } 186 | } 187 | return (drw->fonts = ret); 188 | } 189 | 190 | void 191 | drw_fontset_free(Fnt *font) 192 | { 193 | if (font) { 194 | drw_fontset_free(font->next); 195 | xfont_free(font); 196 | } 197 | } 198 | 199 | void 200 | drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha) 201 | { 202 | if (!drw || !dest || !clrname) 203 | return; 204 | 205 | if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap, 206 | clrname, dest)) 207 | die("error, cannot allocate color '%s'", clrname); 208 | 209 | dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24); 210 | } 211 | 212 | /* Wrapper to create color schemes. The caller has to call free(3) on the 213 | * returned color scheme when done using it. */ 214 | Clr * 215 | drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount) 216 | { 217 | size_t i; 218 | Clr *ret; 219 | 220 | /* need at least two colors for a scheme */ 221 | if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor)))) 222 | return NULL; 223 | 224 | for (i = 0; i < clrcount; i++) 225 | drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]); 226 | return ret; 227 | } 228 | 229 | void 230 | drw_setfontset(Drw *drw, Fnt *set) 231 | { 232 | if (drw) 233 | drw->fonts = set; 234 | } 235 | 236 | void 237 | drw_setscheme(Drw *drw, Clr *scm) 238 | { 239 | if (drw) 240 | drw->scheme = scm; 241 | } 242 | 243 | void 244 | drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert) 245 | { 246 | if (!drw || !drw->scheme) 247 | return; 248 | XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel); 249 | if (filled) 250 | XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); 251 | else 252 | XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1); 253 | } 254 | 255 | int 256 | drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert) 257 | { 258 | char buf[1024]; 259 | int ty; 260 | unsigned int ew; 261 | XftDraw *d = NULL; 262 | Fnt *usedfont, *curfont, *nextfont; 263 | size_t i, len; 264 | int utf8strlen, utf8charlen, render = x || y || w || h; 265 | long utf8codepoint = 0; 266 | const char *utf8str; 267 | FcCharSet *fccharset; 268 | FcPattern *fcpattern; 269 | FcPattern *match; 270 | XftResult result; 271 | int charexists = 0; 272 | 273 | if (!drw || (render && !drw->scheme) || !text || !drw->fonts) 274 | return 0; 275 | 276 | if (!render) { 277 | w = ~w; 278 | } else { 279 | XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); 280 | XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); 281 | d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap); 282 | x += lpad; 283 | w -= lpad; 284 | } 285 | 286 | usedfont = drw->fonts; 287 | while (1) { 288 | utf8strlen = 0; 289 | utf8str = text; 290 | nextfont = NULL; 291 | while (*text) { 292 | utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ); 293 | for (curfont = drw->fonts; curfont; curfont = curfont->next) { 294 | charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint); 295 | if (charexists) { 296 | if (curfont == usedfont) { 297 | utf8strlen += utf8charlen; 298 | text += utf8charlen; 299 | } else { 300 | nextfont = curfont; 301 | } 302 | break; 303 | } 304 | } 305 | 306 | if (!charexists || nextfont) 307 | break; 308 | else 309 | charexists = 0; 310 | } 311 | 312 | if (utf8strlen) { 313 | drw_font_getexts(usedfont, utf8str, utf8strlen, &ew, NULL); 314 | /* shorten text if necessary */ 315 | for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; len--) 316 | drw_font_getexts(usedfont, utf8str, len, &ew, NULL); 317 | 318 | if (len) { 319 | memcpy(buf, utf8str, len); 320 | buf[len] = '\0'; 321 | if (len < utf8strlen) 322 | for (i = len; i && i > len - 3; buf[--i] = '.') 323 | ; /* NOP */ 324 | 325 | if (render) { 326 | ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent; 327 | XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg], 328 | usedfont->xfont, x, ty, (XftChar8 *)buf, len); 329 | } 330 | x += ew; 331 | w -= ew; 332 | } 333 | } 334 | 335 | if (!*text) { 336 | break; 337 | } else if (nextfont) { 338 | charexists = 0; 339 | usedfont = nextfont; 340 | } else { 341 | /* Regardless of whether or not a fallback font is found, the 342 | * character must be drawn. */ 343 | charexists = 1; 344 | 345 | fccharset = FcCharSetCreate(); 346 | FcCharSetAddChar(fccharset, utf8codepoint); 347 | 348 | if (!drw->fonts->pattern) { 349 | /* Refer to the comment in xfont_create for more information. */ 350 | die("the first font in the cache must be loaded from a font string."); 351 | } 352 | 353 | fcpattern = FcPatternDuplicate(drw->fonts->pattern); 354 | FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset); 355 | FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue); 356 | FcPatternAddBool(fcpattern, FC_COLOR, FcFalse); 357 | 358 | FcConfigSubstitute(NULL, fcpattern, FcMatchPattern); 359 | FcDefaultSubstitute(fcpattern); 360 | match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result); 361 | 362 | FcCharSetDestroy(fccharset); 363 | FcPatternDestroy(fcpattern); 364 | 365 | if (match) { 366 | usedfont = xfont_create(drw, NULL, match); 367 | if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) { 368 | for (curfont = drw->fonts; curfont->next; curfont = curfont->next) 369 | ; /* NOP */ 370 | curfont->next = usedfont; 371 | } else { 372 | xfont_free(usedfont); 373 | usedfont = drw->fonts; 374 | } 375 | } 376 | } 377 | } 378 | if (d) 379 | XftDrawDestroy(d); 380 | 381 | return x + (render ? w : 0); 382 | } 383 | 384 | void 385 | drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h) 386 | { 387 | if (!drw) 388 | return; 389 | 390 | XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y); 391 | XSync(drw->dpy, False); 392 | } 393 | 394 | unsigned int 395 | drw_fontset_getwidth(Drw *drw, const char *text) 396 | { 397 | if (!drw || !drw->fonts || !text) 398 | return 0; 399 | return drw_text(drw, 0, 0, 0, 0, 0, text, 0); 400 | } 401 | 402 | void 403 | drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h) 404 | { 405 | XGlyphInfo ext; 406 | 407 | if (!font || !text) 408 | return; 409 | 410 | XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext); 411 | if (w) 412 | *w = ext.xOff; 413 | if (h) 414 | *h = font->h; 415 | } 416 | 417 | Cur * 418 | drw_cur_create(Drw *drw, int shape) 419 | { 420 | Cur *cur; 421 | 422 | if (!drw || !(cur = ecalloc(1, sizeof(Cur)))) 423 | return NULL; 424 | 425 | cur->cursor = XCreateFontCursor(drw->dpy, shape); 426 | 427 | return cur; 428 | } 429 | 430 | void 431 | drw_cur_free(Drw *drw, Cur *cursor) 432 | { 433 | if (!cursor) 434 | return; 435 | 436 | XFreeCursor(drw->dpy, cursor->cursor); 437 | free(cursor); 438 | } 439 | -------------------------------------------------------------------------------- /src/.local/src/dwm/drw.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | 3 | typedef struct { 4 | Cursor cursor; 5 | } Cur; 6 | 7 | typedef struct Fnt { 8 | Display *dpy; 9 | unsigned int h; 10 | XftFont *xfont; 11 | FcPattern *pattern; 12 | struct Fnt *next; 13 | } Fnt; 14 | 15 | enum { ColFg, ColBg, ColBorder }; /* Clr scheme index */ 16 | typedef XftColor Clr; 17 | 18 | typedef struct { 19 | unsigned int w, h; 20 | Display *dpy; 21 | int screen; 22 | Window root; 23 | Visual *visual; 24 | unsigned int depth; 25 | Colormap cmap; 26 | Drawable drawable; 27 | GC gc; 28 | Clr *scheme; 29 | Fnt *fonts; 30 | } Drw; 31 | 32 | /* Drawable abstraction */ 33 | Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap); 34 | void drw_resize(Drw *drw, unsigned int w, unsigned int h); 35 | void drw_free(Drw *drw); 36 | 37 | /* Fnt abstraction */ 38 | Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount); 39 | void drw_fontset_free(Fnt* set); 40 | unsigned int drw_fontset_getwidth(Drw *drw, const char *text); 41 | void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h); 42 | 43 | /* Colorscheme abstraction */ 44 | void drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha); 45 | Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount); 46 | 47 | /* Cursor abstraction */ 48 | Cur *drw_cur_create(Drw *drw, int shape); 49 | void drw_cur_free(Drw *drw, Cur *cursor); 50 | 51 | /* Drawing context manipulation */ 52 | void drw_setfontset(Drw *drw, Fnt *set); 53 | void drw_setscheme(Drw *drw, Clr *scm); 54 | 55 | /* Drawing functions */ 56 | void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert); 57 | int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert); 58 | 59 | /* Map functions */ 60 | void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h); 61 | -------------------------------------------------------------------------------- /src/.local/src/dwm/dwm.1: -------------------------------------------------------------------------------- 1 | .TH DWM 1 dwm\-VERSION 2 | .SH NAME 3 | dwm \- dynamic window manager 4 | .SH SYNOPSIS 5 | .B dwm 6 | .RB [ \-v ] 7 | .SH DESCRIPTION 8 | dwm is a dynamic window manager for X. It manages windows in tiled, monocle 9 | and floating layouts. Either layout can be applied dynamically, optimising the 10 | environment for the application in use and the task performed. 11 | .P 12 | In tiled layouts windows are managed in a master and stacking area. The master 13 | area on the left contains one window by default, and the stacking area on the 14 | right contains all other windows. The number of master area windows can be 15 | adjusted from zero to an arbitrary number. In monocle layout all windows are 16 | maximised to the screen size. In floating layout windows can be resized and 17 | moved freely. Dialog windows are always managed floating, regardless of the 18 | layout applied. 19 | .P 20 | Windows are grouped by tags. Each window can be tagged with one or multiple 21 | tags. Selecting certain tags displays all windows with these tags. 22 | .P 23 | Each screen contains a small status bar which displays all available tags, the 24 | layout, the title of the focused window, and the text read from the root window 25 | name property, if the screen is focused. A floating window is indicated with an 26 | empty square and a maximised floating window is indicated with a filled square 27 | before the windows title. The selected tags are indicated with a different 28 | color. The tags of the focused window are indicated with a filled square in the 29 | top left corner. The tags which are applied to one or more windows are 30 | indicated with an empty square in the top left corner. 31 | .P 32 | dwm draws a small border around windows to indicate the focus state. 33 | .SH OPTIONS 34 | .TP 35 | .B \-v 36 | prints version information to stderr, then exits. 37 | .SH USAGE 38 | .SS Status bar 39 | .TP 40 | .B X root window name 41 | is read and displayed in the status text area. It can be set with the 42 | .BR xsetroot (1) 43 | command. 44 | .TP 45 | .B Button1 46 | click on a tag label to display all windows with that tag, click on the layout 47 | label toggles between tiled and floating layout. 48 | .TP 49 | .B Button3 50 | click on a tag label adds/removes all windows with that tag to/from the view. 51 | .TP 52 | .B Mod1\-Button1 53 | click on a tag label applies that tag to the focused window. 54 | .TP 55 | .B Mod1\-Button3 56 | click on a tag label adds/removes that tag to/from the focused window. 57 | .SS Keyboard commands 58 | .TP 59 | .B Mod1\-Shift\-Return 60 | Start 61 | .BR st(1). 62 | .TP 63 | .B Mod1\-p 64 | Spawn 65 | .BR dmenu(1) 66 | for launching other programs. 67 | .TP 68 | .B Mod1\-, 69 | Focus previous screen, if any. 70 | .TP 71 | .B Mod1\-. 72 | Focus next screen, if any. 73 | .TP 74 | .B Mod1\-Shift\-, 75 | Send focused window to previous screen, if any. 76 | .TP 77 | .B Mod1\-Shift\-. 78 | Send focused window to next screen, if any. 79 | .TP 80 | .B Mod1\-b 81 | Toggles bar on and off. 82 | .TP 83 | .B Mod1\-t 84 | Sets tiled layout. 85 | .TP 86 | .B Mod1\-f 87 | Sets floating layout. 88 | .TP 89 | .B Mod1\-m 90 | Sets monocle layout. 91 | .TP 92 | .B Mod1\-space 93 | Toggles between current and previous layout. 94 | .TP 95 | .B Mod1\-j 96 | Focus next window. 97 | .TP 98 | .B Mod1\-k 99 | Focus previous window. 100 | .TP 101 | .B Mod1\-i 102 | Increase number of windows in master area. 103 | .TP 104 | .B Mod1\-d 105 | Decrease number of windows in master area. 106 | .TP 107 | .B Mod1\-l 108 | Increase master area size. 109 | .TP 110 | .B Mod1\-h 111 | Decrease master area size. 112 | .TP 113 | .B Mod1\-Return 114 | Zooms/cycles focused window to/from master area (tiled layouts only). 115 | .TP 116 | .B Mod1\-Shift\-c 117 | Close focused window. 118 | .TP 119 | .B Mod1\-Shift\-space 120 | Toggle focused window between tiled and floating state. 121 | .TP 122 | .B Mod1\-Tab 123 | Toggles to the previously selected tags. 124 | .TP 125 | .B Mod1\-Shift\-[1..n] 126 | Apply nth tag to focused window. 127 | .TP 128 | .B Mod1\-Shift\-0 129 | Apply all tags to focused window. 130 | .TP 131 | .B Mod1\-Control\-Shift\-[1..n] 132 | Add/remove nth tag to/from focused window. 133 | .TP 134 | .B Mod1\-[1..n] 135 | View all windows with nth tag. 136 | .TP 137 | .B Mod1\-0 138 | View all windows with any tag. 139 | .TP 140 | .B Mod1\-Control\-[1..n] 141 | Add/remove all windows with nth tag to/from the view. 142 | .TP 143 | .B Mod1\-Shift\-q 144 | Quit dwm. 145 | .SS Mouse commands 146 | .TP 147 | .B Mod1\-Button1 148 | Move focused window while dragging. Tiled windows will be toggled to the floating state. 149 | .TP 150 | .B Mod1\-Button2 151 | Toggles focused window between floating and tiled state. 152 | .TP 153 | .B Mod1\-Button3 154 | Resize focused window while dragging. Tiled windows will be toggled to the floating state. 155 | .SH CUSTOMIZATION 156 | dwm is customized by creating a custom config.h and (re)compiling the source 157 | code. This keeps it fast, secure and simple. 158 | .SH SEE ALSO 159 | .BR dmenu (1), 160 | .BR st (1) 161 | .SH ISSUES 162 | Java applications which use the XToolkit/XAWT backend may draw grey windows 163 | only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early 164 | JDK 1.6 versions, because it assumes a reparenting window manager. Possible workarounds 165 | are using JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or setting the 166 | environment variable 167 | .BR AWT_TOOLKIT=MToolkit 168 | (to use the older Motif backend instead) or running 169 | .B xprop -root -f _NET_WM_NAME 32a -set _NET_WM_NAME LG3D 170 | or 171 | .B wmname LG3D 172 | (to pretend that a non-reparenting window manager is running that the 173 | XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable 174 | .BR _JAVA_AWT_WM_NONREPARENTING=1 . 175 | .SH BUGS 176 | Send all bug reports with a patch to hackers@suckless.org. 177 | -------------------------------------------------------------------------------- /src/.local/src/dwm/patches/dwm-actualfullscreen-20191112-cb3f58a.diff: -------------------------------------------------------------------------------- 1 | From 3a16816a6f5d38014c2a06ce395873c545c8789a Mon Sep 17 00:00:00 2001 2 | From: Soenke Lambert 3 | Date: Tue, 12 Nov 2019 10:44:02 +0100 4 | Subject: [PATCH] Fullscreen current window with [Alt]+[Shift]+[f] 5 | 6 | This actually fullscreens a window, instead of just hiding the statusbar 7 | and applying the monocle layout. 8 | --- 9 | config.def.h | 1 + 10 | dwm.c | 8 ++++++++ 11 | 2 files changed, 9 insertions(+) 12 | 13 | diff --git a/config.def.h b/config.def.h 14 | index 1c0b587..8cd3204 100644 15 | --- a/config.def.h 16 | +++ b/config.def.h 17 | @@ -78,6 +78,7 @@ static Key keys[] = { 18 | { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 19 | { MODKEY, XK_space, setlayout, {0} }, 20 | { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 21 | + { MODKEY|ShiftMask, XK_f, togglefullscr, {0} }, 22 | { MODKEY, XK_0, view, {.ui = ~0 } }, 23 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 24 | { MODKEY, XK_comma, focusmon, {.i = -1 } }, 25 | diff --git a/dwm.c b/dwm.c 26 | index 4465af1..c1b899a 100644 27 | --- a/dwm.c 28 | +++ b/dwm.c 29 | @@ -211,6 +211,7 @@ static void tagmon(const Arg *arg); 30 | static void tile(Monitor *); 31 | static void togglebar(const Arg *arg); 32 | static void togglefloating(const Arg *arg); 33 | +static void togglefullscr(const Arg *arg); 34 | static void toggletag(const Arg *arg); 35 | static void toggleview(const Arg *arg); 36 | static void unfocus(Client *c, int setfocus); 37 | @@ -1719,6 +1720,13 @@ togglefloating(const Arg *arg) 38 | arrange(selmon); 39 | } 40 | 41 | +void 42 | +togglefullscr(const Arg *arg) 43 | +{ 44 | + if(selmon->sel) 45 | + setfullscreen(selmon->sel, !selmon->sel->isfullscreen); 46 | +} 47 | + 48 | void 49 | toggletag(const Arg *arg) 50 | { 51 | -- 52 | 2.17.1 53 | 54 | -------------------------------------------------------------------------------- /src/.local/src/dwm/patches/dwm-alpha-20201019-61bb8b2.diff: -------------------------------------------------------------------------------- 1 | From 51f9c34480b984e261a738e5295f518b42c2f29c Mon Sep 17 00:00:00 2001 2 | From: Petrus Karell 3 | Date: Mon, 19 Oct 2020 19:15:24 +0300 4 | Subject: [PATCH] Allow dwm to have translucent bars, while keeping all 5 | the text on it opaque, just like the alpha-patch for st. Updated for 61bb8b2 6 | 7 | --- 8 | config.def.h | 7 ++++++ 9 | config.mk | 2 +- 10 | drw.c | 26 ++++++++++++----------- 11 | drw.h | 9 +++++--- 12 | dwm.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++------ 13 | 5 files changed, 82 insertions(+), 22 deletions(-) 14 | 15 | diff --git a/config.def.h b/config.def.h 16 | index 1c0b587..4f68fe8 100644 17 | --- a/config.def.h 18 | +++ b/config.def.h 19 | @@ -12,11 +12,18 @@ static const char col_gray2[] = "#444444"; 20 | static const char col_gray3[] = "#bbbbbb"; 21 | static const char col_gray4[] = "#eeeeee"; 22 | static const char col_cyan[] = "#005577"; 23 | +static const unsigned int baralpha = 0xd0; 24 | +static const unsigned int borderalpha = OPAQUE; 25 | static const char *colors[][3] = { 26 | /* fg bg border */ 27 | [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, 28 | [SchemeSel] = { col_gray4, col_cyan, col_cyan }, 29 | }; 30 | +static const unsigned int alphas[][3] = { 31 | + /* fg bg border */ 32 | + [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, 33 | + [SchemeSel] = { OPAQUE, baralpha, borderalpha }, 34 | +}; 35 | 36 | /* tagging */ 37 | static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; 38 | diff --git a/config.mk b/config.mk 39 | index 7084c33..21b5404 100644 40 | --- a/config.mk 41 | +++ b/config.mk 42 | @@ -22,7 +22,7 @@ FREETYPEINC = /usr/include/freetype2 43 | 44 | # includes and libs 45 | INCS = -I${X11INC} -I${FREETYPEINC} 46 | -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} 47 | +LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lXrender 48 | 49 | # flags 50 | CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} 51 | diff --git a/drw.c b/drw.c 52 | index 4cdbcbe..fe3aadd 100644 53 | --- a/drw.c 54 | +++ b/drw.c 55 | @@ -61,7 +61,7 @@ utf8decode(const char *c, long *u, size_t clen) 56 | } 57 | 58 | Drw * 59 | -drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h) 60 | +drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap) 61 | { 62 | Drw *drw = ecalloc(1, sizeof(Drw)); 63 | 64 | @@ -70,8 +70,11 @@ drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h 65 | drw->root = root; 66 | drw->w = w; 67 | drw->h = h; 68 | - drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen)); 69 | - drw->gc = XCreateGC(dpy, root, 0, NULL); 70 | + drw->visual = visual; 71 | + drw->depth = depth; 72 | + drw->cmap = cmap; 73 | + drw->drawable = XCreatePixmap(dpy, root, w, h, depth); 74 | + drw->gc = XCreateGC(dpy, drw->drawable, 0, NULL); 75 | XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); 76 | 77 | return drw; 78 | @@ -87,7 +90,7 @@ drw_resize(Drw *drw, unsigned int w, unsigned int h) 79 | drw->h = h; 80 | if (drw->drawable) 81 | XFreePixmap(drw->dpy, drw->drawable); 82 | - drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen)); 83 | + drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth); 84 | } 85 | 86 | void 87 | @@ -194,21 +197,22 @@ drw_fontset_free(Fnt *font) 88 | } 89 | 90 | void 91 | -drw_clr_create(Drw *drw, Clr *dest, const char *clrname) 92 | +drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha) 93 | { 94 | if (!drw || !dest || !clrname) 95 | return; 96 | 97 | - if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen), 98 | - DefaultColormap(drw->dpy, drw->screen), 99 | + if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap, 100 | clrname, dest)) 101 | die("error, cannot allocate color '%s'", clrname); 102 | + 103 | + dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24); 104 | } 105 | 106 | /* Wrapper to create color schemes. The caller has to call free(3) on the 107 | * returned color scheme when done using it. */ 108 | Clr * 109 | -drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount) 110 | +drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount) 111 | { 112 | size_t i; 113 | Clr *ret; 114 | @@ -218,7 +222,7 @@ drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount) 115 | return NULL; 116 | 117 | for (i = 0; i < clrcount; i++) 118 | - drw_clr_create(drw, &ret[i], clrnames[i]); 119 | + drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]); 120 | return ret; 121 | } 122 | 123 | @@ -274,9 +278,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp 124 | } else { 125 | XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); 126 | XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); 127 | - d = XftDrawCreate(drw->dpy, drw->drawable, 128 | - DefaultVisual(drw->dpy, drw->screen), 129 | - DefaultColormap(drw->dpy, drw->screen)); 130 | + d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap); 131 | x += lpad; 132 | w -= lpad; 133 | } 134 | diff --git a/drw.h b/drw.h 135 | index 4bcd5ad..a56f523 100644 136 | --- a/drw.h 137 | +++ b/drw.h 138 | @@ -20,6 +20,9 @@ typedef struct { 139 | Display *dpy; 140 | int screen; 141 | Window root; 142 | + Visual *visual; 143 | + unsigned int depth; 144 | + Colormap cmap; 145 | Drawable drawable; 146 | GC gc; 147 | Clr *scheme; 148 | @@ -27,7 +30,7 @@ typedef struct { 149 | } Drw; 150 | 151 | /* Drawable abstraction */ 152 | -Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h); 153 | +Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap); 154 | void drw_resize(Drw *drw, unsigned int w, unsigned int h); 155 | void drw_free(Drw *drw); 156 | 157 | @@ -38,8 +41,8 @@ unsigned int drw_fontset_getwidth(Drw *drw, const char *text); 158 | void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h); 159 | 160 | /* Colorscheme abstraction */ 161 | -void drw_clr_create(Drw *drw, Clr *dest, const char *clrname); 162 | -Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount); 163 | +void drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha); 164 | +Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount); 165 | 166 | /* Cursor abstraction */ 167 | Cur *drw_cur_create(Drw *drw, int shape); 168 | diff --git a/dwm.c b/dwm.c 169 | index 664c527..d8005c7 100644 170 | --- a/dwm.c 171 | +++ b/dwm.c 172 | @@ -57,6 +57,8 @@ 173 | #define TAGMASK ((1 << LENGTH(tags)) - 1) 174 | #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) 175 | 176 | +#define OPAQUE 0xffU 177 | + 178 | /* enums */ 179 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 180 | enum { SchemeNorm, SchemeSel }; /* color schemes */ 181 | @@ -233,6 +235,7 @@ static Monitor *wintomon(Window w); 182 | static int xerror(Display *dpy, XErrorEvent *ee); 183 | static int xerrordummy(Display *dpy, XErrorEvent *ee); 184 | static int xerrorstart(Display *dpy, XErrorEvent *ee); 185 | +static void xinitvisual(); 186 | static void zoom(const Arg *arg); 187 | 188 | /* variables */ 189 | @@ -269,6 +272,11 @@ static Drw *drw; 190 | static Monitor *mons, *selmon; 191 | static Window root, wmcheckwin; 192 | 193 | +static int useargb = 0; 194 | +static Visual *visual; 195 | +static int depth; 196 | +static Colormap cmap; 197 | + 198 | /* configuration, allows nested code to access above variables */ 199 | #include "config.h" 200 | 201 | @@ -1542,7 +1550,8 @@ setup(void) 202 | sw = DisplayWidth(dpy, screen); 203 | sh = DisplayHeight(dpy, screen); 204 | root = RootWindow(dpy, screen); 205 | - drw = drw_create(dpy, screen, root, sw, sh); 206 | + xinitvisual(); 207 | + drw = drw_create(dpy, screen, root, sw, sh, visual, depth, cmap); 208 | if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) 209 | die("no fonts could be loaded."); 210 | lrpad = drw->fonts->h; 211 | @@ -1570,7 +1579,7 @@ setup(void) 212 | /* init appearance */ 213 | scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); 214 | for (i = 0; i < LENGTH(colors); i++) 215 | - scheme[i] = drw_scm_create(drw, colors[i], 3); 216 | + scheme[i] = drw_scm_create(drw, colors[i], alphas[i], 3); 217 | /* init bars */ 218 | updatebars(); 219 | updatestatus(); 220 | @@ -1807,16 +1816,18 @@ updatebars(void) 221 | Monitor *m; 222 | XSetWindowAttributes wa = { 223 | .override_redirect = True, 224 | - .background_pixmap = ParentRelative, 225 | + .background_pixel = 0, 226 | + .border_pixel = 0, 227 | + .colormap = cmap, 228 | .event_mask = ButtonPressMask|ExposureMask 229 | }; 230 | XClassHint ch = {"dwm", "dwm"}; 231 | for (m = mons; m; m = m->next) { 232 | if (m->barwin) 233 | continue; 234 | - m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen), 235 | - CopyFromParent, DefaultVisual(dpy, screen), 236 | - CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); 237 | + m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, depth, 238 | + InputOutput, visual, 239 | + CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa); 240 | XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor); 241 | XMapRaised(dpy, m->barwin); 242 | XSetClassHint(dpy, m->barwin, &ch); 243 | @@ -2113,6 +2124,43 @@ xerrorstart(Display *dpy, XErrorEvent *ee) 244 | return -1; 245 | } 246 | 247 | +void 248 | +xinitvisual() 249 | +{ 250 | + XVisualInfo *infos; 251 | + XRenderPictFormat *fmt; 252 | + int nitems; 253 | + int i; 254 | + 255 | + XVisualInfo tpl = { 256 | + .screen = screen, 257 | + .depth = 32, 258 | + .class = TrueColor 259 | + }; 260 | + long masks = VisualScreenMask | VisualDepthMask | VisualClassMask; 261 | + 262 | + infos = XGetVisualInfo(dpy, masks, &tpl, &nitems); 263 | + visual = NULL; 264 | + for(i = 0; i < nitems; i ++) { 265 | + fmt = XRenderFindVisualFormat(dpy, infos[i].visual); 266 | + if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) { 267 | + visual = infos[i].visual; 268 | + depth = infos[i].depth; 269 | + cmap = XCreateColormap(dpy, root, visual, AllocNone); 270 | + useargb = 1; 271 | + break; 272 | + } 273 | + } 274 | + 275 | + XFree(infos); 276 | + 277 | + if (! visual) { 278 | + visual = DefaultVisual(dpy, screen); 279 | + depth = DefaultDepth(dpy, screen); 280 | + cmap = DefaultColormap(dpy, screen); 281 | + } 282 | +} 283 | + 284 | void 285 | zoom(const Arg *arg) 286 | { 287 | -- 288 | 2.28.0 289 | 290 | -------------------------------------------------------------------------------- /src/.local/src/dwm/patches/dwm-alwaysfullscreen-6.1.diff: -------------------------------------------------------------------------------- 1 | diff --git a/dwm.c b/dwm.c 2 | index 0362114..a5cab76 100644 3 | --- a/dwm.c 4 | +++ b/dwm.c 5 | @@ -847,7 +847,7 @@ focusstack(const Arg *arg) 6 | { 7 | Client *c = NULL, *i; 8 | 9 | - if (!selmon->sel) 10 | + if (!selmon->sel || selmon->sel->isfullscreen) 11 | return; 12 | if (arg->i > 0) { 13 | for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next); 14 | -------------------------------------------------------------------------------- /src/.local/src/dwm/patches/dwm-attachaside-20180126-db22360.diff: -------------------------------------------------------------------------------- 1 | diff --git a/dwm.c b/dwm.c 2 | index ec6a27c..7b6ce67 100644 3 | --- a/dwm.c 4 | +++ b/dwm.c 5 | @@ -49,7 +49,8 @@ 6 | #define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) 7 | #define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ 8 | * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) 9 | -#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) 10 | +#define ISVISIBLEONTAG(C, T) ((C->tags & T)) 11 | +#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags]) 12 | #define LENGTH(X) (sizeof X / sizeof X[0]) 13 | #define MOUSEMASK (BUTTONMASK|PointerMotionMask) 14 | #define WIDTH(X) ((X)->w + 2 * (X)->bw) 15 | @@ -148,6 +149,7 @@ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interac 16 | static void arrange(Monitor *m); 17 | static void arrangemon(Monitor *m); 18 | static void attach(Client *c); 19 | +static void attachaside(Client *c); 20 | static void attachstack(Client *c); 21 | static void buttonpress(XEvent *e); 22 | static void checkotherwm(void); 23 | @@ -184,6 +186,7 @@ static void maprequest(XEvent *e); 24 | static void monocle(Monitor *m); 25 | static void motionnotify(XEvent *e); 26 | static void movemouse(const Arg *arg); 27 | +static Client *nexttagged(Client *c); 28 | static Client *nexttiled(Client *c); 29 | static void pop(Client *); 30 | static void propertynotify(XEvent *e); 31 | @@ -407,6 +410,18 @@ attach(Client *c) 32 | c->mon->clients = c; 33 | } 34 | 35 | +void 36 | +attachaside(Client *c) { 37 | + Client *at = nexttagged(c); 38 | + if(!at) { 39 | + attach(c); 40 | + return; 41 | + } 42 | + c->next = at->next; 43 | + at->next = c; 44 | +} 45 | + 46 | + 47 | void 48 | attachstack(Client *c) 49 | { 50 | @@ -1063,7 +1078,7 @@ manage(Window w, XWindowAttributes *wa) 51 | c->isfloating = c->oldstate = trans != None || c->isfixed; 52 | if (c->isfloating) 53 | XRaiseWindow(dpy, c->win); 54 | - attach(c); 55 | + attachaside(c); 56 | attachstack(c); 57 | XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, 58 | (unsigned char *) &(c->win), 1); 59 | @@ -1193,6 +1208,16 @@ movemouse(const Arg *arg) 60 | } 61 | } 62 | 63 | + Client * 64 | +nexttagged(Client *c) { 65 | + Client *walked = c->mon->clients; 66 | + for(; 67 | + walked && (walked->isfloating || !ISVISIBLEONTAG(walked, c->tags)); 68 | + walked = walked->next 69 | + ); 70 | + return walked; 71 | +} 72 | + 73 | Client * 74 | nexttiled(Client *c) 75 | { 76 | @@ -1418,7 +1443,7 @@ sendmon(Client *c, Monitor *m) 77 | detachstack(c); 78 | c->mon = m; 79 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 80 | - attach(c); 81 | + attachaside(c); 82 | attachstack(c); 83 | focus(NULL); 84 | arrange(NULL); 85 | @@ -1899,6 +1924,7 @@ updategeom(void) 86 | detachstack(c); 87 | c->mon = mons; 88 | attach(c); 89 | + attachaside(c); 90 | attachstack(c); 91 | } 92 | if (m == selmon) 93 | -------------------------------------------------------------------------------- /src/.local/src/dwm/patches/dwm-hide_vacant_tags-6.2.diff: -------------------------------------------------------------------------------- 1 | diff --git a/dwm.c b/dwm.c 2 | index 4465af1..c4aa3de 100644 3 | --- a/dwm.c 4 | +++ b/dwm.c 5 | @@ -416,7 +416,7 @@ attachstack(Client *c) 6 | void 7 | buttonpress(XEvent *e) 8 | { 9 | - unsigned int i, x, click; 10 | + unsigned int i, x, click, occ = 0; 11 | Arg arg = {0}; 12 | Client *c; 13 | Monitor *m; 14 | @@ -431,9 +431,14 @@ buttonpress(XEvent *e) 15 | } 16 | if (ev->window == selmon->barwin) { 17 | i = x = 0; 18 | - do 19 | + for (c = m->clients; c; c = c->next) 20 | + occ |= c->tags == 255 ? 0 : c->tags; 21 | + do { 22 | + /* do not reserve space for vacant tags */ 23 | + if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) 24 | + continue; 25 | x += TEXTW(tags[i]); 26 | - while (ev->x >= x && ++i < LENGTH(tags)); 27 | + } while (ev->x >= x && ++i < LENGTH(tags)); 28 | if (i < LENGTH(tags)) { 29 | click = ClkTagBar; 30 | arg.ui = 1 << i; 31 | @@ -709,19 +714,19 @@ drawbar(Monitor *m) 32 | } 33 | 34 | for (c = m->clients; c; c = c->next) { 35 | - occ |= c->tags; 36 | + occ |= c->tags == 255 ? 0 : c->tags; 37 | if (c->isurgent) 38 | urg |= c->tags; 39 | } 40 | x = 0; 41 | for (i = 0; i < LENGTH(tags); i++) { 42 | + /* do not draw vacant tags */ 43 | + if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) 44 | + continue; 45 | + 46 | w = TEXTW(tags[i]); 47 | drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); 48 | drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); 49 | - if (occ & 1 << i) 50 | - drw_rect(drw, x + boxs, boxs, boxw, boxw, 51 | - m == selmon && selmon->sel && selmon->sel->tags & 1 << i, 52 | - urg & 1 << i); 53 | x += w; 54 | } 55 | w = blw = TEXTW(m->ltsymbol); 56 | -------------------------------------------------------------------------------- /src/.local/src/dwm/patches/dwm-pertag-20200914-61bb8b2.diff: -------------------------------------------------------------------------------- 1 | diff --git a/dwm.c b/dwm.c 2 | index 664c527..ac8e4ec 100644 3 | --- a/dwm.c 4 | +++ b/dwm.c 5 | @@ -111,6 +111,7 @@ typedef struct { 6 | void (*arrange)(Monitor *); 7 | } Layout; 8 | 9 | +typedef struct Pertag Pertag; 10 | struct Monitor { 11 | char ltsymbol[16]; 12 | float mfact; 13 | @@ -130,6 +131,7 @@ struct Monitor { 14 | Monitor *next; 15 | Window barwin; 16 | const Layout *lt[2]; 17 | + Pertag *pertag; 18 | }; 19 | 20 | typedef struct { 21 | @@ -272,6 +274,15 @@ static Window root, wmcheckwin; 22 | /* configuration, allows nested code to access above variables */ 23 | #include "config.h" 24 | 25 | +struct Pertag { 26 | + unsigned int curtag, prevtag; /* current and previous tag */ 27 | + int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */ 28 | + float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */ 29 | + unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */ 30 | + const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */ 31 | + int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */ 32 | +}; 33 | + 34 | /* compile-time check if all tags fit into an unsigned int bit array. */ 35 | struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; 36 | 37 | @@ -632,6 +643,7 @@ Monitor * 38 | createmon(void) 39 | { 40 | Monitor *m; 41 | + unsigned int i; 42 | 43 | m = ecalloc(1, sizeof(Monitor)); 44 | m->tagset[0] = m->tagset[1] = 1; 45 | @@ -642,6 +654,20 @@ createmon(void) 46 | m->lt[0] = &layouts[0]; 47 | m->lt[1] = &layouts[1 % LENGTH(layouts)]; 48 | strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); 49 | + m->pertag = ecalloc(1, sizeof(Pertag)); 50 | + m->pertag->curtag = m->pertag->prevtag = 1; 51 | + 52 | + for (i = 0; i <= LENGTH(tags); i++) { 53 | + m->pertag->nmasters[i] = m->nmaster; 54 | + m->pertag->mfacts[i] = m->mfact; 55 | + 56 | + m->pertag->ltidxs[i][0] = m->lt[0]; 57 | + m->pertag->ltidxs[i][1] = m->lt[1]; 58 | + m->pertag->sellts[i] = m->sellt; 59 | + 60 | + m->pertag->showbars[i] = m->showbar; 61 | + } 62 | + 63 | return m; 64 | } 65 | 66 | @@ -967,7 +993,7 @@ grabkeys(void) 67 | void 68 | incnmaster(const Arg *arg) 69 | { 70 | - selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); 71 | + selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0); 72 | arrange(selmon); 73 | } 74 | 75 | @@ -1502,9 +1528,9 @@ void 76 | setlayout(const Arg *arg) 77 | { 78 | if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) 79 | - selmon->sellt ^= 1; 80 | + selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; 81 | if (arg && arg->v) 82 | - selmon->lt[selmon->sellt] = (Layout *)arg->v; 83 | + selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v; 84 | strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); 85 | if (selmon->sel) 86 | arrange(selmon); 87 | @@ -1523,7 +1549,7 @@ setmfact(const Arg *arg) 88 | f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; 89 | if (f < 0.05 || f > 0.95) 90 | return; 91 | - selmon->mfact = f; 92 | + selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f; 93 | arrange(selmon); 94 | } 95 | 96 | @@ -1702,7 +1728,7 @@ tile(Monitor *m) 97 | void 98 | togglebar(const Arg *arg) 99 | { 100 | - selmon->showbar = !selmon->showbar; 101 | + selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar; 102 | updatebarpos(selmon); 103 | XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); 104 | arrange(selmon); 105 | @@ -1741,9 +1767,33 @@ void 106 | toggleview(const Arg *arg) 107 | { 108 | unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); 109 | + int i; 110 | 111 | if (newtagset) { 112 | selmon->tagset[selmon->seltags] = newtagset; 113 | + 114 | + if (newtagset == ~0) { 115 | + selmon->pertag->prevtag = selmon->pertag->curtag; 116 | + selmon->pertag->curtag = 0; 117 | + } 118 | + 119 | + /* test if the user did not select the same tag */ 120 | + if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) { 121 | + selmon->pertag->prevtag = selmon->pertag->curtag; 122 | + for (i = 0; !(newtagset & 1 << i); i++) ; 123 | + selmon->pertag->curtag = i + 1; 124 | + } 125 | + 126 | + /* apply settings for this view */ 127 | + selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; 128 | + selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; 129 | + selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; 130 | + selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; 131 | + selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; 132 | + 133 | + if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) 134 | + togglebar(NULL); 135 | + 136 | focus(NULL); 137 | arrange(selmon); 138 | } 139 | @@ -2038,11 +2088,37 @@ updatewmhints(Client *c) 140 | void 141 | view(const Arg *arg) 142 | { 143 | + int i; 144 | + unsigned int tmptag; 145 | + 146 | if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 147 | return; 148 | selmon->seltags ^= 1; /* toggle sel tagset */ 149 | - if (arg->ui & TAGMASK) 150 | + if (arg->ui & TAGMASK) { 151 | selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; 152 | + selmon->pertag->prevtag = selmon->pertag->curtag; 153 | + 154 | + if (arg->ui == ~0) 155 | + selmon->pertag->curtag = 0; 156 | + else { 157 | + for (i = 0; !(arg->ui & 1 << i); i++) ; 158 | + selmon->pertag->curtag = i + 1; 159 | + } 160 | + } else { 161 | + tmptag = selmon->pertag->prevtag; 162 | + selmon->pertag->prevtag = selmon->pertag->curtag; 163 | + selmon->pertag->curtag = tmptag; 164 | + } 165 | + 166 | + selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; 167 | + selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; 168 | + selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; 169 | + selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; 170 | + selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; 171 | + 172 | + if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) 173 | + togglebar(NULL); 174 | + 175 | focus(NULL); 176 | arrange(selmon); 177 | } 178 | -------------------------------------------------------------------------------- /src/.local/src/dwm/transient.c: -------------------------------------------------------------------------------- 1 | /* cc transient.c -o transient -lX11 */ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int main(void) { 9 | Display *d; 10 | Window r, f, t = None; 11 | XSizeHints h; 12 | XEvent e; 13 | 14 | d = XOpenDisplay(NULL); 15 | if (!d) 16 | exit(1); 17 | r = DefaultRootWindow(d); 18 | 19 | f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0); 20 | h.min_width = h.max_width = h.min_height = h.max_height = 400; 21 | h.flags = PMinSize | PMaxSize; 22 | XSetWMNormalHints(d, f, &h); 23 | XStoreName(d, f, "floating"); 24 | XMapWindow(d, f); 25 | 26 | XSelectInput(d, f, ExposureMask); 27 | while (1) { 28 | XNextEvent(d, &e); 29 | 30 | if (t == None) { 31 | sleep(5); 32 | t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0); 33 | XSetTransientForHint(d, t, f); 34 | XStoreName(d, t, "transient"); 35 | XMapWindow(d, t); 36 | XSelectInput(d, t, ExposureMask); 37 | } 38 | } 39 | 40 | XCloseDisplay(d); 41 | exit(0); 42 | } 43 | -------------------------------------------------------------------------------- /src/.local/src/dwm/util.c: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "util.h" 8 | 9 | void * 10 | ecalloc(size_t nmemb, size_t size) 11 | { 12 | void *p; 13 | 14 | if (!(p = calloc(nmemb, size))) 15 | die("calloc:"); 16 | return p; 17 | } 18 | 19 | void 20 | die(const char *fmt, ...) { 21 | va_list ap; 22 | 23 | va_start(ap, fmt); 24 | vfprintf(stderr, fmt, ap); 25 | va_end(ap); 26 | 27 | if (fmt[0] && fmt[strlen(fmt)-1] == ':') { 28 | fputc(' ', stderr); 29 | perror(NULL); 30 | } else { 31 | fputc('\n', stderr); 32 | } 33 | 34 | exit(1); 35 | } 36 | -------------------------------------------------------------------------------- /src/.local/src/dwm/util.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | 3 | #define MAX(A, B) ((A) > (B) ? (A) : (B)) 4 | #define MIN(A, B) ((A) < (B) ? (A) : (B)) 5 | #define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B)) 6 | 7 | void die(const char *fmt, ...); 8 | void *ecalloc(size_t nmemb, size_t size); 9 | -------------------------------------------------------------------------------- /src/.local/src/dwmblocks/Makefile: -------------------------------------------------------------------------------- 1 | PREFIX ?= /usr/local 2 | CC ?= cc 3 | 4 | output: dwmblocks.c blocks.h 5 | ${CC} `pkg-config --cflags x11 --libs x11` dwmblocks.c -o dwmblocks 6 | 7 | clean: 8 | rm -f *.o *.gch dwmblocks 9 | install: output 10 | mkdir -p $(DESTDIR)$(PREFIX)/bin 11 | install -m 0755 dwmblocks $(DESTDIR)$(PREFIX)/bin/dwmblocks 12 | uninstall: 13 | rm -f $(DESTDIR)$(PREFIX)/bin/dwmblocks 14 | -------------------------------------------------------------------------------- /src/.local/src/dwmblocks/blocks.h: -------------------------------------------------------------------------------- 1 | //Modify this file to change what commands output to your statusbar, and recompile using the make command. 2 | static const Block blocks[] = { 3 | /*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/ 4 | 5 | /* {"", "sb-weather", 3600, 0}, */ 6 | {"", "sb-disk", 3600, 0}, 7 | {"", "sb-cpuavg", 6, 0}, 8 | {"", "sb-memory", 6, 0}, 9 | {"", "sb-volume", 0, 10}, 10 | {"", "sb-clock", 15, 0}, 11 | {"", "sb-internet", 15, 0}, 12 | }; 13 | 14 | //sets delimeter between status commands. NULL character ('\0') means no delimeter. 15 | static char delim[] = " "; 16 | static unsigned int delimLen = 5; 17 | -------------------------------------------------------------------------------- /src/.local/src/dwmblocks/dwmblocks.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #ifndef NO_X 7 | #include 8 | #endif 9 | #ifdef __OpenBSD__ 10 | #define SIGPLUS SIGUSR1+1 11 | #define SIGMINUS SIGUSR1-1 12 | #else 13 | #define SIGPLUS SIGRTMIN 14 | #define SIGMINUS SIGRTMIN 15 | #endif 16 | #define LENGTH(X) (sizeof(X) / sizeof (X[0])) 17 | #define CMDLENGTH 50 18 | #define MIN( a, b ) ( ( a < b) ? a : b ) 19 | #define STATUSLENGTH (LENGTH(blocks) * CMDLENGTH + 1) 20 | 21 | typedef struct { 22 | char* icon; 23 | char* command; 24 | unsigned int interval; 25 | unsigned int signal; 26 | } Block; 27 | #ifndef __OpenBSD__ 28 | void dummysighandler(int num); 29 | #endif 30 | void sighandler(int num); 31 | void getcmds(int time); 32 | void getsigcmds(unsigned int signal); 33 | void setupsignals(); 34 | void sighandler(int signum); 35 | int getstatus(char *str, char *last); 36 | void statusloop(); 37 | void termhandler(); 38 | void pstdout(); 39 | #ifndef NO_X 40 | void setroot(); 41 | static void (*writestatus) () = setroot; 42 | static int setupX(); 43 | static Display *dpy; 44 | static int screen; 45 | static Window root; 46 | #else 47 | static void (*writestatus) () = pstdout; 48 | #endif 49 | 50 | 51 | #include "blocks.h" 52 | 53 | static char statusbar[LENGTH(blocks)][CMDLENGTH] = {0}; 54 | static char statusstr[2][STATUSLENGTH]; 55 | static int statusContinue = 1; 56 | static int returnStatus = 0; 57 | 58 | //opens process *cmd and stores output in *output 59 | void getcmd(const Block *block, char *output) 60 | { 61 | strcpy(output, block->icon); 62 | FILE *cmdf = popen(block->command, "r"); 63 | if (!cmdf) 64 | return; 65 | int i = strlen(block->icon); 66 | fgets(output+i, CMDLENGTH-i-delimLen, cmdf); 67 | i = strlen(output); 68 | if (i == 0)//return if block and command output are both empty 69 | return; 70 | if (delim[0] != '\0') { 71 | //only chop off newline if one is present at the end 72 | i = output[i-1] == '\n' ? i-1 : i; 73 | strncpy(output+i, delim, delimLen); 74 | } 75 | else 76 | output[i++] = '\0'; 77 | pclose(cmdf); 78 | } 79 | 80 | void getcmds(int time) 81 | { 82 | const Block* current; 83 | for (unsigned int i = 0; i < LENGTH(blocks); i++) { 84 | current = blocks + i; 85 | if ((current->interval != 0 && time % current->interval == 0) || time == -1) 86 | getcmd(current,statusbar[i]); 87 | } 88 | } 89 | 90 | void getsigcmds(unsigned int signal) 91 | { 92 | const Block *current; 93 | for (unsigned int i = 0; i < LENGTH(blocks); i++) { 94 | current = blocks + i; 95 | if (current->signal == signal) 96 | getcmd(current,statusbar[i]); 97 | } 98 | } 99 | 100 | void setupsignals() 101 | { 102 | #ifndef __OpenBSD__ 103 | /* initialize all real time signals with dummy handler */ 104 | for (int i = SIGRTMIN; i <= SIGRTMAX; i++) 105 | signal(i, dummysighandler); 106 | #endif 107 | 108 | for (unsigned int i = 0; i < LENGTH(blocks); i++) { 109 | if (blocks[i].signal > 0) 110 | signal(SIGMINUS+blocks[i].signal, sighandler); 111 | } 112 | 113 | } 114 | 115 | int getstatus(char *str, char *last) 116 | { 117 | strcpy(last, str); 118 | str[0] = '\0'; 119 | for (unsigned int i = 0; i < LENGTH(blocks); i++) 120 | strcat(str, statusbar[i]); 121 | str[strlen(str)-strlen(delim)] = '\0'; 122 | return strcmp(str, last);//0 if they are the same 123 | } 124 | 125 | #ifndef NO_X 126 | void setroot() 127 | { 128 | if (!getstatus(statusstr[0], statusstr[1]))//Only set root if text has changed. 129 | return; 130 | XStoreName(dpy, root, statusstr[0]); 131 | XFlush(dpy); 132 | } 133 | 134 | int setupX() 135 | { 136 | dpy = XOpenDisplay(NULL); 137 | if (!dpy) { 138 | fprintf(stderr, "dwmblocks: Failed to open display\n"); 139 | return 0; 140 | } 141 | screen = DefaultScreen(dpy); 142 | root = RootWindow(dpy, screen); 143 | return 1; 144 | } 145 | #endif 146 | 147 | void pstdout() 148 | { 149 | if (!getstatus(statusstr[0], statusstr[1]))//Only write out if text has changed. 150 | return; 151 | printf("%s\n",statusstr[0]); 152 | fflush(stdout); 153 | } 154 | 155 | 156 | void statusloop() 157 | { 158 | setupsignals(); 159 | int i = 0; 160 | getcmds(-1); 161 | while (1) { 162 | getcmds(i++); 163 | writestatus(); 164 | if (!statusContinue) 165 | break; 166 | sleep(1.0); 167 | } 168 | } 169 | 170 | #ifndef __OpenBSD__ 171 | /* this signal handler should do nothing */ 172 | void dummysighandler(int signum) 173 | { 174 | return; 175 | } 176 | #endif 177 | 178 | void sighandler(int signum) 179 | { 180 | getsigcmds(signum-SIGPLUS); 181 | writestatus(); 182 | } 183 | 184 | void termhandler() 185 | { 186 | statusContinue = 0; 187 | } 188 | 189 | int main(int argc, char** argv) 190 | { 191 | for (int i = 0; i < argc; i++) {//Handle command line arguments 192 | if (!strcmp("-d",argv[i])) 193 | strncpy(delim, argv[++i], delimLen); 194 | else if (!strcmp("-p",argv[i])) 195 | writestatus = pstdout; 196 | } 197 | #ifndef NO_X 198 | if (!setupX()) 199 | return 1; 200 | #endif 201 | delimLen = MIN(delimLen, strlen(delim)); 202 | delim[delimLen++] = '\0'; 203 | signal(SIGTERM, termhandler); 204 | signal(SIGINT, termhandler); 205 | statusloop(); 206 | #ifndef NO_X 207 | XCloseDisplay(dpy); 208 | #endif 209 | return 0; 210 | } 211 | -------------------------------------------------------------------------------- /src/.zshrc: -------------------------------------------------------------------------------- 1 | .config/zsh/.zshrc -------------------------------------------------------------------------------- /src/Library/Application Support/Cursor/User/keybindings.json: -------------------------------------------------------------------------------- 1 | // Place your key bindings in this file to override the defaults 2 | [ 3 | { 4 | "key": "shift+cmd+g", 5 | "command": "workbench.view.scm", 6 | "when": "workbench.scm.active" 7 | }, 8 | { 9 | "command": "workbench.action.togglePanel", 10 | "key": "ctrl+`" 11 | }, 12 | { 13 | "command": "workbench.action.toggleSidebarVisibility", 14 | "key": "cmd+b" 15 | }, 16 | { 17 | "when": "filesExplorerFocus && !inputFocus", 18 | "command": "explorer.newFile", 19 | "key": "a" 20 | }, 21 | { 22 | "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsFolder && !inputFocus", 23 | "command": "filesExplorer.openFilePreserveFocus", 24 | "key": "l" 25 | }, 26 | { 27 | "key": "cmd+i", 28 | "command": "composerMode.agent" 29 | } 30 | ] 31 | -------------------------------------------------------------------------------- /src/Library/Application Support/Cursor/User/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | // "files.exclude": { "**/.git": false }, 3 | "workbench.statusBar.visible": false, 4 | "cursor.composer.collapsePaneInputBoxPills": true, 5 | "cursor.composer.shouldAllowCustomModes": true, 6 | "cursor.composer.shouldChimeAfterChatFinishes": true, 7 | "editor.fontFamily": "'JetBrainsMono Nerd Font'", 8 | "editor.fontLigatures": true, 9 | "editor.fontSize": 13, 10 | "editor.formatOnSave": true, 11 | "editor.hideCursorInOverviewRuler": true, 12 | "editor.lineHeight": 1.8, 13 | "editor.lineNumbers": "relative", 14 | "editor.minimap.enabled": false, 15 | "editor.overviewRulerBorder": false, 16 | "editor.rulers": [80], 17 | "editor.wordWrap": "on", 18 | "explorer.compactFolders": false, 19 | "explorer.confirmDelete": false, 20 | "explorer.confirmDragAndDrop": false, 21 | "terminal.integrated.fontSize": 13, 22 | "update.releaseTrack": "prerelease", 23 | "window.commandCenter": false, 24 | "window.density.editorTabHeight": "compact", 25 | "window.nativeTabs": true, 26 | "window.systemColorTheme": "auto", 27 | "window.title": "${folderPath}", 28 | "workbench.activityBar.location": "hidden", 29 | "workbench.activityBar.orientation": "vertical", 30 | "workbench.colorTheme": "Vercel Theme", 31 | "workbench.editor.editorActionsLocation": "hidden", 32 | "workbench.layoutControl.enabled": false, 33 | "workbench.navigationControl.enabled": false, 34 | "workbench.sideBar.location": "right", 35 | // VIM plugin 36 | "vim.highlightedyank.duration": 150, 37 | "vim.highlightedyank.enable": true, 38 | "vim.useCtrlKeys": true, 39 | "vim.useSystemClipboard": true, 40 | "vim.normalModeKeyBindings": [ 41 | { "before": ["Y"], "after": ["y", "$"] }, 42 | { "before": ["[", "b"], "commands": ["workbench.action.previousEditor"] }, 43 | { "before": ["]", "b"], "commands": ["workbench.action.nextEditor"] }, 44 | { "before": ["K"], "commands": ["editor.action.showHover"] }, 45 | { "before": ["g", "r"], "commands": ["editor.action.goToReferences"] }, 46 | { 47 | "before": ["", "b", "d"], 48 | "commands": ["workbench.action.closeActiveEditor"] 49 | }, 50 | { 51 | "before": ["", "b", "u"], 52 | "commands": ["workbench.action.reopenClosedEditor"] 53 | }, 54 | { "before": ["", "r", "n"], "commands": ["editor.action.rename"] } 55 | ], 56 | "vim.visualModeKeyBindings": [ 57 | { "before": [">"], "after": [">", "g", "v"] }, 58 | { "before": ["<"], "after": ["<", "g", "v"] } 59 | ] 60 | } 61 | --------------------------------------------------------------------------------