huge rework in order to take full advantage of ansible roles

This commit is contained in:
aminnairi
2023-12-30 17:05:26 +01:00
parent b961d14b97
commit bf3625081d
73 changed files with 506 additions and 532 deletions
+21
View File
@@ -0,0 +1,21 @@
---
- name: "Laptop installation & configuration"
hosts: all
connection: local
vars:
ansible_python_interpreter: auto_silent
gather_facts: false
roles:
- base
- xorg
- i3
- background
- fish
- fontconfig
- notification
- kitty
- felix
- tmux
- rofi
- neovim
- ufw
Binary file not shown.

After

Width:  |  Height:  |  Size: 528 KiB

+5
View File
@@ -0,0 +1,5 @@
---
- name: Install background
synchronize:
src: background/background.jpg
dest: /$HOME/.local/share/backgrounds/background.jpg
+245
View File
@@ -0,0 +1,245 @@
---
- name: Update package manager cache
become: true
pacman:
update_cache: true
- name: Install Eza (alternative to ls)
become: true
pacman:
name: eza
state: present
- name: Install Xclip (clipboard manager for X)
become: true
pacman:
name: xclip
state: present
- name: Install Neofetch (operating system informations logger)
become: true
pacman:
name: neofetch
state: present
- name: Install Fd (alternative to find)
become: true
pacman:
name: fd
state: present
- name: Install Python
become: true
pacman:
name: python
state: present
- name: Install Julia
become: true
pacman:
name: julia
state: present
- name: Install Ruby
become: true
pacman:
name: ruby
state: present
- name: Install Composer (PHP package manager)
become: true
pacman:
name: composer
state: present
- name: Install Luarocks (Lua package manager)
become: true
pacman:
name: luarocks
state: present
- name: Install Wget (HTTP client)
become: true
pacman:
name: wget
state: present
- name: Set the keyboard keymap
become: true
command: localectl set-keymap us
- name: Set the keyboard layout
become: true
command: localectl set-x11-keymap us pc105 euro --no-convert compose:ralt
- name: Install Pulsemixer (Pulseaudio Terminal UI)
become: true
pacman:
name: pulsemixer
state: present
- name: Install Bluez (Bluetooth management)
become: true
pacman:
name: bluez
state: present
- name: Install Bluez Utils (Bluetooth utilities)
become: true
pacman:
name: bluez-utils
state: present
- name: Install Bluetuith (Bluetooth Terminal UI)
become: true
kewlfft.aur.aur:
name: bluetuith
state: present
update_cache: true
- name: Install Playerctl (control media playing on the device)
become: true
pacman:
name: playerctl
state: present
- name: Install Evince (PDF viewer & editor)
become: true
pacman:
name: evince
state: present
- name: Install JMTPFS (for accessing MTP devices)
kewlfft.aur.aur:
name: jmtpfs
state: present
update_cache: true
- name: Install Unzip (uncompression utility)
become: true
pacman:
name: unzip
state: present
- name: Install Zip (compression utility)
become: true
pacman:
name: zip
state: present
- name: Install Xdotool (X11 command-line utility)
become: true
pacman:
name: xdotool
state: present
- name: Install Mesa (graphics driver)
become: true
pacman:
name: mesa
state: present
- name: Install Vulkan Radeon (Vulkan for AMDGPU)
become: true
pacman:
name: vulkan-radeon
state: present
- name: Install Libva Mesa (accelerated video decoding driver)
become: true
pacman:
name: libva-mesa-driver
state: present
- name: Install Radeon Top (graphics monitoring)
become: true
pacman:
name: radeontop
state: present
- name: Install Mesa Vdpau (accelerated video decoding driver)
become: true
pacman:
name: mesa-vdpau
state: present
- name: Install rsync (file synchronizer)
become: true
pacman:
name: rsync
state: present
- name: Install Pulseaudio (sound system)
become: true
pacman:
name: pulseaudio
state: present
- name: Install Pulseaudio Systray (system tray volume control)
become: true
pacman:
name: pasystray
state: present
- name: Install ACPID (Power manager)
become: true
pacman:
name: acpid
state: present
- name: Start ACPID service
become: true
service:
enabled: true
name: acpid
state: started
- name: Install Flameshot (screenshot utility)
become: true
pacman:
name: flameshot
state: present
- name: Install dmenu
become: true
pacman:
name: dmenu
state: present
- name: Install Network Manager (Wi-Fi & ethernet manager)
become: true
pacman:
name: networkmanager
state: present
- name: Start Bluetooth service
become: true
service:
enabled: true
name: bluetooth
state: started
- name: Start Network Manager service
become: true
service:
enabled: true
name: NetworkManager
state: started
- name: Install Node.js
become: true
pacman:
name: nodejs
state: present
- name: Install Tokei (line of code counter)
become: true
pacman:
name: tokei
state: present
- name: Install Chromium (web browser)
become: true
pacman:
name: chromium
state: present
- name: Install bottom (processes visualizer)
become: true
pacman:
name: bottom
state: present
- name: Install Zathura (command-line PDF viewer)
become: true
pacman:
name: zathura
state: present
- name: Install Feh (command-line picture viewer)
become: true
pacman:
name: feh
state: present
- name: Install Chafa (command-line graphics)
become: true
pacman:
name: chafa
state: present
- name: Install Zoxide (smarter cd command)
become: true
pacman:
name: zoxide
state: present
- name: Dua (disk usage analyzer)
become: true
pacman:
name: dua-cli
state: present
- name: Install Bat (replacement for cat)
become: true
pacman:
name: bat
state: present
- name: Install Eza (replacement for ls)
become: true
pacman:
name: eza
state: present
@@ -0,0 +1,67 @@
# (Optional)
# Default exec command when open files.
# If not set, will default to $EDITOR.
default: nvim
# (Optional)
# key (the command you want to use when opening files): [values] (extensions)
# In the key, You can use arguments.
exec:
zathura:
- pdf
'feh -.':
- jpg
- jpeg
- png
- gif
- svg
- hdr
# (Optional)
# Whether to use syntax highlighting in the preview mode.
# If not set, will default to false.
syntax_highlight: true
# (Optional)
# Default theme for syntax highlighting.
# Pick one from the following:
# Base16OceanDark
# Base16EightiesDark
# Base16MochaDark
# Base16OceanLight
# InspiredGitHub
# SolarizedDark
# SolarizedLight
# If not set, will default to "Base16OceanDark".
default_theme: Base16OceanDark
# (Optional)
# Path to .tmtheme file for the syntax highlighting.
# If not set, default_theme will be used.
# theme_path: "/home/kyohei/.config/felix/monokai.tmtheme"
# The foreground color of directory, file and symlink.
# Pick one of the following:
# Black // 0
# Red // 1
# Green // 2
# Yellow // 3
# Blue // 4
# Magenta // 5
# Cyan // 6
# White // 7
# LightBlack // 8
# LightRed // 9
# LightGreen // 10
# LightYellow // 11
# LightBlue // 12
# LightMagenta // 13
# LightCyan // 14
# LightWhite // 15
# Rgb(u8, u8, u8)
# AnsiValue(u8)
# For more details, see https://docs.rs/termion/1.5.6/termion/color/index.html
color:
dir_fg: LightCyan
file_fg: LightWhite
symlink_fg: LightYellow
+10
View File
@@ -0,0 +1,10 @@
---
- name: Felix (command-line file manager)
become: true
pacman:
name: felix-rs
state: present
- name: Felix setup
synchronize:
src: felix
dest: /$HOME/.config
@@ -0,0 +1,7 @@
# Path to Oh My Fish install.
set -q XDG_DATA_HOME
and set -gx OMF_PATH "$XDG_DATA_HOME/omf"
or set -gx OMF_PATH "$HOME/.local/share/omf"
# Load Oh My Fish configuration.
source $OMF_PATH/init.fish
+69
View File
@@ -0,0 +1,69 @@
if status is-interactive
# Enable vi-mode
fish_vi_key_bindings
# Set the keyboard rate
xset r rate 200 50
# Set the editor to use vim
set --export --global EDITOR nvim
# Install OMF if it is not already
if test ! -d ~/.local/share/omf
curl -L https://get.oh-my.fish | fish
end
# Alias for the cat command
alias cat="bat --theme ColdDark-Cold"
# Alias for the ls command
alias ls="eza --icons --long --classify --git --total-size --header --created --accessed --modified"
# Add ruby in the global path for Neovim
fish_add_path ~/.local/share/gem/ruby/3.0.0/bin
# configuration for Oh My Fish BobTheFish theme
set -g theme_display_git yes
set -g theme_display_git_dirty yes
set -g theme_display_git_untracked yes
set -g theme_display_git_ahead_verbose yes
set -g theme_display_git_dirty_verbose yes
set -g theme_display_git_stashed_verbose yes
set -g theme_display_git_default_branch yes
set -g theme_git_default_branches development master main
set -g theme_git_worktree_support yes
set -g theme_use_abbreviated_branch_name yes
set -g theme_display_vagrant no
set -g theme_display_docker_machine yes
set -g theme_display_k8s_context yes
set -g theme_display_hg yes
set -g theme_display_virtualenv no
set -g theme_display_nix no
set -g theme_display_ruby no
set -g theme_display_node yes
set -g theme_display_user ssh
set -g theme_display_hostname ssh
set -g theme_display_vi yes
set -g theme_display_date yes
set -g theme_display_cmd_duration yes
set -g theme_title_display_process yes
set -g theme_title_display_path no
set -g theme_title_display_user yes
set -g theme_title_use_abbreviated_path no
set -g theme_date_format "+%a %H:%M"
set -g theme_date_timezone Europe/Paris
set -g theme_avoid_ambiguous_glyphs yes
set -g theme_powerline_fonts yes
set -g theme_nerd_fonts yes
set -g theme_show_exit_status yes
set -g theme_display_jobs_verbose yes
set -g default_user aminnairi
set -g theme_color_scheme dark
set -g fish_prompt_pwd_dir_length 0
set -g theme_project_dir_length 1
set -g theme_newline_cursor yes
set -g theme_newline_prompt '$ '
# Run neofetch on each fish startup
neofetch
end
@@ -0,0 +1,31 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR __fish_initialized:3400
SETUVAR fish_color_autosuggestion:555\x1ebrblack
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:blue
SETUVAR fish_color_comment:red
SETUVAR fish_color_cwd:green
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:green
SETUVAR fish_color_error:brred
SETUVAR fish_color_escape:brcyan
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:normal
SETUVAR fish_color_host_remote:yellow
SETUVAR fish_color_normal:normal
SETUVAR fish_color_operator:brcyan
SETUVAR fish_color_param:cyan
SETUVAR fish_color_quote:yellow
SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold
SETUVAR fish_color_search_match:\x2d\x2dbackground\x3d111
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_key_bindings:fish_vi_key_bindings
SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:B3A06D\x1eyellow\x1e\x2di
SETUVAR fish_pager_color_prefix:cyan\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr
@@ -0,0 +1,5 @@
function decrease_brightness_by --argument-names amount
set --local brightness (cat /sys/class/backlight/*/brightness)
set --local brightness_increased (math $brightness - $amount)
echo $brightness_increased | sudo tee /sys/class/backlight/*/brightness > /dev/null
end
@@ -0,0 +1,5 @@
function increase_brightness_by --argument-names amount
set --local brightness (cat /sys/class/backlight/*/brightness)
set --local brightness_increased (math $brightness + $amount)
echo $brightness_increased | sudo tee /sys/class/backlight/*/brightness > /dev/null
end
@@ -0,0 +1,3 @@
function set_brightness --argument-names amount
echo $amount | sudo tee /sys/class/backlight/*/brightness > /dev/null
end
@@ -0,0 +1,17 @@
function tmux
if test (count $argv) -eq 0
if type -q omf
# Update Oh My Fish if it installed
omf update
end
end
# Install Tmux plugins
~/.tmux/plugins/tpm/bin/install_plugins
# Update Tmux plugins
~/.tmux/plugins/tpm/bin/install_plugins
# Execute TMUX
/usr/bin/tmux -u $argv
end
+3
View File
@@ -0,0 +1,3 @@
theme bobthefish
theme agnoster
theme default
+1
View File
@@ -0,0 +1 @@
stable
+1
View File
@@ -0,0 +1 @@
agnoster
+16
View File
@@ -0,0 +1,16 @@
---
- name: Install Fish (shell)
become: true
pacman:
name: fish
state: present
- name: Setup Fish
synchronize:
delete: true
src: fish
dest: /$HOME/.config
- name: Setup OMF
synchronize:
delete: true
src: omf
dest: /$HOME/.config
@@ -0,0 +1,33 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans</family>
<family>Noto Color Emoji</family>
<family>Noto Emoji</family>
<family>DejaVu Sans</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif</family>
<family>Noto Color Emoji</family>
<family>Noto Emoji</family>
<family>DejaVu Serif</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Noto Mono</family>
<family>Noto Color Emoji</family>
<family>Noto Emoji</family>
<family>JetBrainsMono Nerd Font</family>
</prefer>
</alias>
</fontconfig>
+15
View File
@@ -0,0 +1,15 @@
---
- name: Install JetBrains Mono Nerd (IntelliJ font)
become: true
pacman:
name: ttf-jetbrains-mono-nerd
state: present
- name: Install Noto Fonts Emoji (for emojis support)
become: true
pacman:
name: noto-fonts-emoji
state: present
- name: Setup Fonts
synchronize:
src: fontconfig
dest: /$HOME/.config
+251
View File
@@ -0,0 +1,251 @@
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:JetBrains Mono Nerd Font 14
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Start XDG autostart .desktop files using dex. See also
# https://wiki.archlinux.org/index.php/XDG_Autostart
exec --no-startup-id dex --autostart --environment i3
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock-fancy --nofork --font Noto-Sans-Regular --text "Welcome, Amin NAIRI"
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
exec --no-startup-id nm-applet
# PulseAudio system tray volume indicator
exec --no-startup-id pasystray
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# move tiling windows via drag & drop by left-clicking into the title bar,
# or left-clicking anywhere into the window while holding the floating modifier.
tiling_drag modifier titlebar
# Alignment of the top title of a window (left, center or right)
title_align center
# start a terminal
bindsym $mod+Return exec kitty
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
# bindsym $mod+d exec --no-startup-id dmenu_run
# A more modern dmenu replacement is rofi:
bindsym $mod+d exec "rofi -modi drun,run -show drun"
# There also is i3-dmenu-desktop which only displays applications shipping a
# .desktop file. It is a wrapper around dmenu, so you need that installed.
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
# Set gaps
gaps inner 20
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# Lock the screen when hitting the Super+x keybind
bindsym $mod+x exec i3lock-fancy --nofork --font 'Noto-Sans-Regular' --text "Welcome Amin NAIRI"
# Use Flameshot when hitting the Super+p keybind
bindsym $mod+p exec flameshot gui
# Show emoji when hitting Super+m keybind
bindsym $mod+m exec --no-startup-id rofi -modi emoji -show emoji -emoji-format '{emoji}'
# Use Rofi-rbw to copy password to clipboard when hitting Super+b keybind
bindsym $mod+b exec --no-startup-id rofi-rbw
# Use Xbacklight to control brightness
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 5
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 5
# Use Playerctl to control music
bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
bindsym XF86AudioNext exec --no-startup-id playerctl next
bindsym XF86AudioPrev exec --no-startup-id playerctl previous
bindsym XF86AudioStop exec --no-startup-id playerctl stop
# Window coloring
# class border backgr. text indicator child_border
client.focused #24283b #24283b #c0caf5 #c0caf5 #285577
client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a
client.unfocused #333333 #222222 #888888 #292d2e #222222
client.urgent #2f343a #900000 #ffffff #900000 #900000
client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
client.background #ffffff
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command node $HOME/.config/i3/i3status
# Padding top, bottom, left & right
padding 3px
# Position of the bar relative to the screen (top or bottom)
position top
colors {
background #24283b
statusline #c0caf5
separator #666666
# Location Border Background Text
focused_workspace #24283b #24283b #c0caf5
active_workspace #7aa2f7 #5f676a #1f2335
inactive_workspace #24283b #24283b #666666
urgent_workspace #24283b #c0caf5 #24283b
binding_mode #c0caf5 #24283b #c0caf5
}
}
+552
View File
@@ -0,0 +1,552 @@
import { URL } from "url";
import { request } from "https";
import { readFile } from "fs/promises";
import { cpus as cpuInfo, homedir } from "os";
import { exec } from "child_process";
import { createInterface } from "readline/promises";
import { stdin as input, stdout as output } from "process";
import { createRenderer } from "@aminnairi/i3status";
import { join } from "path";
// SETTINGS
const settings = await readFile(join(homedir(), ".config/i3/i3status/settings.json")).then(fileContent => {
return JSON.parse(fileContent);
}).catch(() => {
return {
weather: {
appid: ""
}
};
});
// HELPERS
const toHexadecimal = (number) => {
const hexadecimal = number.toString(16);
return hexadecimal.length === 1
? `0${hexadecimal}`
: hexadecimal;
};
const getHexadecimalColorBetween = (color1, color2, ratio) => {
const red = Math.round(color1.red + (color2.red - color1.red) * ratio);
const green = Math.round(color1.green + (color2.green - color1.green) * ratio);
const blue = Math.round(color1.blue + (color2.blue - color1.blue) * ratio);
return `#${toHexadecimal(red)}${toHexadecimal(green)}${toHexadecimal(blue)}`;
};
const red = {
red: 255,
green: 0,
blue: 0
};
const green = {
red: 0,
green: 255,
blue: 0
};
const json = {
get: (url) => {
return new Promise((resolve, reject) => {
const { hostname, pathname, search } = new URL(url);
const path = `${pathname}${search}`;
let data = "";
const req = request({
hostname,
path,
port: 443,
method: "GET"
}, response => {
response.on("data", chunk => {
data += chunk.toString();
});
response.on("end", () => {
try {
resolve(JSON.parse(data));
} catch (error) {
reject(error);
}
});
});
req.on("error", error => {
reject(error);
});
req.end();
});
}
};
const execute = (command) => {
return new Promise((resolve, reject) => {
exec(command, (error, stdout, stderr) => {
if (error) {
return reject(error);
}
if (stderr) {
return reject(new Error(stderr));
}
resolve(stdout);
});
});
};
const ignore = () => { };
// BUSINESS
const getCov19 = async () => {
return json.get("https://coronavirusapifr.herokuapp.com/data/live/france").then(response => {
return `${Math.round(response[0].TO * 10000) / 100}%`;
});
};
const getClock = () => {
const date = new Date();
return `${date.toLocaleDateString("fr-FR")} ${date.toLocaleTimeString("fr-FR")}`;
};
const getBitcoinRate = async () => {
return json.get("https://api.coindesk.com/v1/bpi/currentprice.json").then(json => {
return `${json.bpi.USD.rate}`;
});
};
const getWeather = async () => {
return json.get(`https://api.openweathermap.org/data/2.5/weather?q=paris&appid=${settings.weather.appid}&units=metric`).then(json => {
return `${Math.round((Number(json.main.temp) || 0) * 10) / 10}°C ${json.weather[0].main}`;
});
};
const getCpus = () => {
const cpus = cpuInfo();
const count = cpus.length;
const speed = Math.round(cpus.reduce((clock, cpu) => clock + cpu.speed, 0) / count) / 1000;
return `${count} CPUs ${speed}GHz`;
};
const getBattery = async () => {
return Promise.all([
execute("/usr/bin/cat /sys/class/power_supply/BAT*/capacity"),
execute("/usr/bin/cat /sys/class/power_supply/BAT*/status")
]).then(([rawBattery, rawStatus]) => {
const battery = Number(rawBattery.trim()) || 0;
const status = rawStatus.trim();
const icon = status === "Discharging" ? "" : "";
const color = status === "Discharging" ? getHexadecimalColorBetween(red, green, battery / 100) : "#00FF00";
return {
color,
full_text: `${icon} ${battery}%`
}
});
};
const getBrightness = async () => {
return execute("/usr/bin/cat /sys/class/backlight/*/brightness").then(brightness => {
const brightnessLevel = Number(brightness.trim()) || 0;
return `${brightnessLevel}%`;
});
};
const getVolume = async () => {
return Promise.all([
execute("pactl get-sink-volume @DEFAULT_SINK@ | grep 'Volume' | cut -d '/' -f 2"),
execute("pactl get-sink-mute @DEFAULT_SINK@")
]).then(([volume, muted]) => {
return `${muted.includes("no") ? "" : ""} ${volume.trim()}`;
});
};
const getMemory = async () => {
return Promise.all([
execute("grep MemTotal /proc/meminfo | cut -d ' ' -f 8"),
execute("grep MemAvailable /proc/meminfo | cut -d ' ' -f 5")
]).then(([rawTotalMemory, rawAvailableMemory]) => {
const totalMemory = Math.round((Number(rawTotalMemory.trim()) || 0) / 100000) / 10;
const freeMemory = Math.round((Number(rawAvailableMemory.trim()) || 0) / 100000) / 10;
return `${freeMemory}Go / ${totalMemory}Go`;
});
};
const getDiskSpace = async () => {
return Promise.all([
execute("df -h | grep '/\$' | cut -d ' ' -f 7"),
execute("df -h | grep '/\$' | cut -d ' ' -f 3")
]).then(([rawDiskSpaceRemaining, rawDiskSpaceTotal]) => {
const diskSpaceRemaining = rawDiskSpaceRemaining.trim();
const diskSpaceTotal = rawDiskSpaceTotal.trim();
return `${diskSpaceRemaining} / ${diskSpaceTotal}`;
});
};
// SETUP
const render = createRenderer({
createInterface,
input,
output
});
const dispatch = render({
initialBlocks: [
{
name: "disk",
full_text: "",
separator: false
},
{
name: "memory",
full_text: "",
separator: false
},
{
name: "cpus",
full_text: getCpus(),
separator: false
},
{
name: "bitcoin",
full_text: "",
separator: false
},
{
name: "cov19",
full_text: "",
separator: false
},
{
name: "weather",
full_text: "",
separator: false
},
{
name: "battery",
full_text: "",
separator: false
},
{
name: "brightness",
full_text: "",
separator: false
},
{
name: "volume",
full_text: "",
separator: false
},
{
name: "clock",
full_text: getClock(),
separator: false
},
],
onEvent: ({ event: { name, button, modifiers }, dispatch }) => {
const leftClick = 1;
if (name === "clock" && button === leftClick && modifiers.length === 1 && modifiers.includes("Control")) {
return execute("librewolf https://calendar.google.com");
}
if (name === "weather" && button === 1 && modifiers.length === 0) {
return getWeather().then(weather => {
dispatch({
name: "WEATHER_SET_FULL_TEXT",
payload: weather
});
}).catch(ignore);
}
if (name === "bitcoin" && button === 1) {
if (modifiers.length === 0) {
return getBitcoinRate().then(rate => {
dispatch({
name: "BITCOIN_SET_FULL_TEXT",
payload: rate
});
}).catch(ignore);
}
if (modifiers.length === 1 && modifiers.includes("Control")) {
return execute("librewolf https://coindesk.com/price/bitcoin");
}
}
},
onDispatch: ({ blocks, action: { name, payload } }) => {
switch (name) {
case "CLOCK_SET_FULL_TEXT":
return blocks.map(block => {
if (block.name !== "clock") {
return block;
}
return {
...block,
full_text: payload
};
})
case "BITCOIN_SET_FULL_TEXT":
return blocks.map(block => {
if (block.name !== "bitcoin") {
return block;
}
return {
...block,
full_text: payload
};
});
case "WEATHER_SET_FULL_TEXT":
return blocks.map(block => {
if (block.name !== "weather") {
return block;
}
return {
...block,
full_text: payload
};
});
case "CPUS_SET_FULL_TEXT":
return blocks.map(block => {
if (block.name !== "cpus") {
return block;
}
return {
...block,
full_text: payload
};
});
case "BATTERY_SET_FULL_TEXT_COLOR":
return blocks.map(block => {
if (block.name !== "battery") {
return block;
}
return {
...block,
full_text: payload.full_text,
color: payload.color
};
});
case "BRIGHTNESS_SET_FULL_TEXT":
return blocks.map(block => {
if (block.name !== "brightness") {
return block;
}
return {
...block,
full_text: payload
};
});
case "VOLUME_SET_FULL_TEXT":
return blocks.map(block => {
if (block.name !== "volume") {
return block;
}
return {
...block,
full_text: payload
};
});
case "MEMORY_SET_FULL_TEXT":
return blocks.map(block => {
if (block.name !== "memory") {
return block;
}
return {
...block,
full_text: payload
};
});
case "DISK_SET_FULL_TEXT":
return blocks.map(block => {
if (block.name !== "disk") {
return block;
}
return {
...block,
full_text: payload
};
});
case "COV19_SET_FULL_TEXT":
return blocks.map(block => {
if (block.name !== "cov19") {
return block;
}
return {
...block,
full_text: payload
};
});
default:
return blocks;
}
}
});
// INTERVALS
setInterval(() => {
dispatch({
name: "CLOCK_SET_FULL_TEXT",
payload: getClock()
});
dispatch({
name: "CPUS_SET_FULL_TEXT",
payload: getCpus()
});
getBattery().then(battery => {
dispatch({
name: "BATTERY_SET_FULL_TEXT_COLOR",
payload: battery
});
}).catch(ignore);
getBrightness().then(brightness => {
dispatch({
name: "BRIGHTNESS_SET_FULL_TEXT",
payload: brightness
});
}).catch(ignore);
getVolume().then(volume => {
dispatch({
name: "VOLUME_SET_FULL_TEXT",
payload: volume
});
}).catch(ignore);
getMemory().then(memory => {
dispatch({
name: "MEMORY_SET_FULL_TEXT",
payload: memory
});
}).catch(ignore);
getDiskSpace().then(diskSpace => {
dispatch({
name: "DISK_SET_FULL_TEXT",
payload: diskSpace
});
}).catch(ignore);
}, 1000);
setInterval(() => {
getBitcoinRate().then(rate => {
dispatch({
name: "BITCOIN_SET_FULL_TEXT",
payload: rate
});
}).catch(ignore);
}, 1000 * 60 * 10);
setInterval(() => {
getWeather().then(weather => {
dispatch({
name: "WEATHER_SET_FULL_TEXT",
payload: weather
});
}).catch(ignore);
}, 1000 * 60 * 30);
setInterval(() => {
getCov19().then(payload => {
dispatch({
name: "COV19_SET_FULL_TEXT",
payload
});
}).catch(ignore);
}, 1000 * 60 * 60 * 12);
// INITIAL SETUP
getBitcoinRate().then(rate => {
dispatch({
name: "BITCOIN_SET_FULL_TEXT",
payload: rate
});
}).catch(ignore);
getWeather().then(weather => {
dispatch({
name: "WEATHER_SET_FULL_TEXT",
payload: weather
});
}).catch(ignore);
getBattery().then(battery => {
dispatch({
name: "BATTERY_SET_FULL_TEXT_COLOR",
payload: battery
});
}).catch(ignore);
getBrightness().then(brightness => {
dispatch({
name: "BRIGHTNESS_SET_FULL_TEXT",
payload: brightness
});
}).catch(ignore);
getVolume().then(volume => {
dispatch({
name: "VOLUME_SET_FULL_TEXT",
payload: volume
});
}).catch(ignore);
getMemory().then(memory => {
dispatch({
name: "MEMORY_SET_FULL_TEXT",
payload: memory
});
}).catch(ignore);
getDiskSpace().then(diskSpace => {
dispatch({
name: "DISK_SET_FULL_TEXT",
payload: diskSpace
});
}).catch(ignore);
getCov19().then(payload => {
dispatch({
name: "COV19_SET_FULL_TEXT",
payload
});
}).catch(ignore);
@@ -0,0 +1,7 @@
{
"type": "module",
"private": true,
"dependencies": {
"@aminnairi/i3status": "1.1.0"
}
}
@@ -0,0 +1,5 @@
{
"weather": {
"appid": "150bbc4bae133cc448cba94e05b66703"
}
}
+25
View File
@@ -0,0 +1,25 @@
---
- name: Install i3-gaps (window manager)
become: true
pacman:
name: i3-gaps
state: present
- name: Install i3lock-fancy (window locker)
become: true
kewlfft.aur.aur:
name: i3lock-fancy
state: present
update_cache: true
- name: Install Network Manager Applet (Network Manager i3status icon)
become: true
pacman:
name: network-manager-applet
state: present
- name: Setup i3 Window Manager
synchronize:
src: i3
dest: /$HOME/.config
- name: Install custom i3status dependencies
npm:
path: /$HOME/.config/i3/i3status
state: present
@@ -0,0 +1,69 @@
# Tokyo Night color scheme for kitty terminal emulator
foreground #a9b1d6
background #1a1b26
# Black
color0 #414868
color8 #414868
# Red
color1 #f7768e
color9 #f7768e
# Green
color2 #73daca
color10 #73daca
# Yellow
color3 #e0af68
color11 #e0af68
# Blue
color4 #7aa2f7
color12 #7aa2f7
# Magenta
color5 #bb9af7
color13 #bb9af7
# Cyan
color6 #7dcfff
color14 #7dcfff
# White
color7 #c0caf5
color15 #c0caf5
# Cursor
cursor #c0caf5
cursor_text_color #1a1b26
# Selection highlight
selection_foreground none
selection_background #28344a
# The color for highlighting URLs on mouse-over
url_color #9ece6a
# Window borders
active_border_color #3d59a1
inactive_border_color #101014
bell_border_color #e0af68
# Tab bar
tab_bar_style fade
tab_fade 1
active_tab_foreground #3d59a1
active_tab_background #16161e
active_tab_font_style bold
inactive_tab_foreground #787c99
inactive_tab_background #16161e
inactive_tab_font_style bold
tab_bar_background #101014
# Title bar
macos_titlebar_color #16161e
# Storm
# background #24283b
# cursor_text_color #24283b
# active_tab_background #1f2335
# inactive_tab_background #1f2335
# macos_titlebar_color #1f2335
# Custom configuration
font_family JetBrainsMono NFM
bold_font JetBrainsMono NFM Bold
italic_font JetBrainsMono NFM Italic
bold_italic_font JetBrainsMono NFM BoldItali
font_size 18.0
force_ltr no
disable_ligatures never
modify_font cell_height 10px
background_opacity 1
background_blur 0
+11
View File
@@ -0,0 +1,11 @@
---
- name: Install Kitty (terminal emulator)
become: true
pacman:
name: kitty
state: present
- name: Setup Kitty
synchronize:
delete: true
src: kitty
dest: /$HOME/.config
+4
View File
@@ -0,0 +1,4 @@
require("settings.options")
require("settings.keymap")
require("settings.autocommands")
require("settings.lazy")
@@ -0,0 +1,9 @@
vim.api.nvim_create_autocmd("FileType", {
pattern = "php",
callback = function()
vim.bo.tabstop = 4
vim.bo.softtabstop = 4
vim.bo.shiftwidth = 4
vim.bo.expandtab = true
end,
})
@@ -0,0 +1,2 @@
vim.g.mapleader = " "
vim.g.maplocalleader = " "
@@ -0,0 +1,16 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("settings.lazy.plugins")
@@ -0,0 +1,67 @@
return {
"romgrk/barbar.nvim",
event = "BufNew",
dependencies = {
"lewis6991/gitsigns.nvim",
"nvim-tree/nvim-web-devicons",
},
init = function()
vim.g.barbar_auto_setup = false
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
local whichKey = require("which-key")
whichKey.register({
["<leader>b"] = {
name = "Barbar",
d = {
"<cmd>BarbarDisable<cr>",
"Disable Barbar"
},
e = {
"<cmd>BarbarEnable<cr>",
"Enable Barbar"
},
c = {
name = "Close",
c = {
"<cmd>BufferCloseAllButCurrent<cr>",
"Close all buffers but the current one"
},
p = {
"<cmd>BufferCloseAllButPinned<cr>",
"Close all buffers but the pinned ones"
},
l = {
"<cmd>BufferCloseBuffersLeft<cr>",
"Close all buffers to the left"
},
r = {
"<cmd>BufferCloseBuffersRight<cr>",
"Close all buffers to the right"
}
}
}
})
map("n", "<A-,>", "<Cmd>BufferPrevious<CR>", opts)
map("n", "<A-.>", "<Cmd>BufferNext<CR>", opts)
map("n", "<A-<>", "<Cmd>BufferMovePrevious<CR>", opts)
map("n", "<A->>", "<Cmd>BufferMoveNext<CR>", opts)
map("n", "<A-1>", "<Cmd>BufferGoto 1<CR>", opts)
map("n", "<A-2>", "<Cmd>BufferGoto 2<CR>", opts)
map("n", "<A-3>", "<Cmd>BufferGoto 3<CR>", opts)
map("n", "<A-4>", "<Cmd>BufferGoto 4<CR>", opts)
map("n", "<A-5>", "<Cmd>BufferGoto 5<CR>", opts)
map("n", "<A-6>", "<Cmd>BufferGoto 6<CR>", opts)
map("n", "<A-7>", "<Cmd>BufferGoto 7<CR>", opts)
map("n", "<A-8>", "<Cmd>BufferGoto 8<CR>", opts)
map("n", "<A-9>", "<Cmd>BufferGoto 9<CR>", opts)
map("n", "<A-0>", "<Cmd>BufferLast<CR>", opts)
map("n", "<A-p>", "<Cmd>BufferPin<CR>", opts)
map("n", "<A-c>", "<Cmd>BufferClose<CR>", opts)
map("n", "<A-p>", "<Cmd>BufferPick<CR>", opts)
end,
opts = {},
}
@@ -0,0 +1,13 @@
return {
"utilyre/barbecue.nvim",
name = "barbecue",
event = "BufEnter",
dependencies = {
"SmiteshP/nvim-navic",
"nvim-tree/nvim-web-devicons",
"folke/tokyonight.nvim",
},
opts = {
theme = "tokyonight",
},
}
@@ -0,0 +1,46 @@
return {
"numToStr/Comment.nvim",
opts = {
---Add a space b/w comment and the line
padding = true,
---Whether the cursor should stay at its position
sticky = true,
---Lines to be ignored while (un)comment
ignore = nil,
---LHS of toggle mappings in NORMAL mode
toggler = {
---Line-comment toggle keymap
line = "gcc",
---Block-comment toggle keymap
block = "gbc",
},
---LHS of operator-pending mappings in NORMAL and VISUAL mode
opleader = {
---Line-comment keymap
line = "gc",
---Block-comment keymap
block = "gb",
},
---LHS of extra mappings
extra = {
---Add comment on the line above
above = "gcO",
---Add comment on the line below
below = "gco",
---Add comment at the end of line
eol = "gcA",
},
---Enable keybindings
---NOTE: If given `false` then the plugin won't create any mappings
mappings = {
---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
basic = true,
---Extra mapping; `gco`, `gcO`, `gcA`
extra = true,
},
---Function to call before (un)comment
pre_hook = nil,
---Function to call after (un)comment
post_hook = nil,
},
}
@@ -0,0 +1,39 @@
return {
"stevearc/conform.nvim",
init = function()
local whichKey = require("which-key");
local conform = require("conform")
whichKey.register({
["<leader>f"] = {
name = "Format",
f = {
function()
local currentFileBufferNumber = vim.fn.bufnr("%")
conform.format({ bufnr = currentFileBufferNumber })
end,
"Format the current file"
}
}
})
end,
config = function()
local conform = require("conform")
conform.setup({
formatters_by_ft = {
lua = { "stylua" },
javascript = { "eslint_d" },
php = { "phpcbf" },
elm = { "elm_format" }
},
})
conform.formatters.phpcbf = {
prepend_args = {
"--standard=PSR12"
}
}
end
}
@@ -0,0 +1,168 @@
return {
"stevearc/dressing.nvim",
event = "VeryLazy",
opts = {
input = {
-- Set to false to disable the vim.ui.input implementation
enabled = true,
-- Default prompt string
default_prompt = "Input:",
-- Can be 'left', 'right', or 'center'
title_pos = "left",
-- When true, <Esc> will close the modal
insert_only = true,
-- When true, input will start in insert mode.
start_in_insert = true,
-- These are passed to nvim_open_win
border = "rounded",
-- 'editor' and 'win' will default to being centered
relative = "cursor",
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
prefer_width = 40,
width = nil,
-- min_width and max_width can be a list of mixed types.
-- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total"
max_width = { 140, 0.9 },
min_width = { 20, 0.2 },
buf_options = {},
win_options = {
-- Window transparency (0-100)
winblend = 10,
-- Disable line wrapping
wrap = false,
-- Indicator for when text exceeds window
list = true,
listchars = "precedes:…,extends:…",
-- Increase this for more context when text scrolls off the window
sidescrolloff = 0,
},
-- Set to `false` to disable
mappings = {
n = {
["<Esc>"] = "Close",
["<CR>"] = "Confirm",
},
i = {
["<C-c>"] = "Close",
["<CR>"] = "Confirm",
["<Up>"] = "HistoryPrev",
["<Down>"] = "HistoryNext",
},
},
override = function(conf)
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
return conf
end,
-- see :help dressing_get_config
get_config = nil,
},
select = {
-- Set to false to disable the vim.ui.select implementation
enabled = true,
-- Priority list of preferred vim.select implementations
backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" },
-- Trim trailing `:` from prompt
trim_prompt = true,
-- Options for telescope selector
-- These are passed into the telescope picker directly. Can be used like:
-- telescope = require('telescope.themes').get_ivy({...})
telescope = nil,
-- Options for fzf selector
fzf = {
window = {
width = 0.5,
height = 0.4,
},
},
-- Options for fzf-lua
fzf_lua = {
-- winopts = {
-- height = 0.5,
-- width = 0.5,
-- },
},
-- Options for nui Menu
nui = {
position = "50%",
size = nil,
relative = "editor",
border = {
style = "rounded",
},
buf_options = {
swapfile = false,
filetype = "DressingSelect",
},
win_options = {
winblend = 10,
},
max_width = 80,
max_height = 40,
min_width = 40,
min_height = 10,
},
-- Options for built-in selector
builtin = {
-- These are passed to nvim_open_win
border = "rounded",
-- 'editor' and 'win' will default to being centered
relative = "editor",
buf_options = {},
win_options = {
-- Window transparency (0-100)
winblend = 10,
cursorline = true,
cursorlineopt = "both",
},
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- the min_ and max_ options can be a list of mixed types.
-- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total"
width = nil,
max_width = { 140, 0.8 },
min_width = { 40, 0.2 },
height = nil,
max_height = 0.9,
min_height = { 10, 0.2 },
-- Set to `false` to disable
mappings = {
["<Esc>"] = "Close",
["<C-c>"] = "Close",
["<CR>"] = "Confirm",
},
override = function(conf)
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
return conf
end,
},
-- Used to override format_item. See :help dressing-format
format_item_override = {},
-- see :help dressing_get_config
get_config = nil,
},
},
}
@@ -0,0 +1,36 @@
return {
"ziontee113/icon-picker.nvim",
event = "VeryLazy",
config = function()
local iconPicker = require("icon-picker")
local whichKey = require("which-key")
iconPicker.setup({
disable_legacy_commands = true
})
whichKey.register({
["<leader>i"] = {
name = "Icon Picker",
e = {
function()
vim.cmd("IconPickerInsert emoji")
end,
"Pick emoji"
},
s = {
function()
vim.cmd("IconPickerInsert symbols")
end,
"Pick symbol"
},
n = {
function()
vim.cmd("IconPickerInsert nerd_font")
end,
"Pick Nerd font symbol"
}
}
})
end
}
@@ -0,0 +1,43 @@
return {
"xiyaowong/link-visitor.nvim",
event = "BufEnter",
opts = {
open_cmd = nil,
silent = true,
skip_confirmation = true,
border = "rounded",
},
config = function()
local whichKey = require("which-key")
whichKey.register({
["<leader>v"] = {
name = "Visit link",
v = {
function()
require("link-visitor").visit()
end,
"Visit",
},
l = {
function()
require("link-visitor").link_under_cursor()
end,
"Under cursor",
},
n = {
function()
require("link-visitor").link_near_cursor()
end,
"Near cursor",
},
N = {
function()
require("link-visitor").link_nearest()
end,
"Near cursor",
},
},
})
end
}
@@ -0,0 +1,12 @@
return {
"folke/lsp-colors.nvim",
dependencies = {
"neovim/nvim-lspconfig",
},
opts = {
Error = "#db4b4b",
Warning = "#e0af68",
Information = "#0db9d7",
Hint = "#10B981",
},
}
@@ -0,0 +1,36 @@
return {
"onsails/lspkind.nvim",
config = function()
require('lspkind').init({
mode = 'symbol_text',
preset = 'codicons',
symbol_map = {
Text = "󰉿",
Method = "󰆧",
Function = "󰊕",
Constructor = "",
Field = "󰜢",
Variable = "󰀫",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "󰑭",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈙",
Reference = "󰈇",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "󰙅",
Event = "",
Operator = "󰆕",
TypeParameter = "",
},
})
end
}
@@ -0,0 +1,47 @@
return {
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
dependencies = {
"nvim-tree/nvim-web-devicons"
},
opts = {
options = {
icons_enabled = true,
theme = "tokyonight",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { "encoding", "fileformat", "filetype" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
},
}
@@ -0,0 +1,24 @@
return {
"williamboman/mason-lspconfig.nvim",
dependencies = {
"williamboman/mason.nvim",
},
opts = {
automatic_instalation = true,
ensure_installed = {
"cssls",
"cssmodules_ls",
"dockerls",
"elmls",
"eslint",
"intelephense",
"lua_ls",
"marksman",
"prismals",
"rust_analyzer",
"tsserver",
"volar",
"yamlls",
},
},
}
@@ -0,0 +1,29 @@
return {
"WhoIsSethDaniel/mason-tool-installer.nvim",
dependencies = {
"williamboman/mason.nvim",
},
opts = {
ensure_installed = {
"stylua",
"luacheck",
"stylelint",
"shellcheck",
"rustfmt",
"jq",
"jsonlint",
"htmlbeautifier",
"eslint",
"blade-formatter",
"markdownlint",
"yamllint",
"ansible-lint",
"eslint_d",
"phpcbf",
"phpcs",
"phpstan"
},
auto_update = true,
run_on_start = true,
}
}
@@ -0,0 +1,4 @@
return {
"williamboman/mason.nvim",
opts = {}
}
@@ -0,0 +1,34 @@
return {
"NeogitOrg/neogit",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim", -- required
"nvim-telescope/telescope.nvim", -- optional
"sindrets/diffview.nvim", -- optional
"ibhagwan/fzf-lua", -- optional
},
config = function()
local whichKey = require("which-key")
local neogit = require("neogit")
neogit.setup({})
whichKey.register({
["<leader>g"] = {
name = "Neogit",
g = {
function()
neogit.open()
end,
"Open Neogit"
},
c = {
function()
neogit.open({ "commit" })
end,
"Open Neogit commit"
}
}
})
end
}
@@ -0,0 +1,5 @@
return {
"karb94/neoscroll.nvim",
event = "BufEnter",
opts = {},
}
@@ -0,0 +1,26 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
opts = {
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
},
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
}
}
@@ -0,0 +1,5 @@
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
opts = {},
}
@@ -0,0 +1,44 @@
return {
"mfussenegger/nvim-lint",
dependencies = {
"WhoIsSethDaniel/mason-tool-installer.nvim",
},
event = { "BufReadPre", "BufWritePost" },
init = function()
local lint = require("lint")
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()
lint.try_lint()
end
})
end,
config = function()
local lint = require("lint")
local phpcs = lint.linters.phpcs
phpcs.args = {
"-q",
-- <- Add a new parameter here
"--standard=PSR12",
"--report=json",
"-",
}
lint.linters_by_ft = {
lua = { "luacheck" },
javascript = { "eslint" },
typescript = { "eslint" },
javascriptreact = { "eslint" },
typescriptreact = { "eslint" },
vue = { "eslint" },
sh = { "shellcheck" },
fish = { "fish" },
json = { "jsonlint" },
markdown = { "markdownlint" },
php = { "php", "phpcs", "phpstan" },
css = { "stylelint" },
yaml = { "yamllint" },
}
end,
}
@@ -0,0 +1,150 @@
return {
"neovim/nvim-lspconfig",
event = "VeryLazy",
dependencies = {
"williamboman/mason-lspconfig.nvim",
"hrsh7th/nvim-cmp",
"folke/neodev.nvim"
},
config = function()
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local whichKey = require("which-key")
local signs = { Error = "󰅚 ", Warn = "󰀪 ", Hint = "󰌶 ", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
local on_attach = function(_, buffer)
whichKey.register({
["<leader>l"] = {
name = "LSP",
d = {
name = "LSP Diagnostic",
o = {
function()
vim.diagnostic.open_float()
end,
"Open LSP diagnostic",
},
p = {
function()
vim.diagnostic.goto_prev()
end,
"Previous LSP diagnostic",
},
n = {
function()
vim.diagnostic.goto_next()
end,
"Next LSP diagnostic",
},
},
b = {
name = "LSP Buffer",
D = {
function()
vim.lsp.buf.declaration()
end,
"Go to symbol declaration",
buffer = buffer,
},
d = {
function()
vim.lsp.buf.definition()
end,
"Go to symbol definition",
buffer = buffer,
},
h = {
function()
vim.lsp.buf.hover()
end,
"Hover symbol documentation",
buffer = buffer,
},
i = {
function()
vim.lsp.buf.implementation()
end,
"Go to symbol implementation",
buffer = buffer,
},
s = {
function()
vim.lsp.buf.signature_help()
end,
"Go to symbol signature",
buffer = buffer,
},
t = {
function()
vim.lsp.buf.type_definition()
end,
"Go to symbol type definition",
buffer = buffer,
},
r = {
function()
vim.lsp.buf.rename()
end,
"Rename symbol",
buffer = buffer,
},
c = {
function()
vim.lsp.buf.code_action()
end,
"LSP code action",
buffer = buffer,
},
R = {
function()
vim.lsp.buf.references()
end,
"Go to symbol deferences",
buffer = buffer,
},
f = {
function()
vim.lsp.buf.format({
async = true,
})
end,
"Format file",
buffer = buffer,
},
},
},
})
end
-- Needed in order to get more completion in Lua files for Vim/Neovim
require("neodev").setup()
local languageServers = {
"lua_ls",
"tsserver",
"volar",
"cssls",
"cssmodules_ls",
"prismals",
"yamlls",
"marksman",
"eslint",
"dockerls",
"rust_analyzer",
"intelephense",
"elmls",
}
for _, languageServerName in pairs(languageServers) do
lspconfig[languageServerName].setup({
capabilities = capabilities,
on_attach = on_attach
})
end
end,
}
@@ -0,0 +1,50 @@
return {
"rcarriga/nvim-notify",
event = "VeryLazy",
config = function()
local notify = require("notify")
vim.notify = notify
require("which-key").register({
["<leader>u"] = {
name = "User Interface",
n = {
name = "Notification",
e = {
function()
vim.notify = notify
end,
"Enable notifications"
},
d = {
function()
vim.notify = function() end
end,
"Disable notifications"
},
l = {
function()
require("telescope").extensions.notify.notify()
end,
"List notifications"
}
}
}
})
require("notify.config").setup({
enabled = false,
stages = "fade_in_slide_out",
timeout = 5000,
background_colour = "#1e222a",
icons = {
ERROR = "",
WARN = "",
INFO = "",
DEBUG = "",
TRACE = "",
},
})
end,
}
@@ -0,0 +1,5 @@
return {
"kylechui/nvim-surround",
event = "BufEnter",
opts = {},
}
@@ -0,0 +1,65 @@
return {
"nvim-treesitter/nvim-treesitter",
event = "VeryLazy",
config = function()
require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = {
"bash",
"c",
"css",
"csv",
"dockerfile",
"elm",
"fish",
"javascript",
"jsdoc",
"json",
"lua",
"markdown",
"markdown_inline",
"php",
"prisma",
"query",
"regex",
"rust",
"scss",
"sql",
"ssh_config",
"svelte",
"toml",
"tsx",
"twig",
"typescript",
"vim",
"vimdoc",
"vue",
"xml",
"yaml",
},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = true,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally
auto_install = true,
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
indent = {
enable = true
},
highlight = {
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on "syntax" being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = true,
},
})
end,
}
@@ -0,0 +1,70 @@
return {
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
'L3MON4D3/LuaSnip',
'saadparwaiz1/cmp_luasnip'
},
event = "InsertEnter",
config = function()
local cmp = require("cmp")
cmp.setup({
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp", group_index = 2 },
{ name = "path", group_index = 2 },
{ name = 'luasnip' },
}, {
{ name = "buffer" },
}),
})
-- Set configuration for specific filetype.
cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({
{ name = "git" }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}, {
{ name = "buffer" },
}),
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won"t work anymore).
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
-- Use cmdline & path source for ":" (if you enabled `native_menu`, this won"t work anymore).
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
})
end,
}
@@ -0,0 +1,158 @@
local function use_nvim_tree_width(options)
if type(options) ~= "table" then
return
end
---@type number
local offset = options.offset
---@type number
local initial_width = options.initial_width
local initial_width_type = type(initial_width)
local on_width_updated = options.on_width_updated
if type(on_width_updated) ~= "function" then
on_width_updated = function() end
end
if type(offset) ~= "number" then
offset = 10
end
if initial_width_type ~= "number" and initial_width_type ~= "table" then
initial_width = 30
end
---@type number|table
local previous_width = initial_width
if initial_width_type ~= "number" then
previous_width = 30
end
---@type number|table
local width = initial_width
local function get_width()
return width
end
local function increment_width()
if type(width) == "table" then
width = previous_width
end
local new_width = width + offset
previous_width = new_width
width = new_width
on_width_updated(new_width)
end
local function decrement_width()
if type(width) == "table" then
width = previous_width
end
local new_width = width - offset
previous_width = new_width
width = new_width
on_width_updated(new_width)
end
local function dynamic_width()
width = {}
on_width_updated(width)
end
return get_width, increment_width, decrement_width, dynamic_width
end
return {
"nvim-tree/nvim-tree.lua",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
config = function()
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true
local nvimTreeApi = require("nvim-tree.api")
local get_width, increment_width, decrement_width, dynamic_width = use_nvim_tree_width({
offset = 5,
initial_width = 30,
on_width_updated = function(width)
vim.cmd.NvimTreeResize(width)
end
})
require("nvim-tree").setup({
auto_reload_on_write = true,
sort_by = "case_sensitive",
view = {
width = get_width,
},
filters = {
dotfiles = false,
},
notify = {
threshold = vim.log.levels.INFO,
absolute_path = false,
},
})
local whichKey = require("which-key")
whichKey.register({
["<leader>n"] = {
name = "NvimTree",
w = {
name = "NvimTree Width",
i = {
increment_width,
"Increment NvimTree Width"
},
d = {
decrement_width,
"Increment NvimTree Width"
},
a = {
dynamic_width,
"Automatic NvimTree Width"
}
},
t = {
function()
nvimTreeApi.tree.toggle()
end,
"Toggle NvimTree",
},
f = {
function()
nvimTreeApi.tree.focus()
end,
"Focus NvimTree",
},
e = {
function()
nvimTreeApi.tree.expand_all()
end,
"Expand NvimTree",
},
c = {
function()
nvimTreeApi.tree.collapse_all()
end,
"Collapse NvimTree",
},
},
})
end,
}
@@ -0,0 +1,56 @@
return {
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
local telescope = require("telescope")
local telescopeBuiltin = require("telescope.builtin")
telescope.setup({})
local whichKey = require("which-key")
whichKey.register({
["<leader>t"] = {
name = "Telescope",
h = {
function()
telescopeBuiltin.help_tags()
end,
"Find help tags"
},
t = {
function()
telescopeBuiltin.treesitter()
end,
"Explore the Abstract Syntax Tree",
},
f = {
function()
telescopeBuiltin.find_files()
end,
"Find files",
},
w = {
function()
telescopeBuiltin.live_grep()
end,
"Find words",
},
c = {
function()
telescopeBuiltin.colorscheme()
end,
"Find color schemes",
},
g = {
function()
telescopeBuiltin.git_files()
end,
"Find git files",
},
},
})
end,
}
@@ -0,0 +1,16 @@
return {
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
init = function()
vim.cmd.colorscheme("tokyonight")
end,
opts = {
style = "storm",
transparent = false,
light_style = "day",
terminal_colors = true,
},
},
}
@@ -0,0 +1,122 @@
return {
"folke/trouble.nvim",
opts = {
position = "bottom", -- position of the list can be: bottom, top, left, right
height = 10, -- height of the trouble list when position is top or bottom
width = 50, -- width of the list when position is left or right
icons = true, -- use devicons for filenames
mode = "workspace_diagnostics",
severity = nil, -- nil (ALL) or vim.diagnostic.severity.ERROR | WARN | INFO | HINT
fold_open = "", -- icon used for open folds
fold_closed = "", -- icon used for closed folds
group = true, -- group results by file
padding = true, -- add an extra new line on top of the list
cycle_results = true, -- cycle item list when reaching beginning or end of list
action_keys = { -- key mappings for actions in the trouble list
-- map to {} to remove a mapping, for example:
-- close = {},
close = "q",
cancel = "<esc>",
refresh = "r",
jump = { "<cr>", "<tab>", "<2-leftmouse>" },
open_split = { "<c-x>" },
open_vsplit = { "<c-v>" },
open_tab = { "<c-t>" },
jump_close = { "o" },
toggle_mode = "m",
switch_severity = "s",
toggle_preview = "P",
hover = "K",
preview = "p",
open_code_href = "c",
close_folds = { "zM", "zm" }, -- close all folds
open_folds = { "zR", "zr" }, -- open all folds
toggle_fold = { "zA", "za" }, -- toggle fold of current file
previous = "k", -- previous item
next = "j", -- next item,
help = "?" -- help menu
},
multiline = true, -- render multi-line messages
indent_lines = true,
win_config = { border = "single" },
auto_open = false,
auto_close = false,
auto_preview = true,
auto_fold = false,
auto_jump = { "lsp_definitions" },
include_declaration = { "lsp_references", "lsp_implementations", "lsp_definitions" },
signs = {
-- icons / text used for a diagnostic
error = "",
warning = "",
hint = "",
information = "",
other = "",
},
use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client
},
config = function()
local whichKey = require("which-key")
local trouble = require("trouble")
whichKey.register({
["<leader>x"] = {
name = "Trouble",
t = {
function()
trouble.toggle()
end,
"Toggle Trouble"
},
o = {
function()
trouble.open()
end,
"Open Trouble"
},
c = {
function()
trouble.close()
end,
"Close Trouble"
},
n = {
function()
trouble.next({
skip_groups = true,
jump = true
})
end,
"Trouble next item"
},
p = {
function()
trouble.previous({
skip_groups = true,
jump = true
})
end,
"Trouble previous item"
},
f = {
function()
trouble.first({
skip_groups = true,
jump = true
})
end,
"Trouble first item"
},
l = {
function()
trouble.last({
skip_groups = true,
jump = true
})
end,
"Trouble last item"
}
}
})
end
}
@@ -0,0 +1,52 @@
return {
"RRethy/vim-illuminate",
event = "BufEnter",
config = function()
require("illuminate").configure({
-- providers: provider used to get references in the buffer, ordered by priority
providers = {
"lsp",
"treesitter",
"regex",
},
-- delay: delay in milliseconds
delay = 100,
-- filetype_overrides: filetype specific overrides.
-- The keys are strings to represent the filetype while the values are tables that
-- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist
filetype_overrides = {},
-- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
filetypes_denylist = {
"dirvish",
"fugitive",
},
-- filetypes_allowlist: filetypes to illuminate, this is overriden by filetypes_denylist
filetypes_allowlist = {},
-- modes_denylist: modes to not illuminate, this overrides modes_allowlist
-- See `:help mode()` for possible values
modes_denylist = {},
-- modes_allowlist: modes to illuminate, this is overriden by modes_denylist
-- See `:help mode()` for possible values
modes_allowlist = {},
-- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_denylist = {},
-- providers_regex_syntax_allowlist: syntax to illuminate, this is overriden by providers_regex_syntax_denylist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_allowlist = {},
-- under_cursor: whether or not to illuminate under the cursor
under_cursor = true,
-- large_file_cutoff: number of lines at which to use large_file_config
-- The `under_cursor` option is disabled when this cutoff is hit
large_file_cutoff = nil,
-- large_file_config: config to use for large files (based on large_file_cutoff).
-- Supports the same keys passed to .configure
-- If nil, vim-illuminate will be disabled for large files.
large_file_overrides = nil,
-- min_count_to_highlight: minimum number of matches required to perform highlighting
min_count_to_highlight = 1,
})
end,
}
@@ -0,0 +1,36 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 0
end,
config = function()
require("which-key").register({
["<C-s>"] = {
":write<CR>",
"Persist the content of the current buffer to the file system"
},
["<C-q>"] = {
":quitall<CR>",
"Quit the editor with confirmation"
},
["<C-h>"] = {
"<C-w>h",
"Move to the window on the left"
},
["<C-l>"] = {
"<C-w>l",
"Move to the window on the right"
},
["<C-k>"] = {
"<C-w>k",
"Move to the window on the top"
},
["<C-j>"] = {
"<C-w>j",
"Move to the window on the bottom"
}
})
end
}
@@ -0,0 +1,43 @@
local opt = vim.opt
opt.autoindent = true
opt.autoread = true
opt.backspace = "indent,eol,start"
opt.bufhidden = "hide"
opt.clipboard:append("unnamedplus")
opt.confirm = true
opt.copyindent = true
opt.emoji = true
opt.encoding = "UTF-8"
opt.expandtab = true
opt.fileignorecase = true
opt.hlsearch = true
opt.ignorecase = true
opt.incsearch = true
opt.infercase = true
opt.joinspaces = true
opt.laststatus = 2
opt.lazyredraw = false
opt.backup = false
opt.breakindent = false
opt.compatible = false
opt.errorbells = false
opt.linebreak = false
opt.swapfile = false
opt.number = true
opt.relativenumber = true
opt.shiftround = true
opt.shiftwidth = 2
opt.shiftwidth = 2
opt.smartcase = true
opt.smartindent = true
opt.smarttab = true
opt.softtabstop = 2
opt.tabstop = 2
vim.syntax = "on"
opt.wrap = false
opt.cursorline = true
opt.termguicolors = true
opt.signcolumn = "yes"
opt.splitright = true
opt.splitbelow = true
+49
View File
@@ -0,0 +1,49 @@
---
- name: Install Node.js package for Neovim
become: true
npm:
name: neovim
global: true
state: present
path: /usr/local/bin/node_modules
- name: Install Neovim (command-line text editor)
become: true
pacman:
name: neovim
state: present
- name: Install Neovim package for Python
become: true
pacman:
name: python-neovim
state: present
- name: Install TreeSitter CLI for Neovim
become: true
pacman:
name: tree-sitter-cli
state: present
- name: Install Java SDK for Neovim
become: true
pacman:
name: jdk-openjdk
state: present
- name: Install Ruby for Neovim
become: true
pacman:
name: ruby
state: present
- name: Install Ruby Gem for Neovim
become: true
gem:
name: neovim
state: present
- name: Setup NeoVim for the unprivileged user
synchronize:
src: nvim
dest: /$HOME/.config
delete: true
- name: Setup NeoVim for the administrator user
become: true
synchronize:
src: nvim
dest: /root/.config
delete: true
@@ -0,0 +1,3 @@
[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/lib/notification-daemon-1.0/notification-daemon
+11
View File
@@ -0,0 +1,11 @@
---
- name: Install Notification Daemon
become: true
pacman:
name: notification-daemon
state: present
- name: Setup Notification Daemon
become: true
synchronize:
src: notification/notification.service
dest: /usr/share/dbus-1/services/org.freedesktop.Notification.service
@@ -0,0 +1,6 @@
configuration {
modi: "drun,combi";
font: "JetBrains Mono Nerd Font 14";
combi-modi: "window,drun";
}
@theme "/usr/share/rofi/themes/purple.rasi"
+25
View File
@@ -0,0 +1,25 @@
---
- name: Install Rofi (application switcher)
become: true
pacman:
name: rofi
state: present
- name: Install Rofi Emoji (emoji selector for Rofi)
become: true
pacman:
name: rofi-emoji
state: present
- name: Install Rbw (Bitwarden CLI)
become: true
pacman:
name: rbw
state: present
# - name: Install Rofi Bitwarden (Bitwarden client for Rofi)
# kewlfft.aur.aur:
# name: rofi-rbw
# state: present
# update_cache: true
- name: Setup Rofi
synchronize:
src: rofi
dest: /$HOME/.config
+78
View File
@@ -0,0 +1,78 @@
# Open in current director# Rebind Ctrl-b to Ctrl-a
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# VI-mode
set-window-option -g mode-keys vi
set-window-option -g status-keys vi
# Enable Vi copy commands
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -selection clipboard'
# Vim keybinding for resizing panes
bind -r C-h resize-pane -L # Control-a Control-h
bind -r C-j resize-pane -D # Control-a Control-j
bind -r C-k resize-pane -U # Control-a Control-k
bind -r C-l resize-pane -R # Control-a Control-l
# Vim keybinding for switching between panes
bind h select-pane -l # Control-a h
bind j select-pane -D # Control-a j
bind k select-pane -U # Control-a k
bind l select-pane -R # Control-a l
# Bind Control-a + X to kill a session
bind X kill-session
# Bind Control-a + C to create a new session
bind C new-session
# split panes using | and - and use the current working directory
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# Create new window with current path
bind c new-window -c "#{pane_current_path}"
# Unbinding the old keybind for splitting the pane vertically
unbind '"'
# Unbinding the old keybind for splitting the pane horizontally
unbind %
# Disable completely the mouse
set -g mouse off
# Set the default terminal
set -s default-terminal 'kitty'
# Longer workspace names
set -g status-left-length 20
# Reduce the escape time for Neovim
set-option -sg escape-time 10
# Enable focus event for Neovim
set-option -g focus-events on
# Terminal feature specific to Neovim
set-option -sa terminal-overrides ',kitty:Tc'
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
# Tmux plugin to handle tmux plugins
set -g @plugin 'tmux-plugins/tpm'
# Tmux theme plugin
set -g @plugin 'jimeh/tmux-themepack'
# Tmux plugin to navigate easily between session
set -g @plugin 'tmux-plugins/tmux-sessionist'
# Setting the theme to use with Tmux Themepack
set -g @themepack 'powerline/block/cyan'
# Run the Tmux plugin manager
run '~/.tmux/plugins/tpm/tpm'
+10
View File
@@ -0,0 +1,10 @@
---
- name: Install TMUX (terminal multiplexer)
become: true
pacman:
name: tmux
state: present
- name: Setup TMUX
copy:
src: tmux/tmux.conf
dest: /$HOME/.tmux.conf
+23
View File
@@ -0,0 +1,23 @@
---
- name: Install UFW (firewall)
become: true
pacman:
name: ufw
state: present
- name: UFW reset all rules
become: true
ufw:
state: reset
- name: UFW deny all by default
become: true
ufw:
policy: deny
- name: UFW enable
become: true
ufw:
state: enabled
- name: UFW service startup
become: true
service:
name: ufw
state: restarted
+20
View File
@@ -0,0 +1,20 @@
# Enable flameshot
flameshot &
# Enable background
feh --bg-fill $HOME/.local/share/backgrounds/background.jpg
# Enable natural scrolling on the touchpad
xinput set-prop "QXTP7868:00 27C6:01E8 Touchpad" "libinput Natural Scrolling Enabled" 1
# Enable middle button emulation on the touchpad
xinput set-prop "QXTP7868:00 27C6:01E8 Touchpad" "libinput Middle Emulation Enabled" 1
# Enable two-fingers click
xinput set-prop "QXTP7868:00 27C6:01E8 Touchpad" "libinput Click Method Enabled" 0 1
# Set the compose key
# setxkbmap -option compose:ralt
# Start i3 window manager
exec i3
+35
View File
@@ -0,0 +1,35 @@
---
- name: Install Xorg (X11 server)
become: true
pacman:
name: xorg-server
state: present
- name: Install Xset (Xorg configuration manager)
become: true
pacman:
name: xorg-xset
state: present
- name: Install Xorg AMDGPU (AMD graphics driver for Xorg)
become: true
pacman:
name: xf86-video-amdgpu
state: present
- name: Install Xorg Backlight (brightness manager)
become: true
pacman:
name: xorg-xbacklight
state: present
- name: Install Xorg Xinput (input devices manager)
become: true
pacman:
name: xorg-xinput
state: present
- name: Install Xorg Xinit (Xorg startup script)
become: true
pacman:
name: xorg-xinit
state: present
- name: Setup Xorg Xinit
synchronize:
src: xinit/xinitrc
dest: /$HOME/.xinitrc