Skip to content

sigfaulterror/kali-config

 
 

Repository files navigation

Introduction

This is my Kali Linux configuration. I have decided to publish it for everyone out there, feel free to use it and optimize it to your liking. :)

Note: Please install this in a new virtual machine and not in a working machine to avoid errors.

Last tested in: kali-linux-2021.4a-vmware-amd64 with 4 GB of RAM.

Don't forget to give me a ⭐ to motivate me to continue adding cool features to this configuration.

Relevant Content

Cool Features

  • Normally you would use Windows + Alt + R to reload bspwn in order to fix the wallpaper and the polybar when changing screen resolution but I have made a script with xeventbind and a polybar configuration so that you don't have to reload bspwm. In other words, it automatically changes the wallpaper and the polybar resolution/size when changing the screen resolution without the need to reload bspwm.

  • You can use Windows + Alt + W to shuffle wallpapers and change colors on the fly. Alternatively, you could use Windows + Alt + E to change to a specific wallpaper using the GUI.

  • The alacritty terminal font size can be changed with Windows + Alt + F.

  • You can change the corners of the windows and the polybar to rounded or sharp corners with Windows + Alt + B.

  • You can also copy IPs to the clipboard with a left click on the bar (ethernet, vpn or target).

  • There's a VPN status bar, it shows your VPN IP when connected and it tells you when you're disconnected from a VPN.

  • There's a network bar where you can configure your network.

  • On zsh you can set the target IP with the command settarget 10.10.10.10. You can use the command cleartarget to clear the target IP.

Latest Features Added

  • New wallpaper changer.

  • New alacritty font changer.

Latest Issues Fixed

Here is a list of issues that have been fixed:

  • Tmux color issue (fixed)

  • Rofi color issue (fixed)

  • Python2 issue (fixed)

Overview

Edit-1.mp4

This is the look of my dotfiles configuration.

Installation

I recommend having 4 GB of RAM or more (but no less than 4GB) because alacritty takes quite an amount of memory when compiling/building it.

Make sure to disable sleep because the script can take a while to finish doing its stuff. This is optional but recommended.

  1. Clone this repo and change the directory:
cd ~ && git clone https://github.com/wixnic/kali-config.git && cd kali-config

IMPORTANT: Clone this in the home folder, otherwise modify the script and change some directories in the script.

  1. Run the script (The script already creates a swap partition to avoid issues):
./install.sh

The installation can take a while because it downloads a lot of things. The time that it takes to finish will depend mostly on your internet download bandwidth provided by your ISP.

image

You may want to launch wireshark with rofi, however running rofi as root can be bad. If your prefer capturing packets as your low-priv user then you want to choose 'Yes' and you will be able to launch wireshark with rofi and be able to capture packets, otherwise choose 'No' and run wireshark from a terminal with sudo.

nodejs

When prompted here type y for yes. This will install node.js which is needed for the coc plugin in neovim.

  1. Reboot the machine (required):
reboot

bspwm-login

Once you have rebooted the machine, select bspwm as the window manager and then login.

  1. Open alacritty with Windows + Enter.

  2. Run sudo su to switch to the root user.

image

To fix this error just do Windows + Alt + W. This will execute the changer script which changes your environment.

After generating wal cache files. Create a Symlink to the root directory for the root user, this will sync the cache as well.

sudo ln -s /home/kali/.cache/wal /root/.cache/wal
  1. Install Neovim plugins.

That's it, now hit two (2) times the following keyboard shorcuts:

  • Windows + Alt + W and Windows + Alt + B and see which look you like the most.

Note: You may need to hit those keyboard shortcuts multiple times when you first install this configuration.

Configuration Files

If you which to change some settings, here are the locations of the configuration files.

alacritty Terminal Configuration

~/.config/alacritty/alacritty.yml

bspwm WM Configuration

~/.config/bspwm/bspwmrc

sxhkd Keyboard Shortcuts Configuration

~/.config/sxhkd/sxhkdrc

picom Transparency Configuration

~/.config/picom/picom.conf

nvim Terminal Text Editor Configuration

~/.config/nvim/init.vim

polybar Workspace and Desktop Panel Configuration

~/.config/polybar/colorblocks/launch.sh

rofi Program Launcher Configuration

~/.config/rofi/config

zsh Shell Configuration

~/.zshrc

BSPWM Mouse

Alt + Left Click move a floating window or swap a tiled window.

Alt + Right Click resize any tiling or floating window.

Keyboard Shortcuts

Windows + Enter : Open the terminal-emulator (alacritty).

Windows + W : Close the current window.

Windows + Alt + R : Restart the bspwm configuration.

Windows + Alt + Q : Logout.

Windows + (⬆⬅⬇➡) : Move through the windows in the current workspace.

Windows + D : Open Rofi and Esc to exit.

Windows + (1,2,3,4,5,6,7,8,9) : Change the workspace.

Windows + T : Change current window to "terminal" (normal) mode. It helps us when the window is in full or floating screen mode.

Windows + M : Change the current window to "full" mode. Press the same keys to return to "terminal" (normal) mode.

Windows + F : Change the current window to full screen mode (it occupies everything including the polybar).

Windows + S : Change the current window to "floating" mode.

Windows + Alt + (1,2,3,4,5,6,7,8,9) : Move the current window to another workspace.

Windows + Alt + (⬆⬅⬇➡) : Resize current window (only works if you are in terminal or floating mode).

Windows + Ctrl + (⬆⬅⬇➡) : Change the position of the current window (only works in floating mode).

Windows + Ctrl + Alt + (⬆⬅⬇➡) : Show a preselection and then open a window (a terminal, firefox, a file, etc.).

Windows + Ctrl + Space: Undo the preselection.

Special sxhkd Shortcuts

Windows + Alt + W: Shuffle through wallpapers with pywal (This will change all the colors according to the wallpaper). ✨

Print: Take a screenshot with flameshot.

Theme

Launch lxappearance a.k.a Customize Look and Feel with rofi (Windows + D).

lxappearance theme

Change the theme to Arc-Dark.

lxapperance icon

Change the icon to Papirus-Dark.

Ristretto Image Viewer

Ristretto

Open the Thunar File Manager which you can launch with rofi, the shortcut for rofi is Windows + D, once you are in Thunar, navigate to the Pictures directory. Right click on a picture, a nice comfortable image viewer is ristretto, which I recommend using.

Picom Configuration

If you want to add transparency to an application, use the xprop WM_CLASS command and select the windows/application that you want to apply transparency to, once you click with the cursor on that application you will get the output of the name, copy that name and add it to your ~/.config/picom/picom.conf file.

Example:

opacity-rule = [
        "95:class_g = 'Alacritty'",
        "99:class_g = 'Code'",
        "99:class_g = 'Sublime_text'"
        "85:class_g = 'YOUR_APPLICATION_NAME'"
];

Neovim

Run this commands as your user and as the root user to correctly install/update the neovim plugins.

nvim

You can ignore this message because once the plugins are updated or installed it'll disappear:

image

  1. Inside nvim, press the : (colon key) and type the following:
:PlugUpdate

This is the output that you should see:

image

You can use Shift + R to retry.

Once installed or updated, you can exit with :q!, and then type vim or nvim to check the health.

  1. Check Health
:checkhealth
  1. coc Intellisense
:CocInstall coc-json coc-tsserver coc-pyright coc-snippets coc-vimlsp
  1. Search
:FZF
:Rg
:BLines
:Lines

nvim health check

nvim checkhealth

In nvim we can perform a health check to verify if there are any errors with some plugins.

Neovim Shortcuts

" Navigation
inoremap <expr> <c-j> ("\<C-n>")
inoremap <expr> <c-k> ("\<C-p>")

" Use **alt** which is M + hjkl to resize windows
nnoremap <M-j>    :resize -2<CR>
nnoremap <M-k>    :resize +2<CR>
nnoremap <M-h>    :vertical resize -2<CR>
nnoremap <M-l>    :vertical resize +2<CR>

" I hate escape more than anything else, quick and dirty Escape
inoremap jk <Esc>
inoremap kj <Esc>

" Easy CAPS
inoremap <c-u> <ESC>viwUi
nnoremap <c-u> viwU<Esc>

" TAB in general mode will move to text buffer
nnoremap <TAB> :bnext<CR>
" SHIFT-TAB will go back
nnoremap <S-TAB> :bprevious<CR>

" Alternate way to save
nnoremap <C-s> :w<CR>
" Alternate way to quit
nnoremap <C-Q> :wq!<CR>
" Use control-c instead of escape
nnoremap <C-c> <Esc>
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"

" Better tabbing
vnoremap < <gv
vnoremap > >gv

" Better window navigation
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

nnoremap <Leader>o o<Esc>^Da
nnoremap <Leader>O O<Esc>^Da

Do you want more coc extensions for nvim?

Check out coc extensions here: https://github.com/neoclide/coc.nvim/wiki/Using-coc-extensions

Do you want more themes for nvim?

Check out this repo: https://github.com/rafi/awesome-vim-colorschemes

Do you want to configure coc.nvim?

Check out this wiki: https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file

Errors

Alacritty

If you're getting errors with compiling alacritty then increase the RAM or create a swap partition.

Firefox

Here is the path for the firefox rofi desktop configuration:

cat .local/share/applications/firefox.desktop

You may want to change the firefox browser icon:

Icon=/home/YOUR_USER/appimages/fire.png

From here is up to you if you want to use firejail, create a symlink or whatever.

Configuring the Polybar and Alacritty

Bottom or Top?

If you want the polybar at the top or bottom, modify the ~/.config/polybar/colorblocks/config.ini:

; Put the bar at the bottom of the screen
bottom = true

; Put the bar at the top of the screen
bottom = false

Borders or No Borders?

If you want to increase or remove the border width of every window, modify the ~/.config/bspwm/bspwmrc:

# On
bspc config border_width 1

# Off
bspc config border_width 0

Rounded Corners

Polybar

Polybar rounded corners or not, modify the .ini files that have the radius variable set:

; rounded corners
radius = 15.0


; no rounded corners
radius = 0

Compton/Picom

If you want to exclude some windows from having rounded corners, modify the ~/.config/compton/compton.conf file or ~/.config/picom/picom.conf file:

; rounded corners
corner-radius = 15.0;

; no rounded corners
corner-radius = 0.0;

; exclude specific programs/apps:
rounded-corners-exclude = [
  #"window_type = 'normal'",
  #"class_g = 'rofi'",
  #"class_g = 'XTerm'",
  #"class_g = 'Polybar'",
  #"class_g = 'code-oss'",
  #"class_g = 'TelegramDesktop'",
  "class_g = 'firefox'"
  #"class_g = 'Thunderbird'
];

This will apply to terminal emulators, rofi and others.

References

If you want learn more about it, check out this repos.

xevent:

Configurations:

Fonts:

nvim Plugins:

About

Kali Linux dotfiles.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 60.4%
  • Shell 39.1%
  • Python 0.5%