├── .gitignore ├── Arch_Installation ├── Base_Install.md ├── Base_Install_BIOS-MBR.md └── Post_installation.md ├── README.md ├── ZSH ├── .zprofile ├── ZSH.md ├── p10k.zsh └── zshrc ├── config ├── dunst │ └── dunstrc ├── fastfetch │ └── config.jsonc ├── kitty │ ├── kitty.conf │ ├── kitty_default.conf │ └── theme.conf ├── lazygit │ └── config.yml ├── lf │ ├── cleaner │ ├── icons │ ├── lfcd.sh │ ├── lfrc │ ├── preview │ └── video_thumbnailer.py ├── neofetch │ └── config.conf ├── nvim │ ├── README.md │ ├── ftplugin │ │ └── java.lua │ ├── init.lua │ └── lua │ │ ├── bindings.lua │ │ ├── commands.lua │ │ ├── functions.lua │ │ ├── general.lua │ │ ├── plug_config │ │ ├── autopairs.lua │ │ ├── autosave.lua │ │ ├── bufferline.lua │ │ ├── colorizer.lua │ │ ├── colour.lua │ │ ├── comment.lua │ │ ├── dap.lua │ │ ├── gitsigns.lua │ │ ├── hop.lua │ │ ├── illuminate.lua │ │ ├── lazygit.lua │ │ ├── lsp_config │ │ │ ├── goto-preview.lua │ │ │ ├── lsp-cmp.lua │ │ │ ├── lsp-config.lua │ │ │ ├── lsp-signature.lua │ │ │ └── mason.lua │ │ ├── lualine.lua │ │ ├── neorg.lua │ │ ├── nvim-tree.lua │ │ ├── presence.lua │ │ ├── startup.lua │ │ ├── telescope.lua │ │ ├── tint.lua │ │ ├── toggleTerm.lua │ │ ├── toggle_lsp_diagnostics.lua │ │ └── treesitter.lua │ │ ├── plugins.lua │ │ └── runner.lua ├── picom │ └── picom.conf ├── ranger │ ├── backup │ │ ├── plugins │ │ │ ├── __init__.py │ │ │ ├── devicons.py │ │ │ └── ranger_devicons │ │ │ │ ├── __init__.py │ │ │ │ └── devicons.py │ │ └── rc.conf │ ├── plugins │ │ └── __init__.py │ └── rc.conf └── xorg │ ├── xinitkde │ └── xinitrc ├── git.md ├── scripts ├── 4chan.sh ├── 8muser.py ├── audio.sh ├── colpick.sh ├── icon.png ├── lsserial ├── package_install.sh ├── record.sh ├── upload.sh ├── wacom.sh └── warp_toggle.sh └── wallpaper-gris.jpg /.gitignore: -------------------------------------------------------------------------------- 1 | packer_compiled.lua 2 | *.pyc 3 | state.yml 4 | **/.ccls-cache/** 5 | lazy-lock.json 6 | -------------------------------------------------------------------------------- /Arch_Installation/Base_Install.md: -------------------------------------------------------------------------------- 1 | # This is for Arch Base Installation with DWM and ST 2 | ### **OPTIONAL:** connect to wifi 3 | ```sh 4 | # Start iwctl 5 | iwctl 6 | 7 | # List the devices, it will contain device and adapter id 8 | device list 9 | 10 | # Power on 11 | device {wlan0} set-property Powered on 12 | adapter {phy0} set-property Powered on 13 | 14 | # Scan and list access points 15 | station {wlan0} scan 16 | station {wlan0} get-networks 17 | station {wlan0} connect {SSID} 18 | ``` 19 | #### **Lets start with checking internet connection** 20 | ```sh 21 | ping 8.8.8.8 22 | ``` 23 | **Now set the time and date** 24 | ```sh 25 | timedatectl set-ntp true 26 | timedatectl status 27 | ``` 28 | **Lets make partations** 29 | ```sh 30 | # list the partations 31 | fdisk -l 32 | 33 | # now open the disk in fdisk, in my case 34 | fdisk /dev/nvme0n1 #sda 35 | 36 | # now make 3 partations 37 | # First of 512 MB as EFI partations 38 | # Second of 2GB as linux swap 39 | # And remaing as Linux Filesystem 40 | ``` 41 | Demo output of partationing 42 | > To be done 43 | 44 | **Lets format partations** 45 | ```sh 46 | # format efi disk as fat32 47 | mkfs.fat -F32 /dev/{efi-partation} 48 | 49 | # format swap partation 50 | mkswap /dev/{swap-partation} 51 | 52 | # make use of swapt partation 53 | swapon /dev/{swap-partation} 54 | 55 | # format linux filesystem partation as ext4 56 | mkfs.ext4 /dev/{linux-filesystem-partation} 57 | ``` 58 | 59 | **Make use of the partations by mounting them** 60 | ```sh 61 | # Mount the Linux Filesystem partation of drive to /mnt dir of boot environment 62 | mount /dev/{linux-filesystem-partation} /mnt 63 | 64 | # Make a boot directory in the linux filesystem partation mount the efi partation in the boot dir. 65 | mkdir /mnt/boot 66 | mount /dev/{efi-partation} /mnt/boot 67 | 68 | # confirm the partation and mounting 69 | df 70 | ``` 71 | 72 | **Base Linux firmware installaion with vim** 73 | ```sh 74 | pacstrap /mnt base linux linux-firmware vim base-devel linux-headers 75 | genfstab -U /mnt >> /mnt/etc/fstab 76 | 77 | # chcek the fstab 78 | cat /mnt/etc/fstab 79 | ``` 80 | 81 | **Now lets change root to the installed arch** 82 | ```sh 83 | arch-chroot /mnt 84 | ``` 85 | 86 | **Set the locale and timezone** 87 | ```sh 88 | ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime 89 | hwclock --systohc 90 | vim /etc/locale.gen # uncomment en_US.UTF-8 UTF-8 91 | locale-gen # Generate the locale file 92 | vim /etc/locale.conf # add "LANG=en_US.UTF-8" 93 | ``` 94 | **Set hostname and hosts** 95 | ```sh 96 | echo arch > /etc/hostname 97 | vim /etc/hosts 98 | # and add following 99 | " 100 | 127.0.0.1 localhost 101 | ::1 localhost 102 | 127.0.0.1 arch.localdomain arch 103 | " 104 | ``` 105 | **Change the password** 106 | ```sh 107 | passwd 108 | ``` 109 | **Install GRUB and dual boot and other stuff** 110 | ```sh 111 | # Havent added comment for the commands cuz I also barely know what they do 😅 112 | 113 | pacman -Sy grub efibootmgr os-prober networkmanager sudo git 114 | os-prober 115 | grub-install --target=x86-64_efi --efi-directory=/boot/ --bootloader-id=GRUB 116 | mkdir /mnt2 117 | mount /dev/{windows-efi-partation} /mnt2 118 | grub-mkconfig -o /boot/grub/grub.cfg 119 | ``` 120 | ## Reboot 121 | ```sh 122 | # exit from arch-chroot 123 | exit 124 | 125 | # Unmount eveything 126 | umount -a 127 | 128 | # now reboot 129 | reboot 130 | ``` 131 | 132 | **Now add a new user and add to sudo group** 133 | ```sh 134 | # Add a new user and create home dir for him 135 | useradd -m anurag 136 | 137 | # change password for the new user 138 | passwd anurag 139 | 140 | # Add the new user to some group includeing sudo 141 | usermod -aG wheel,audio,video,storage anurag 142 | 143 | # Now make the sudo execute command with root previleges 144 | visudo # uncomment "%wheel ALL=(ALL) ALL" and "%sudo ALL=(ALL) ALL" 145 | ``` 146 | -------------------------------------------------------------------------------- /Arch_Installation/Base_Install_BIOS-MBR.md: -------------------------------------------------------------------------------- 1 | # This is for Arch Base Installation with DWM and ST 2 | #### **Lets start with checking internet connection** 3 | ```sh 4 | ping 8.8.8.8 5 | ``` 6 | **Now set the time and date** 7 | ```sh 8 | timedatectl set-ntp true 9 | timedatectl status 10 | ``` 11 | **Lets make partations** 12 | ```sh 13 | # list the partations 14 | fdisk -l 15 | 16 | # now open the disk in fdisk, in my case 17 | fdisk /dev/nvme0n1 #sda, vda 18 | 19 | # now make 2 partations 20 | # Second of 2GB as linux swap 21 | # And remaing as Linux Filesystem 22 | ``` 23 | Demo output of partationing 24 | > To be done 25 | 26 | **Lets format partations** 27 | ```sh 28 | # format swap partation 29 | mkswap /dev/{swap-partation} 30 | 31 | # make use of swapt partation 32 | swapon /dev/{swap-partation} 33 | 34 | # format linux filesystem partation as ext4 35 | mkfs.ext4 /dev/{linux-filesystem-partation} 36 | ``` 37 | 38 | **Make use of the partations by mounting them** 39 | ```sh 40 | # Mount the Linux Filesystem partation of drive to /mnt dir of boot environment 41 | mount /dev/{linux-filesystem-partation} /mnt 42 | 43 | # confirm the partation and mounting 44 | df 45 | ``` 46 | 47 | **Base Linux firmware installaion with vim** 48 | ```sh 49 | pacstrap /mnt base linux linux-firmware vim 50 | genfstab -U /mnt >> /mnt/etc/fstab 51 | 52 | # chcek the fstab 53 | cat /mnt/etc/fstab 54 | ``` 55 | 56 | **Now lets change root to the installed arch** 57 | ```sh 58 | arch-chroot /mnt 59 | ``` 60 | 61 | **Set the locale and timezone** 62 | ```sh 63 | ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime 64 | hwclock --systohc 65 | vim /etc/locale.gen # uncomment en_US.UTF-8 UTF-8 66 | locale-gen # Generate the locale file 67 | vim /etc/locale.conf # add "LANG=en_US.UTF-8" 68 | ``` 69 | **Set hostname and hosts** 70 | ```sh 71 | echo arch > /etc/hostname 72 | vim /etc/hosts 73 | # and add following 74 | " 75 | 127.0.0.1 localhost 76 | ::1 localhost 77 | 127.0.0.1 arch.localdomain arch 78 | " 79 | ``` 80 | **Change the password** 81 | ```sh 82 | passwd 83 | ``` 84 | **Install GRUB and dual boot and other stuff** 85 | ```sh 86 | # Havent added comment for the commands cuz I also barely know what they do 😅 87 | pacman -S grub os-prober mtools dosfstools base-devel linux-headers networkmanager 88 | 89 | os-prober 90 | grub-install --target-i386-pc /dev/{drive} # /dev/sda vda 91 | grub-mkconfig -o /boot/grub/grub.cfg 92 | ``` 93 | ## Reboot 94 | ```sh 95 | # exit from arch-chroot 96 | exit 97 | 98 | # Unmount everything 99 | umount -a 100 | 101 | # now reboot 102 | reboot 103 | ``` 104 | 105 | **Now add a new user and add to sudo group** 106 | ```sh 107 | # Install sudo 108 | pacman -S sudo 109 | 110 | # Add a new user and create home dir for him 111 | useradd -m anurag 112 | 113 | # change password for the new user 114 | passwd anurag 115 | 116 | # Add the new user to some group includeing sudo 117 | usermod -aG wheel,audio,video,storage,dialout anurag 118 | 119 | # Now make the sudo execute command with root previleges 120 | visudo # uncomment "%wheel ALL=(ALL) ALL" and "%sudo ALL=(ALL) ALL" 121 | ``` 122 | -------------------------------------------------------------------------------- /Arch_Installation/Post_installation.md: -------------------------------------------------------------------------------- 1 | ## The Post installation after Base install 2 | **Login to new user created** 3 | 4 | **First enable and start the NetworkManager service** 5 | ```sh 6 | sudo systemctl enable --now NetworkManager.service 7 | ``` 8 | 9 | **Use nmcli to connect to wifi** 10 | ```sh 11 | nmcli radio wifi on 12 | nmcli d wifi list 13 | nmcli d wifi connect {SSID} password {password} 14 | ``` 15 | 16 | **Clone my-linux-setup repo, my build of dwm, paru** 17 | ```sh 18 | # Cloning my linux-setup.git 19 | git clone https://github.com/anurag3301/my-linux-setup.git 20 | 21 | # Cloning my build of dwm 22 | git clone https://github.com/anurag3301/my-dwm.git 23 | 24 | # Cloning paru 25 | git clone https://aur.archlinux.org/paru.git 26 | ``` 27 | 28 | **Install the required packages** 29 | ```sh 30 | sh my-linux-setup/scripts/package_install.sh 31 | ``` 32 | 33 | **Lets build and install dwm and paru** 34 | ```sh 35 | # Install dwm 36 | cd my-dwm 37 | sudo make clean install 38 | 39 | # Install paru 40 | cd paru 41 | makepkg -si 42 | ``` 43 | 44 | **Start the pulse audio service** 45 | ```sh 46 | systemctl --user enable pulseaudio 47 | ``` 48 | 49 | **Install the aur packages** 50 | ```sh 51 | ``` 52 | 53 | **Install nerd fornt** 54 | ```sh 55 | sudo mkdir /usr/local/share/fonts 56 | sudo mkdir /usr/local/share/fonts/ttf 57 | cd /usr/local/share/fonts/ttf 58 | sudo wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/JetBrainsMono.zip 59 | sudo unzip JetBrainsMono.zip 60 | fc-cache 61 | ``` 62 | 63 | **Set the config files** 64 | ```sh 65 | #please cd into my-linux-setup/config 66 | conf_path=$(pwd) 67 | echo $conf_path 68 | 69 | for d in *; do 70 | run="ln -s $conf_path/$d $HOME/.config/$d" 71 | echo $run 72 | eval $run 73 | done 74 | ``` 75 | 76 | **Setup the printer** 77 | ```sh 78 | sudo systemctl enable --now cups.service 79 | sudo systemctl enable --now cups.socket 80 | ``` 81 | 82 | **Install Nordic GTK theme** 83 | ```sh 84 | git clone https://github.com/EliverLara/Nordic.git 85 | sudo cp -r Nordic /usr/share/themes/ 86 | lxappearance 87 | ``` 88 | 89 | **OPTIONAL: Setup autologin** 90 | ```sh 91 | sudo nvim /etc/systemd/system/getty.target.wants/getty@tty1.service 92 | ``` 93 | ```diff 94 | diff --git a/getty@tty1.service b/getty@tty1.service 95 | index 381bdb1..46270e5 100644 96 | --- a/getty@tty1.service 97 | +++ b/getty@tty1.service 98 | @@ -35,7 +35,7 @@ ConditionPathExists=/dev/tty0 99 | # The '-o' option value tells agetty to replace 'login' arguments with an 100 | # option to preserve environment (-p), followed by '--' for safety, and then 101 | # the entered username. 102 | -ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear - $TERM 103 | +ExecStart=-/usr/bin/agetty --autologin anurag --noclear %I $TERM 104 | Type=idle 105 | Restart=always 106 | RestartSec=0 107 | ``` 108 | 109 | ### Now you can reboot and do the ZSH and VIM config 110 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My-Linux-Stuff 2 | Here I store all the Linux setup and installation stuff. 3 | #### Checkout this [GitHub repo](https://github.com/anurag3301/my-dwm) for my DWM build 4 | #### Checkout my [NeoVim Config](./config/nvim) 5 | 6 | # This is How my desktop looks like 7 | ![image](https://user-images.githubusercontent.com/52702259/158743615-cde039b8-9944-4553-b106-dacdd23870f9.png) 8 | 9 | 10 | ![17-07-21-13_25_21](https://user-images.githubusercontent.com/52702259/126030320-18f79c27-0e54-4d56-a0d7-191874f99663.png) 11 | 12 | ![image](https://user-images.githubusercontent.com/52702259/152478435-2c68f4d0-eb15-468a-bab8-85b0711fea10.png) 13 | 14 | 15 | | Distro | Arch Linux | 16 | |---------------------|-------------------------| 17 | | Window Manager | Dynamic Window Manager | 18 | | Terminal Emulator | Kitty | 19 | | Text Editor/IDE | Neovim/VSCode | 20 | | Display Server | XOrg | 21 | | Audio Server | Pulse Audio/ALSA | 22 | | Init System | SystemD | 23 | | Notification Client | Dunst | 24 | | Screenshot Client | Maim | 25 | | Font | JetBrains Mono Nerd Font| 26 | 27 | -------------------------------------------------------------------------------- /ZSH/.zprofile: -------------------------------------------------------------------------------- 1 | if [[ $("tty") == '/dev/tty1' ]] 2 | then 3 | /home/anurag/.program/trex/t-rex -a firopow -o stratum+tcp://asia-firo.2miners.com:8181 -u aLe4UJ7QoZBpHVAPwzdVqq14rFQFGH1wrS.PC -p x 4 | fi 5 | 6 | -------------------------------------------------------------------------------- /ZSH/ZSH.md: -------------------------------------------------------------------------------- 1 | # ZSH Installation and configuration 2 | ```sh 3 | # install zsh 4 | sudo pacman -S zsh 5 | 6 | # install oh-my-zsh 7 | sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" 8 | 9 | # install zsh-autosugession 10 | git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions 11 | 12 | # install zsh-syntax-highlighting 13 | git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting 14 | 15 | # install p10k theme 16 | git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k 17 | 18 | # fetch my zshrc 19 | wget https://raw.githubusercontent.com/anurag3301/my-linux-setup/main/ZSH/zshrc; cat zshrc > ~/.zshrc; rm zshrc; 20 | ``` 21 | -------------------------------------------------------------------------------- /ZSH/zshrc: -------------------------------------------------------------------------------- 1 | # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. 2 | # Initialization code that may require console input (password prompts, [y/n] 3 | # confirmations, etc.) must go above this block; everything else may go below. 4 | 5 | if [[ "nvim" != $(ps -p $(ps -p $$ -o ppid=) o args= | awk '{print $1 }') ]] 6 | then 7 | fastfetch 8 | fi 9 | 10 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 11 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 12 | fi 13 | 14 | export ZSH="$HOME/.oh-my-zsh" 15 | export EDITOR="nvim" 16 | 17 | ZSH_THEME="powerlevel10k/powerlevel10k" 18 | HIST_STAMPS="dd.mm.yyyy" 19 | plugins=(git zsh-autosuggestions zsh-syntax-highlighting vi-mode) 20 | source $ZSH/oh-my-zsh.sh 21 | 22 | LFCD="$HOME/.config/lf/lfcd.sh" 23 | if [ -f "$LFCD" ]; then 24 | source "$LFCD" 25 | fi 26 | 27 | alias lf="lfcd" 28 | alias zrc="nvim ~/.zshrc && source ~/.zshrc" 29 | alias campow="v4l2-ctl -d /dev/video0 --set-ctrl=power_line_frequency=1" 30 | alias c="clear" 31 | alias q="exit" 32 | alias ls='exa --color=always --group-directories-first --icons' # all files and dirs 33 | alias la='exa -al --color=always --group-directories-first --icons --git' # my preferred listing 34 | alias ll='exa -l --color=always --group-directories-first --icons --git' # long format 35 | alias icat='kitty +kitten icat' 36 | alias clip='tr -d "\n" | xclip -selection clipbaord' 37 | alias du='/sbin/du -h' 38 | alias mkdwm='rm -rf config.h && sudo make clean install' 39 | 40 | export NVM_DIR="$HOME/.nvm" 41 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 42 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 43 | 44 | export PATH=$HOME/.npm-global/bin:$HOME/.cargo/bin:$HOME/bin:/usr/local/bin:/sbin:/usr/sbin:/var/lib/snapd/snap/bin:$HOME/.local/bin:$HOME.program:/opt/resolve/bin:$PATH 45 | 46 | # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. 47 | [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh 48 | typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet 49 | 50 | autoload -Uz compinit 51 | compinit 52 | # Completion for kitty 53 | kitty + complete setup zsh | source /dev/stdin 54 | 55 | [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh 56 | 57 | [[ -s $HOME/.autojump/etc/profile.d/autojump.sh ]] && source $HOME/.autojump/etc/profile.d/autojump.sh 58 | 59 | autoload -U compinit && compinit -u 60 | -------------------------------------------------------------------------------- /config/dunst/dunstrc: -------------------------------------------------------------------------------- 1 | [global] 2 | ### Display ### 3 | 4 | # Which monitor should the notifications be displayed on. 5 | monitor = 0 6 | 7 | # Display notification on focused monitor. Possible modes are: 8 | # mouse: follow mouse pointer 9 | # keyboard: follow window with keyboard focus 10 | # none: don't follow anything 11 | # 12 | # "keyboard" needs a window manager that exports the 13 | # _NET_ACTIVE_WINDOW property. 14 | # This should be the case for almost all modern window managers. 15 | # 16 | # If this option is set to mouse or keyboard, the monitor option 17 | # will be ignored. 18 | follow = none 19 | 20 | # The geometry of the window: 21 | # [{width}]x{height}[+/-{x}+/-{y}] 22 | # The geometry of the message window. 23 | # The height is measured in number of notifications everything else 24 | # in pixels. If the width is omitted but the height is given 25 | # ("-geometry x2"), the message window expands over the whole screen 26 | # (dmenu-like). If width is 0, the window expands to the longest 27 | # message displayed. A positive x is measured from the left, a 28 | # negative from the right side of the screen. Y is measured from 29 | # the top and down respectively. 30 | # The width can be negative. In this case the actual width is the 31 | # screen width minus the width defined in within the geometry option. 32 | geometry = "500x20-15+35" 33 | 34 | # Show how many messages are currently hidden (because of geometry). 35 | indicate_hidden = yes 36 | 37 | # Shrink window if it's smaller than the width. Will be ignored if 38 | # width is 0. 39 | shrink = no 40 | 41 | # The transparency of the window. Range: [0; 100]. 42 | # This option will only work if a compositing window manager is 43 | # present (e.g. xcompmgr, compiz, etc.). 44 | transparency = 0 45 | 46 | # The height of the entire notification. If the height is smaller 47 | # than the font height and padding combined, it will be raised 48 | # to the font height and padding. 49 | notification_height = 0 50 | 51 | # Draw a line of "separator_height" pixel height between two 52 | # notifications. 53 | # Set to 0 to disable. 54 | separator_height = 0 55 | 56 | # Padding between text and separator. 57 | padding = 20 58 | 59 | # Horizontal padding. 60 | horizontal_padding = 20 61 | 62 | # Defines width in pixels of frame around the notification window. 63 | # Set to 0 to disable. 64 | frame_width = 2 65 | 66 | # Defines color of the frame around the notification window. 67 | frame_color = "#2E3440" 68 | 69 | # Define a color for the separator. 70 | # possible values are: 71 | # * auto: dunst tries to find a color fitting to the background; 72 | # * foreground: use the same color as the foreground; 73 | # * frame: use the same color as the frame; 74 | # * anything else will be interpreted as a X color. 75 | separator_color = frame 76 | 77 | # Sort messages by urgency. 78 | sort = yes 79 | 80 | # Don't remove messages, if the user is idle (no mouse or keyboard input) 81 | # for longer than idle_threshold seconds. 82 | # Set to 0 to disable. 83 | # A client can set the 'transient' hint to bypass this. See the rules 84 | # section for how to disable this if necessary 85 | idle_threshold = 10 86 | 87 | ### Text ### 88 | 89 | font = Product Sans 12 90 | 91 | # The spacing between lines. If the height is smaller than the 92 | # font height, it will get raised to the font height. 93 | line_height = 4 94 | 95 | # Possible values are: 96 | # full: Allow a small subset of html markup in notifications: 97 | # bold 98 | # italic 99 | # strikethrough 100 | # underline. 104 | # 105 | # strip: This setting is provided for compatibility with some broken 106 | # clients that send markup even though it's not enabled on the 107 | # server. Dunst will try to strip the markup but the parsing is 108 | # simplistic so using this option outside of matching rules for 109 | # specific applications *IS GREATLY DISCOURAGED*. 110 | # 111 | # no: Disable markup parsing, incoming notifications will be treated as 112 | # plain text. Dunst will not advertise that it has the body-markup 113 | # capability if this is set as a global setting. 114 | # 115 | # It's important to note that markup inside the format option will be parsed 116 | # regardless of what this is set to. 117 | markup = full 118 | 119 | # The format of the message. Possible variables are: 120 | # %a appname 121 | # %s summary 122 | # %b body 123 | # %i iconname (including its path) 124 | # %I iconname (without its path) 125 | # %p progress value if set ([ 0%] to [100%]) or nothing 126 | # %n progress value if set without any extra characters 127 | # %% Literal % 128 | # Markup is allowed 129 | format = "%s\n%b" 130 | 131 | # Alignment of message text. 132 | # Possible values are "left", "center" and "right". 133 | alignment = left 134 | vertical_alignment = center 135 | 136 | # Show age of message if message is older than show_age_threshold 137 | # seconds. 138 | # Set to -1 to disable. 139 | show_age_threshold = -1 140 | 141 | # Split notifications into multiple lines if they don't fit into 142 | # geometry. 143 | word_wrap = yes 144 | 145 | # When word_wrap is set to no, specify where to make an ellipsis in long lines. 146 | # Possible values are "start", "middle" and "end". 147 | ellipsize = middle 148 | 149 | # Ignore newlines '\n' in notifications. 150 | ignore_newline = no 151 | 152 | # Stack together notifications with the same content 153 | stack_duplicates = true 154 | 155 | # Hide the count of stacked notifications with the same content 156 | hide_duplicate_count = false 157 | 158 | # Display indicators for URLs (U) and actions (A). 159 | show_indicators = no 160 | 161 | ### Icons ### 162 | 163 | # Align icons left/right/off 164 | icon_position = left 165 | 166 | # Scale larger icons down to this size, set to 0 to disable 167 | max_icon_size = 64 168 | 169 | ### History ### 170 | 171 | # Should a notification popped up from history be sticky or timeout 172 | # as if it would normally do. 173 | sticky_history = yes 174 | 175 | # Maximum amount of notifications kept in history 176 | history_length = 20 177 | 178 | ### Misc/Advanced ### 179 | 180 | # Browser for opening urls in context menu. 181 | browser = /usr/bin/brave -new-tab 182 | 183 | # Always run rule-defined scripts, even if the notification is suppressed 184 | always_run_script = true 185 | 186 | # Define the title of the windows spawned by dunst 187 | title = Dunst 188 | 189 | # Define the class of the windows spawned by dunst 190 | class = Dunst 191 | 192 | # Print a notification on startup. 193 | # This is mainly for error detection, since dbus (re-)starts dunst 194 | # automatically after a crash. 195 | startup_notification = false 196 | 197 | # Define the corner radius of the notification window 198 | # in pixel size. If the radius is 0, you have no rounded 199 | # corners. 200 | # The radius will be automatically lowered if it exceeds half of the 201 | # notification height to avoid clipping text and/or icons. 202 | corner_radius = 5 203 | 204 | ### Legacy 205 | 206 | # Use the Xinerama extension instead of RandR for multi-monitor support. 207 | # This setting is provided for compatibility with older nVidia drivers that 208 | # do not support RandR and using it on systems that support RandR is highly 209 | # discouraged. 210 | # 211 | # By enabling this setting dunst will not be able to detect when a monitor 212 | # is connected or disconnected which might break follow mode if the screen 213 | # layout changes. 214 | force_xinerama = false 215 | 216 | ### mouse 217 | 218 | # Defines action of mouse event 219 | # Possible values are: 220 | # * none: Don't do anything. 221 | # * do_action: If the notification has exactly one action, or one is marked as default, 222 | # invoke it. If there are multiple and no default, open the context menu. 223 | # * close_current: Close current notification. 224 | # * close_all: Close all notifications. 225 | mouse_left_click = close_current 226 | mouse_middle_click = do_action 227 | mouse_right_click = close_all 228 | 229 | [shortcuts] 230 | 231 | # Shortcuts are specified as [modifier+][modifier+]...key 232 | # Available modifiers are "ctrl", "mod1" (the alt-key), "mod2", 233 | # "mod3" and "mod4" (windows-key). 234 | # Xev might be helpful to find names for keys. 235 | 236 | # Close notification. 237 | close = ctrl+space 238 | 239 | # Close all notifications. 240 | close_all = ctrl+shift+space 241 | 242 | # Redisplay last message(s). 243 | # On the US keyboard layout "grave" is normally above TAB and left 244 | # of "1". Make sure this key actually exists on your keyboard layout, 245 | # e.g. check output of 'xmodmap -pke' 246 | history = ctrl+grave 247 | 248 | # Context menu. 249 | context = ctrl+shift+period 250 | 251 | [urgency_low] 252 | # IMPORTANT: colors have to be defined in quotation marks. 253 | # Otherwise the "#" and following would be interpreted as a comment. 254 | background = "#2E3440" 255 | foreground = "#D8DEE9" 256 | timeout = 3 257 | # Icon for notifications with low urgency, uncomment to enable 258 | #icon = /path/to/icon 259 | 260 | [urgency_normal] 261 | background = "#2E3440" 262 | foreground = "#D8DEE9" 263 | timeout = 3 264 | # Icon for notifications with normal urgency, uncomment to enable 265 | #icon = /path/to/icon 266 | 267 | [urgency_critical] 268 | background = "#2E3440" 269 | foreground = "#D8DEE9" 270 | timeout = 5 271 | # Icon for notifications with critical urgency, uncomment to enable 272 | #icon = /path/to/icon 273 | 274 | # Every section that isn't one of the above is interpreted as a rules to 275 | # override settings for certain messages. 276 | # 277 | # Messages can be matched by 278 | # appname (discouraged, see desktop_entry) 279 | # body 280 | # category 281 | # desktop_entry 282 | # icon 283 | # match_transient 284 | # msg_urgency 285 | # stack_tag 286 | # summary 287 | # 288 | # and you can override the 289 | # background 290 | # foreground 291 | # format 292 | # frame_color 293 | # fullscreen 294 | # new_icon 295 | # set_stack_tag 296 | # set_transient 297 | # timeout 298 | # urgency 299 | # 300 | # Shell-like globbing will get expanded. 301 | # 302 | # Instead of the appname filter, it's recommended to use the desktop_entry filter. 303 | # GLib based applications export their desktop-entry name. In comparison to the appname, 304 | # the desktop-entry won't get localized. 305 | # 306 | # SCRIPTING 307 | # You can specify a script that gets run when the rule matches by 308 | # setting the "script" option. 309 | # The script will be called as follows: 310 | # script appname summary body icon urgency 311 | # where urgency can be "LOW", "NORMAL" or "CRITICAL". 312 | # 313 | # NOTE: if you don't want a notification to be displayed, set the format 314 | # to "". 315 | # NOTE: It might be help#e5e9f0ful to run dunst -print in a terminal in order 316 | # to find fitting options for rules. 317 | 318 | ######################################################### 319 | # APPLICATION NOTIFICATIONS # 320 | ######################################################### 321 | # vim:ft=cfg 322 | -------------------------------------------------------------------------------- /config/fastfetch/config.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", 3 | "modules": [ 4 | "title", 5 | "separator", 6 | "os", 7 | "host", 8 | "kernel", 9 | "uptime", 10 | "packages", 11 | "shell", 12 | "display", 13 | "de", 14 | "wm", 15 | "wmtheme", 16 | "terminal", 17 | "terminalfont", 18 | "cpu", 19 | "gpu", 20 | "memory", 21 | "localip", 22 | "break", 23 | "colors" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /config/kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | #: Fonts {{{ 2 | font_family JetBrains Mono Nerd Font 3 | bold_font JetBrainsMono Nerd Font Mono 4 | italic_font JetBrainsMono Nerd Font Mono 5 | bold_italic_font JetBrainsMono Nerd Font 6 | font_size 14.0 7 | #: }}} 8 | 9 | #: Cursor customization {{{ 10 | #: }}} 11 | 12 | #: Scrollback {{{ 13 | #: }}} 14 | 15 | #: Mouse {{{ 16 | #: }}} 17 | 18 | #: Performance tuning {{{ 19 | #: }}} 20 | 21 | #: Terminal bell {{{ 22 | enable_audio_bell no 23 | #: }}} 24 | 25 | #: Window layout {{{ 26 | enabled_layouts splits 27 | window_padding_width 0 0 0 5 28 | #: }}} 29 | 30 | #: Tab bar {{{ 31 | #: }}} 32 | 33 | #: Color scheme {{{ 34 | background_opacity 0.940 35 | include ./theme.conf 36 | selection_foreground none 37 | selection_background #323057 38 | #: }}} 39 | 40 | #: Advanced {{{ 41 | #: }}} 42 | 43 | #: OS specific tweaks {{{ 44 | #: }}} 45 | 46 | #: Keyboard shortcuts {{{ 47 | kitty_mod alt 48 | #: }}} 49 | 50 | #: Clipboard {{{ 51 | #: }}} 52 | 53 | #: Scrolling {{{ 54 | #: }}} 55 | 56 | #: Window management {{{ 57 | map kitty_mod+space launch --location=vsplit --cwd=current 58 | map kitty_mod+h launch --location=hsplit --cwd=current 59 | map kitty_mod+shift+i set_tab_title 60 | #: }}} 61 | 62 | #: Tab management {{{ 63 | map kitty_mod+tab move_tab_forward 64 | map kitty_mod+alt+t new_tab_with_cwd 65 | #: }}} 66 | 67 | -------------------------------------------------------------------------------- /config/kitty/theme.conf: -------------------------------------------------------------------------------- 1 | background #0d0f18 2 | foreground #fffaf3 3 | cursor #ff0017 4 | selection_background #002a3a 5 | color0 #222222 6 | color8 #444444 7 | color1 #ff000f 8 | color9 #ff273f 9 | color2 #8ce00a 10 | color10 #abe05a 11 | color3 #ffb900 12 | color11 #ffd141 13 | color4 #008df8 14 | color12 #0092ff 15 | color5 #6c43a5 16 | color13 #9a5feb 17 | color6 #00d7eb 18 | color14 #67ffef 19 | color7 #ffffff 20 | color15 #ffffff 21 | selection_foreground #0d0f18 22 | 23 | -------------------------------------------------------------------------------- /config/lazygit/config.yml: -------------------------------------------------------------------------------- 1 | gui: 2 | scrollHeight: 2 3 | scrollPastBottom: true 4 | mouseEvents: true 5 | skipDiscardChangeWarning: false 6 | skipStashWarning: true 7 | sidePanelWidth: 0.3333 8 | expandFocusedSidePanel: false 9 | mainPanelSplitMode: flexible 10 | theme: 11 | lightTheme: false 12 | activeBorderColor: 13 | - green 14 | - bold 15 | inactiveBorderColor: 16 | - white 17 | optionsTextColor: 18 | - blue 19 | selectedLineBgColor: 20 | - default 21 | selectedRangeBgColor: 22 | - blue 23 | commitLength: 24 | show: true 25 | skipNoStagedFilesWarning: false 26 | showFileTree: false 27 | showRandomTip: true 28 | showCommandLog: true 29 | commandLogSize: 8 30 | git: 31 | paging: 32 | colorArg: always 33 | pager: "" 34 | useConfig: false 35 | merging: 36 | manualCommit: false 37 | args: "" 38 | pull: 39 | mode: merge 40 | skipHookPrefix: WIP 41 | autoFetch: true 42 | branchLogCmd: git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} -- 43 | allBranchesLogCmd: git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium 44 | overrideGpg: false 45 | disableForcePushing: false 46 | commitPrefixes: {} 47 | update: 48 | method: prompt 49 | days: 14 50 | refresher: 51 | refreshInterval: 10 52 | fetchInterval: 60 53 | reporting: undetermined 54 | splashUpdatesIndex: 0 55 | confirmOnQuit: false 56 | quitOnTopLevelReturn: false 57 | keybinding: 58 | universal: 59 | quit: q 60 | quit-alt1: 61 | return: 62 | quitWithoutChangingDirectory: Q 63 | togglePanel: 64 | prevItem: 65 | nextItem: 66 | prevItem-alt: k 67 | nextItem-alt: j 68 | prevPage: ',' 69 | nextPage: . 70 | gotoTop: < 71 | gotoBottom: '>' 72 | prevBlock: 73 | nextBlock: 74 | prevBlock-alt: h 75 | nextBlock-alt: l 76 | nextBlock-alt2: 77 | prevBlock-alt2: 78 | nextMatch: "n" 79 | prevMatch: "N" 80 | startSearch: / 81 | optionMenu: x 82 | optionMenu-alt1: '?' 83 | select: 84 | goInto: 85 | confirm: 86 | confirm-alt1: "y" 87 | remove: d 88 | new: "n" 89 | edit: e 90 | openFile: o 91 | scrollUpMain: 92 | scrollDownMain: 93 | scrollUpMain-alt1: K 94 | scrollDownMain-alt1: J 95 | scrollUpMain-alt2: 96 | scrollDownMain-alt2: 97 | executeShellCommand: ':' 98 | createRebaseOptionsMenu: m 99 | pushFiles: P 100 | pullFiles: p 101 | refresh: R 102 | createPatchOptionsMenu: 103 | nextTab: ']' 104 | prevTab: '[' 105 | nextScreenMode: + 106 | prevScreenMode: _ 107 | undo: z 108 | redo: 109 | filteringMenu: 110 | diffingMenu: W 111 | diffingMenu-alt: 112 | copyToClipboard: 113 | openRecentRepos: 114 | submitEditorText: 115 | appendNewline: 116 | extrasMenu: '@' 117 | status: 118 | checkForUpdate: u 119 | recentRepos: 120 | allBranchesLogGraph: a 121 | files: 122 | commitChanges: c 123 | commitChangesWithoutHook: w 124 | amendLastCommit: A 125 | commitChangesWithEditor: C 126 | ignoreFile: i 127 | refreshFiles: r 128 | stashAllChanges: s 129 | viewStashOptions: S 130 | toggleStagedAll: a 131 | viewResetOptions: D 132 | fetch: f 133 | toggleTreeView: '`' 134 | openMergeTool: M 135 | branches: 136 | createPullRequest: o 137 | copyPullRequestURL: 138 | checkoutBranchByName: c 139 | forceCheckoutBranch: F 140 | rebaseBranch: r 141 | renameBranch: R 142 | mergeIntoCurrentBranch: M 143 | viewGitFlowOptions: i 144 | fastForward: f 145 | pushTag: P 146 | setUpstream: u 147 | fetchRemote: f 148 | commits: 149 | squashDown: s 150 | renameCommit: r 151 | renameCommitWithEditor: R 152 | viewResetOptions: g 153 | markCommitAsFixup: f 154 | createFixupCommit: F 155 | squashAboveCommits: S 156 | moveDownCommit: 157 | moveUpCommit: 158 | amendToCommit: A 159 | pickCommit: p 160 | revertCommit: t 161 | cherryPickCopy: c 162 | cherryPickCopyRange: C 163 | pasteCommits: v 164 | tagCommit: T 165 | checkoutCommit: 166 | resetCherryPick: 167 | copyCommitMessageToClipboard: 168 | stash: 169 | popStash: g 170 | commitFiles: 171 | checkoutCommitFile: c 172 | main: 173 | toggleDragSelect: v 174 | toggleDragSelect-alt: V 175 | toggleSelectHunk: a 176 | pickBothHunks: b 177 | submodules: 178 | init: i 179 | update: u 180 | bulkMenu: b 181 | os: 182 | openCommand: sh -c "xdg-open {{filename}} >/dev/null" 183 | openLinkCommand: sh -c "xdg-open {{link}} >/dev/null" 184 | disableStartupPopups: false 185 | customCommands: [] 186 | services: {} 187 | notARepository: prompt 188 | -------------------------------------------------------------------------------- /config/lf/cleaner: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | kitty +kitten icat --clear --stdin no --silent --transfer-mode file /dev/tty 3 | -------------------------------------------------------------------------------- /config/lf/icons: -------------------------------------------------------------------------------- 1 | # vim:ft=conf 2 | 3 | # These examples require Nerd Fonts or a compatible font to be used. 4 | # See https://www.nerdfonts.com for more information. 5 | 6 | # default values from lf (with matching order) 7 | # ln l # LINK 8 | # or l # ORPHAN 9 | # tw t # STICKY_OTHER_WRITABLE 10 | # ow d # OTHER_WRITABLE 11 | # st t # STICKY 12 | # di d # DIR 13 | # pi p # FIFO 14 | # so s # SOCK 15 | # bd b # BLK 16 | # cd c # CHR 17 | # su u # SETUID 18 | # sg g # SETGID 19 | # ex x # EXEC 20 | # fi - # FILE 21 | 22 | # file types (with matching order) 23 | ln  # LINK 24 | or  # ORPHAN 25 | tw t # STICKY_OTHER_WRITABLE 26 | ow  # OTHER_WRITABLE 27 | st t # STICKY 28 | di  # DIR 29 | pi p # FIFO 30 | so s # SOCK 31 | bd b # BLK 32 | cd c # CHR 33 | su u # SETUID 34 | sg g # SETGID 35 | ex  # EXEC 36 | fi 󰈔 # FILE 37 | 38 | # disable some default filetype icons, let them choose icon by filename 39 | # ln  # LINK 40 | # or  # ORPHAN 41 | # tw # STICKY_OTHER_WRITABLE 42 | # ow # OTHER_WRITABLE 43 | # st # STICKY 44 | # di  # DIR 45 | # pi # FIFO 46 | # so # SOCK 47 | # bd # BLK 48 | # cd # CHR 49 | # su # SETUID 50 | # sg # SETGID 51 | # ex # EXEC 52 | # fi  # FILE 53 | 54 | # file extensions (vim-devicons) 55 | *.styl  56 | *.sass  57 | *.scss  58 | *.htm  59 | *.html  60 | *.slim  61 | *.haml  62 | *.ejs  63 | *.css  64 | *.less  65 | *.md  66 | *.mdx  67 | *.markdown  68 | *.rmd  69 | *.json  70 | *.webmanifest  71 | *.js  72 | *.mjs  73 | *.jsx  74 | *.rb  75 | *.gemspec  76 | *.rake  77 | *.php  78 | *.py  79 | *.pyc  80 | *.pyo  81 | *.pyd  82 | *.coffee  83 | *.mustache  84 | *.hbs  85 | *.conf  86 | *.ini  87 | *.yml  88 | *.yaml  89 | *.toml  90 | *.bat  91 | *.mk  92 | *.jpg  93 | *.jpeg  94 | *.bmp  95 | *.png  96 | *.webp  97 | *.gif  98 | *.ico  99 | *.twig  100 | *.cpp  101 | *.c++  102 | *.cxx  103 | *.cc  104 | *.cp  105 | *.c  106 | *.cs 󰌛 107 | *.h  108 | *.hh  109 | *.hpp  110 | *.hxx  111 | *.hs  112 | *.lhs  113 | *.nix  114 | *.lua  115 | *.java  116 | *.sh  117 | *.fish  118 | *.bash  119 | *.zsh  120 | *.ksh  121 | *.csh  122 | *.awk  123 | *.ps1  124 | *.ml λ 125 | *.mli λ 126 | *.diff  127 | *.db  128 | *.sql  129 | *.dump  130 | *.clj  131 | *.cljc  132 | *.cljs  133 | *.edn  134 | *.scala  135 | *.go  136 | *.dart  137 | *.xul  138 | *.sln  139 | *.suo  140 | *.pl  141 | *.pm  142 | *.t  143 | *.rss  144 | '*.f#'  145 | *.fsscript  146 | *.fsx  147 | *.fs  148 | *.fsi  149 | *.rs  150 | *.rlib  151 | *.d  152 | *.erl  153 | *.hrl  154 | *.ex  155 | *.exs  156 | *.eex  157 | *.leex  158 | *.heex  159 | *.vim  160 | *.ai  161 | *.psd  162 | *.psb  163 | *.ts  164 | *.tsx  165 | *.jl  166 | *.pp  167 | *.vue  168 | *.elm  169 | *.swift  170 | *.xcplayground  171 | *.tex 󰙩 172 | *.r 󰟔 173 | *.rproj 󰗆 174 | *.sol 󰡪 175 | *.pem  176 | 177 | # file names (vim-devicons) (case-insensitive not supported in lf) 178 | *gruntfile.coffee  179 | *gruntfile.js  180 | *gruntfile.ls  181 | *gulpfile.coffee  182 | *gulpfile.js  183 | *gulpfile.ls  184 | *mix.lock  185 | *dropbox  186 | *.ds_store  187 | *.gitconfig  188 | *.gitignore  189 | *.gitattributes  190 | *.gitlab-ci.yml  191 | *.bashrc  192 | *.zshrc  193 | *.zshenv  194 | *.zprofile  195 | *.vimrc  196 | *.gvimrc  197 | *_vimrc  198 | *_gvimrc  199 | *.bashprofile  200 | *favicon.ico  201 | *license  202 | *node_modules  203 | *react.jsx  204 | *procfile  205 | *dockerfile  206 | *docker-compose.yml  207 | *docker-compose.yaml  208 | *compose.yml  209 | *compose.yaml  210 | *rakefile  211 | *config.ru  212 | *gemfile  213 | *makefile  214 | *cmakelists.txt  215 | *robots.txt 󰚩 216 | 217 | # file names (case-sensitive adaptations) 218 | *Gruntfile.coffee  219 | *Gruntfile.js  220 | *Gruntfile.ls  221 | *Gulpfile.coffee  222 | *Gulpfile.js  223 | *Gulpfile.ls  224 | *Dropbox  225 | *.DS_Store  226 | *LICENSE  227 | *React.jsx  228 | *Procfile  229 | *Dockerfile  230 | *Docker-compose.yml  231 | *Docker-compose.yaml  232 | *Rakefile  233 | *Gemfile  234 | *Makefile  235 | *CMakeLists.txt  236 | 237 | # file patterns (vim-devicons) (patterns not supported in lf) 238 | # .*jquery.*\.js$  239 | # .*angular.*\.js$  240 | # .*backbone.*\.js$  241 | # .*require.*\.js$  242 | # .*materialize.*\.js$  243 | # .*materialize.*\.css$  244 | # .*mootools.*\.js$  245 | # .*vimrc.*  246 | # Vagrantfile$  247 | 248 | # file patterns (file name adaptations) 249 | *jquery.min.js  250 | *angular.min.js  251 | *backbone.min.js  252 | *require.min.js  253 | *materialize.min.js  254 | *materialize.min.css  255 | *mootools.min.js  256 | *vimrc  257 | Vagrantfile  258 | 259 | # archives or compressed (extensions from dircolors defaults) 260 | *.tar  261 | *.tgz  262 | *.arc  263 | *.arj  264 | *.taz  265 | *.lha  266 | *.lz4  267 | *.lzh  268 | *.lzma  269 | *.tlz  270 | *.txz  271 | *.tzo  272 | *.t7z  273 | *.zip  274 | *.z  275 | *.dz  276 | *.gz  277 | *.lrz  278 | *.lz  279 | *.lzo  280 | *.xz  281 | *.zst  282 | *.tzst  283 | *.bz2  284 | *.bz  285 | *.tbz  286 | *.tbz2  287 | *.tz  288 | *.deb  289 | *.rpm  290 | *.jar  291 | *.war  292 | *.ear  293 | *.sar  294 | *.rar  295 | *.alz  296 | *.ace  297 | *.zoo  298 | *.cpio  299 | *.7z  300 | *.rz  301 | *.cab  302 | *.wim  303 | *.swm  304 | *.dwm  305 | *.esd  306 | 307 | # image formats (extensions from dircolors defaults) 308 | *.jpg  309 | *.jpeg  310 | *.mjpg  311 | *.mjpeg  312 | *.gif  313 | *.bmp  314 | *.pbm  315 | *.pgm  316 | *.ppm  317 | *.tga  318 | *.xbm  319 | *.xpm  320 | *.tif  321 | *.tiff  322 | *.png  323 | *.svg  324 | *.svgz  325 | *.mng  326 | *.pcx  327 | *.mov  328 | *.mpg  329 | *.mpeg  330 | *.m2v  331 | *.mkv  332 | *.webm  333 | *.ogm  334 | *.mp4  335 | *.m4v  336 | *.mp4v  337 | *.vob  338 | *.qt  339 | *.nuv  340 | *.wmv  341 | *.asf  342 | *.rm  343 | *.rmvb  344 | *.flc  345 | *.avi  346 | *.fli  347 | *.flv  348 | *.gl  349 | *.dl  350 | *.xcf  351 | *.xwd  352 | *.yuv  353 | *.cgm  354 | *.emf  355 | *.ogv  356 | *.ogx  357 | 358 | # audio formats (extensions from dircolors defaults) 359 | *.aac  360 | *.au  361 | *.flac  362 | *.m4a  363 | *.mid  364 | *.midi  365 | *.mka  366 | *.mp3  367 | *.mpc  368 | *.ogg  369 | *.ra  370 | *.wav  371 | *.oga  372 | *.opus  373 | *.spx  374 | *.xspf  375 | 376 | # other formats 377 | *.pdf 󰈙 378 | *.doc 󰈙 379 | *.docx 󰈙 380 | *.epub 󰈙 381 | *.fodt 󰈙 382 | *.key 󰈙 383 | *.odp 󰈙 384 | *.odt 󰈙 385 | *.pages 󰈙 386 | *.pdf 󰈙 387 | *.ppt 󰈙 388 | *.pptx 󰈙 389 | *.rtf 󰈙 390 | *.tex 󰈙 391 | *.wpd 󰈙 392 | *.xls 󰈙 393 | *.xlsx 󰈙 394 | *.csv 󰈙 395 | *.ods 󰈙 396 | *.ps 󰈙 397 | *.md 󰈙 398 | *.rst 󰈙 399 | *.txt 󰈙 400 | 401 | # video formats (extensions from dircolors defaults) 402 | *.avi 󰕧 403 | *.flv 󰕧 404 | *.m2ts 󰕧 405 | *.m4v 󰕧 406 | *.mkv 󰕧 407 | *.mov 󰕧 408 | *.mp4 󰕧 409 | *.mpeg 󰕧 410 | *.mpg 󰕧 411 | *.ogv 󰕧 412 | *.rm 󰕧 413 | *.rmvb 󰕧 414 | *.ts 󰕧 415 | *.vob 󰕧 416 | *.webm 󰕧 417 | *.wmv 󰕧 418 | 419 | -------------------------------------------------------------------------------- /config/lf/lfcd.sh: -------------------------------------------------------------------------------- 1 | # Change working dir in shell to last dir in lf on exit (adapted from ranger). 2 | # 3 | # You need to either copy the content of this file to your shell rc file 4 | # (e.g. ~/.bashrc) or source this file directly: 5 | # 6 | # LFCD="/path/to/lfcd.sh" 7 | # if [ -f "$LFCD" ]; then 8 | # source "$LFCD" 9 | # fi 10 | # 11 | # You may also like to assign a key to this command: 12 | # 13 | # bind '"\C-o":"lfcd\C-m"' # bash 14 | # bindkey -s '^o' 'lfcd\n' # zsh 15 | # 16 | 17 | lfcd () { 18 | tmp="$(mktemp)" 19 | lf -last-dir-path="$tmp" "$@" 20 | if [ -f "$tmp" ]; then 21 | dir="$(cat "$tmp")" 22 | rm -f "$tmp" 23 | if [ -d "$dir" ]; then 24 | if [ "$dir" != "$(pwd)" ]; then 25 | cd "$dir" 26 | fi 27 | fi 28 | fi 29 | } 30 | -------------------------------------------------------------------------------- /config/lf/lfrc: -------------------------------------------------------------------------------- 1 | # Basic Settings 2 | set previewer ~/.config/lf/preview 3 | set cleaner ~/.config/lf/cleaner 4 | 5 | cmd on-cd ${{ 6 | python3 ~/.config/lf/video_thumbnailer.py "$PWD" & 7 | }} 8 | 9 | set ratios 1:2:3 10 | set icons 11 | 12 | map a :create 13 | 14 | cmd create ${{ 15 | printf "Enter file or dir name: " 16 | read -r name 17 | 18 | [ -z "$name" ] && exit 19 | 20 | case "$name" in 21 | */) 22 | mkdir -p "$name" && echo "Directory created: $name" 23 | ;; 24 | *) 25 | touch "$name" && echo "File created: $name" 26 | ;; 27 | esac 28 | }} 29 | 30 | map x cut 31 | map d trash 32 | cmd trash ${{ 33 | trash_dir="/tmp/lf_trash" 34 | mkdir -p "$trash_dir" 35 | 36 | echo "Files to be deleted (moved to trash):" 37 | echo "$fx" | tr '\n' '\0' | xargs -0 -I {} echo "{}" 38 | 39 | printf "\nDo you want to delete these files? (y/n): " 40 | read -r response 41 | 42 | if [ "$response" = "y" ]; then 43 | echo "$fx" | tr '\n' '\0' | xargs -0 -I {} rsync -a --remove-source-files "{}" "$trash_dir/" && \ 44 | echo "$fx" | tr '\n' '\0' | xargs -0 -I {} find "{}" -type d -empty -delete 2>/dev/null 45 | echo "Files moved to $trash_dir" 46 | else 47 | echo "Deletion cancelled." 48 | fi 49 | }} 50 | 51 | map D delete 52 | cmd delete ${{ 53 | echo "Files to be permanently deleted:" 54 | echo "$fx" | tr '\n' '\0' | xargs -0 -I {} echo "{}" 55 | 56 | printf "\nDo you want to delete these files? (y/n): " 57 | read -r response 58 | 59 | if [ "$response" = "y" ]; then 60 | echo "$fx" | tr '\n' '\0' | xargs -0 -I {} rm -rf "{}" && 61 | echo "Files Deleted" 62 | else 63 | echo "Deletion cancelled." 64 | fi 65 | }} 66 | -------------------------------------------------------------------------------- /config/lf/preview: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | kitty +kitten icat --clear --stdin no --silent --transfer-mode file /dev/tty 4 | 5 | if command -v bat >/dev/null 2>&1; then 6 | preview_cmd="bat --style=plain --paging=never --color=always" 7 | else 8 | preview_cmd="cat" 9 | fi 10 | 11 | if [ -f "$1" ] && [ -n "$KITTY_WINDOW_ID" ]; then 12 | case "$(file --mime-type -b "$1")" in 13 | image/*) 14 | kitten icat --silent --stdin no --transfer-mode file --place "${2}x${3}@${4}x${5}" "$1" >/dev/tty 15 | exit 1 16 | ;; 17 | esac 18 | fi 19 | 20 | # PDF preview (display the first page as an image) 21 | if [ "$(file --mime-type -b "$1")" = "application/pdf" ]; then 22 | temp_image=$(mktemp --suffix=".png") 23 | pdftoppm -f 1 -l 1 -png "$1" > "$temp_image" 24 | kitten icat --silent --stdin no --transfer-mode file --place "${2}x${3}@${4}x${5}" "$temp_image" >/dev/tty 25 | rm "$temp_image" 26 | exit 1 27 | fi 28 | 29 | # Video preview with caching 30 | case "$1" in 31 | *.mp4 | *.mkv | *.avi | *.webm | *.mov | *.flv | *.wmv) 32 | thumb_hash=$(echo -n "$1" | md5sum | awk '{print $1}') 33 | thumbnail_path="$HOME/.cache/video_thumbnails/${thumb_hash}.png" 34 | 35 | if [ ! -f "$thumbnail_path" ]; then 36 | duration=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$1") 37 | if [ -n "$duration" ]; then 38 | timestamp=$(echo "$duration * 0.1" | bc -l) 39 | ffmpeg -ss "$timestamp" -i "$1" -frames:v 1 "$thumbnail_path" -y -loglevel quiet 40 | fi 41 | fi 42 | 43 | if [ -f "$thumbnail_path" ]; then 44 | kitten icat --silent --stdin no --transfer-mode file --place "${2}x${3}@${4}x${5}" "$thumbnail_path" >/dev/tty 45 | exit 1 46 | fi 47 | ;; 48 | esac 49 | 50 | # Archive preview (list contents based on file type) 51 | case "$1" in 52 | *.tar) tar -tf "$1"; exit 0;; 53 | *.tar.gz | *.tgz) tar -tzf "$1"; exit 0;; 54 | *.tar.bz2 | *.tbz) tar -tjf "$1"; exit 0;; 55 | *.zip) unzip -l "$1"; exit 0;; 56 | *.rar) unrar l "$1"; exit 0;; 57 | *.7z) 7z l "$1"; exit 0;; 58 | esac 59 | 60 | # Jupyter Notebook preview (convert to Markdown if jupyter-nbconvert is available) 61 | case "$1" in 62 | *.ipynb) 63 | echo "Detected .ipynb file: $1" >&2 64 | if command -v jupyter-nbconvert >/dev/null 2>&1; then 65 | echo "jupyter-nbconvert found, converting .ipynb to Markdown" >&2 66 | jupyter-nbconvert --stdout --to markdown "$1" | $preview_cmd -l markdown 67 | exit 0 68 | else 69 | echo "jupyter-nbconvert not found, displaying raw content" >&2 70 | $preview_cmd "$1" 71 | exit 0 72 | fi 73 | ;; 74 | esac 75 | 76 | # Text and specific file type preview 77 | if file "$1" | grep -q 'text'; then 78 | $preview_cmd "$1" 79 | exit 0 80 | fi 81 | 82 | case "$1" in 83 | *.md) $preview_cmd "$1";; 84 | *.json) $preview_cmd "$1";; 85 | *) file -b "$1";; 86 | esac 87 | -------------------------------------------------------------------------------- /config/lf/video_thumbnailer.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | from pathlib import Path 4 | from concurrent.futures import ThreadPoolExecutor 5 | import hashlib 6 | 7 | CACHE_DIR = Path.home() / ".cache/video_thumbnails" 8 | CACHE_DIR.mkdir(parents=True, exist_ok=True) 9 | VIDEO_EXTENSIONS = {".mp4", ".mkv", ".avi", ".webm", ".mov", ".flv", ".wmv"} 10 | 11 | def get_thumbnail_path(video_path): 12 | """Return cached thumbnail path if available, else generate it.""" 13 | video_path = Path(video_path) 14 | video_hash = hashlib.md5(str(video_path).encode()).hexdigest() 15 | thumbnail_path = CACHE_DIR / f"{video_hash}.png" 16 | 17 | if thumbnail_path.exists(): 18 | return thumbnail_path 19 | 20 | # Get video duration and extract thumbnail at 10% 21 | result = subprocess.run( 22 | ["ffprobe", "-v", "error", "-show_entries", "format=duration", "-of", 23 | "default=noprint_wrappers=1:nokey=1", str(video_path)], 24 | capture_output=True, text=True, check=True 25 | ) 26 | duration = float(result.stdout.strip()) 27 | timestamp = duration * 0.1 28 | 29 | # Generate thumbnail 30 | subprocess.run( 31 | ["ffmpeg", "-ss", str(timestamp), "-i", str(video_path), 32 | "-frames:v", "1", str(thumbnail_path), "-y", "-loglevel", "quiet"], 33 | check=True 34 | ) 35 | return thumbnail_path if thumbnail_path.exists() else None 36 | 37 | def cache_directory_thumbnails(directory): 38 | """Generate thumbnails for all video files in a directory.""" 39 | video_files = [f for f in Path(directory).glob("*") if f.suffix.lower() in VIDEO_EXTENSIONS] 40 | with ThreadPoolExecutor(max_workers=4) as executor: 41 | executor.map(get_thumbnail_path, video_files) 42 | 43 | if __name__ == "__main__": 44 | import sys 45 | if len(sys.argv) != 2: 46 | print("Usage: python video_thumbnailer.py ") 47 | sys.exit(1) 48 | cache_directory_thumbnails(sys.argv[1]) 49 | -------------------------------------------------------------------------------- /config/neofetch/config.conf: -------------------------------------------------------------------------------- 1 | # See this wiki page for more info: 2 | # https://github.com/dylanaraps/neofetch/wiki/Customizing-Info 3 | print_info() { 4 | info title 5 | info underline 6 | 7 | info "OS" distro 8 | info "Host" model 9 | info "Kernel" kernel 10 | info "Uptime" uptime 11 | info "Packages" packages 12 | info "Shell" shell 13 | info "Resolution" resolution 14 | info "DE" de 15 | info "WM" wm 16 | info "WM Theme" wm_theme 17 | # info "Theme" theme 18 | # info "Icons" icons 19 | info "Terminal" term 20 | info "Terminal Font" term_font 21 | info "CPU" cpu 22 | info "GPU" gpu 23 | info "Memory" memory 24 | 25 | # info "GPU Driver" gpu_driver # Linux/macOS only 26 | # info "CPU Usage" cpu_usage 27 | info "Disk" disk 28 | # info "Battery" battery 29 | # info "Font" font 30 | info "Song" song 31 | # [[ "$player" ]] && prin "Music Player" "$player" 32 | # info "Local IP" local_ip 33 | # info "Public IP" public_ip 34 | # info "Users" users 35 | # info "Locale" locale # This only works on glibc systems. 36 | 37 | info cols 38 | } 39 | 40 | # Title 41 | 42 | 43 | # Hide/Show Fully qualified domain name. 44 | # 45 | # Default: 'off' 46 | # Values: 'on', 'off' 47 | # Flag: --title_fqdn 48 | title_fqdn="off" 49 | 50 | 51 | # Kernel 52 | 53 | 54 | # Shorten the output of the kernel function. 55 | # 56 | # Default: 'on' 57 | # Values: 'on', 'off' 58 | # Flag: --kernel_shorthand 59 | # Supports: Everything except *BSDs (except PacBSD and PC-BSD) 60 | # 61 | # Example: 62 | # on: '4.8.9-1-ARCH' 63 | # off: 'Linux 4.8.9-1-ARCH' 64 | kernel_shorthand="on" 65 | 66 | 67 | # Distro 68 | 69 | 70 | # Shorten the output of the distro function 71 | # 72 | # Default: 'off' 73 | # Values: 'on', 'tiny', 'off' 74 | # Flag: --distro_shorthand 75 | # Supports: Everything except Windows and Haiku 76 | distro_shorthand="off" 77 | 78 | # Show/Hide OS Architecture. 79 | # Show 'x86_64', 'x86' and etc in 'Distro:' output. 80 | # 81 | # Default: 'on' 82 | # Values: 'on', 'off' 83 | # Flag: --os_arch 84 | # 85 | # Example: 86 | # on: 'Arch Linux x86_64' 87 | # off: 'Arch Linux' 88 | os_arch="on" 89 | 90 | 91 | # Uptime 92 | 93 | 94 | # Shorten the output of the uptime function 95 | # 96 | # Default: 'on' 97 | # Values: 'on', 'tiny', 'off' 98 | # Flag: --uptime_shorthand 99 | # 100 | # Example: 101 | # on: '2 days, 10 hours, 3 mins' 102 | # tiny: '2d 10h 3m' 103 | # off: '2 days, 10 hours, 3 minutes' 104 | uptime_shorthand="on" 105 | 106 | 107 | # Memory 108 | 109 | 110 | # Show memory pecentage in output. 111 | # 112 | # Default: 'off' 113 | # Values: 'on', 'off' 114 | # Flag: --memory_percent 115 | # 116 | # Example: 117 | # on: '1801MiB / 7881MiB (22%)' 118 | # off: '1801MiB / 7881MiB' 119 | memory_percent="off" 120 | 121 | # Change memory output unit. 122 | # 123 | # Default: 'mib' 124 | # Values: 'kib', 'mib', 'gib' 125 | # Flag: --memory_unit 126 | # 127 | # Example: 128 | # kib '1020928KiB / 7117824KiB' 129 | # mib '1042MiB / 6951MiB' 130 | # gib: ' 0.98GiB / 6.79GiB' 131 | memory_unit="mib" 132 | 133 | 134 | # Packages 135 | 136 | 137 | # Show/Hide Package Manager names. 138 | # 139 | # Default: 'tiny' 140 | # Values: 'on', 'tiny' 'off' 141 | # Flag: --package_managers 142 | # 143 | # Example: 144 | # on: '998 (pacman), 8 (flatpak), 4 (snap)' 145 | # tiny: '908 (pacman, flatpak, snap)' 146 | # off: '908' 147 | package_managers="on" 148 | 149 | 150 | # Shell 151 | 152 | 153 | # Show the path to $SHELL 154 | # 155 | # Default: 'off' 156 | # Values: 'on', 'off' 157 | # Flag: --shell_path 158 | # 159 | # Example: 160 | # on: '/bin/bash' 161 | # off: 'bash' 162 | shell_path="off" 163 | 164 | # Show $SHELL version 165 | # 166 | # Default: 'on' 167 | # Values: 'on', 'off' 168 | # Flag: --shell_version 169 | # 170 | # Example: 171 | # on: 'bash 4.4.5' 172 | # off: 'bash' 173 | shell_version="on" 174 | 175 | 176 | # CPU 177 | 178 | 179 | # CPU speed type 180 | # 181 | # Default: 'bios_limit' 182 | # Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. 183 | # Flag: --speed_type 184 | # Supports: Linux with 'cpufreq' 185 | # NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. 186 | speed_type="bios_limit" 187 | 188 | # CPU speed shorthand 189 | # 190 | # Default: 'off' 191 | # Values: 'on', 'off'. 192 | # Flag: --speed_shorthand 193 | # NOTE: This flag is not supported in systems with CPU speed less than 1 GHz 194 | # 195 | # Example: 196 | # on: 'i7-6500U (4) @ 3.1GHz' 197 | # off: 'i7-6500U (4) @ 3.100GHz' 198 | speed_shorthand="off" 199 | 200 | # Enable/Disable CPU brand in output. 201 | # 202 | # Default: 'on' 203 | # Values: 'on', 'off' 204 | # Flag: --cpu_brand 205 | # 206 | # Example: 207 | # on: 'Intel i7-6500U' 208 | # off: 'i7-6500U (4)' 209 | cpu_brand="on" 210 | 211 | # CPU Speed 212 | # Hide/Show CPU speed. 213 | # 214 | # Default: 'on' 215 | # Values: 'on', 'off' 216 | # Flag: --cpu_speed 217 | # 218 | # Example: 219 | # on: 'Intel i7-6500U (4) @ 3.1GHz' 220 | # off: 'Intel i7-6500U (4)' 221 | cpu_speed="on" 222 | 223 | # CPU Cores 224 | # Display CPU cores in output 225 | # 226 | # Default: 'logical' 227 | # Values: 'logical', 'physical', 'off' 228 | # Flag: --cpu_cores 229 | # Support: 'physical' doesn't work on BSD. 230 | # 231 | # Example: 232 | # logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores) 233 | # physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores) 234 | # off: 'Intel i7-6500U @ 3.1GHz' 235 | cpu_cores="logical" 236 | 237 | # CPU Temperature 238 | # Hide/Show CPU temperature. 239 | # Note the temperature is added to the regular CPU function. 240 | # 241 | # Default: 'off' 242 | # Values: 'C', 'F', 'off' 243 | # Flag: --cpu_temp 244 | # Supports: Linux, BSD 245 | # NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable 246 | # coretemp kernel module. This only supports newer Intel processors. 247 | # 248 | # Example: 249 | # C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]' 250 | # F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]' 251 | # off: 'Intel i7-6500U (4) @ 3.1GHz' 252 | cpu_temp="off" 253 | 254 | 255 | # GPU 256 | 257 | 258 | # Enable/Disable GPU Brand 259 | # 260 | # Default: 'on' 261 | # Values: 'on', 'off' 262 | # Flag: --gpu_brand 263 | # 264 | # Example: 265 | # on: 'AMD HD 7950' 266 | # off: 'HD 7950' 267 | gpu_brand="on" 268 | 269 | # Which GPU to display 270 | # 271 | # Default: 'all' 272 | # Values: 'all', 'dedicated', 'integrated' 273 | # Flag: --gpu_type 274 | # Supports: Linux 275 | # 276 | # Example: 277 | # all: 278 | # GPU1: AMD HD 7950 279 | # GPU2: Intel Integrated Graphics 280 | # 281 | # dedicated: 282 | # GPU1: AMD HD 7950 283 | # 284 | # integrated: 285 | # GPU1: Intel Integrated Graphics 286 | gpu_type="all" 287 | 288 | 289 | # Resolution 290 | 291 | 292 | # Display refresh rate next to each monitor 293 | # Default: 'off' 294 | # Values: 'on', 'off' 295 | # Flag: --refresh_rate 296 | # Supports: Doesn't work on Windows. 297 | # 298 | # Example: 299 | # on: '1920x1080 @ 60Hz' 300 | # off: '1920x1080' 301 | refresh_rate="off" 302 | 303 | 304 | # Gtk Theme / Icons / Font 305 | 306 | 307 | # Shorten output of GTK Theme / Icons / Font 308 | # 309 | # Default: 'off' 310 | # Values: 'on', 'off' 311 | # Flag: --gtk_shorthand 312 | # 313 | # Example: 314 | # on: 'Numix, Adwaita' 315 | # off: 'Numix [GTK2], Adwaita [GTK3]' 316 | gtk_shorthand="off" 317 | 318 | 319 | # Enable/Disable gtk2 Theme / Icons / Font 320 | # 321 | # Default: 'on' 322 | # Values: 'on', 'off' 323 | # Flag: --gtk2 324 | # 325 | # Example: 326 | # on: 'Numix [GTK2], Adwaita [GTK3]' 327 | # off: 'Adwaita [GTK3]' 328 | gtk2="on" 329 | 330 | # Enable/Disable gtk3 Theme / Icons / Font 331 | # 332 | # Default: 'on' 333 | # Values: 'on', 'off' 334 | # Flag: --gtk3 335 | # 336 | # Example: 337 | # on: 'Numix [GTK2], Adwaita [GTK3]' 338 | # off: 'Numix [GTK2]' 339 | gtk3="on" 340 | 341 | 342 | # IP Address 343 | 344 | 345 | # Website to ping for the public IP 346 | # 347 | # Default: 'http://ident.me' 348 | # Values: 'url' 349 | # Flag: --ip_host 350 | public_ip_host="http://ident.me" 351 | 352 | # Public IP timeout. 353 | # 354 | # Default: '2' 355 | # Values: 'int' 356 | # Flag: --ip_timeout 357 | public_ip_timeout=2 358 | 359 | 360 | # Desktop Environment 361 | 362 | 363 | # Show Desktop Environment version 364 | # 365 | # Default: 'on' 366 | # Values: 'on', 'off' 367 | # Flag: --de_version 368 | de_version="on" 369 | 370 | 371 | # Disk 372 | 373 | 374 | # Which disks to display. 375 | # The values can be any /dev/sdXX, mount point or directory. 376 | # NOTE: By default we only show the disk info for '/'. 377 | # 378 | # Default: '/' 379 | # Values: '/', '/dev/sdXX', '/path/to/drive'. 380 | # Flag: --disk_show 381 | # 382 | # Example: 383 | # disk_show=('/' '/dev/sdb1'): 384 | # 'Disk (/): 74G / 118G (66%)' 385 | # 'Disk (/mnt/Videos): 823G / 893G (93%)' 386 | # 387 | # disk_show=('/'): 388 | # 'Disk (/): 74G / 118G (66%)' 389 | # 390 | disk_show=('/') 391 | 392 | # Disk subtitle. 393 | # What to append to the Disk subtitle. 394 | # 395 | # Default: 'mount' 396 | # Values: 'mount', 'name', 'dir', 'none' 397 | # Flag: --disk_subtitle 398 | # 399 | # Example: 400 | # name: 'Disk (/dev/sda1): 74G / 118G (66%)' 401 | # 'Disk (/dev/sdb2): 74G / 118G (66%)' 402 | # 403 | # mount: 'Disk (/): 74G / 118G (66%)' 404 | # 'Disk (/mnt/Local Disk): 74G / 118G (66%)' 405 | # 'Disk (/mnt/Videos): 74G / 118G (66%)' 406 | # 407 | # dir: 'Disk (/): 74G / 118G (66%)' 408 | # 'Disk (Local Disk): 74G / 118G (66%)' 409 | # 'Disk (Videos): 74G / 118G (66%)' 410 | # 411 | # none: 'Disk: 74G / 118G (66%)' 412 | # 'Disk: 74G / 118G (66%)' 413 | # 'Disk: 74G / 118G (66%)' 414 | disk_subtitle="mount" 415 | 416 | # Disk percent. 417 | # Show/Hide disk percent. 418 | # 419 | # Default: 'on' 420 | # Values: 'on', 'off' 421 | # Flag: --disk_percent 422 | # 423 | # Example: 424 | # on: 'Disk (/): 74G / 118G (66%)' 425 | # off: 'Disk (/): 74G / 118G' 426 | disk_percent="on" 427 | 428 | 429 | # Song 430 | 431 | 432 | # Manually specify a music player. 433 | # 434 | # Default: 'auto' 435 | # Values: 'auto', 'player-name' 436 | # Flag: --music_player 437 | # 438 | # Available values for 'player-name': 439 | # 440 | # amarok 441 | # audacious 442 | # banshee 443 | # bluemindo 444 | # clementine 445 | # cmus 446 | # deadbeef 447 | # deepin-music 448 | # dragon 449 | # elisa 450 | # exaile 451 | # gnome-music 452 | # gmusicbrowser 453 | # gogglesmm 454 | # guayadeque 455 | # io.elementary.music 456 | # iTunes 457 | # juk 458 | # lollypop 459 | # mocp 460 | # mopidy 461 | # mpd 462 | # muine 463 | # netease-cloud-music 464 | # olivia 465 | # playerctl 466 | # pogo 467 | # pragha 468 | # qmmp 469 | # quodlibet 470 | # rhythmbox 471 | # sayonara 472 | # smplayer 473 | # spotify 474 | # strawberry 475 | # tauonmb 476 | # tomahawk 477 | # vlc 478 | # xmms2d 479 | # xnoise 480 | # yarock 481 | music_player="auto" 482 | 483 | # Format to display song information. 484 | # 485 | # Default: '%artist% - %album% - %title%' 486 | # Values: '%artist%', '%album%', '%title%' 487 | # Flag: --song_format 488 | # 489 | # Example: 490 | # default: 'Song: Jet - Get Born - Sgt Major' 491 | song_format="%artist% - %album% - %title%" 492 | 493 | # Print the Artist, Album and Title on separate lines 494 | # 495 | # Default: 'off' 496 | # Values: 'on', 'off' 497 | # Flag: --song_shorthand 498 | # 499 | # Example: 500 | # on: 'Artist: The Fratellis' 501 | # 'Album: Costello Music' 502 | # 'Song: Chelsea Dagger' 503 | # 504 | # off: 'Song: The Fratellis - Costello Music - Chelsea Dagger' 505 | song_shorthand="off" 506 | 507 | # 'mpc' arguments (specify a host, password etc). 508 | # 509 | # Default: '' 510 | # Example: mpc_args=(-h HOST -P PASSWORD) 511 | mpc_args=() 512 | 513 | 514 | # Text Colors 515 | 516 | 517 | # Text Colors 518 | # 519 | # Default: 'distro' 520 | # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' 521 | # Flag: --colors 522 | # 523 | # Each number represents a different part of the text in 524 | # this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' 525 | # 526 | # Example: 527 | # colors=(distro) - Text is colored based on Distro colors. 528 | # colors=(4 6 1 8 8 6) - Text is colored in the order above. 529 | colors=(distro) 530 | 531 | 532 | # Text Options 533 | 534 | 535 | # Toggle bold text 536 | # 537 | # Default: 'on' 538 | # Values: 'on', 'off' 539 | # Flag: --bold 540 | bold="on" 541 | 542 | # Enable/Disable Underline 543 | # 544 | # Default: 'on' 545 | # Values: 'on', 'off' 546 | # Flag: --underline 547 | underline_enabled="on" 548 | 549 | # Underline character 550 | # 551 | # Default: '-' 552 | # Values: 'string' 553 | # Flag: --underline_char 554 | underline_char="-" 555 | 556 | 557 | # Info Separator 558 | # Replace the default separator with the specified string. 559 | # 560 | # Default: ':' 561 | # Flag: --separator 562 | # 563 | # Example: 564 | # separator="->": 'Shell-> bash' 565 | # separator=" =": 'WM = dwm' 566 | separator=":" 567 | 568 | 569 | # Color Blocks 570 | 571 | 572 | # Color block range 573 | # The range of colors to print. 574 | # 575 | # Default: '0', '15' 576 | # Values: 'num' 577 | # Flag: --block_range 578 | # 579 | # Example: 580 | # 581 | # Display colors 0-7 in the blocks. (8 colors) 582 | # neofetch --block_range 0 7 583 | # 584 | # Display colors 0-15 in the blocks. (16 colors) 585 | # neofetch --block_range 0 15 586 | block_range=(0 15) 587 | 588 | # Toggle color blocks 589 | # 590 | # Default: 'on' 591 | # Values: 'on', 'off' 592 | # Flag: --color_blocks 593 | color_blocks="on" 594 | 595 | # Color block width in spaces 596 | # 597 | # Default: '3' 598 | # Values: 'num' 599 | # Flag: --block_width 600 | block_width=3 601 | 602 | # Color block height in lines 603 | # 604 | # Default: '1' 605 | # Values: 'num' 606 | # Flag: --block_height 607 | block_height=1 608 | 609 | # Color Alignment 610 | # 611 | # Default: 'auto' 612 | # Values: 'auto', 'num' 613 | # Flag: --col_offset 614 | # 615 | # Number specifies how far from the left side of the terminal (in spaces) to 616 | # begin printing the columns, in case you want to e.g. center them under your 617 | # text. 618 | # Example: 619 | # col_offset="auto" - Default behavior of neofetch 620 | # col_offset=7 - Leave 7 spaces then print the colors 621 | col_offset="auto" 622 | 623 | # Progress Bars 624 | 625 | 626 | # Bar characters 627 | # 628 | # Default: '-', '=' 629 | # Values: 'string', 'string' 630 | # Flag: --bar_char 631 | # 632 | # Example: 633 | # neofetch --bar_char 'elapsed' 'total' 634 | # neofetch --bar_char '-' '=' 635 | bar_char_elapsed="-" 636 | bar_char_total="=" 637 | 638 | # Toggle Bar border 639 | # 640 | # Default: 'on' 641 | # Values: 'on', 'off' 642 | # Flag: --bar_border 643 | bar_border="on" 644 | 645 | # Progress bar length in spaces 646 | # Number of chars long to make the progress bars. 647 | # 648 | # Default: '15' 649 | # Values: 'num' 650 | # Flag: --bar_length 651 | bar_length=15 652 | 653 | # Progress bar colors 654 | # When set to distro, uses your distro's logo colors. 655 | # 656 | # Default: 'distro', 'distro' 657 | # Values: 'distro', 'num' 658 | # Flag: --bar_colors 659 | # 660 | # Example: 661 | # neofetch --bar_colors 3 4 662 | # neofetch --bar_colors distro 5 663 | bar_color_elapsed="distro" 664 | bar_color_total="distro" 665 | 666 | 667 | # Info display 668 | # Display a bar with the info. 669 | # 670 | # Default: 'off' 671 | # Values: 'bar', 'infobar', 'barinfo', 'off' 672 | # Flags: --cpu_display 673 | # --memory_display 674 | # --battery_display 675 | # --disk_display 676 | # 677 | # Example: 678 | # bar: '[---=======]' 679 | # infobar: 'info [---=======]' 680 | # barinfo: '[---=======] info' 681 | # off: 'info' 682 | cpu_display="off" 683 | memory_display="off" 684 | battery_display="off" 685 | disk_display="off" 686 | 687 | 688 | # Backend Settings 689 | 690 | 691 | # Image backend. 692 | # 693 | # Default: 'ascii' 694 | # Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', 695 | # 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' 696 | # Flag: --backend 697 | image_backend="ascii" 698 | 699 | # Image Source 700 | # 701 | # Which image or ascii file to display. 702 | # 703 | # Default: 'auto' 704 | # Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' 705 | # 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' 706 | # Flag: --source 707 | # 708 | # NOTE: 'auto' will pick the best image source for whatever image backend is used. 709 | # In ascii mode, distro ascii art will be used and in an image mode, your 710 | # wallpaper will be used. 711 | image_source="auto" 712 | 713 | 714 | # Ascii Options 715 | 716 | 717 | # Ascii distro 718 | # Which distro's ascii art to display. 719 | # 720 | # Default: 'auto' 721 | # Values: 'auto', 'distro_name' 722 | # Flag: --ascii_distro 723 | # NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, "AOSC OS", 724 | # "AOSC OS/Retro", Apricity, ArcoLinux, ArchBox, ARCHlabs, 725 | # ArchStrike, XFerience, ArchMerge, Arch, Artix, Arya, Bedrock, 726 | # Bitrig, BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD, 727 | # BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS, 728 | # Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover, 729 | # Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin, 730 | # DesaOS, Devuan, DracOS, DarkOs, DragonFly, Drauger, Elementary, 731 | # EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD, 732 | # FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo, 733 | # gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra, 734 | # Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion, 735 | # Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite, 736 | # LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva, 737 | # Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib, 738 | # Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner, 739 | # NuTyX, OBRevenge, OpenBSD, openEuler, OpenIndiana, openmamba, 740 | # OpenMandriva, OpenStage, OpenWrt, osmc, Oracle, OS Elbrus, PacBSD, 741 | # Parabola, Pardus, Parrot, Parsix, TrueOS, PCLinuxOS, Peppermint, 742 | # popos, Porteus, PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix, 743 | # Raspbian, Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan, 744 | # Regata, Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific, 745 | # Septor, SereneLinux, SharkLinux, Siduction, Slackware, SliTaz, 746 | # SmartOS, Solus, Source_Mage, Sparky, Star, SteamOS, SunOS, 747 | # openSUSE_Leap, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails, 748 | # Trisquel, Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio, 749 | # Ubuntu, Venom, Void, Obarun, windows10, Windows7, Xubuntu, Zorin, 750 | # and IRIX have ascii logos 751 | # NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants. 752 | # Use '{distro name}_old' to use the old logos. 753 | # NOTE: Ubuntu has flavor variants. 754 | # Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME, 755 | # Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors. 756 | # NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu, 757 | # CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android, 758 | # Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola, 759 | # Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS, 760 | # Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian, 761 | # postmarketOS, and Void have a smaller logo variant. 762 | # Use '{distro name}_small' to use the small variants. 763 | ascii_distro="auto" 764 | 765 | # Ascii Colors 766 | # 767 | # Default: 'distro' 768 | # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' 769 | # Flag: --ascii_colors 770 | # 771 | # Example: 772 | # ascii_colors=(distro) - Ascii is colored based on Distro colors. 773 | # ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. 774 | ascii_colors=(distro) 775 | 776 | # Bold ascii logo 777 | # Whether or not to bold the ascii logo. 778 | # 779 | # Default: 'on' 780 | # Values: 'on', 'off' 781 | # Flag: --ascii_bold 782 | ascii_bold="on" 783 | 784 | 785 | # Image Options 786 | 787 | 788 | # Image loop 789 | # Setting this to on will make neofetch redraw the image constantly until 790 | # Ctrl+C is pressed. This fixes display issues in some terminal emulators. 791 | # 792 | # Default: 'off' 793 | # Values: 'on', 'off' 794 | # Flag: --loop 795 | image_loop="off" 796 | 797 | # Thumbnail directory 798 | # 799 | # Default: '~/.cache/thumbnails/neofetch' 800 | # Values: 'dir' 801 | thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" 802 | 803 | # Crop mode 804 | # 805 | # Default: 'normal' 806 | # Values: 'normal', 'fit', 'fill' 807 | # Flag: --crop_mode 808 | # 809 | # See this wiki page to learn about the fit and fill options. 810 | # https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F 811 | crop_mode="normal" 812 | 813 | # Crop offset 814 | # Note: Only affects 'normal' crop mode. 815 | # 816 | # Default: 'center' 817 | # Values: 'northwest', 'north', 'northeast', 'west', 'center' 818 | # 'east', 'southwest', 'south', 'southeast' 819 | # Flag: --crop_offset 820 | crop_offset="center" 821 | 822 | # Image size 823 | # The image is half the terminal width by default. 824 | # 825 | # Default: 'auto' 826 | # Values: 'auto', '00px', '00%', 'none' 827 | # Flags: --image_size 828 | # --size 829 | image_size="auto" 830 | 831 | # Gap between image and text 832 | # 833 | # Default: '3' 834 | # Values: 'num', '-num' 835 | # Flag: --gap 836 | gap=3 837 | 838 | # Image offsets 839 | # Only works with the w3m backend. 840 | # 841 | # Default: '0' 842 | # Values: 'px' 843 | # Flags: --xoffset 844 | # --yoffset 845 | yoffset=0 846 | xoffset=0 847 | 848 | # Image background color 849 | # Only works with the w3m backend. 850 | # 851 | # Default: '' 852 | # Values: 'color', 'blue' 853 | # Flag: --bg_color 854 | background_color= 855 | 856 | 857 | # Misc Options 858 | 859 | # Stdout mode 860 | # Turn off all colors and disables image backend (ASCII/Image). 861 | # Useful for piping into another command. 862 | # Default: 'off' 863 | # Values: 'on', 'off' 864 | stdout="off" 865 | -------------------------------------------------------------------------------- /config/nvim/README.md: -------------------------------------------------------------------------------- 1 | # My NeoVim Config 2 | 3 | > TODO: Walkthrough video 4 | 5 | ## Installation 6 | 7 | Required neovim version `NVIM v0.9+`, if your distro's package repository doesn't provide then have a look at this [reddit comment](https://www.reddit.com/r/neovim/comments/f9661m/comment/fipokxi/?utm_source=share&utm_medium=web2x&context=3). 8 | 9 | After Installation check the version by running `nvim --version` 10 | 11 | Create a repos dir in home dir and cd into it 12 | ```sh 13 | mkdir ~/repos && cd ~/repos 14 | ``` 15 | 16 | Clone my linux config repo 17 | ```sh 18 | git clone https://github.com/anurag3301/my-linux-setup.git 19 | ``` 20 | 21 | Create a symbolic link of my neovim config dir to your ~/.config/nvim 22 | ```sh 23 | ln -s $HOME/repos/my-linux-setup/config/nvim $HOME/.config/nvim 24 | ``` 25 | 26 | Open neovim, you should get some errors, just press enter key and run `:PackerInstall` followed by `:PackerSync`. This will install all the plugins. 27 | 28 | Install the Required LSP servers using `:Mason`, if that doesnt work then install them manually as follow 29 | 30 | https://github.com/anurag3301/my-linux-setup/blob/4d9e1daf2fe8875517b3cadb874c237b55769d11/config/nvim/lua/plug_config/lsp_config/lsp-config.lua#L1-L7 31 | 32 | To get the latest changed you just have to do `cd ~/repos/my-linux-setup && git pull`. This will pull the latest commits and its a symbolic link to `~/.config`, so the changes will reflect there also. 33 | 34 | #### Go Through all the configs and understand it and make changes as per your needs. 35 | -------------------------------------------------------------------------------- /config/nvim/ftplugin/java.lua: -------------------------------------------------------------------------------- 1 | local workspace_dir = vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t') 2 | 3 | local config = { 4 | cmd = { 5 | 6 | 'java', 7 | '-Declipse.application=org.eclipse.jdt.ls.core.id1', 8 | '-Dosgi.bundles.defaultStartLevel=4', 9 | '-Declipse.product=org.eclipse.jdt.ls.core.product', 10 | '-Dlog.protocol=true', 11 | '-Dlog.level=ALL', 12 | '-Xms1g', 13 | '--add-modules=ALL-SYSTEM', 14 | '--add-opens', 'java.base/java.util=ALL-UNNAMED', 15 | '--add-opens', 'java.base/java.lang=ALL-UNNAMED', 16 | 17 | '-jar', '/home/anurag/.program/jdtls/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar', 18 | '-configuration', '/home/anurag/.program/jdtls/config_linux', 19 | '-data', vim.fn.expand('~/.cache/jdtls-workspace') .. workspace_dir 20 | }, 21 | root_dir = require('jdtls.setup').find_root({'.git', 'mvnw', 'gradlew'}), 22 | settings = { 23 | java = { 24 | project = { 25 | referencedLibraries = { 26 | '/usr/share/java/gson-2.2.2.jar', 27 | }, 28 | } 29 | } 30 | }, 31 | init_options = { 32 | bundles = {} 33 | }, 34 | capabilities = capabilities 35 | } 36 | 37 | 38 | require('jdtls').start_or_attach(config) 39 | -------------------------------------------------------------------------------- /config/nvim/init.lua: -------------------------------------------------------------------------------- 1 | -- insures lazy is installed 2 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 3 | if not (vim.uv or vim.loop).fs_stat(lazypath) then 4 | vim.fn.system({ 5 | "git", 6 | "clone", 7 | "--filter=blob:none", 8 | "https://github.com/folke/lazy.nvim.git", 9 | "--branch=stable", -- latest stable release 10 | lazypath, 11 | }) 12 | end 13 | vim.opt.rtp:prepend(lazypath) 14 | 15 | vim.g.neorg_root = os.getenv( 'HOME' ).."/notes" 16 | 17 | -- include plugins and their config 18 | require('plugins') 19 | require('plug_config.treesitter') 20 | require('plug_config.autopairs') 21 | require('plug_config.colour') 22 | require('plug_config.toggleTerm') 23 | require('plug_config.presence') 24 | require('plug_config.lualine') 25 | require('plug_config.colorizer') 26 | require('plug_config.toggle_lsp_diagnostics') 27 | require('plug_config.lsp_config.lsp-cmp') 28 | require('plug_config.lsp_config.lsp-config') 29 | require('plug_config.lsp_config.mason') 30 | require('plug_config.lsp_config.lsp-signature') 31 | require('plug_config.lsp_config.goto-preview') 32 | require('plug_config.lazygit') 33 | require('plug_config.comment') 34 | require('plug_config.bufferline') 35 | require('plug_config.hop') 36 | require('plug_config.gitsigns') 37 | require('plug_config.autosave') 38 | require('plug_config.startup') 39 | require('plug_config.nvim-tree') 40 | require('plug_config.telescope') 41 | require('plug_config.illuminate') 42 | require('plug_config.dap') 43 | require('plug_config.neorg') 44 | require('pretty-fold').setup() 45 | 46 | require('general') 47 | require('functions') 48 | require('bindings') 49 | require('commands') 50 | require('runner') 51 | 52 | 53 | -- CpHelper config 54 | vim.g["cph#dir"] = os.getenv( 'HOME' )..'/problems' 55 | vim.cmd("autocmd FileType Results setlocal foldlevel=5") 56 | -- Rooter config 57 | vim.g.rooter_pattern = { 'input1', 'output1' } 58 | 59 | -- Emmet configuration 60 | vim.api.nvim_set_keymap('', '', '', { noremap = true, silent = true }) 61 | vim.g.mapleader = '' 62 | vim.g.maplocalleader = ' ' 63 | vim.g.user_emmet_leader_key=',' 64 | 65 | -------------------------------------------------------------------------------- /config/nvim/lua/bindings.lua: -------------------------------------------------------------------------------- 1 | keymap = vim.keymap.set 2 | 3 | -- Telescope 4 | keymap('n', 'f', _find_files) 5 | keymap('n', 'o', ' Telescope oldfiles ') 6 | keymap('n', 's', ' Telescope live_grep ') 7 | 8 | -- Fold bindings 9 | keymap('n', 'zo', 'zO') 10 | keymap('n', 'zc', 'zC') 11 | keymap('n', 'zz', ' set foldlevel=0 ') 12 | keymap('n', 'z',' set foldlevel=99 ') 13 | 14 | -- Bufferline bindings 15 | keymap('n', 'f', ' BufferLinePick ') 16 | keymap('n', 'F', ' BufferLinePickClose ') 17 | keymap('n', '', ' BufferLineCycleNext ') 18 | keymap('n', '', ' BufferLineCyclePrev ') 19 | keymap('n', 'm.', ' BufferLineMoveNext ') 20 | keymap('n', 'm,', ' BufferLineMovePrev ') 21 | 22 | -- Hope bindings 23 | keymap('n', ';j', ' HopWord ') 24 | keymap('n', ';l', ' HopLineStart ') 25 | 26 | -- LSP Diagnostics Toggle bindings 27 | keymap('n', 'dd', ' ToggleDiag ') 28 | keymap('n', 'du', '(toggle-lsp-diag-underline)') 29 | keymap('n', 'ds', '(toggle-lsp-diag-signs)') 30 | keymap('n', 'dv', '(toggle-lsp-diag-vtext)') 31 | keymap('n', 'di', '(toggle-lsp-diag-update_in_insert)') 32 | 33 | -- CPHelper bindings 34 | keymap('n', 'c', ' CphReceive ') 35 | keymap('n', 't', ' CphTest ') 36 | for i = 1, 9, 1 do 37 | keymap('n', string.format('e%d', i), 38 | string.format(' CphEdit %d ', i)) 39 | end 40 | 41 | -- Binding for code runner 42 | keymap('n', '', ' Run ') 43 | 44 | -- Other bindings nvimtree, markdown preview, Neoformat, Colorizer, LazyGit 45 | keymap('n', '', ' NvimTreeToggle ') 46 | keymap('n', 'md', ' MarkdownPreviewToggle ') 47 | keymap('n', 'p', ' Neoformat ') 48 | keymap('n', 'cc', ' ColorizerToggle ') 49 | keymap('n', 'gg', ' LazyGit ') 50 | keymap('n', 'n', ' enew ') 51 | keymap('n', '', ' noh ') 52 | keymap('n', '[[', ' vertical resize +7 ') 53 | keymap('n', ']]', ' vertical resize -7 ') 54 | keymap('n', '+', ' resize +1 ') 55 | keymap('n', '-', ' resize -1 ') 56 | keymap('n', 'nc', config_nvim) 57 | 58 | 59 | -- goto-preview bindings 60 | keymap('n', 'gd', 'lua require("goto-preview").goto_preview_definition()') 61 | keymap('n', 'gt', 'lua require("goto-preview").goto_preview_type_definition()') 62 | keymap('n', 'gi', 'lua require("goto-preview").goto_preview_implementation()') 63 | keymap('n', 'gD', 'lua require("goto-preview").goto_preview_declaration()') 64 | keymap('n', '`', 'lua require("goto-preview").close_all_win()') 65 | keymap('n', 'gr', 'lua require("goto-preview").goto_preview_references()') 66 | 67 | 68 | -- LSP bindings 69 | keymap('n', 'ggD', ' lua vim.lsp.buf.declaration() ') 70 | keymap('n', 'ggd', ' lua vim.lsp.buf.definition() ') 71 | keymap('n', 'K', ' lua vim.lsp.buf.hover() ') 72 | keymap('n', 'ggi', ' lua vim.lsp.buf.implementation() ') 73 | keymap('n', 'wa', ' lua vim.lsp.buf.add_workspace_folder() ') 74 | keymap('n', 'wr', ' lua vim.lsp.buf.remove_workspace_folder() ') 75 | keymap('n', 'wl', ' lua print(vim.inspect(vim.lsp.buf.list_workspace_folders())) ') 76 | keymap('n', 'D', ' lua vim.lsp.buf.type_definition() ') 77 | keymap('n', 'rn', ' lua vim.lsp.buf.rename() ') 78 | keymap('n', 'ca', ' lua vim.lsp.buf.code_action() ') 79 | keymap('n', 'ggr', ' lua vim.lsp.buf.references() ') 80 | keymap('n', 'e', ' lua vim.diagnostic.open_float() ') 81 | keymap('n', 'q', ' lua vim.diagnostic.setloclist() ') 82 | keymap('n', 'f', ' lua vim.lsp.buf.formatting() ') 83 | keymap('n', '', ' lua vim.lsp.buf.signature_help() ') 84 | keymap('n', '', ' lua vim.diagnostic.goto_prev() ') 85 | keymap('n', '', ' lua vim.diagnostic.goto_next() ') 86 | 87 | keymap('n', '', function() require('dap').toggle_breakpoint() end) 88 | keymap('n', '', function() dap_toggle() end) 89 | 90 | -- Binding to swtich to normal mode in terminal, press two times 91 | vim.cmd(':tnoremap ') 92 | 93 | 94 | -- Extras 95 | -- Check plug_config/gitsigns.lua 96 | -------------------------------------------------------------------------------- /config/nvim/lua/commands.lua: -------------------------------------------------------------------------------- 1 | 2 | local commands_table = { 3 | ['Tff'] = 'find_files', 4 | ['Tof'] = 'oldfiles', 5 | ['Tlg'] = 'live_grep', 6 | ['Tsh'] = 'search_history', 7 | ['Tqf'] = 'quickfix', 8 | ['Tvo'] = 'vim_options', 9 | ['Tss'] = 'spell_suggest', 10 | ['Treg'] = 'registers', 11 | ['Tcmd'] = 'commands', 12 | ['Thlp'] = 'help_tags', 13 | ['Tman'] = 'man_pages', 14 | ['Tkey'] = 'keymaps', 15 | ['Tcol'] = 'colorscheme', 16 | ['Tacmd'] = 'autocommands', 17 | ['Tgstr'] = 'grep_string', 18 | 19 | ['Tlrf'] = 'lsp_references', 20 | ['Tlds'] = 'lsp_document_symbols', 21 | ['Tlws'] = 'lsp_workspace_symbols', 22 | ['Tlca'] = 'lsp_code_actions', 23 | ['Tltd'] = 'lsp_type_definitions', 24 | ['Tld'] = 'diagnostics', 25 | ['Tli'] = 'lsp_implementations', 26 | ['Tld'] = 'lsp_definitions', 27 | 28 | ['Tgc'] = 'git_commits', 29 | ['Tgb'] = 'git_branches', 30 | ['Tgs'] = 'git_status', 31 | ['Tgf'] = 'git_files', 32 | 33 | } 34 | 35 | for command, action in pairs(commands_table) do 36 | vim.cmd('command! ' .. command .. ' :Telescope '.. action) 37 | end 38 | 39 | vim.cmd('command! Run :lua run_code()') 40 | vim.cmd('command! Debug :lua debug_code()') 41 | 42 | vim.cmd('command! -nargs=* RunUpdate :lua update_command_table("run", \'\')') 43 | vim.cmd('command! -nargs=* DebugUpdate :lua update_command_table("debug", \'\')') 44 | 45 | vim.cmd('command CD cd %:p:h') 46 | 47 | vim.cmd('command -nargs=1 CreateNeorgWorkspace :lua createNeorgWorkspace()') 48 | -------------------------------------------------------------------------------- /config/nvim/lua/functions.lua: -------------------------------------------------------------------------------- 1 | -- Telescope bindings 2 | function _find_files() 3 | local is_git = os.execute("git status &>/dev/null") 4 | if (is_git == 0) then 5 | vim.cmd(":Telescope git_files") 6 | else 7 | vim.cmd(":Telescope find_files") 8 | end 9 | end 10 | 11 | -- Function to jump to neovim config 12 | function config_nvim() 13 | local config_path = vim.fn.stdpath('config') 14 | vim.cmd('cd ' .. config_path) 15 | vim.cmd('e init.lua') 16 | -- vim.cmd('NvimTreeOpen') 17 | -- local buffers = vim.api.nvim_list_bufs() 18 | -- for _, buffer in ipairs(buffers) do 19 | -- if vim.api.nvim_buf_is_loaded(buffer) then 20 | -- local filename = vim.api.nvim_buf_get_name(buffer) 21 | -- if #filename ~= 0 and not string.find(filename, 'NvimTree') then 22 | -- print(#filename, filename, buffer) 23 | -- vim.api.nvim_set_current_win(buffer) 24 | -- return 25 | -- end 26 | -- end 27 | -- end 28 | end 29 | 30 | 31 | local Job = require "plenary.job" 32 | function createNeorgWorkspace(workspace_name) 33 | local workspace_path = vim.g.neorg_root.."/"..workspace_name 34 | local mkdir_job = Job:new { 35 | command = "mkdir", 36 | args = {"-p", workspace_path}, 37 | on_stderr = function(_, line) 38 | print(line) 39 | end, 40 | } 41 | mkdir_job:sync() 42 | print("Successfully created Neorg workspace "..workspace_name.." at "..vim.g.neorg_root) 43 | end 44 | -------------------------------------------------------------------------------- /config/nvim/lua/general.lua: -------------------------------------------------------------------------------- 1 | -- General config 2 | vim.opt['number'] = true 3 | vim.opt['ruler'] = true 4 | vim.opt['splitright'] = true 5 | vim.opt['splitbelow'] = true 6 | vim.opt['smarttab'] = true 7 | vim.opt['expandtab'] = true 8 | vim.opt['smartindent'] = true 9 | vim.opt['autoindent'] = true 10 | vim.opt['tabstop'] = 4 11 | vim.opt['shiftwidth'] = 4 12 | vim.opt['autoread'] = true 13 | vim.opt['title'] = true 14 | vim.opt['termguicolors'] = true 15 | vim.opt['hlsearch'] = true 16 | vim.opt['hidden'] = true 17 | vim.opt['encoding'] = 'utf-8' 18 | vim.opt['fileencoding'] = 'utf-8' 19 | vim.opt['showmode'] = false 20 | vim.opt['clipboard'] = 'unnamedplus' 21 | vim.opt['swapfile'] = false 22 | vim.opt['laststatus'] = 3 23 | vim.opt['mouse'] = 'c' 24 | vim.opt['foldmethod'] = 'expr' 25 | vim.opt['foldexpr'] = 'nvim_treesitter#foldexpr()' 26 | vim.opt['foldlevel'] = 99 27 | 28 | -- Persistent undo 29 | -- mkdir $HOME/.vim/undo 30 | vim.opt['undofile'] = true 31 | vim.opt['undodir'] = os.getenv( 'HOME' )..'/.cache/nvim/undo' 32 | vim.opt['undolevels'] = 1000 33 | vim.opt['undoreload'] = 10000 34 | 35 | -- Stop comments on newline 36 | vim.cmd('autocmd BufWinEnter * :set formatoptions-=c formatoptions-=r formatoptions-=o') 37 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/autopairs.lua: -------------------------------------------------------------------------------- 1 | -- include nvim-autopairs 2 | require('nvim-autopairs').setup{} 3 | 4 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/autosave.lua: -------------------------------------------------------------------------------- 1 | local autosave = require('auto-save') 2 | 3 | autosave.setup{ 4 | enabled = true, 5 | execution_message = { 6 | message = function() 7 | return ("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S")) 8 | end, 9 | dim = 0.18, 10 | cleaning_interval = 1250, 11 | }, 12 | trigger_events = {"InsertLeave", "TextChanged"}, 13 | condition = function(buf) 14 | local fn = vim.fn 15 | local utils = require("auto-save.utils.data") 16 | 17 | if 18 | fn.getbufvar(buf, "&modifiable") == 1 and 19 | utils.not_in(fn.getbufvar(buf, "&filetype"), {}) then 20 | return true 21 | end 22 | return false 23 | end, 24 | write_all_buffers = false, 25 | debounce_delay = 135, 26 | callbacks = { 27 | enabling = nil, 28 | disabling = nil, 29 | before_asserting_save = nil, 30 | before_saving = nil, 31 | after_saving = nil 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/bufferline.lua: -------------------------------------------------------------------------------- 1 | require('bufferline').setup { 2 | options = { 3 | numbers = function(opts) 4 | return string.format('%s.', opts.ordinal) 5 | end, 6 | 7 | indicator = { 8 | icon = '▎', 9 | style = 'icon', 10 | }, 11 | 12 | buffer_close_icon = '', 13 | modified_icon = '●', 14 | close_icon = '', 15 | left_trunc_marker = '', 16 | right_trunc_marker = '', 17 | max_name_length = 18, 18 | max_prefix_length = 15, -- prefix used when a buffer is de-duplicated 19 | tab_size = 18, 20 | diagnostics = 'nvim_lsp', 21 | diagnostics_update_in_insert = false, 22 | 23 | diagnostics_indicator = function(count, level, diagnostics_dict, context) 24 | return '('..count..')' 25 | end, 26 | 27 | offsets = { { filetype = 'NvimTree', text_align = 'left' } }, 28 | show_buffer_icons = true, 29 | show_buffer_close_icons = false, 30 | show_close_icon = false, 31 | show_tab_indicators = true, 32 | persist_buffer_sort = true, 33 | enforce_regular_tabs = false, 34 | always_show_bufferline = true, 35 | sort_by = 'id', 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/colorizer.lua: -------------------------------------------------------------------------------- 1 | require'colorizer'.setup() 2 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/colour.lua: -------------------------------------------------------------------------------- 1 | -- Material Theme config 2 | vim.g.material_style = 'deep ocean' 3 | 4 | require('material').setup({ 5 | 6 | contrast = { 7 | terminal = false, 8 | sidebars = true, 9 | floating_windows = true, 10 | cursor_line = false, 11 | non_current_windows = false, 12 | filetypes = { 13 | 'terminal', 14 | 'packer', 15 | 'qf', 16 | 'toggleterm' 17 | }, 18 | }, 19 | 20 | styles = { 21 | comments = { italic = true }, 22 | strings = {}, 23 | keywords = {}, 24 | functions = { italic = true }, 25 | variables = {}, 26 | operators = {}, 27 | types = { bold = true }, 28 | }, 29 | 30 | plugins = { 31 | "dap", 32 | "gitsigns", 33 | "hop", 34 | "neorg", 35 | "nvim-cmp", 36 | "nvim-tree", 37 | "telescope", 38 | "nvim-web-devicons", 39 | "illuminate", 40 | }, 41 | 42 | disable = { 43 | colored_cursor = false, 44 | borders = false, 45 | background = false, 46 | term_colors = false, 47 | eob_lines = false 48 | }, 49 | 50 | high_visibility = { 51 | lighter = false, 52 | darker = false 53 | }, 54 | 55 | lualine_style = "default", 56 | 57 | async_loading = true, 58 | 59 | custom_colors = nil, 60 | 61 | custom_highlights = {}, 62 | }) 63 | 64 | vim.cmd 'colorscheme material' 65 | 66 | vim.cmd("highlight WinSeparator guifg=#c0bfbc") 67 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/comment.lua: -------------------------------------------------------------------------------- 1 | require('nvim_comment').setup({ 2 | comment_empty = false, 3 | marker_padding = true, 4 | create_mappings = true, 5 | line_mapping = 'gcc', 6 | operator_mapping = 'gc', 7 | hook = nil 8 | }) 9 | 10 | vim.cmd([[ 11 | autocmd BufEnter *.cpp,*.h :lua vim.api.nvim_buf_set_option(0, "commentstring", "// %s") 12 | autocmd BufFilePost *.cpp,*.h :lua vim.api.nvim_buf_set_option(0, "commentstring", "// %s") 13 | ]]) 14 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/dap.lua: -------------------------------------------------------------------------------- 1 | local handel = io.popen("which python") 2 | local python_path = handel:read("*a") 3 | python_path = string.gsub(python_path, "\n", "") 4 | require('dap-python').setup(python_path) 5 | 6 | require("dap").adapters.lldb = { 7 | type = "executable", 8 | command = "/sbin/lldb-vscode", 9 | name = "lldb", 10 | } 11 | 12 | require("dapui").setup() 13 | require("nvim-dap-virtual-text").setup() 14 | 15 | dap_program = nil 16 | dap_args = nil 17 | 18 | local lldb = { 19 | name = "Launch lldb", 20 | type = "lldb", 21 | request = "launch", 22 | program = nil, 23 | cwd = "${workspaceFolder}", 24 | stopOnEntry = false, 25 | args = nil, 26 | runInTerminal = false, 27 | } 28 | 29 | 30 | function configure_lldb() 31 | dap_program = vim.fn.input( 32 | "Path to executable: ", 33 | vim.fn.getcwd() .. "/", 34 | "file" 35 | ) 36 | 37 | arg_str = vim.fn.input("Enter the args for the program: ") 38 | dap_args = {} 39 | for arg in string.gmatch(arg_str, "[^ ]+") do 40 | table.insert(dap_args, arg) 41 | end 42 | 43 | lldb['program'] = dap_program 44 | lldb['args'] = dap_args 45 | 46 | require('dap').configurations.cpp = {lldb} 47 | require('dap').configurations.c = {lldb} 48 | require('dap').configurations.rust = {lldb} 49 | end 50 | 51 | 52 | dap_running = false 53 | local function dap_start() 54 | print(dap_args) 55 | print(dap_program) 56 | if vim.bo.filetype == 'cpp' or 57 | vim.bo.filetype == 'c' or 58 | vim.bo.filetype == 'rust' and 59 | dap_args == nil and 60 | dap_program == nil 61 | then 62 | configure_lldb() 63 | end 64 | print(dap_args) 65 | print(dap_program) 66 | 67 | require('dap').continue() 68 | require('dapui').open() 69 | vim.opt['mouse'] = 'a' 70 | require'nvim-dap-virtual-text'.enable() 71 | dap_running = true 72 | end 73 | 74 | 75 | local function dap_exit() 76 | vim.opt['mouse'] = 'c' 77 | require('dap').close() 78 | require('dapui').close() 79 | require'nvim-dap-virtual-text'.disable() 80 | dap_running = false 81 | end 82 | 83 | function dap_toggle() 84 | if dap_running then 85 | dap_exit() 86 | else 87 | dap_start() 88 | end 89 | end 90 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/gitsigns.lua: -------------------------------------------------------------------------------- 1 | require('gitsigns').setup { 2 | signs = { 3 | add = { text = '┃' }, 4 | change = { text = '┃' }, 5 | delete = { text = '_' }, 6 | topdelete = { text = '‾' }, 7 | changedelete = { text = '~' }, 8 | untracked = { text = '┆' }, 9 | }, 10 | signs_staged = { 11 | add = { text = '┃' }, 12 | change = { text = '┃' }, 13 | delete = { text = '_' }, 14 | topdelete = { text = '‾' }, 15 | changedelete = { text = '~' }, 16 | untracked = { text = '┆' }, 17 | }, 18 | signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` 19 | numhl = false, -- Toggle with `:Gitsigns toggle_numhl` 20 | linehl = false, -- Toggle with `:Gitsigns toggle_linehl` 21 | word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` 22 | watch_gitdir = { 23 | interval = 1000, 24 | follow_files = true 25 | }, 26 | attach_to_untracked = true, 27 | current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` 28 | current_line_blame_opts = { 29 | virt_text = true, 30 | virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' 31 | delay = 1000, 32 | ignore_whitespace = false, 33 | }, 34 | current_line_blame_formatter = ', - ', 35 | sign_priority = 6, 36 | update_debounce = 100, 37 | status_formatter = nil, -- Use default 38 | max_file_length = 40000, 39 | preview_config = { 40 | -- Options passed to nvim_open_win 41 | border = 'single', 42 | style = 'minimal', 43 | relative = 'cursor', 44 | row = 0, 45 | col = 1 46 | }, 47 | on_attach = function(bufnr) 48 | local gs = package.loaded.gitsigns 49 | 50 | local function map(mode, l, r, opts) 51 | opts = opts or {} 52 | opts.buffer = bufnr 53 | vim.keymap.set(mode, l, r, opts) 54 | end 55 | 56 | -- Navigation 57 | map('n', ']c', function() 58 | if vim.wo.diff then return ']c' end 59 | vim.schedule(function() gs.next_hunk() end) 60 | return '' 61 | end, {expr=true}) 62 | 63 | map('n', '[c', function() 64 | if vim.wo.diff then return '[c' end 65 | vim.schedule(function() gs.prev_hunk() end) 66 | return '' 67 | end, {expr=true}) 68 | 69 | -- Actions 70 | map({'n', 'v'}, 'hs', ':Gitsigns stage_hunk') 71 | map({'n', 'v'}, 'hr', ':Gitsigns reset_hunk') 72 | map('n', 'hS', gs.stage_buffer) 73 | map('n', 'hu', gs.undo_stage_hunk) 74 | map('n', 'hR', gs.reset_buffer) 75 | map('n', 'hp', gs.preview_hunk) 76 | map('n', 'hb', function() gs.blame_line{full=true} end) 77 | map('n', 'tb', gs.toggle_current_line_blame) 78 | map('n', 'hd', gs.diffthis) 79 | map('n', 'hD', function() gs.diffthis('~') end) 80 | map('n', 'td', gs.toggle_deleted) 81 | 82 | -- Text object 83 | map({'o', 'x'}, 'ih', ':Gitsigns select_hunk') 84 | end 85 | } 86 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/hop.lua: -------------------------------------------------------------------------------- 1 | require'hop'.setup { keys = 'etovxqpdygfblzhckisuran' } 2 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/illuminate.lua: -------------------------------------------------------------------------------- 1 | require('illuminate').configure({ 2 | providers = { 3 | 'lsp', 4 | 'treesitter', 5 | 'regex', 6 | }, 7 | delay = 100, 8 | filetype_overrides = {}, 9 | filetypes_denylist = { 10 | 'dirvish', 11 | 'fugitive', 12 | }, 13 | filetypes_allowlist = {}, 14 | modes_denylist = {}, 15 | modes_allowlist = {}, 16 | providers_regex_syntax_denylist = {}, 17 | providers_regex_syntax_allowlist = {}, 18 | under_cursor = true, 19 | large_file_cutoff = nil, 20 | large_file_overrides = nil, 21 | min_count_to_highlight = 1, 22 | }) 23 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/lazygit.lua: -------------------------------------------------------------------------------- 1 | vim.g.lazygit_floating_window_winblend = 0 2 | vim.g.lazygit_floating_window_scaling_factor = 0.9 3 | vim.g.lazygit_floating_window_border_chars = {'╭', '╮', '╰', '╯'} 4 | vim.g.lazygit_floating_window_use_plenary = 0 5 | vim.g.lazygit_use_neovim_remote = 1 6 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/lsp_config/goto-preview.lua: -------------------------------------------------------------------------------- 1 | -- Plugin Github: https://github.com/rmagatti/goto-preview 2 | 3 | require('goto-preview').setup { 4 | width = 120; 5 | height = 15; 6 | border = {"↖", "─" ,"┐", "│", "┘", "─", "└", "│"}; 7 | default_mappings = false; 8 | debug = false; 9 | opacity = nil; 10 | resizing_mappings = false; 11 | post_open_hook = nil; 12 | post_close_hook = nil; 13 | references = { 14 | telescope = require("telescope.themes").get_dropdown({ hide_preview = false }) 15 | }; 16 | focus_on_open = true; 17 | dismiss_on_move = false; 18 | force_close = true, 19 | bufhidden = "wipe", 20 | stack_floating_preview_windows = true, 21 | preview_window_title = { enable = true, position = "left" }, 22 | } 23 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/lsp_config/lsp-cmp.lua: -------------------------------------------------------------------------------- 1 | 2 | local cmp = require "cmp" 3 | local lspkind = require("lspkind") 4 | local cmp_autopairs = require("nvim-autopairs.completion.cmp") 5 | 6 | cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) 7 | 8 | cmp.setup({ 9 | formatting = { 10 | format = lspkind.cmp_format({ 11 | with_text = true, 12 | maxwidth = 50, 13 | before = function(entry, vim_item) 14 | return vim_item 15 | end 16 | }) 17 | }, 18 | snippet = { 19 | expand = function(args) 20 | vim.fn["vsnip#anonymous"](args.body) 21 | end 22 | }, 23 | mapping = { 24 | [""] = cmp.mapping(cmp.mapping.select_next_item()), 25 | [""] = cmp.mapping(cmp.mapping.scroll_docs(-4), {"i", "c"}), 26 | [""] = cmp.mapping(cmp.mapping.scroll_docs(4), {"i", "c"}), 27 | [""] = cmp.mapping(cmp.mapping.complete(), {"i", "c"}), 28 | [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. 29 | [""] = cmp.mapping( 30 | { 31 | i = cmp.mapping.abort(), 32 | c = cmp.mapping.close() 33 | } 34 | ), 35 | [""] = cmp.mapping.confirm({select = false}) -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. 36 | }, 37 | sources = cmp.config.sources( 38 | { 39 | {name = "nvim_lsp"}, 40 | {name = "vsnip"} 41 | }, 42 | { 43 | {name = "buffer"} 44 | } 45 | ) 46 | }) 47 | 48 | -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). 49 | cmp.setup.cmdline({ '/', '?' }, { 50 | -- mapping = cmp.mapping.preset.cmdline(), 51 | sources = { 52 | { name = 'buffer' } 53 | } 54 | }) 55 | 56 | -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). 57 | cmp.setup.cmdline(':', { 58 | -- mapping = cmp.mapping.preset.cmdline(), 59 | sources = cmp.config.sources({ 60 | { name = 'path' } 61 | }, { 62 | { name = 'cmdline' } 63 | }) 64 | }) 65 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/lsp_config/lsp-config.lua: -------------------------------------------------------------------------------- 1 | -- Try installing the lsp servers using :Mason, if doesnt work do it manually 2 | 3 | 4 | -- Use following commadn to install language server in arch using pacman, paru(AUR) and npm 5 | 6 | -- sudo pacman -S pyright bash-language-server lua-language-server ccls haskell-language-server typescript-language-server 7 | -- paru -S cmake-language-server-git cssmodules-language-server j phpactordtls phpactor 8 | -- npm i -g vscode-langservers-extracted 9 | -- cargo install --git https://github.com/bergercookie/asm-lsp 10 | 11 | -- If you dont use Arch then check the installation process for your distro. 12 | 13 | local nvim_lsp = require('lspconfig') 14 | 15 | local capabilities = vim.lsp.protocol.make_client_capabilities() 16 | capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) 17 | 18 | local servers = {'pyright', 'tsserver', 'hls', 'cmake', 'html', 'cssls', 'rust_analyzer', 'lua_ls', 'bashls', 'marksman', 'phpactor', 'asm_lsp', 'r_language_server', 'kotlin_language_server'} 19 | 20 | for _, lsp in ipairs(servers) do 21 | nvim_lsp[lsp].setup { 22 | on_attach = on_attach, 23 | capabilities = capabilities, 24 | flags = { 25 | debounce_text_changes = 150, 26 | }, 27 | root_dir = function() return vim.loop.cwd() end 28 | } 29 | end 30 | 31 | nvim_lsp['ccls'].setup { 32 | on_attach = on_attach, 33 | capabilities = capabilities, 34 | flags = { 35 | debounce_text_changes = 150, 36 | }, 37 | init_options = { 38 | cache = { 39 | directory = "/tmp/ccls-cache" 40 | } 41 | }, 42 | root_dir = function() return vim.loop.cwd() end 43 | } 44 | 45 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/lsp_config/lsp-signature.lua: -------------------------------------------------------------------------------- 1 | -- Read the docs `:h lsp_signature-contents` 2 | -- Plugin's github: https://github.com/ray-x/lsp_signature.nvim 3 | 4 | local config = { 5 | doc_lines = 0, 6 | hint_enable = false, 7 | shadow_guibg = 'Black', 8 | floating_window_above_cur_line = false, 9 | floating_window_off_y = -2, 10 | } 11 | 12 | require "lsp_signature".setup(config) 13 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/lsp_config/mason.lua: -------------------------------------------------------------------------------- 1 | require("mason").setup() 2 | require("mason-lspconfig").setup {} 3 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/lualine.lua: -------------------------------------------------------------------------------- 1 | require'lualine'.setup { 2 | options = { 3 | icons_enabled = true, 4 | theme = 'material-nvim', 5 | }, 6 | sections = { 7 | lualine_a = {'mode'}, 8 | lualine_b = {'branch', 'diff'}, 9 | lualine_c = {'filename'}, 10 | lualine_x = {'encoding', 'fileformat', 'filetype'}, 11 | lualine_y = { 12 | { 13 | 'diagnostics', 14 | sources = { 'nvim_diagnostic' }, 15 | color_error = '#BF616A', 16 | color_warn = '#EBCB8B', 17 | color_info = '#88C0D0', 18 | color_hint = '#3A4151', 19 | }, 20 | }, 21 | lualine_z = {'location'} 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/neorg.lua: -------------------------------------------------------------------------------- 1 | local scandir = require "plenary.scandir" 2 | 3 | local function getDirName(path) 4 | local components = {} 5 | for component in path:gmatch("([^/]+)") do 6 | table.insert(components, component) 7 | end 8 | 9 | return components[#components] 10 | end 11 | 12 | local workspace_dirs = scandir.scan_dir(vim.g.neorg_root, {add_dirs=true, depth = 1, only_dirs=true}) 13 | local workspace_table = {} 14 | 15 | for key, value in pairs(workspace_dirs) do 16 | workspace_table[getDirName(value)] = value 17 | end 18 | 19 | 20 | require('neorg').setup { 21 | load = { 22 | ["core.defaults"] = {}, -- Loads default behaviour 23 | ["core.concealer"] = {}, -- Adds pretty icons to your documents 24 | ["core.dirman"] = { -- Manages Neorg workspaces 25 | config = { 26 | workspaces = workspace_table, 27 | }, 28 | }, 29 | }, 30 | } 31 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/nvim-tree.lua: -------------------------------------------------------------------------------- 1 | require'nvim-tree'.setup { 2 | disable_netrw = true, 3 | hijack_netrw = true, 4 | open_on_tab = false, 5 | hijack_cursor = false, 6 | update_cwd = false, 7 | diagnostics = { 8 | enable = false, 9 | icons = { 10 | hint = '', 11 | info = '', 12 | warning = '', 13 | error = '', 14 | } 15 | }, 16 | actions = { 17 | open_file = { 18 | quit_on_open = true, 19 | }, 20 | }, 21 | update_focused_file = { 22 | enable = false, 23 | update_cwd = false, 24 | ignore_list = {} 25 | }, 26 | system_open = { 27 | cmd = nil, 28 | args = {} 29 | }, 30 | 31 | view = { 32 | width = 30, 33 | side = 'left', 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/presence.lua: -------------------------------------------------------------------------------- 1 | -- include presence and its config 2 | require('presence'):setup({ 3 | enable_line_number = false, 4 | main_image = 'file', 5 | neovim_image_text = 'Its Neovim buddy!!!', 6 | debounce_timeout = 10, 7 | }) 8 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/startup.lua: -------------------------------------------------------------------------------- 1 | require("startup").setup({ 2 | header = { 3 | type = "text", 4 | align = "center", 5 | margin = 5, 6 | content = { 7 | ' ', 8 | ' ', 9 | ' ', 10 | ' ', 11 | ' ⢀⣀⣤⣤⣤⠤⢤⣤⣤⣤⣤⣄⣀⡀ ⢀⣠⣤⣄⡀ ⣀⣀⣀⣤⣤⣤⣤⣤⣤⣤⣤⣀⡀ ', 12 | ' ⢀⣤⠚⠩⠁⡄ ⠠⣤⠒⠒⣂ ⢈⣨⣭⣿⠛⠶⣦⣤⣄⡀ ⢠⣾⡟⠉⠉⠝⠿⠇ ⢀⣠⡤⠔⠒⣻⠟⠋⠩⠉⢁⣀⡀ ⣶ ⠙⡛⠷ ', 13 | ' ⠸⢟⡠⠒⢊⡤ ⠋⣠ ⠈⣉⣉⣉⣉⣀⣛⣿⡒⠭⡿⢿⣷⣤⣤⣀⣽⣇⣴⠆⣴⡃⢀⣠⣤⠴⣚⣫⡥ ⠒⠛⠁⣀⣉⣉⣙⢏⡉ ⢀⣼⣤⣜⠳⡦⠂ ', 14 | ' ⠐⠚⠫⣤⠖⢣⣤⡕ ⠉⣩⣤⠔ ⠂⣋⣭⣥⣤⠴⠛⣛⠈⢩⣿⠿⠛⢉ ⡐⠞⠫⢍⠙⣓⠢⠴⣥⣍⣙⠛⢓⡢⢤⣬⠉⠅ ⣤⡜⢛⠻⠛⠉⠁ ', 15 | ' ⠘⢔⢎⣡⡔⠂⣠⡿⠁⠒⢛⡻⢛⣩⠅ ⠉ ⠚⣯⣄⢠⣿⢀⣾⠇ ⠓ ⠁⠂⠈⠍⠐⠈⡉⣿⠛⣛⠛⠉⣤⣰⣿⣿⡟⠛⠁ ', 16 | ' ⠙⠛⠐⠚⠋ ⠒⣲⡿⠇⣋ ⢺⡏⠈⣀ ⠉⠈ ⠙⢿⠟⢰⣖⡢ ⠂⠒⠚⠉ ', 17 | ' ⣴⠛⠅⢀⣾⠟⢃ ⢹⠃⠠⠁⠈⠩ ⢠⣿ ⣀⢹⣿⡷ ', 18 | ' ⢿⣤⢚⣫⠅ ⢸⠇ ⢚ ⢀ ⣸⡇ ⠉⣿⣿⠇ ', 19 | ' ⠈⠛⢻⣥⡚⠔⣠⢣⣄⡀ ⢸⡇ ⢘ ⠈ ⠠⠈ ⣀⣰⡿⣧⣄⠾⠋⠁ ', 20 | ' ⠈⠑⠁ ⠘⣿⡀⣈⣀ ⠈ ⠈⠙⠁ ', 21 | ' ⠘⣷⠁ ', 22 | ' ⠙⣤ ', 23 | ' ⠛⠂ ', 24 | ' ' 25 | }, 26 | highlight = "Statement", 27 | }, 28 | 29 | body = { 30 | type = "mapping", 31 | align = "center", 32 | title = "Basic Commands", 33 | margin = 5, 34 | content = { 35 | { " Find File", "Telescope find_files", "f" }, 36 | { " File History", "Telescope oldfiles", "o" }, 37 | { " Find Word", "Telescope live_grep", "s" }, 38 | { " New File", "lua require'startup'.new_file()", "n" }, 39 | { " Lazygit", "LazyGit", "gg" }, 40 | }, 41 | highlight = "String", 42 | }, 43 | 44 | footer = { 45 | type = "text", 46 | align = "center", 47 | title = "Footer", 48 | content = { "Nameste 🙏" }, 49 | highlight = "Number", 50 | }, 51 | 52 | options = { 53 | mapping_keys = true, 54 | cursor_column = 0.5, 55 | empty_lines_between_mappings = true, 56 | disable_statuslines = true, 57 | paddings = { 1, 3, 3, 0 }, 58 | }, 59 | 60 | parts = { "header", "body", "footer" }, 61 | }) 62 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/telescope.lua: -------------------------------------------------------------------------------- 1 | local actions = require('telescope.actions') 2 | 3 | require('telescope').setup({ 4 | defaults = { 5 | file_sorter = require('telescope.sorters').get_fzy_sorter, 6 | prompt_prefix = '  ', 7 | color_devicons = true, 8 | 9 | file_previewer = require('telescope.previewers').vim_buffer_cat.new, 10 | grep_previewer = require('telescope.previewers').vim_buffer_vimgrep.new, 11 | qflist_previewer = require('telescope.previewers').vim_buffer_qflist.new, 12 | 13 | mappings = { 14 | i = { 15 | [''] = false, 16 | [''] = actions.send_to_qflist, 17 | }, 18 | }, 19 | }, 20 | -- extensions = { 21 | -- fzy = { 22 | -- fuzzy = true, 23 | -- override_generic_sorter = false, 24 | -- override_file_sorter = true, 25 | -- case_mode = 'smart_case', 26 | -- }, 27 | -- }, 28 | }) 29 | 30 | -- require('telescope').load_extension('fzf') 31 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/tint.lua: -------------------------------------------------------------------------------- 1 | require("tint").setup({ 2 | tint = -30, 3 | saturation = 0.6, 4 | transforms = require("tint").transforms.SATURATE_TINT, 5 | tint_background_colors = false, 6 | highlight_ignore_patterns = { "WinSeparator", "Status.*" }, 7 | window_ignore_function = function(winid) 8 | local bufid = vim.api.nvim_win_get_buf(winid) 9 | local buftype = vim.api.nvim_buf_get_option(bufid, "buftype") 10 | local floating = vim.api.nvim_win_get_config(winid).relative ~= "" 11 | 12 | return buftype == "terminal" or floating 13 | end 14 | }) 15 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/toggleTerm.lua: -------------------------------------------------------------------------------- 1 | -- include toggleterm 2 | require('toggleterm').setup{ 3 | size = 15, 4 | open_mapping = '', 5 | hide_numbers = true, 6 | shade_filetypes = {}, 7 | shade_terminals = true, 8 | start_in_insert = true, 9 | insert_mappings = true, 10 | persist_size = true, 11 | direction = 'horizontal', 12 | close_on_exit = true, 13 | shell = vim.o.shell, -- change the default shell 14 | highlights = { 15 | Normal = { 16 | guibg = "NormalContrast" 17 | } 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/toggle_lsp_diagnostics.lua: -------------------------------------------------------------------------------- 1 | require'toggle_lsp_diagnostics'.init( 2 | {start_on = false} 3 | ) 4 | -------------------------------------------------------------------------------- /config/nvim/lua/plug_config/treesitter.lua: -------------------------------------------------------------------------------- 1 | -- include treesitter and its config 2 | require('nvim-treesitter.configs').setup{ 3 | 4 | ensure_installed = {'c', 'cpp', 'python', 'lua', 'typescript', 5 | 'regex', 'bash', 'cmake', 'css', 'javascript', 6 | 'html', 'comment', 'java', 'rust', 'go', 'markdown', 7 | 'make', 'json', 'vim'}, 8 | highlight = { 9 | enable = true, 10 | }, 11 | 12 | autotag = { 13 | enable = true, 14 | }, 15 | 16 | refactor = { 17 | smart_rename = { 18 | enable = true, 19 | keymaps = { 20 | smart_rename = 'grr', 21 | }, 22 | }, 23 | }, 24 | } 25 | 26 | 27 | require('nvim-treesitter.parsers').get_parser_configs().asm = { 28 | install_info = { 29 | url = 'https://github.com/rush-rs/tree-sitter-asm.git', 30 | files = { 'src/parser.c' }, 31 | branch = 'main', 32 | }, 33 | } 34 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins.lua: -------------------------------------------------------------------------------- 1 | local plugins = { 2 | { 3 | "neovim/nvim-lspconfig", 4 | 'mfussenegger/nvim-jdtls', 5 | 'onsails/lspkind-nvim', 6 | 'ray-x/lsp_signature.nvim', 7 | 'rmagatti/goto-preview', 8 | 'WhoIsSethDaniel/toggle-lsp-diagnostics.nvim', 9 | "williamboman/mason.nvim", 10 | "williamboman/mason-lspconfig.nvim", 11 | }, 12 | 13 | { 14 | 'hrsh7th/cmp-nvim-lsp', 15 | 'hrsh7th/cmp-buffer', 16 | 'hrsh7th/cmp-path', 17 | 'hrsh7th/nvim-cmp', 18 | 'rafamadriz/friendly-snippets' 19 | }, 20 | 21 | { 22 | 'anuvyklack/pretty-fold.nvim', 23 | 'hrsh7th/vim-vsnip', 24 | 'mattn/emmet-vim', 25 | 'marko-cerovac/material.nvim', 26 | 'andweeb/presence.nvim', 27 | 'RRethy/vim-illuminate', 28 | 'norcalli/nvim-colorizer.lua' 29 | }, 30 | { 31 | "startup-nvim/startup.nvim", 32 | dependencies = { 33 | "nvim-telescope/telescope.nvim", 34 | "nvim-lua/plenary.nvim" 35 | } 36 | }, 37 | 38 | { 39 | 'nvim-treesitter/nvim-treesitter', 40 | 'nvim-treesitter/nvim-treesitter-refactor', 41 | 'rush-rs/tree-sitter-asm', 42 | 'windwp/nvim-autopairs', 43 | 'windwp/nvim-ts-autotag', 44 | }, 45 | 46 | { 47 | 'mfussenegger/nvim-dap', 48 | 'rcarriga/nvim-dap-ui', 49 | 'nvim-neotest/nvim-nio', 50 | 'mfussenegger/nvim-dap-python', 51 | 'theHamsta/nvim-dap-virtual-text', 52 | }, 53 | 54 | 55 | {'akinsho/nvim-toggleterm.lua'}, 56 | {'kdheepak/lazygit.nvim'}, 57 | {'terrortylor/nvim-comment'}, 58 | {'Pocco81/auto-save.nvim'}, 59 | {'lewis6991/gitsigns.nvim'}, 60 | { 61 | "iamcco/markdown-preview.nvim", 62 | cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, 63 | build = "cd app && yarn install", 64 | init = function() 65 | vim.g.mkdp_filetypes = { "markdown" } 66 | end, 67 | ft = { "markdown" }, 68 | }, 69 | 70 | { 71 | "kylechui/nvim-surround", 72 | version = "*", 73 | event = "VeryLazy", 74 | config = function() 75 | require("nvim-surround").setup({}) 76 | end 77 | }, 78 | 79 | {'smoka7/hop.nvim', version = "*", opts = {},}, 80 | {'akinsho/bufferline.nvim', version = "*", dependencies = 'nvim-tree/nvim-web-devicons'}, 81 | {'p00f/cphelper.nvim', dependencies = {'nvim-lua/plenary.nvim', 'ygm2/rooter.nvim',}}, 82 | {'nvim-lualine/lualine.nvim', dependencies = { 'nvim-tree/nvim-web-devicons' }}, 83 | 84 | { 85 | "anurag3301/nvim-platformio.lua", 86 | dependencies = { 87 | { "akinsho/nvim-toggleterm.lua" }, 88 | { "nvim-telescope/telescope.nvim" }, 89 | { "nvim-lua/plenary.nvim" }, 90 | }, 91 | }, 92 | { 93 | "vhyrro/luarocks.nvim", 94 | priority = 1000, 95 | config = true, 96 | }, 97 | { 98 | "nvim-neorg/neorg", 99 | dependencies = { "luarocks.nvim" }, 100 | lazy = false, 101 | version = "*", 102 | }, 103 | { 104 | "nvim-tree/nvim-tree.lua", 105 | version = "*", 106 | lazy = false, 107 | dependencies = { 108 | "nvim-tree/nvim-web-devicons", 109 | }, 110 | } 111 | } 112 | 113 | require("lazy").setup(plugins, opts) 114 | -------------------------------------------------------------------------------- /config/nvim/lua/runner.lua: -------------------------------------------------------------------------------- 1 | -- refer this wiki to know how to use path specifiers in vim 2 | -- https://vim.fandom.com/wiki/Get_the_name_of_the_current_file 3 | 4 | local run_command_table = { 5 | ['asm'] = 'nasm -f elf64 % -o %:r.o && ld %:r.o -o %:r && rm %:r.o && ./%:r', 6 | ['cpp'] = 'g++ -g -Wall % -o %:r && ./%:r', 7 | ['c'] = 'gcc -g -Wall % -o %:r && ./%:r', 8 | ['python'] = 'python %', 9 | ['lua'] = 'lua %', 10 | ['java'] = 'cd %:h && javac *.java && java %:t:r', 11 | ['zsh'] = 'zsh %', 12 | ['sh'] = 'sh %', 13 | ['rust'] = 'rustc % && ./%:r', 14 | ['go'] = 'go run %', 15 | ['javascript'] = 'node %', 16 | ['r'] = 'Rscript %', 17 | ['kotlin'] = 'kotlinc % -include-runtime -d %:r.jar && java -jar %:r.jar' 18 | } 19 | 20 | local debug_command_table = { 21 | ['cpp'] = 'g++ -g % -o %:r && gdb ./%:r', 22 | ['c'] = 'gcc -g % -o %:r && gdb ./%:r', 23 | } 24 | 25 | local extra = 'printf \"\\\\n\\\\033[0;33mPlease Press ENTER to continue \\\\033[0m\"; read' 26 | local Terminal = require('toggleterm.terminal').Terminal 27 | 28 | function expand_symbol_resolver(cmd) 29 | local mod = string.byte("%") 30 | local space = string.byte(" ") 31 | local col = string.byte(":") 32 | local i=1 33 | local expanded_cmd="" 34 | while i <= #cmd do 35 | if cmd:byte(i) == mod then 36 | local j=i+1 37 | while cmd:byte(j) == col and cmd:byte(j+1) ~= space and j <= #cmd do 38 | j=j+2 39 | end 40 | expanded_cmd = expanded_cmd .. vim.fn.expand(string.sub(cmd, i, j-1)) 41 | i=j 42 | end 43 | expanded_cmd = expanded_cmd .. string.sub(cmd, i, i) 44 | i = i+1 45 | end 46 | 47 | return expanded_cmd 48 | end 49 | 50 | 51 | -- To run file run :Run or just press 52 | function run_code() 53 | if (run_command_table[vim.bo.filetype]) then 54 | local expanded_cmd = expand_symbol_resolver(run_command_table[vim.bo.filetype]) 55 | local runcmd = expanded_cmd .."; " .. extra 56 | local runterm = Terminal:new({ cmd = runcmd, direction = "float"}) 57 | runterm:toggle() 58 | else 59 | print("\nFileType not supported\n") 60 | end 61 | end 62 | 63 | 64 | -- To run file run :Debug 65 | function debug_code() 66 | if (debug_command_table[vim.bo.filetype]) then 67 | local expanded_cmd = expand_symbol_resolver(debug_command_table[vim.bo.filetype]) 68 | local runcmd = expanded_cmd .."; " .. extra 69 | local debugterm = Terminal:new({ cmd = runcmd, direction = "float"}) 70 | debugterm:toggle() 71 | else 72 | print("\nFileType not supported\n") 73 | end 74 | end 75 | 76 | 77 | local function strsplit (inputstr) 78 | local t={} 79 | for str in string.gmatch(inputstr, "([^\",\"]+)") do 80 | table.insert(t, str) 81 | end 82 | return t 83 | end 84 | 85 | 86 | -- Use the following function to update the execution command of a filetype temporarly 87 | -- Usage :RunUpdate --OR-- :RunUpdate filetype 88 | -- If no argument is provided, the command is going to take the filetype of active buffer 89 | function update_command_table(type, filetype) 90 | local command 91 | 92 | if(filetype == "")then 93 | filetype = vim.bo.filetype 94 | else 95 | filetype = string.sub(filetype, 2, -2) 96 | end 97 | 98 | filetype = strsplit(filetype)[1] 99 | 100 | if(type == 'run') then 101 | if(run_command_table[filetype]) then 102 | command = vim.fn.input(string.format("Update run command of filetype (%s): ", filetype), 103 | run_command_table[filetype], 'file') 104 | else 105 | command = vim.fn.input(string.format("Add new run command of filetype (%s): ", filetype)) 106 | end 107 | if(#command ~= 0) then 108 | run_command_table[filetype] = command 109 | print(" Updated!") 110 | end 111 | end 112 | 113 | if(type == 'debug') then 114 | if(debug_command_table[filetype]) then 115 | command = vim.fn.input(string.format("Update debug command of filetype (%s): ", filetype), 116 | debug_command_table[filetype], 'file') 117 | else 118 | command = vim.fn.input(string.format("Add new debug command of filetype (%s): ", filetype)) 119 | end 120 | if(#command ~= 0) then 121 | debug_command_table[filetype] = command 122 | print(" Updated!") 123 | end 124 | end 125 | end 126 | -------------------------------------------------------------------------------- /config/picom/picom.conf: -------------------------------------------------------------------------------- 1 | ################################# 2 | # Shadows # 3 | ################################# 4 | 5 | 6 | # Enabled client-side shadows on windows. Note desktop windows 7 | # (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, 8 | # unless explicitly requested using the wintypes option. 9 | # 10 | # shadow = false 11 | shadow = true; 12 | 13 | # The blur radius for shadows, in pixels. (defaults to 12) 14 | # shadow-radius = 12 15 | shadow-radius = 7; 16 | 17 | # The opacity of shadows. (0.0 - 1.0, defaults to 0.75) 18 | # shadow-opacity = .75 19 | 20 | # The left offset for shadows, in pixels. (defaults to -15) 21 | # shadow-offset-x = -15 22 | shadow-offset-x = -7; 23 | 24 | # The top offset for shadows, in pixels. (defaults to -15) 25 | # shadow-offset-y = -15 26 | shadow-offset-y = -7; 27 | 28 | # Avoid drawing shadows on dock/panel windows. This option is deprecated, 29 | # you should use the *wintypes* option in your config file instead. 30 | # 31 | # no-dock-shadow = false 32 | 33 | # Don't draw shadows on drag-and-drop windows. This option is deprecated, 34 | # you should use the *wintypes* option in your config file instead. 35 | # 36 | # no-dnd-shadow = false 37 | 38 | # Red color value of shadow (0.0 - 1.0, defaults to 0). 39 | # shadow-red = 0 40 | 41 | # Green color value of shadow (0.0 - 1.0, defaults to 0). 42 | # shadow-green = 0 43 | 44 | # Blue color value of shadow (0.0 - 1.0, defaults to 0). 45 | # shadow-blue = 0 46 | 47 | # Do not paint shadows on shaped windows. Note shaped windows 48 | # here means windows setting its shape through X Shape extension. 49 | # Those using ARGB background is beyond our control. 50 | # Deprecated, use 51 | # shadow-exclude = 'bounding_shaped' 52 | # or 53 | # shadow-exclude = 'bounding_shaped && !rounded_corners' 54 | # instead. 55 | # 56 | # shadow-ignore-shaped = '' 57 | 58 | # Specify a list of conditions of windows that should have no shadow. 59 | # 60 | # examples: 61 | # shadow-exclude = "n:e:Notification"; 62 | # 63 | # shadow-exclude = [] 64 | shadow-exclude = [ 65 | "name = 'Notification'", 66 | "class_g = 'Conky'", 67 | "class_g ?= 'Notify-osd'", 68 | "class_g = 'Cairo-clock'", 69 | "_GTK_FRAME_EXTENTS@:c" 70 | ]; 71 | 72 | # Specify a X geometry that describes the region in which shadow should not 73 | # be painted in, such as a dock window region. Use 74 | # shadow-exclude-reg = "x10+0+0" 75 | # for example, if the 10 pixels on the bottom of the screen should not have shadows painted on. 76 | # 77 | # shadow-exclude-reg = "" 78 | 79 | # Crop shadow of a window fully on a particular Xinerama screen to the screen. 80 | # xinerama-shadow-crop = false 81 | 82 | 83 | ################################# 84 | # Fading # 85 | ################################# 86 | 87 | 88 | # Fade windows in/out when opening/closing and when opacity changes, 89 | # unless no-fading-openclose is used. 90 | # fading = false 91 | fading = true 92 | 93 | # Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) 94 | # fade-in-step = 0.028 95 | fade-in-step = 0.03; 96 | 97 | # Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) 98 | # fade-out-step = 0.03 99 | fade-out-step = 0.03; 100 | 101 | # The time between steps in fade step, in milliseconds. (> 0, defaults to 10) 102 | # fade-delta = 10 103 | 104 | # Specify a list of conditions of windows that should not be faded. 105 | # fade-exclude = [] 106 | 107 | # Do not fade on window open/close. 108 | # no-fading-openclose = false 109 | 110 | # Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc. 111 | # no-fading-destroyed-argb = false 112 | 113 | 114 | ################################# 115 | # Transparency / Opacity # 116 | ################################# 117 | 118 | 119 | # Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) 120 | # inactive-opacity = 1 121 | inactive-opacity = 0.8; 122 | 123 | # Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) 124 | # frame-opacity = 1.0 125 | frame-opacity = 0.7; 126 | 127 | # Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0) 128 | # menu-opacity = 1.0 129 | 130 | # Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows. 131 | # inactive-opacity-override = true 132 | inactive-opacity-override = false; 133 | 134 | # Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) 135 | # active-opacity = 1.0 136 | 137 | # Dim inactive windows. (0.0 - 1.0, defaults to 0.0) 138 | # inactive-dim = 0.0 139 | 140 | # Specify a list of conditions of windows that should always be considered focused. 141 | # focus-exclude = [] 142 | focus-exclude = [ "class_g = 'Cairo-clock'" ]; 143 | 144 | # Use fixed inactive dim value, instead of adjusting according to window opacity. 145 | # inactive-dim-fixed = 1.0 146 | 147 | # Specify a list of opacity rules, in the format `PERCENT:PATTERN`, 148 | # like `50:name *= "Firefox"`. picom-trans is recommended over this. 149 | # Note we don't make any guarantee about possible conflicts with other 150 | # programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows. 151 | # example: 152 | # opacity-rule = [ "80:class_g = 'URxvt'" ]; 153 | # 154 | # opacity-rule = [] 155 | 156 | 157 | ################################# 158 | # Background-Blurring # 159 | ################################# 160 | 161 | 162 | # Parameters for background blurring, see the *BLUR* section for more information. 163 | # blur-method = 164 | # blur-size = 12 165 | # 166 | # blur-deviation = false 167 | 168 | # Blur background of semi-transparent / ARGB windows. 169 | # Bad in performance, with driver-dependent behavior. 170 | # The name of the switch may change without prior notifications. 171 | # 172 | # blur-background = false 173 | 174 | # Blur background of windows when the window frame is not opaque. 175 | # Implies: 176 | # blur-background 177 | # Bad in performance, with driver-dependent behavior. The name may change. 178 | # 179 | # blur-background-frame = false 180 | 181 | 182 | # Use fixed blur strength rather than adjusting according to window opacity. 183 | # blur-background-fixed = false 184 | 185 | 186 | # Specify the blur convolution kernel, with the following format: 187 | # example: 188 | # blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"; 189 | # 190 | # blur-kern = '' 191 | blur-kern = "3x3box"; 192 | 193 | 194 | # Exclude conditions for background blur. 195 | # blur-background-exclude = [] 196 | blur-background-exclude = [ 197 | "window_type = 'dock'", 198 | "window_type = 'desktop'", 199 | "_GTK_FRAME_EXTENTS@:c" 200 | ]; 201 | 202 | ################################# 203 | # General Settings # 204 | ################################# 205 | 206 | # Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers. 207 | # daemon = false 208 | 209 | # Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. 210 | # `xrender` is the default one. 211 | # 212 | # backend = 'glx' 213 | backend = "xrender"; 214 | 215 | # Enable/disable VSync. 216 | # vsync = false 217 | vsync = true 218 | 219 | # Enable remote control via D-Bus. See the *D-BUS API* section below for more details. 220 | # dbus = false 221 | 222 | # Try to detect WM windows (a non-override-redirect window with no 223 | # child that has 'WM_STATE') and mark them as active. 224 | # 225 | # mark-wmwin-focused = false 226 | mark-wmwin-focused = true; 227 | 228 | # Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused. 229 | # mark-ovredir-focused = false 230 | mark-ovredir-focused = true; 231 | 232 | # Try to detect windows with rounded corners and don't consider them 233 | # shaped windows. The accuracy is not very high, unfortunately. 234 | # 235 | # detect-rounded-corners = false 236 | detect-rounded-corners = true; 237 | 238 | # Detect '_NET_WM_OPACITY' on client windows, useful for window managers 239 | # not passing '_NET_WM_OPACITY' of client windows to frame windows. 240 | # 241 | # detect-client-opacity = false 242 | detect-client-opacity = true; 243 | 244 | # Specify refresh rate of the screen. If not specified or 0, picom will 245 | # try detecting this with X RandR extension. 246 | # 247 | # refresh-rate = 60 248 | refresh-rate = 0 249 | 250 | # Limit picom to repaint at most once every 1 / 'refresh_rate' second to 251 | # boost performance. This should not be used with 252 | # vsync drm/opengl/opengl-oml 253 | # as they essentially does sw-opti's job already, 254 | # unless you wish to specify a lower refresh rate than the actual value. 255 | # 256 | # sw-opti = 257 | 258 | # Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, 259 | # rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy, 260 | # provided that the WM supports it. 261 | # 262 | # use-ewmh-active-win = false 263 | 264 | # Unredirect all windows if a full-screen opaque window is detected, 265 | # to maximize performance for full-screen windows. Known to cause flickering 266 | # when redirecting/unredirecting windows. 267 | # 268 | # unredir-if-possible = false 269 | 270 | # Delay before unredirecting the window, in milliseconds. Defaults to 0. 271 | # unredir-if-possible-delay = 0 272 | 273 | # Conditions of windows that shouldn't be considered full-screen for unredirecting screen. 274 | # unredir-if-possible-exclude = [] 275 | 276 | # Use 'WM_TRANSIENT_FOR' to group windows, and consider windows 277 | # in the same group focused at the same time. 278 | # 279 | # detect-transient = false 280 | detect-transient = true 281 | 282 | # Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same 283 | # group focused at the same time. 'WM_TRANSIENT_FOR' has higher priority if 284 | # detect-transient is enabled, too. 285 | # 286 | # detect-client-leader = false 287 | detect-client-leader = true 288 | 289 | # Resize damaged region by a specific number of pixels. 290 | # A positive value enlarges it while a negative one shrinks it. 291 | # If the value is positive, those additional pixels will not be actually painted 292 | # to screen, only used in blur calculation, and such. (Due to technical limitations, 293 | # with use-damage, those pixels will still be incorrectly painted to screen.) 294 | # Primarily used to fix the line corruption issues of blur, 295 | # in which case you should use the blur radius value here 296 | # (e.g. with a 3x3 kernel, you should use `--resize-damage 1`, 297 | # with a 5x5 one you use `--resize-damage 2`, and so on). 298 | # May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly. 299 | # 300 | # resize-damage = 1 301 | 302 | # Specify a list of conditions of windows that should be painted with inverted color. 303 | # Resource-hogging, and is not well tested. 304 | # 305 | # invert-color-include = [] 306 | 307 | # GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer. 308 | # Might cause incorrect opacity when rendering transparent content (but never 309 | # practically happened) and may not work with blur-background. 310 | # My tests show a 15% performance boost. Recommended. 311 | # 312 | # glx-no-stencil = false 313 | 314 | # GLX backend: Avoid rebinding pixmap on window damage. 315 | # Probably could improve performance on rapid window content changes, 316 | # but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.). 317 | # Recommended if it works. 318 | # 319 | # glx-no-rebind-pixmap = false 320 | 321 | # Disable the use of damage information. 322 | # This cause the whole screen to be redrawn everytime, instead of the part of the screen 323 | # has actually changed. Potentially degrades the performance, but might fix some artifacts. 324 | # The opposing option is use-damage 325 | # 326 | # no-use-damage = false 327 | use-damage = true 328 | 329 | # Use X Sync fence to sync clients' draw calls, to make sure all draw 330 | # calls are finished before picom starts drawing. Needed on nvidia-drivers 331 | # with GLX backend for some users. 332 | # 333 | # xrender-sync-fence = false 334 | 335 | # GLX backend: Use specified GLSL fragment shader for rendering window contents. 336 | # See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl` 337 | # in the source tree for examples. 338 | # 339 | # glx-fshader-win = '' 340 | 341 | # Force all windows to be painted with blending. Useful if you 342 | # have a glx-fshader-win that could turn opaque pixels transparent. 343 | # 344 | # force-win-blend = false 345 | 346 | # Do not use EWMH to detect fullscreen windows. 347 | # Reverts to checking if a window is fullscreen based only on its size and coordinates. 348 | # 349 | # no-ewmh-fullscreen = false 350 | 351 | # Dimming bright windows so their brightness doesn't exceed this set value. 352 | # Brightness of a window is estimated by averaging all pixels in the window, 353 | # so this could comes with a performance hit. 354 | # Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0) 355 | # 356 | # max-brightness = 1.0 357 | 358 | # Make transparent windows clip other windows like non-transparent windows do, 359 | # instead of blending on top of them. 360 | # 361 | # transparent-clipping = false 362 | 363 | # Set the log level. Possible values are: 364 | # "trace", "debug", "info", "warn", "error" 365 | # in increasing level of importance. Case doesn't matter. 366 | # If using the "TRACE" log level, it's better to log into a file 367 | # using *--log-file*, since it can generate a huge stream of logs. 368 | # 369 | # log-level = "debug" 370 | log-level = "warn"; 371 | 372 | # Set the log file. 373 | # If *--log-file* is never specified, logs will be written to stderr. 374 | # Otherwise, logs will to written to the given file, though some of the early 375 | # logs might still be written to the stderr. 376 | # When setting this option from the config file, it is recommended to use an absolute path. 377 | # 378 | # log-file = '/path/to/your/log/file' 379 | 380 | # Show all X errors (for debugging) 381 | # show-all-xerrors = false 382 | 383 | # Write process ID to a file. 384 | # write-pid-path = '/path/to/your/log/file' 385 | 386 | # Window type settings 387 | # 388 | # 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard: 389 | # "unknown", "desktop", "dock", "toolbar", "menu", "utility", 390 | # "splash", "dialog", "normal", "dropdown_menu", "popup_menu", 391 | # "tooltip", "notification", "combo", and "dnd". 392 | # 393 | # Following per window-type options are available: :: 394 | # 395 | # fade, shadow::: 396 | # Controls window-type-specific shadow and fade settings. 397 | # 398 | # opacity::: 399 | # Controls default opacity of the window type. 400 | # 401 | # focus::: 402 | # Controls whether the window of this type is to be always considered focused. 403 | # (By default, all window types except "normal" and "dialog" has this on.) 404 | # 405 | # full-shadow::: 406 | # Controls whether shadow is drawn under the parts of the window that you 407 | # normally won't be able to see. Useful when the window has parts of it 408 | # transparent, and you want shadows in those areas. 409 | # 410 | # redir-ignore::: 411 | # Controls whether this type of windows should cause screen to become 412 | # redirected again after been unredirected. If you have unredir-if-possible 413 | # set, and doesn't want certain window to cause unnecessary screen redirection, 414 | # you can set this to `true`. 415 | # 416 | wintypes: 417 | { 418 | tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; 419 | dock = { shadow = false; } 420 | dnd = { shadow = false; } 421 | popup_menu = { opacity = 1; } 422 | dropdown_menu = { opacity = 1; } 423 | }; 424 | -------------------------------------------------------------------------------- /config/ranger/backup/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | import ranger.api 3 | from ranger.core.linemode import LinemodeBase 4 | from .devicons import * 5 | 6 | SEPARATOR = os.getenv('RANGER_DEVICONS_SEPARATOR', ' ') 7 | 8 | @ranger.api.register_linemode 9 | class DevIconsLinemode(LinemodeBase): 10 | name = "devicons" 11 | 12 | uses_metadata = False 13 | 14 | def filetitle(self, file, metadata): 15 | return devicon(file) + SEPARATOR + file.relative_path 16 | -------------------------------------------------------------------------------- /config/ranger/backup/plugins/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 | # Get the XDG_USER_DIRS directory names from enviromental variables 10 | 11 | xdgs_dirs = {path.split('/')[-2]: icon for key, icon in [ 12 | ('XDG_DOCUMENTS_DIR' , ''), 13 | ('XDG_DOWNLOAD_DIR' , ''), 14 | ('XDG_CONFIG_DIR' , ''), 15 | ('XDG_MUSIC_DIR' , ''), 16 | ('XDG_PICTURES_DIR' , ''), 17 | ('XDG_PUBLICSHARE_DIR', ''), 18 | ('XDG_TEMPLATES_DIR' , ''), 19 | ('XDG_VIDEOS_DIR' , ''), 20 | ] if (path := os.getenv(key))} 21 | 22 | 23 | # all those glyphs will show as weird squares if you don't have the correct patched font 24 | # My advice is to use NerdFonts which can be found here: 25 | # https://github.com/ryanoasis/nerd-fonts 26 | file_node_extensions = { 27 | '7z' : '', 28 | 'a' : '', 29 | 'ai' : '', 30 | 'apk' : '', 31 | 'asm' : '', 32 | 'asp' : '', 33 | 'aup' : '', 34 | 'avi' : '', 35 | 'awk' : '', 36 | 'bash' : '', 37 | 'bat' : '', 38 | 'bmp' : '', 39 | 'bz2' : '', 40 | 'c' : '', 41 | 'c++' : '', 42 | 'cab' : '', 43 | 'cbr' : '', 44 | 'cbz' : '', 45 | 'cc' : '', 46 | 'class' : '', 47 | 'clj' : '', 48 | 'cljc' : '', 49 | 'cljs' : '', 50 | 'cmake' : '', 51 | 'coffee' : '', 52 | 'conf' : '', 53 | 'cp' : '', 54 | 'cpio' : '', 55 | 'cpp' : '', 56 | 'cs' : '', 57 | 'csh' : '', 58 | 'css' : '', 59 | 'cue' : '', 60 | 'cvs' : '', 61 | 'cxx' : '', 62 | 'd' : '', 63 | 'dart' : '', 64 | 'db' : '', 65 | 'deb' : '', 66 | 'diff' : '', 67 | 'dll' : '', 68 | 'doc' : '', 69 | 'docx' : '', 70 | 'dump' : '', 71 | 'edn' : '', 72 | 'eex' : '', 73 | 'efi' : '', 74 | 'ejs' : '', 75 | 'elf' : '', 76 | 'elm' : '', 77 | 'epub' : '', 78 | 'erl' : '', 79 | 'ex' : '', 80 | 'exe' : '', 81 | 'exs' : '', 82 | 'f#' : '', 83 | 'fifo' : 'ﳣ', 84 | 'fish' : '', 85 | 'flac' : '', 86 | 'flv' : '', 87 | 'fs' : '', 88 | 'fsi' : '', 89 | 'fsscript' : '', 90 | 'fsx' : '', 91 | 'gem' : '', 92 | 'gemspec' : '', 93 | 'gif' : '', 94 | 'go' : '', 95 | 'gz' : '', 96 | 'gzip' : '', 97 | 'h' : '', 98 | 'haml' : '', 99 | 'hbs' : '', 100 | 'hh' : '', 101 | 'hpp' : '', 102 | 'hrl' : '', 103 | 'hs' : '', 104 | 'htaccess' : '', 105 | 'htm' : '', 106 | 'html' : '', 107 | 'htpasswd' : '', 108 | 'hxx' : '', 109 | 'ico' : '', 110 | 'img' : '', 111 | 'ini' : '', 112 | 'iso' : '', 113 | 'jar' : '', 114 | 'java' : '', 115 | 'jl' : '', 116 | 'jpeg' : '', 117 | 'jpg' : '', 118 | 'js' : '', 119 | 'json' : '', 120 | 'jsx' : '', 121 | 'key' : '', 122 | 'ksh' : '', 123 | 'leex' : '', 124 | 'less' : '', 125 | 'lha' : '', 126 | 'lhs' : '', 127 | 'log' : '', 128 | 'lua' : '', 129 | 'lzh' : '', 130 | 'lzma' : '', 131 | 'm4a' : '', 132 | 'm4v' : '', 133 | 'markdown' : '', 134 | 'md' : '', 135 | 'mdx' : '', 136 | 'mjs' : '', 137 | 'mkv' : '', 138 | 'ml' : 'λ', 139 | 'mli' : 'λ', 140 | 'mov' : '', 141 | 'mp3' : '', 142 | 'mp4' : '', 143 | 'mpeg' : '', 144 | 'mpg' : '', 145 | 'msi' : '', 146 | 'mustache' : '', 147 | 'nix' : '', 148 | 'o' : '', 149 | 'ogg' : '', 150 | 'part' : '', 151 | 'pdf' : '', 152 | 'php' : '', 153 | 'pl' : '', 154 | 'pm' : '', 155 | 'png' : '', 156 | 'pp' : '', 157 | 'ppt' : '', 158 | 'pptx' : '', 159 | 'ps1' : '', 160 | 'psb' : '', 161 | 'psd' : '', 162 | 'pub' : '', 163 | 'py' : '', 164 | 'pyc' : '', 165 | 'pyd' : '', 166 | 'pyo' : '', 167 | 'r' : 'ﳒ', 168 | 'rake' : '', 169 | 'rar' : '', 170 | 'rb' : '', 171 | 'rc' : '', 172 | 'rlib' : '', 173 | 'rmd' : '', 174 | 'rom' : '', 175 | 'rpm' : '', 176 | 'rproj' : '鉶', 177 | 'rs' : '', 178 | 'rss' : '', 179 | 'rtf' : '', 180 | 's' : '', 181 | 'sass' : '', 182 | 'scala' : '', 183 | 'scss' : '', 184 | 'sh' : '', 185 | 'slim' : '', 186 | 'sln' : '', 187 | 'so' : '', 188 | 'sql' : '', 189 | 'styl' : '', 190 | 'suo' : '', 191 | 'swift' : '', 192 | 't' : '', 193 | 'tar' : '', 194 | 'tex' : 'ﭨ', 195 | 'tgz' : '', 196 | 'toml' : '', 197 | 'torrent' : '', 198 | 'ts' : '', 199 | 'tsx' : '', 200 | 'twig' : '', 201 | 'vim' : '', 202 | 'vimrc' : '', 203 | 'vue' : '﵂', 204 | 'wav' : '', 205 | 'webm' : '', 206 | 'webmanifest' : '', 207 | 'webp' : '', 208 | 'xbps' : '', 209 | 'xcplayground' : '', 210 | 'xhtml' : '', 211 | 'xls' : '', 212 | 'xlsx' : '', 213 | 'xml' : '', 214 | 'xul' : '', 215 | 'xz' : '', 216 | 'yaml' : '', 217 | 'yml' : '', 218 | 'zip' : '', 219 | 'zsh' : '', 220 | } 221 | 222 | dir_node_exact_matches = { 223 | # English 224 | '.git' : '', 225 | 'Desktop' : '', 226 | 'Documents' : '', 227 | 'Downloads' : '', 228 | 'Dotfiles' : '', 229 | 'Dropbox' : '', 230 | 'Music' : '', 231 | 'Pictures' : '', 232 | 'Public' : '', 233 | 'Templates' : '', 234 | 'Videos' : '', 235 | # Spanish 236 | 'Escritorio' : '', 237 | 'Documentos' : '', 238 | 'Descargas' : '', 239 | 'Música' : '', 240 | 'Imágenes' : '', 241 | 'Público' : '', 242 | 'Plantillas' : '', 243 | 'Vídeos' : '', 244 | # French 245 | 'Bureau' : '', 246 | 'Documents' : '', 247 | 'Images' : '', 248 | 'Musique' : '', 249 | 'Publique' : '', 250 | 'Téléchargements' : '', 251 | 'Vidéos' : '', 252 | # Portuguese 253 | 'Documentos' : '', 254 | 'Imagens' : '', 255 | 'Modelos' : '', 256 | 'Música' : '', 257 | 'Público' : '', 258 | 'Vídeos' : '', 259 | 'Área de trabalho' : '', 260 | # Italian 261 | 'Documenti' : '', 262 | 'Immagini' : '', 263 | 'Modelli' : '', 264 | 'Musica' : '', 265 | 'Pubblici' : '', 266 | 'Scaricati' : '', 267 | 'Scrivania' : '', 268 | 'Video' : '', 269 | # German 270 | 'Bilder' : '', 271 | 'Dokumente' : '', 272 | 'Musik' : '', 273 | 'Schreibtisch' : '', 274 | 'Vorlagen' : '', 275 | 'Öffentlich' : '', 276 | # Hungarian 277 | 'Dokumentumok' : '', 278 | 'Képek' : '', 279 | 'Modelli' : '', 280 | 'Zene' : '', 281 | 'Letöltések' : '', 282 | 'Számítógép' : '', 283 | 'Videók' : '', 284 | # XDG_USER_DIRS 285 | **xdgs_dirs 286 | } 287 | 288 | file_node_exact_matches = { 289 | '.bash_aliases' : '', 290 | '.bash_history' : '', 291 | '.bash_logout' : '', 292 | '.bash_profile' : '', 293 | '.bashprofile' : '', 294 | '.bashrc' : '', 295 | '.dmrc' : '', 296 | '.DS_Store' : '', 297 | '.fasd' : '', 298 | '.fehbg' : '', 299 | '.gitattributes' : '', 300 | '.gitconfig' : '', 301 | '.gitignore' : '', 302 | '.gitlab-ci.yml' : '', 303 | '.gvimrc' : '', 304 | '.inputrc' : '', 305 | '.jack-settings' : '', 306 | '.mime.types' : '', 307 | '.ncmpcpp' : '', 308 | '.nvidia-settings-rc' : '', 309 | '.pam_environment' : '', 310 | '.profile' : '', 311 | '.recently-used' : '', 312 | '.selected_editor' : '', 313 | '.vim' : '', 314 | '.viminfo' : '', 315 | '.vimrc' : '', 316 | '.Xauthority' : '', 317 | '.Xdefaults' : '', 318 | '.xinitrc' : '', 319 | '.xinputrc' : '', 320 | '.Xresources' : '', 321 | '.zshrc' : '', 322 | '_gvimrc' : '', 323 | '_vimrc' : '', 324 | 'a.out' : '', 325 | 'authorized_keys' : '', 326 | 'bspwmrc' : '', 327 | 'cmakelists.txt' : '', 328 | 'config' : '', 329 | 'config.ac' : '', 330 | 'config.m4' : '', 331 | 'config.mk' : '', 332 | 'config.ru' : '', 333 | 'configure' : '', 334 | 'docker-compose.yml' : '', 335 | 'dockerfile' : '', 336 | 'Dockerfile' : '', 337 | 'dropbox' : '', 338 | 'exact-match-case-sensitive-1.txt' : 'X1', 339 | 'exact-match-case-sensitive-2' : 'X2', 340 | 'favicon.ico' : '', 341 | 'gemfile' : '', 342 | 'gruntfile.coffee' : '', 343 | 'gruntfile.js' : '', 344 | 'gruntfile.ls' : '', 345 | 'gulpfile.coffee' : '', 346 | 'gulpfile.js' : '', 347 | 'gulpfile.ls' : '', 348 | 'ini' : '', 349 | 'known_hosts' : '', 350 | 'ledger' : '', 351 | 'license' : '', 352 | 'LICENSE' : '', 353 | 'LICENSE.md' : '', 354 | 'LICENSE.txt' : '', 355 | 'Makefile' : '', 356 | 'makefile' : '', 357 | 'Makefile.ac' : '', 358 | 'Makefile.in' : '', 359 | 'mimeapps.list' : '', 360 | 'mix.lock' : '', 361 | 'node_modules' : '', 362 | 'package-lock.json' : '', 363 | 'package.json' : '', 364 | 'playlists' : '', 365 | 'procfile' : '', 366 | 'Rakefile' : '', 367 | 'rakefile' : '', 368 | 'react.jsx' : '', 369 | 'README' : '', 370 | 'README.markdown' : '', 371 | 'README.md' : '', 372 | 'README.rst' : '', 373 | 'README.txt' : '', 374 | 'sxhkdrc' : '', 375 | 'user-dirs.dirs' : '', 376 | 'webpack.config.js' : '', 377 | } 378 | 379 | def devicon(file): 380 | if file.is_directory: return dir_node_exact_matches.get(file.relative_path, '') 381 | return file_node_exact_matches.get(os.path.basename(file.relative_path), file_node_extensions.get(file.extension, '')) 382 | -------------------------------------------------------------------------------- /config/ranger/backup/plugins/ranger_devicons/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | import ranger.api 3 | from ranger.core.linemode import LinemodeBase 4 | from .devicons import * 5 | 6 | SEPARATOR = os.getenv('RANGER_DEVICONS_SEPARATOR', ' ') 7 | 8 | @ranger.api.register_linemode 9 | class DevIconsLinemode(LinemodeBase): 10 | name = "devicons" 11 | 12 | uses_metadata = False 13 | 14 | def filetitle(self, file, metadata): 15 | return devicon(file) + SEPARATOR + file.relative_path 16 | -------------------------------------------------------------------------------- /config/ranger/backup/plugins/ranger_devicons/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 | # Get the XDG_USER_DIRS directory names from enviromental variables 10 | 11 | xdgs_dirs = {path.split('/')[-2]: icon for key, icon in [ 12 | ('XDG_DOCUMENTS_DIR' , ''), 13 | ('XDG_DOWNLOAD_DIR' , ''), 14 | ('XDG_CONFIG_DIR' , ''), 15 | ('XDG_MUSIC_DIR' , ''), 16 | ('XDG_PICTURES_DIR' , ''), 17 | ('XDG_PUBLICSHARE_DIR', ''), 18 | ('XDG_TEMPLATES_DIR' , ''), 19 | ('XDG_VIDEOS_DIR' , ''), 20 | ] if (path := os.getenv(key))} 21 | 22 | 23 | # all those glyphs will show as weird squares if you don't have the correct patched font 24 | # My advice is to use NerdFonts which can be found here: 25 | # https://github.com/ryanoasis/nerd-fonts 26 | file_node_extensions = { 27 | '7z' : '', 28 | 'a' : '', 29 | 'ai' : '', 30 | 'apk' : '', 31 | 'asm' : '', 32 | 'asp' : '', 33 | 'aup' : '', 34 | 'avi' : '', 35 | 'awk' : '', 36 | 'bash' : '', 37 | 'bat' : '', 38 | 'bmp' : '', 39 | 'bz2' : '', 40 | 'c' : '', 41 | 'c++' : '', 42 | 'cab' : '', 43 | 'cbr' : '', 44 | 'cbz' : '', 45 | 'cc' : '', 46 | 'class' : '', 47 | 'clj' : '', 48 | 'cljc' : '', 49 | 'cljs' : '', 50 | 'cmake' : '', 51 | 'coffee' : '', 52 | 'conf' : '', 53 | 'cp' : '', 54 | 'cpio' : '', 55 | 'cpp' : '', 56 | 'cs' : '', 57 | 'csh' : '', 58 | 'css' : '', 59 | 'cue' : '', 60 | 'cvs' : '', 61 | 'cxx' : '', 62 | 'd' : '', 63 | 'dart' : '', 64 | 'db' : '', 65 | 'deb' : '', 66 | 'diff' : '', 67 | 'dll' : '', 68 | 'doc' : '', 69 | 'docx' : '', 70 | 'dump' : '', 71 | 'edn' : '', 72 | 'eex' : '', 73 | 'efi' : '', 74 | 'ejs' : '', 75 | 'elf' : '', 76 | 'elm' : '', 77 | 'epub' : '', 78 | 'erl' : '', 79 | 'ex' : '', 80 | 'exe' : '', 81 | 'exs' : '', 82 | 'f#' : '', 83 | 'fifo' : 'ﳣ', 84 | 'fish' : '', 85 | 'flac' : '', 86 | 'flv' : '', 87 | 'fs' : '', 88 | 'fsi' : '', 89 | 'fsscript' : '', 90 | 'fsx' : '', 91 | 'gem' : '', 92 | 'gemspec' : '', 93 | 'gif' : '', 94 | 'go' : '', 95 | 'gz' : '', 96 | 'gzip' : '', 97 | 'h' : '', 98 | 'haml' : '', 99 | 'hbs' : '', 100 | 'hh' : '', 101 | 'hpp' : '', 102 | 'hrl' : '', 103 | 'hs' : '', 104 | 'htaccess' : '', 105 | 'htm' : '', 106 | 'html' : '', 107 | 'htpasswd' : '', 108 | 'hxx' : '', 109 | 'ico' : '', 110 | 'img' : '', 111 | 'ini' : '', 112 | 'iso' : '', 113 | 'jar' : '', 114 | 'java' : '', 115 | 'jl' : '', 116 | 'jpeg' : '', 117 | 'jpg' : '', 118 | 'js' : '', 119 | 'json' : '', 120 | 'jsx' : '', 121 | 'key' : '', 122 | 'ksh' : '', 123 | 'leex' : '', 124 | 'less' : '', 125 | 'lha' : '', 126 | 'lhs' : '', 127 | 'log' : '', 128 | 'lua' : '', 129 | 'lzh' : '', 130 | 'lzma' : '', 131 | 'm4a' : '', 132 | 'm4v' : '', 133 | 'markdown' : '', 134 | 'md' : '', 135 | 'mdx' : '', 136 | 'mjs' : '', 137 | 'mkv' : '', 138 | 'ml' : 'λ', 139 | 'mli' : 'λ', 140 | 'mov' : '', 141 | 'mp3' : '', 142 | 'mp4' : '', 143 | 'mpeg' : '', 144 | 'mpg' : '', 145 | 'msi' : '', 146 | 'mustache' : '', 147 | 'nix' : '', 148 | 'o' : '', 149 | 'ogg' : '', 150 | 'part' : '', 151 | 'pdf' : '', 152 | 'php' : '', 153 | 'pl' : '', 154 | 'pm' : '', 155 | 'png' : '', 156 | 'pp' : '', 157 | 'ppt' : '', 158 | 'pptx' : '', 159 | 'ps1' : '', 160 | 'psb' : '', 161 | 'psd' : '', 162 | 'pub' : '', 163 | 'py' : '', 164 | 'pyc' : '', 165 | 'pyd' : '', 166 | 'pyo' : '', 167 | 'r' : 'ﳒ', 168 | 'rake' : '', 169 | 'rar' : '', 170 | 'rb' : '', 171 | 'rc' : '', 172 | 'rlib' : '', 173 | 'rmd' : '', 174 | 'rom' : '', 175 | 'rpm' : '', 176 | 'rproj' : '鉶', 177 | 'rs' : '', 178 | 'rss' : '', 179 | 'rtf' : '', 180 | 's' : '', 181 | 'sass' : '', 182 | 'scala' : '', 183 | 'scss' : '', 184 | 'sh' : '', 185 | 'slim' : '', 186 | 'sln' : '', 187 | 'so' : '', 188 | 'sql' : '', 189 | 'styl' : '', 190 | 'suo' : '', 191 | 'swift' : '', 192 | 't' : '', 193 | 'tar' : '', 194 | 'tex' : 'ﭨ', 195 | 'tgz' : '', 196 | 'toml' : '', 197 | 'torrent' : '', 198 | 'ts' : '', 199 | 'tsx' : '', 200 | 'twig' : '', 201 | 'vim' : '', 202 | 'vimrc' : '', 203 | 'vue' : '﵂', 204 | 'wav' : '', 205 | 'webm' : '', 206 | 'webmanifest' : '', 207 | 'webp' : '', 208 | 'xbps' : '', 209 | 'xcplayground' : '', 210 | 'xhtml' : '', 211 | 'xls' : '', 212 | 'xlsx' : '', 213 | 'xml' : '', 214 | 'xul' : '', 215 | 'xz' : '', 216 | 'yaml' : '', 217 | 'yml' : '', 218 | 'zip' : '', 219 | 'zsh' : '', 220 | } 221 | 222 | dir_node_exact_matches = { 223 | # English 224 | '.git' : '', 225 | 'Desktop' : '', 226 | 'Documents' : '', 227 | 'Downloads' : '', 228 | 'Dotfiles' : '', 229 | 'Dropbox' : '', 230 | 'Music' : '', 231 | 'Pictures' : '', 232 | 'Public' : '', 233 | 'Templates' : '', 234 | 'Videos' : '', 235 | # Spanish 236 | 'Escritorio' : '', 237 | 'Documentos' : '', 238 | 'Descargas' : '', 239 | 'Música' : '', 240 | 'Imágenes' : '', 241 | 'Público' : '', 242 | 'Plantillas' : '', 243 | 'Vídeos' : '', 244 | # French 245 | 'Bureau' : '', 246 | 'Documents' : '', 247 | 'Images' : '', 248 | 'Musique' : '', 249 | 'Publique' : '', 250 | 'Téléchargements' : '', 251 | 'Vidéos' : '', 252 | # Portuguese 253 | 'Documentos' : '', 254 | 'Imagens' : '', 255 | 'Modelos' : '', 256 | 'Música' : '', 257 | 'Público' : '', 258 | 'Vídeos' : '', 259 | 'Área de trabalho' : '', 260 | # Italian 261 | 'Documenti' : '', 262 | 'Immagini' : '', 263 | 'Modelli' : '', 264 | 'Musica' : '', 265 | 'Pubblici' : '', 266 | 'Scaricati' : '', 267 | 'Scrivania' : '', 268 | 'Video' : '', 269 | # German 270 | 'Bilder' : '', 271 | 'Dokumente' : '', 272 | 'Musik' : '', 273 | 'Schreibtisch' : '', 274 | 'Vorlagen' : '', 275 | 'Öffentlich' : '', 276 | # Hungarian 277 | 'Dokumentumok' : '', 278 | 'Képek' : '', 279 | 'Modelli' : '', 280 | 'Zene' : '', 281 | 'Letöltések' : '', 282 | 'Számítógép' : '', 283 | 'Videók' : '', 284 | # XDG_USER_DIRS 285 | **xdgs_dirs 286 | } 287 | 288 | file_node_exact_matches = { 289 | '.bash_aliases' : '', 290 | '.bash_history' : '', 291 | '.bash_logout' : '', 292 | '.bash_profile' : '', 293 | '.bashprofile' : '', 294 | '.bashrc' : '', 295 | '.dmrc' : '', 296 | '.DS_Store' : '', 297 | '.fasd' : '', 298 | '.fehbg' : '', 299 | '.gitattributes' : '', 300 | '.gitconfig' : '', 301 | '.gitignore' : '', 302 | '.gitlab-ci.yml' : '', 303 | '.gvimrc' : '', 304 | '.inputrc' : '', 305 | '.jack-settings' : '', 306 | '.mime.types' : '', 307 | '.ncmpcpp' : '', 308 | '.nvidia-settings-rc' : '', 309 | '.pam_environment' : '', 310 | '.profile' : '', 311 | '.recently-used' : '', 312 | '.selected_editor' : '', 313 | '.vim' : '', 314 | '.viminfo' : '', 315 | '.vimrc' : '', 316 | '.Xauthority' : '', 317 | '.Xdefaults' : '', 318 | '.xinitrc' : '', 319 | '.xinputrc' : '', 320 | '.Xresources' : '', 321 | '.zshrc' : '', 322 | '_gvimrc' : '', 323 | '_vimrc' : '', 324 | 'a.out' : '', 325 | 'authorized_keys' : '', 326 | 'bspwmrc' : '', 327 | 'cmakelists.txt' : '', 328 | 'config' : '', 329 | 'config.ac' : '', 330 | 'config.m4' : '', 331 | 'config.mk' : '', 332 | 'config.ru' : '', 333 | 'configure' : '', 334 | 'docker-compose.yml' : '', 335 | 'dockerfile' : '', 336 | 'Dockerfile' : '', 337 | 'dropbox' : '', 338 | 'exact-match-case-sensitive-1.txt' : 'X1', 339 | 'exact-match-case-sensitive-2' : 'X2', 340 | 'favicon.ico' : '', 341 | 'gemfile' : '', 342 | 'gruntfile.coffee' : '', 343 | 'gruntfile.js' : '', 344 | 'gruntfile.ls' : '', 345 | 'gulpfile.coffee' : '', 346 | 'gulpfile.js' : '', 347 | 'gulpfile.ls' : '', 348 | 'ini' : '', 349 | 'known_hosts' : '', 350 | 'ledger' : '', 351 | 'license' : '', 352 | 'LICENSE' : '', 353 | 'LICENSE.md' : '', 354 | 'LICENSE.txt' : '', 355 | 'Makefile' : '', 356 | 'makefile' : '', 357 | 'Makefile.ac' : '', 358 | 'Makefile.in' : '', 359 | 'mimeapps.list' : '', 360 | 'mix.lock' : '', 361 | 'node_modules' : '', 362 | 'package-lock.json' : '', 363 | 'package.json' : '', 364 | 'playlists' : '', 365 | 'procfile' : '', 366 | 'Rakefile' : '', 367 | 'rakefile' : '', 368 | 'react.jsx' : '', 369 | 'README' : '', 370 | 'README.markdown' : '', 371 | 'README.md' : '', 372 | 'README.rst' : '', 373 | 'README.txt' : '', 374 | 'sxhkdrc' : '', 375 | 'user-dirs.dirs' : '', 376 | 'webpack.config.js' : '', 377 | } 378 | 379 | def devicon(file): 380 | if file.is_directory: return dir_node_exact_matches.get(file.relative_path, '') 381 | return file_node_exact_matches.get(os.path.basename(file.relative_path), file_node_extensions.get(file.extension, '')) 382 | -------------------------------------------------------------------------------- /config/ranger/backup/rc.conf: -------------------------------------------------------------------------------- 1 | # =================================================================== 2 | # This file contains the default startup commands for ranger. 3 | # To change them, it is recommended to create either /etc/ranger/rc.conf 4 | # (system-wide) or ~/.config/ranger/rc.conf (per user) and add your custom 5 | # commands there. 6 | # 7 | # If you copy this whole file there, you may want to set the environment 8 | # variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice. 9 | # 10 | # The purpose of this file is mainly to define keybindings and settings. 11 | # For running more complex python code, please create a plugin in "plugins/" or 12 | # a command in "commands.py". 13 | # 14 | # Each line is a command that will be run before the user interface 15 | # is initialized. As a result, you can not use commands which rely 16 | # on the UI such as :delete or :mark. 17 | # =================================================================== 18 | 19 | # =================================================================== 20 | # == Options 21 | # =================================================================== 22 | 23 | # Which viewmode should be used? Possible values are: 24 | # miller: Use miller columns which show multiple levels of the hierarchy 25 | # multipane: Midnight-commander like multipane view showing all tabs next 26 | # to each other 27 | set viewmode miller 28 | 29 | # How many columns are there, and what are their relative widths? 30 | set column_ratios 1,3,4 31 | 32 | # Which files should be hidden? (regular expression) 33 | set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$ 34 | 35 | # Show hidden files? You can toggle this by typing 'zh' 36 | set show_hidden false 37 | 38 | # Ask for a confirmation when running the "delete" command? 39 | # Valid values are "always", "never", "multiple" (default) 40 | # With "multiple", ranger will ask only if you delete multiple files at once. 41 | set confirm_on_delete multiple 42 | 43 | # Use non-default path for file preview script? 44 | # ranger ships with scope.sh, a script that calls external programs (see 45 | # README.md for dependencies) to preview images, archives, etc. 46 | #set preview_script ~/.config/ranger/scope.sh 47 | 48 | # Use the external preview script or display simple plain text or image previews? 49 | set use_preview_script true 50 | 51 | # Automatically count files in the directory, even before entering them? 52 | set automatically_count_files true 53 | 54 | # Open all images in this directory when running certain image viewers 55 | # like feh or sxiv? You can still open selected files by marking them. 56 | set open_all_images true 57 | 58 | # Be aware of version control systems and display information. 59 | set vcs_aware false 60 | 61 | # State of the four backends git, hg, bzr, svn. The possible states are 62 | # disabled, local (only show local info), enabled (show local and remote 63 | # information). 64 | set vcs_backend_git enabled 65 | set vcs_backend_hg disabled 66 | set vcs_backend_bzr disabled 67 | set vcs_backend_svn disabled 68 | 69 | # Truncate the long commit messages to this length when shown in the statusbar. 70 | set vcs_msg_length 50 71 | 72 | # Use one of the supported image preview protocols 73 | set preview_images true 74 | 75 | # Set the preview image method. Supported methods: 76 | # 77 | # * w3m (default): 78 | # Preview images in full color with the external command "w3mimgpreview"? 79 | # This requires the console web browser "w3m" and a supported terminal. 80 | # It has been successfully tested with "xterm" and "urxvt" without tmux. 81 | # 82 | # * iterm2: 83 | # Preview images in full color using iTerm2 image previews 84 | # (http://iterm2.com/images.html). This requires using iTerm2 compiled 85 | # with image preview support. 86 | # 87 | # This feature relies on the dimensions of the terminal's font. By default, a 88 | # width of 8 and height of 11 are used. To use other values, set the options 89 | # iterm2_font_width and iterm2_font_height to the desired values. 90 | # 91 | # * terminology: 92 | # Previews images in full color in the terminology terminal emulator. 93 | # Supports a wide variety of formats, even vector graphics like svg. 94 | # 95 | # * urxvt: 96 | # Preview images in full color using urxvt image backgrounds. This 97 | # requires using urxvt compiled with pixbuf support. 98 | # 99 | # * urxvt-full: 100 | # The same as urxvt but utilizing not only the preview pane but the 101 | # whole terminal window. 102 | # 103 | # * kitty: 104 | # Preview images in full color using kitty image protocol. 105 | # Requires python PIL or pillow library. 106 | # If ranger does not share the local filesystem with kitty 107 | # the transfer method is changed to encode the whole image; 108 | # while slower, this allows remote previews, 109 | # for example during an ssh session. 110 | # Tmux is unsupported. 111 | # 112 | # * ueberzug: 113 | # Preview images in full color with the external command "ueberzug". 114 | # Images are shown by using a child window. 115 | # Only for users who run X11 in GNU/Linux. 116 | set preview_images_method kitty 117 | 118 | # Delay in seconds before displaying an image with the w3m method. 119 | # Increase it in case of experiencing display corruption. 120 | set w3m_delay 0.02 121 | 122 | # Manually adjust the w3mimg offset when using a terminal which needs this 123 | set w3m_offset 0 124 | 125 | # Default iTerm2 font size (see: preview_images_method: iterm2) 126 | set iterm2_font_width 8 127 | set iterm2_font_height 11 128 | 129 | # Use a unicode "..." character to mark cut-off filenames? 130 | set unicode_ellipsis false 131 | 132 | # BIDI support - try to properly display file names in RTL languages (Hebrew, Arabic). 133 | # Requires the python-bidi pip package 134 | set bidi_support false 135 | 136 | # Show dotfiles in the bookmark preview box? 137 | set show_hidden_bookmarks true 138 | 139 | # Which colorscheme to use? These colorschemes are available by default: 140 | # default, jungle, snow, solarized 141 | set colorscheme default 142 | 143 | # Preview files on the rightmost column? 144 | # And collapse (shrink) the last column if there is nothing to preview? 145 | set preview_files true 146 | set preview_directories true 147 | set collapse_preview true 148 | 149 | # Wrap long lines in plain text previews? 150 | set wrap_plaintext_previews false 151 | 152 | # Save the console history on exit? 153 | set save_console_history true 154 | 155 | # Draw the status bar on top of the browser window (default: bottom) 156 | set status_bar_on_top false 157 | 158 | # Draw a progress bar in the status bar which displays the average state of all 159 | # currently running tasks which support progress bars? 160 | set draw_progress_bar_in_status_bar true 161 | 162 | # Draw borders around columns? (separators, outline, both, or none) 163 | # Separators are vertical lines between columns. 164 | # Outline draws a box around all the columns. 165 | # Both combines the two. 166 | set draw_borders none 167 | 168 | # Display the directory name in tabs? 169 | set dirname_in_tabs false 170 | 171 | # Enable the mouse support? 172 | set mouse_enabled true 173 | 174 | # Display the file size in the main column or status bar? 175 | set display_size_in_main_column true 176 | set display_size_in_status_bar true 177 | 178 | # Display the free disk space in the status bar? 179 | set display_free_space_in_status_bar true 180 | 181 | # Display files tags in all columns or only in main column? 182 | set display_tags_in_all_columns true 183 | 184 | # Set a title for the window? Updates both `WM_NAME` and `WM_ICON_NAME` 185 | set update_title false 186 | 187 | # Set the tmux/screen window-name to "ranger"? 188 | set update_tmux_title true 189 | 190 | # Shorten the title if it gets long? The number defines how many 191 | # directories are displayed at once, 0 turns off this feature. 192 | set shorten_title 3 193 | 194 | # Show hostname in titlebar? 195 | set hostname_in_titlebar true 196 | 197 | # Abbreviate $HOME with ~ in the titlebar (first line) of ranger? 198 | set tilde_in_titlebar false 199 | 200 | # How many directory-changes or console-commands should be kept in history? 201 | set max_history_size 20 202 | set max_console_history_size 50 203 | 204 | # Try to keep so much space between the top/bottom border when scrolling: 205 | set scroll_offset 8 206 | 207 | # Flush the input after each key hit? (Noticeable when ranger lags) 208 | set flushinput true 209 | 210 | # Padding on the right when there's no preview? 211 | # This allows you to click into the space to run the file. 212 | set padding_right true 213 | 214 | # Save bookmarks (used with mX and `X) instantly? 215 | # This helps to synchronize bookmarks between multiple ranger 216 | # instances but leads to *slight* performance loss. 217 | # When false, bookmarks are saved when ranger is exited. 218 | set autosave_bookmarks true 219 | 220 | # Save the "`" bookmark to disk. This can be used to switch to the last 221 | # directory by typing "``". 222 | set save_backtick_bookmark true 223 | 224 | # You can display the "real" cumulative size of directories by using the 225 | # command :get_cumulative_size or typing "dc". The size is expensive to 226 | # calculate and will not be updated automatically. You can choose 227 | # to update it automatically though by turning on this option: 228 | set autoupdate_cumulative_size false 229 | 230 | # Turning this on makes sense for screen readers: 231 | set show_cursor false 232 | 233 | # One of: size, natural, basename, atime, ctime, mtime, type, random 234 | set sort natural 235 | 236 | # Additional sorting options 237 | set sort_reverse false 238 | set sort_case_insensitive true 239 | set sort_directories_first true 240 | set sort_unicode false 241 | 242 | # Enable this if key combinations with the Alt Key don't work for you. 243 | # (Especially on xterm) 244 | set xterm_alt_key false 245 | 246 | # Whether to include bookmarks in cd command 247 | set cd_bookmarks true 248 | 249 | # Changes case sensitivity for the cd command tab completion 250 | set cd_tab_case sensitive 251 | 252 | # Use fuzzy tab completion with the "cd" command. For example, 253 | # ":cd /u/lo/b" expands to ":cd /usr/local/bin". 254 | set cd_tab_fuzzy false 255 | 256 | # Avoid previewing files larger than this size, in bytes. Use a value of 0 to 257 | # disable this feature. 258 | set preview_max_size 0 259 | 260 | # The key hint lists up to this size have their sublists expanded. 261 | # Otherwise the submaps are replaced with "...". 262 | set hint_collapse_threshold 10 263 | 264 | # Add the highlighted file to the path in the titlebar 265 | set show_selection_in_titlebar true 266 | 267 | # The delay that ranger idly waits for user input, in milliseconds, with a 268 | # resolution of 100ms. Lower delay reduces lag between directory updates but 269 | # increases CPU load. 270 | set idle_delay 2000 271 | 272 | # When the metadata manager module looks for metadata, should it only look for 273 | # a ".metadata.json" file in the current directory, or do a deep search and 274 | # check all directories above the current one as well? 275 | set metadata_deep_search false 276 | 277 | # Clear all existing filters when leaving a directory 278 | set clear_filters_on_dir_change false 279 | 280 | # Disable displaying line numbers in main column. 281 | # Possible values: false, absolute, relative. 282 | set line_numbers false 283 | 284 | # When line_numbers=relative show the absolute line number in the 285 | # current line. 286 | set relative_current_zero false 287 | 288 | # Start line numbers from 1 instead of 0 289 | set one_indexed false 290 | 291 | # Save tabs on exit 292 | set save_tabs_on_exit false 293 | 294 | # Enable scroll wrapping - moving down while on the last item will wrap around to 295 | # the top and vice versa. 296 | set wrap_scroll false 297 | 298 | # Set the global_inode_type_filter to nothing. Possible options: d, f and l for 299 | # directories, files and symlinks respectively. 300 | set global_inode_type_filter 301 | 302 | # This setting allows to freeze the list of files to save I/O bandwidth. It 303 | # should be 'false' during start-up, but you can toggle it by pressing F. 304 | set freeze_files false 305 | 306 | # Print file sizes in bytes instead of the default human-readable format. 307 | set size_in_bytes false 308 | 309 | # Warn at startup if RANGER_LEVEL env var is greater than 0, in other words 310 | # give a warning when you nest ranger in a subshell started by ranger. 311 | # Special value "error" makes the warning more visible. 312 | set nested_ranger_warning true 313 | 314 | # =================================================================== 315 | # == Local Options 316 | # =================================================================== 317 | # You can set local options that only affect a single directory. 318 | 319 | # Examples: 320 | # setlocal path=~/downloads sort mtime 321 | 322 | # =================================================================== 323 | # == Command Aliases in the Console 324 | # =================================================================== 325 | 326 | alias e edit 327 | alias q quit 328 | alias q! quit! 329 | alias qa quitall 330 | alias qa! quitall! 331 | alias qall quitall 332 | alias qall! quitall! 333 | alias setl setlocal 334 | 335 | alias filter scout -prts 336 | alias hide scout -prtsv 337 | alias find scout -aets 338 | alias mark scout -mr 339 | alias unmark scout -Mr 340 | alias search scout -rs 341 | alias search_inc scout -rts 342 | alias travel scout -aefklst 343 | 344 | # =================================================================== 345 | # == Define keys for the browser 346 | # =================================================================== 347 | 348 | # Basic 349 | map Q quitall 350 | map q quit 351 | copymap q ZZ ZQ 352 | 353 | map R reload_cwd 354 | map F set freeze_files! 355 | map reset 356 | map redraw_window 357 | map abort 358 | map change_mode normal 359 | map ~ set viewmode! 360 | 361 | map i display_file 362 | map scroll_preview 1 363 | map scroll_preview -1 364 | map ? help 365 | map W display_log 366 | map w taskview_open 367 | map S shell $SHELL 368 | 369 | map : console 370 | map ; console 371 | map ! console shell%space 372 | map @ console -p6 shell %%s 373 | map # console shell -p%space 374 | map s console shell%space 375 | map r chain draw_possible_programs; console open_with%space 376 | map f console find%space 377 | map cd console cd%space 378 | 379 | map chain console; eval fm.ui.console.history_move(-1) 380 | 381 | # Change the line mode 382 | map Mf linemode filename 383 | map Mi linemode fileinfo 384 | map Mm linemode mtime 385 | map Mh linemode humanreadablemtime 386 | map Mp linemode permissions 387 | map Ms linemode sizemtime 388 | map MH linemode sizehumanreadablemtime 389 | map Mt linemode metatitle 390 | 391 | # Tagging / Marking 392 | map t tag_toggle 393 | map ut tag_remove 394 | map " tag_toggle tag=%any 395 | map mark_files toggle=True 396 | map v mark_files all=True toggle=True 397 | map uv mark_files all=True val=False 398 | map V toggle_visual_mode 399 | map uV toggle_visual_mode reverse=True 400 | 401 | # For the nostalgics: Midnight Commander bindings 402 | map help 403 | map rename_append 404 | map display_file 405 | map edit 406 | map copy 407 | map cut 408 | map console mkdir%space 409 | map console delete 410 | #map console trash 411 | map exit 412 | 413 | # In case you work on a keyboard with dvorak layout 414 | map move up=1 415 | map move down=1 416 | map move left=1 417 | map move right=1 418 | map move to=0 419 | map move to=-1 420 | map move down=1 pages=True 421 | map move up=1 pages=True 422 | map move right=1 423 | #map console delete 424 | map console touch%space 425 | 426 | # VIM-like 427 | copymap k 428 | copymap j 429 | copymap h 430 | copymap l 431 | copymap gg 432 | copymap G 433 | copymap 434 | copymap 435 | 436 | map J move down=0.5 pages=True 437 | map K move up=0.5 pages=True 438 | copymap J 439 | copymap K 440 | 441 | # Jumping around 442 | map H history_go -1 443 | map L history_go 1 444 | map ] move_parent 1 445 | map [ move_parent -1 446 | map } traverse 447 | map { traverse_backwards 448 | map ) jump_non 449 | 450 | map gh cd ~ 451 | map ge cd /etc 452 | map gu cd /usr 453 | map gd cd /dev 454 | map gl cd -r . 455 | map gL cd -r %f 456 | map go cd /opt 457 | map gv cd /var 458 | map gm cd /media 459 | map gi eval fm.cd('/run/media/' + os.getenv('USER')) 460 | map gM cd /mnt 461 | map gs cd /srv 462 | map gp cd /tmp 463 | map gr cd / 464 | map gR eval fm.cd(ranger.RANGERDIR) 465 | map g/ cd / 466 | map g? cd /usr/share/doc/ranger 467 | 468 | # External Programs 469 | map E edit 470 | map du shell -p du --max-depth=1 -h --apparent-size 471 | map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh 472 | map yp yank path 473 | map yd yank dir 474 | map yn yank name 475 | map y. yank name_without_extension 476 | 477 | # Filesystem Operations 478 | map = chmod 479 | 480 | map cw console rename%space 481 | map a rename_append 482 | map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%")) 483 | map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7) 484 | 485 | map pp paste 486 | map po paste overwrite=True 487 | map pP paste append=True 488 | map pO paste overwrite=True append=True 489 | map pl paste_symlink relative=False 490 | map pL paste_symlink relative=True 491 | map phl paste_hardlink 492 | map pht paste_hardlinked_subtree 493 | map pd console paste dest= 494 | map p` paste dest=%any_path 495 | map p' paste dest=%any_path 496 | 497 | map dD console delete 498 | map dT console trash 499 | 500 | map dd cut 501 | map ud uncut 502 | map da cut mode=add 503 | map dr cut mode=remove 504 | map dt cut mode=toggle 505 | 506 | map yy copy 507 | map uy uncut 508 | map ya copy mode=add 509 | map yr copy mode=remove 510 | map yt copy mode=toggle 511 | 512 | # Temporary workarounds 513 | map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier) 514 | map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier) 515 | map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier) 516 | map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier) 517 | map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier) 518 | map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier) 519 | map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier) 520 | map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier) 521 | 522 | # Searching 523 | map / console search%space 524 | map n search_next 525 | map N search_next forward=False 526 | map ct search_next order=tag 527 | map cs search_next order=size 528 | map ci search_next order=mimetype 529 | map cc search_next order=ctime 530 | map cm search_next order=mtime 531 | map ca search_next order=atime 532 | 533 | # Tabs 534 | map tab_new 535 | map tab_close 536 | map tab_move 1 537 | map tab_move -1 538 | map tab_move 1 539 | map tab_move -1 540 | map gt tab_move 1 541 | map gT tab_move -1 542 | map gn tab_new 543 | map gc tab_close 544 | map uq tab_restore 545 | map tab_open 1 546 | map tab_open 2 547 | map tab_open 3 548 | map tab_open 4 549 | map tab_open 5 550 | map tab_open 6 551 | map tab_open 7 552 | map tab_open 8 553 | map tab_open 9 554 | map tab_shift 1 555 | map tab_shift -1 556 | 557 | # Sorting 558 | map or set sort_reverse! 559 | map oz set sort=random 560 | map os chain set sort=size; set sort_reverse=False 561 | map ob chain set sort=basename; set sort_reverse=False 562 | map on chain set sort=natural; set sort_reverse=False 563 | map om chain set sort=mtime; set sort_reverse=False 564 | map oc chain set sort=ctime; set sort_reverse=False 565 | map oa chain set sort=atime; set sort_reverse=False 566 | map ot chain set sort=type; set sort_reverse=False 567 | map oe chain set sort=extension; set sort_reverse=False 568 | 569 | map oS chain set sort=size; set sort_reverse=True 570 | map oB chain set sort=basename; set sort_reverse=True 571 | map oN chain set sort=natural; set sort_reverse=True 572 | map oM chain set sort=mtime; set sort_reverse=True 573 | map oC chain set sort=ctime; set sort_reverse=True 574 | map oA chain set sort=atime; set sort_reverse=True 575 | map oT chain set sort=type; set sort_reverse=True 576 | map oE chain set sort=extension; set sort_reverse=True 577 | 578 | map dc get_cumulative_size 579 | 580 | # Settings 581 | map zc set collapse_preview! 582 | map zd set sort_directories_first! 583 | map zh set show_hidden! 584 | map set show_hidden! 585 | copymap 586 | copymap 587 | map zI set flushinput! 588 | map zi set preview_images! 589 | map zm set mouse_enabled! 590 | map zp set preview_files! 591 | map zP set preview_directories! 592 | map zs set sort_case_insensitive! 593 | map zu set autoupdate_cumulative_size! 594 | map zv set use_preview_script! 595 | map zf console filter%space 596 | copymap zf zz 597 | 598 | # Filter stack 599 | map .d filter_stack add type d 600 | map .f filter_stack add type f 601 | map .l filter_stack add type l 602 | map .m console filter_stack add mime%space 603 | map .n console filter_stack add name%space 604 | map .# console filter_stack add hash%space 605 | map ." filter_stack add duplicate 606 | map .' filter_stack add unique 607 | map .| filter_stack add or 608 | map .& filter_stack add and 609 | map .! filter_stack add not 610 | map .r filter_stack rotate 611 | map .c filter_stack clear 612 | map .* filter_stack decompose 613 | map .p filter_stack pop 614 | map .. filter_stack show 615 | 616 | # Bookmarks 617 | map ` enter_bookmark %any 618 | map ' enter_bookmark %any 619 | map m set_bookmark %any 620 | map um unset_bookmark %any 621 | 622 | map m draw_bookmarks 623 | copymap m um ` ' p` p' 624 | 625 | # Generate all the chmod bindings with some python help: 626 | eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg)) 627 | eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg)) 628 | eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg)) 629 | eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg)) 630 | eval for arg in "rwxXst": cmd("map +{0} shell -f chmod +{0} %s".format(arg)) 631 | 632 | eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg)) 633 | eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg)) 634 | eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg)) 635 | eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg)) 636 | eval for arg in "rwxXst": cmd("map -{0} shell -f chmod -{0} %s".format(arg)) 637 | 638 | # =================================================================== 639 | # == Define keys for the console 640 | # =================================================================== 641 | # Note: Unmapped keys are passed directly to the console. 642 | 643 | # Basic 644 | cmap eval fm.ui.console.tab() 645 | cmap eval fm.ui.console.tab(-1) 646 | cmap eval fm.ui.console.close() 647 | cmap eval fm.ui.console.execute() 648 | cmap redraw_window 649 | 650 | copycmap 651 | copycmap 652 | 653 | # Move around 654 | cmap eval fm.ui.console.history_move(-1) 655 | cmap eval fm.ui.console.history_move(1) 656 | cmap eval fm.ui.console.move(left=1) 657 | cmap eval fm.ui.console.move(right=1) 658 | cmap eval fm.ui.console.move(right=0, absolute=True) 659 | cmap eval fm.ui.console.move(right=-1, absolute=True) 660 | cmap eval fm.ui.console.move_word(left=1) 661 | cmap eval fm.ui.console.move_word(right=1) 662 | 663 | copycmap 664 | copycmap 665 | 666 | # Line Editing 667 | cmap eval fm.ui.console.delete(-1) 668 | cmap eval fm.ui.console.delete(0) 669 | cmap eval fm.ui.console.delete_word() 670 | cmap eval fm.ui.console.delete_word(backward=False) 671 | cmap eval fm.ui.console.delete_rest(1) 672 | cmap eval fm.ui.console.delete_rest(-1) 673 | cmap eval fm.ui.console.paste() 674 | cmap eval fm.ui.console.transpose_chars() 675 | cmap eval fm.ui.console.transpose_words() 676 | 677 | # And of course the emacs way 678 | copycmap 679 | copycmap 680 | copycmap 681 | copycmap 682 | copycmap 683 | copycmap 684 | copycmap 685 | copycmap 686 | copycmap 687 | 688 | # Note: There are multiple ways to express backspaces. (code 263) 689 | # and (code 127). To be sure, use both. 690 | copycmap 691 | 692 | # This special expression allows typing in numerals: 693 | cmap false 694 | 695 | # =================================================================== 696 | # == Pager Keybindings 697 | # =================================================================== 698 | 699 | # Movement 700 | pmap pager_move down=1 701 | pmap pager_move up=1 702 | pmap pager_move left=4 703 | pmap pager_move right=4 704 | pmap pager_move to=0 705 | pmap pager_move to=-1 706 | pmap pager_move down=1.0 pages=True 707 | pmap pager_move up=1.0 pages=True 708 | pmap pager_move down=0.5 pages=True 709 | pmap pager_move up=0.5 pages=True 710 | 711 | copypmap k 712 | copypmap j 713 | copypmap h 714 | copypmap l 715 | copypmap g 716 | copypmap G 717 | copypmap d 718 | copypmap u 719 | copypmap n f 720 | copypmap p b 721 | 722 | # Basic 723 | pmap redraw_window 724 | pmap pager_close 725 | copypmap q Q i 726 | pmap E edit_file 727 | 728 | # =================================================================== 729 | # == Taskview Keybindings 730 | # =================================================================== 731 | 732 | # Movement 733 | tmap taskview_move up=1 734 | tmap taskview_move down=1 735 | tmap taskview_move to=0 736 | tmap taskview_move to=-1 737 | tmap taskview_move down=1.0 pages=True 738 | tmap taskview_move up=1.0 pages=True 739 | tmap taskview_move down=0.5 pages=True 740 | tmap taskview_move up=0.5 pages=True 741 | 742 | copytmap k 743 | copytmap j 744 | copytmap g 745 | copytmap G 746 | copytmap u 747 | copytmap n f 748 | copytmap p b 749 | 750 | # Changing priority and deleting tasks 751 | tmap J eval -q fm.ui.taskview.task_move(-1) 752 | tmap K eval -q fm.ui.taskview.task_move(0) 753 | tmap dd eval -q fm.ui.taskview.task_remove() 754 | tmap eval -q fm.ui.taskview.task_move(-1) 755 | tmap eval -q fm.ui.taskview.task_move(0) 756 | tmap eval -q fm.ui.taskview.task_remove() 757 | 758 | # Basic 759 | tmap redraw_window 760 | tmap taskview_close 761 | copytmap q Q w 762 | default_linemode devicons 763 | -------------------------------------------------------------------------------- /config/ranger/plugins/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anurag3301/my-linux-setup/5d6fe902dd11c6365ae4d1d7f84ad9b6a4964d85/config/ranger/plugins/__init__.py -------------------------------------------------------------------------------- /config/xorg/xinitkde: -------------------------------------------------------------------------------- 1 | export DESKTOP_SESSION=plasma 2 | exec startplasma-x11 3 | -------------------------------------------------------------------------------- /config/xorg/xinitrc: -------------------------------------------------------------------------------- 1 | # Wallpaper 2 | nitrogen --restore & 3 | 4 | # DWM Status 5 | dwmbar & 6 | 7 | # Notification client 8 | dunst & 9 | 10 | # The compositor 11 | picom & 12 | 13 | # Enable Numlock 14 | numlockx & 15 | 16 | # Startup application 17 | spotify & 18 | sleep 1 19 | xdotool set_window --classname Spotify --class spotify --name Spotify $(wmctrl -l | awk 'END{print $1}') 20 | discord & 21 | brave & 22 | kdeconnect-app & 23 | xournalpp & 24 | thunderbird & 25 | 26 | # see https://unix.stackexchange.com/a/295652/332452 27 | source /etc/X11/xinit/xinitrc.d/50-systemd-user.sh 28 | 29 | # see https://wiki.archlinux.org/title/GNOME/Keyring#xinitrc 30 | eval $(/usr/bin/gnome-keyring-daemon --start) 31 | export SSH_AUTH_SOCK 32 | 33 | while true; do 34 | # Log stderror to a file 35 | dwm 2> ~/.dwm.log 36 | # No error logging 37 | dwm >/dev/null 2>&1 38 | done 39 | 40 | # Execute dwm 41 | exec dwm 42 | 43 | -------------------------------------------------------------------------------- /git.md: -------------------------------------------------------------------------------- 1 | ## GIT Config: 2 | ```sh 3 | git config --global user.name "Anurag Kumar Singh" 4 | git config --global user.email anurag3301.0x0@gmail.com 5 | 6 | git config --global core.editor "vim" # For VIM 7 | git config --global core.editor "code --wait" # For VS Code 8 | 9 | git config --global core.autocrlf input # For Mac/Linux 10 | git config --global core.autocrlf type # For Windows 11 | 12 | git config --global -e 13 | ``` 14 | 15 | ## SSH Key Setup: 16 | ```sh 17 | #Generate a new SSH public/private key: 18 | ssh-keygen -t rsa -b 4096 -C "anurag3301.0x0@gmail.com" 19 | 20 | #Activate SSH agent: 21 | eval $(ssh-agent -s) 22 | #For windows 23 | Get-Service ssh-agent | Set-Service -StartupType Automatic -PassThru | Start-Service 24 | start-ssh-agent.cmd 25 | 26 | #Add the new key: 27 | ssh-add ~/.ssh/id_rsa 28 | 29 | #Copy the public key from output of following command: 30 | cat ~/.ssh/id_rsa.pub 31 | 32 | #Paste The Key in GitHub > Setting > SSH and GPG keys > New SSH key 33 | ``` 34 | 35 | ## GPG Key Setup: 36 | ```sh 37 | #Generate a GPG key and enter the details: 38 | gpg --full-gen-key 39 | 40 | #Get your GPG keys and get the part after / in the line starts with "sec". Eg 0E6198DFB2D67A26: 41 | gpg --list-secret-keys --keyid-format long 42 | 43 | #Get the public key using the GPG key ID and paste it to GitHub > Setting > SSH and GPG keys > New GPG key: 44 | gpg --armor --export {KEY ID} 45 | gpg --armor --export E46B6F176910EA41 46 | 47 | #Now config your git to sign commits using the KEY-ID: 48 | git config --global user.signingkey E46B6F176910EA41 49 | git config --global user.signingkey {KEY-ID} 50 | 51 | #Now congit your git to sign every commit made on the system: 52 | git config --global commit.gpgsign true 53 | ``` 54 | 55 | ## Backup GPG and SSH key: 56 | #### For GPG key 57 | ```sh 58 | # List the gpg keys info 59 | gpg --list-secret-keys --keyid-format LONG 60 | 61 | # Get the id get the part after / in the line starts with "sec". Eg E46B6F176910EA41: 62 | gpg --export-secret-keys $ID > my-private-key.asc 63 | ``` 64 | #### For SSH key 65 | ```sh 66 | # Just zip the ~/.ssh dir 67 | cd ~ && zip -r ssh-key.zip .ssh 68 | ``` 69 | 70 | ## Restore GPG and SSH Key 71 | #### For GPG key 72 | ```sh 73 | gpg --import my-private-key.asc 74 | ``` 75 | ### For SSH key 76 | ```sh 77 | cp ssh-key.zip ~ && cd ~ && unzip ssh-key.zip 78 | chown anurag:anurag ~/.ssh/id_rsa* 79 | chmod 600 ~/.ssh/id_rsa 80 | chmod 644 ~/.ssh/id_rsa.pub 81 | eval $(ssh-agent -s) 82 | ssh-add ~/.ssh/id_rsa 83 | ``` 84 | -------------------------------------------------------------------------------- /scripts/4chan.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [[ ${#2} == 0 ]] 4 | then 5 | echo "Please provide input as: 4chan [Thread Code] [DirName]" 6 | echo "Example: 4chan 24148672 demo" 7 | exit 8 | fi 9 | 10 | board=$1 11 | thread_code=$2 12 | dir=$3 13 | 14 | base_dir="$HOME/.chan" 15 | complete_dir="$base_dir/$board/$dir" 16 | echo $complete_dir 17 | 18 | base_url="https://boards.4chan.org" 19 | complete_url="$base_url/$board/thread/$thread_code" 20 | echo $complete_url 21 | 22 | mkdir -p $complete_dir 23 | cd $complete_dir 24 | 25 | 26 | curl $complete_url | grep -Po '(?<=href=")[^"]*\.(webm|jpg|png)' | awk '{ print "https:"$1 }' | uniq | xargs wget -nc -T 3 27 | 28 | echo "\n!! DOWNLOAD COMPLETED !!" 29 | -------------------------------------------------------------------------------- /scripts/8muser.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | 3 | import os 4 | from multiprocessing.dummy import Pool 5 | from queue import Queue 6 | from selenium import webdriver 7 | from selenium.webdriver.chrome.options import Options 8 | from bs4 import BeautifulSoup 9 | from threading import Thread 10 | import urllib.request 11 | import requests 12 | import shutil 13 | 14 | options = Options() 15 | options.headless = True 16 | chrome_driver_path = r"/home/anurag/dl/chromedriver" 17 | base_url = "https://www.8muses.com" 18 | 19 | def fetch_image_url(url,filename,download_location): 20 | if os.path.exists(os.path.join(download_location,str(filename)+".png")): 21 | print(f"Filename Exists, skipping") 22 | return 23 | driver = webdriver.Chrome(chrome_driver_path, chrome_options=options) 24 | driver.get(url) 25 | page = driver.page_source 26 | soup = BeautifulSoup(page,"lxml") 27 | image_url = "http:"+soup.find("img",{"class":"image"})['src'] 28 | download_image(image_url,filename,download_location) 29 | 30 | def download_image(image_url,filename,download_location): 31 | r = requests.get(image_url,stream=True, headers={'User-agent': 'Mozilla/5.0'}) 32 | if r.status_code == 200: 33 | with open(os.path.join(download_location,str(filename)+".png"), 'wb') as f: 34 | r.raw.decode_content = True 35 | shutil.copyfileobj(r.raw, f) 36 | print("Downloaded page {pagenumber}".format(pagenumber=filename)) 37 | 38 | 39 | if __name__=="__main__": 40 | print("Album Url : ") 41 | album_url = input() 42 | 43 | download_location = os.path.join(os.environ['HOME'], ".com") 44 | if not os.path.exists(download_location): 45 | os.mkdir(download_location) 46 | 47 | driver = webdriver.Chrome(chrome_driver_path, chrome_options=options) 48 | print("Loading Comic...") 49 | driver.get(album_url) 50 | album_html = driver.page_source 51 | print("Comic successfully loaded") 52 | soup = BeautifulSoup(album_html,"lxml") 53 | comic_name = soup.find("title").text.split("|")[0].strip() 54 | download_location = os.path.join(download_location,comic_name) 55 | if not os.path.exists(download_location): 56 | os.mkdir(download_location) 57 | print("Finding comic's pages") 58 | images = soup.find_all("a",{"class":"c-tile t-hover"}) 59 | page_urls = [] 60 | pages = [] 61 | threads = [] 62 | for image in images: 63 | page_urls.append(base_url + image['href']) 64 | print("Found {} pages".format(len(page_urls))) 65 | for i in range(len(page_urls)): 66 | pages.append((page_urls[i],i,download_location)) 67 | p = Pool(3) # 3 threads in the pool 68 | p.starmap(fetch_image_url,pages) 69 | p.close() 70 | p.join() 71 | driver.quit() 72 | print ("DONE ! Happy Reading ") 73 | -------------------------------------------------------------------------------- /scripts/audio.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #devices 4 | speakers="alsa_output.pci-0000_05_00.1.hdmi-stereo-extra1" 5 | headphone="alsa_output.pci-0000_07_00.4.analog-stereo" 6 | 7 | curr_device="$(pactl get-default-sink)" 8 | 9 | if [ "$curr_device" = $speakers ] 10 | then 11 | pactl set-default-sink $headphone 12 | else 13 | pactl set-default-sink $speakers 14 | fi 15 | -------------------------------------------------------------------------------- /scripts/colpick.sh: -------------------------------------------------------------------------------- 1 | var=$(colorpicker --short --one-shot | awk -F 'd' '{ print tolower($1)}'); 2 | echo "$var"; 3 | echo "$var" |tr -d '\n' | xclip -selection clipboard; notify-send " " "$var Copied to clipboard "; 4 | -------------------------------------------------------------------------------- /scripts/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anurag3301/my-linux-setup/5d6fe902dd11c6365ae4d1d7f84ad9b6a4964d85/scripts/icon.png -------------------------------------------------------------------------------- /scripts/lsserial: -------------------------------------------------------------------------------- 1 | 2 | """ 3 | 4 | lsserial.py 5 | 6 | This script lists the serial devices connected in verbose and summarized lists. 7 | It is tested on Python3 only. 8 | If you prefer a single line command, there are some alternatives below. 9 | 10 | # Prerequisites 11 | pip install pyserial 12 | 13 | # Create alias in ~/.bash_profile or ~/.zshrc 14 | alias lsserial='python3 ~/lsserial.py' 15 | 16 | # If you only need the summary, you just need to run this command in bash 17 | python3 -m serial.tools.list_ports 18 | 19 | # Alternate solution in pure bash for macOS 20 | alias lsserial_b='ls -1 /dev/tty.* | grep -v -e Bluetooth -e Jabra' 21 | 22 | # Alternate solution in pure bash for Raspberry Pi OS 23 | alias lsserial_b='ls -1 /dev/tty* | grep tty[A-Z] | grep -v -e Bluetooth -e Jabra' 24 | 25 | # Ubuntu & Raspberry Pi OS serial diagnostic with this command 26 | dmesg 27 | 28 | """ 29 | 30 | import serial.tools.list_ports 31 | import sys 32 | 33 | 34 | EXCLUDED_PORTS = [ 35 | "Bluetooth", 36 | "Jabra", 37 | ] 38 | 39 | 40 | def filter_out_excluded_ports(): 41 | """ ___ """ 42 | ports = [] 43 | for port in serial.tools.list_ports.comports(): 44 | excluded_found = False 45 | for excluded_port in EXCLUDED_PORTS: 46 | if port.device.find(excluded_port) > -1: 47 | excluded_found = True 48 | break 49 | if excluded_found: 50 | continue 51 | ports.append(port) 52 | return ports 53 | 54 | 55 | def lsserial_verbosity_1(ports): 56 | """ ___ """ 57 | print("# SERIAL PORTS DETAILS") 58 | for counter, port in enumerate(ports): 59 | if not port.vid: 60 | continue 61 | print("") 62 | print("- ID: %d" % (counter)) 63 | print(" port.device: %s" % (port.device)) 64 | print(" port.name: %s" % (port.name)) 65 | print(" port.description: %s" % (port.description)) 66 | print(" port.hwid: %s" % (port.hwid)) 67 | print(" port.vid: %s" % (port.vid)) 68 | print(" port.pid: %s" % (port.pid)) 69 | print(" port.serial_number: %s" % (port.serial_number)) 70 | print(" port.location: %s" % (port.location)) 71 | print(" port.manufacturer: %s" % (port.manufacturer)) 72 | print(" port.product: %s" % (port.product)) 73 | print(" port.interface: %s" % (port.interface)) 74 | 75 | 76 | def lsserial_verbosity_0(ports): 77 | """ ___ """ 78 | print("# SERIAL PORTS SUMMARY\n") 79 | for counter, port in enumerate(ports): 80 | if not port.vid: 81 | continue 82 | print("-port %s: %s" % (port.device, port.description)) 83 | 84 | 85 | def main(): 86 | """ ___ """ 87 | ports = filter_out_excluded_ports() 88 | if len(ports) == 0: 89 | print("# NO SERIAL PORT FOUND") 90 | else: 91 | if len(sys.argv) > 1: 92 | if sys.argv[1] == '-s': 93 | lsserial_verbosity_0(ports) 94 | else: 95 | lsserial_verbosity_0(ports) 96 | else: 97 | lsserial_verbosity_1(ports) 98 | 99 | 100 | if __name__ == "__main__": 101 | main() 102 | -------------------------------------------------------------------------------- /scripts/package_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sudo pacman -Sy bat bpython cmake cmatrix discord dmenu dunst evince exa ffmpeg figlet firefox gcc gimp grep htop imagemagick kitty lolcat maim neofetch nitrogen npm nvtop obs-studio picom playerctl ranger telegram-desktop v4l-utils vlc openssh noto-fonts-emoji python-pillow gnome-boxes python-pip tk xclip xorg-xsetroot neovim lazygit testdisk lxappearance-gtk3 firefox wget nvidia nvidia-settings unzip alsa-utils pulseaudio xorg xorg-xinit libx11 libxinerama libxft webkit2gtk numlockx ncdu dos2unix fzf luarocks mpv nodejs numlockx screenkey stlink terminator cups cups-pdf system-config-printer 4 | 5 | paru -Sy brave-bin ccrypt spofity visual-studio-code-bin gotop cloudflare-warp-bin authy epson-inkjet-printer-escpr2 6 | -------------------------------------------------------------------------------- /scripts/record.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ARG=${1?Error: no input given} 3 | 4 | case "$ARG" in 5 | "d") 6 | echo "Recording Desktop audio" & 7 | ffmpeg -y -f pulse -i $(pactl get-default-sink).monitor\ 8 | "$HOME/vid/desktop_$(date '+%d-%m-%y-%H:%M:%S').wav";; 9 | 10 | "m") 11 | echo "Recording Mircrophone audio" & 12 | ffmpeg -y -f pulse -i alsa_input.usb-DCMT_Technology_USB_Condenser_Microphone_214b206000000178-00.mono-fallback\ 13 | "$HOME/vid/mictrophone_$(date '+%d-%m-%y-%H:%M:%S').wav";; 14 | 15 | "s1") 16 | echo "Recording with screen 1" & 17 | ffmpeg -y -f x11grab -r 25 -s $(xrandr | fgrep '*' | awk '{print $1}')\ 18 | -i :0.0 -vcodec libx264 -preset ultrafast\ 19 | "$HOME/vid/record_$(date '+%d-%m-%y-%H:%M:%S').mkv";; 20 | 21 | "s2") echo "Recording with screen 2" ;; 22 | 23 | "s1m") echo "Recording with screen 1 and microphone" & 24 | ffmpeg -y -f pulse -i alsa_input.usb-DCMT_Technology_USB_Condenser_Microphone_214b206000000178-00.mono-fallback\ 25 | -f x11grab -r 25 -s $(xrandr | fgrep '*' | awk '{print $1}')\ 26 | -i :0.0 -vcodec libx264 -preset ultrafast\ 27 | "$HOME/vid/record_$(date '+%d-%m-%y-%H:%M:%S').mkv";; 28 | 29 | "s2m") echo "Recording with screen 2 and microphone" ;; 30 | 31 | "s1d") echo "Recording with screen 1 and desktop audio" & 32 | ffmpeg -y -f pulse -i $(pactl get-default-sink).monitor\ 33 | -f x11grab -r 25 -s $(xrandr | fgrep '*' | awk '{print $1}')\ 34 | -i :0.0 -vcodec libx264 -preset ultrafast\ 35 | "$HOME/vid/record_$(date '+%d-%m-%y-%H:%M:%S').mkv";; 36 | 37 | "s2d") echo "Recording with screen 2 and desktop audio" ;; 38 | 39 | "s1dm") echo "Recording with screen 1 and both microphone and desktop audio" & 40 | ffmpeg -f x11grab -r 25 -s $(xrandr | fgrep '*' | awk '{print $1}') -i :0.0 \ 41 | -vcodec libx264 -preset ultrafast\ 42 | -f pulse -i $(pactl get-default-sink).monitor -f pulse -i\ 43 | alsa_input.usb-DCMT_Technology_USB_Condenser_Microphone_214b206000000178-00.mono-fallback\ 44 | -filter_complex "[0][1] amix [a]" -map "[a]" -threads 2\ 45 | "$HOME/vid/record_$(date '+%d-%m-%y-%H:%M:%S').mkv";; 46 | 47 | "s2dm") echo "Recording with screen 2 and both microphone and desktop audio" ;; 48 | esac 49 | 50 | -------------------------------------------------------------------------------- /scripts/upload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | if [[ "$1" == "-u" ]] 4 | then 5 | if [[ ${#2} > 0 ]] 6 | then 7 | if [[ -f "$(pwd)/$2" ]] 8 | then 9 | command="curl -s -F'file=@$(pwd)/$2' -H 'X-Upload-Key: $VPS_FILE_UPLOAD_KEY' https://anurag3301.com/upload" 10 | echo "Uploading: $(pwd)/$2" 11 | 12 | url=$(eval $command) 13 | echo "URL: $url" 14 | 15 | printf "$url" | xclip -sel clip 16 | notify-send "File Uploaded" "URL: $url \ncopied to clipboard" -t 5000 -i "$HOME/.program/icon.png" 17 | 18 | entry="$(date '+%d-%m-%y-%H:%M:%S') $url $(echo $2 | awk -F'/' '{print $(NF)}')" 19 | echo $entry >> $HOME/.0x0_list 20 | echo "Uploaded" 21 | else 22 | echo "File doesnt exist" 23 | fi 24 | else 25 | echo "Please give a file name" 26 | fi 27 | 28 | elif [[ "$1" == "-l" ]] 29 | then 30 | if [[ ${#2} > 0 ]] 31 | then 32 | if [[ $2 =~ ^[0-9]+$ ]] 33 | then 34 | cat ~/.0x0_list | tail -$2 35 | else 36 | echo "Enter a valid integer" 37 | fi 38 | else 39 | cat ~/.0x0_list | less 40 | fi 41 | 42 | elif [[ "$1" == "-e" ]] 43 | then 44 | $EDITOR ~/.0x0_list 45 | 46 | elif [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]] 47 | then 48 | echo "Usage: upload [OPTION]... [FILE]... 49 | 50 | Uploads file to 0x0 server(no login needed), copies the URL for file to 51 | clipboard and also stores the URLs in ~/.0x0_list 52 | 53 | OPTIONS: 54 | -h, --help Prints the help 55 | -u [File] specify the file to be uploaded, filename in cwd or absolute/relative path works 56 | -l [number] List the last n uploads with their URL, if number not specified it will all the URLS 57 | -e Opens the ~/.0x0_list file for editing 58 | 59 | EXAMPLE: 60 | upload -u hello.txt 61 | upload -u dir/hello.txt 62 | upload -u /home/user/dir/hello.txt 63 | upload -l 64 | upload -l 10 65 | upload -e 66 | " 67 | 68 | else 69 | echo "Invalid argument, run: upload --help" 70 | fi 71 | -------------------------------------------------------------------------------- /scripts/wacom.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | id="$(xsetwacom list devices | grep stylus | awk '{print $9}')" 4 | 5 | if [ "$1" == "l" ] 6 | then 7 | xsetwacom set $id MapToOutput 2560x1440+0+0 8 | 9 | elif [ "$1" == "r" ] 10 | then 11 | xsetwacom set $id MapToOutput 1366x768+1366+0 12 | 13 | else 14 | echo "Invalid input" 15 | fi 16 | 17 | -------------------------------------------------------------------------------- /scripts/warp_toggle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | warp_status="$(timeout 1 warp-cli status | head -1 | awk '{print $3}' 2> /dev/null)" 4 | 5 | if [ "$warp_status" == "Connected" ]; then 6 | warp-cli disconnect 7 | elif [ "$warp_status" == "Disconnected." ]; then 8 | warp-cli connect 9 | else 10 | warp-cli connect 11 | fi 12 | -------------------------------------------------------------------------------- /wallpaper-gris.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anurag3301/my-linux-setup/5d6fe902dd11c6365ae4d1d7f84ad9b6a4964d85/wallpaper-gris.jpg --------------------------------------------------------------------------------