Compare commits
2 Commits
main
...
based-neov
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e84c2f591 | |||
| 28598c5e1d |
@ -19,3 +19,5 @@
|
||||
required = true
|
||||
[init]
|
||||
defaultBranch = main
|
||||
[url "https://x-access-token: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@github.com/"]
|
||||
insteadOf = https://github.com/
|
||||
|
||||
42
.zshrc
42
.zshrc
@ -14,22 +14,31 @@ plug "zsh-users/zsh-syntax-highlighting"
|
||||
plug "wintermi/zsh-lsd"
|
||||
plug "romkatv/powerlevel10k"
|
||||
# plug "zap-zsh/nvm"
|
||||
#
|
||||
#
|
||||
# # Load and initialise completion system
|
||||
# autoload -Uz compinit
|
||||
# fpath+=~/.zfunc
|
||||
# compinit
|
||||
|
||||
|
||||
# Load and initialise completion system
|
||||
autoload -Uz compinit
|
||||
fpath+=~/.zfunc
|
||||
compinit
|
||||
|
||||
# # nvm initialization
|
||||
# source /usr/share/nvm/init-nvm.sh
|
||||
XDG_CURRENT_DESKTOP="${XDG_CURRENT_DESKTOP:-sway}"
|
||||
MOZ_ENABLE_WAYLAND=1
|
||||
|
||||
alias v="nvim"
|
||||
alias conservation-on="sudo ectool chargecontrol normal 80 80"
|
||||
alias conservation-off="sudo ectool chargecontrol normal"
|
||||
alias orphans="sudo pacman -Qtdq | sudo pacman -Rns -"
|
||||
# alias orphans="sudo pacman -Qtdq | sudo pacman -Rns -"
|
||||
|
||||
# Define variables for monitor names
|
||||
LAPTOP_MONITOR="eDP-1"
|
||||
EXTERNAL_MONITOR="DP-2"
|
||||
|
||||
# Alias to disable laptop screen (only if external is connected)
|
||||
alias laptop-screen-off='if xrandr | grep "$EXTERNAL_MONITOR connected"; then swaymsg output $LAPTOP_MONITOR disable; echo "Laptop screen disabled."; else echo "External monitor not connected. Keeping laptop screen on."; fi'
|
||||
|
||||
# Alias to enable laptop screen
|
||||
alias laptop-screen-on='swaymsg output $LAPTOP_MONITOR enable; echo "Laptop screen enabled."'
|
||||
|
||||
|
||||
alias space="du -hsx * | sort -rh | head -10"
|
||||
|
||||
@ -37,8 +46,15 @@ alias space="du -hsx * | sort -rh | head -10"
|
||||
export GPG_TTY=$(tty)
|
||||
export EDITOR="nvim"
|
||||
|
||||
source /usr/share/nvm/init-nvm.sh
|
||||
source "/home/user/.sdkman/bin/sdkman-init.sh"
|
||||
|
||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
||||
|
||||
|
||||
source ~/.cargo/env
|
||||
|
||||
export GOROOT="$HOME/.local/bin/go"
|
||||
export GOPATH="$HOME/.go"
|
||||
export PATH="$GOROOT/bin:$GOPATH/bin:$PATH"
|
||||
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
|
||||
@ -17,5 +17,3 @@ npm config set prefix '~/.npm-global'
|
||||
|
||||
FONT
|
||||
https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/Inconsolata.zip
|
||||
- (guida per installare i nerd fonts)[https://blog.khmersite.net/p/installing-nerd-font-on-fedora/]
|
||||
- (iosevka)[https://release-assets.githubusercontent.com/github-production-release-asset/27574418/da264fe4-47cc-4350-acd3-4435de81106e?sp=r&sv=2018-11-09&sr=b&spr=https&se=2025-10-23T07%3A54%3A53Z&rscd=attachment%3B+filename%3DIntelOneMono.zip&rsct=application%2Foctet-stream&skoid=96c2d410-5711-43a1-aedd-ab1947aa7ab0&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skt=2025-10-23T06%3A54%3A07Z&ske=2025-10-23T07%3A54%3A53Z&sks=b&skv=2018-11-09&sig=mxyF4BWvhxi8ePVdXlPnWk6t3vY5m5xd4t7W%2BRZhL%2FU%3D&jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmVsZWFzZS1hc3NldHMuZ2l0aHVidXNlcmNvbnRlbnQuY29tIiwia2V5Ijoia2V5MSIsImV4cCI6MTc2MTIwNDkzMywibmJmIjoxNzYxMjAzMTMzLCJwYXRoIjoicmVsZWFzZWFzc2V0cHJvZHVjdGlvbi5ibG9iLmNvcmUud2luZG93cy5uZXQifQ.m4n0dZ3ElI-zBBX281ciSWgdS8tedJihBq-_FfVpY1E&response-content-disposition=attachment%3B%20filename%3DIntelOneMono.zip&response-content-type=application%2Foctet-stream]
|
||||
|
||||
60
dns.md
60
dns.md
@ -1,60 +0,0 @@
|
||||
# How to Manually Manage Your DNS Configuration (`/etc/resolv.conf`)
|
||||
|
||||
## 1. Introduction
|
||||
|
||||
On a standard Linux system, the `/etc/resolv.conf` file is managed automatically by network services. However, if your system is overriding your preferred DNS settings, you may need to take manual control.
|
||||
|
||||
This guide explains how to "unlock" the file to make changes and "lock" it again to prevent the system from overwriting your manual configuration. The `chattr` command is used to change file attributes, specifically the **immutable** flag.
|
||||
|
||||
---
|
||||
|
||||
## 2. The Workflow: Unlock, Edit, Lock
|
||||
|
||||
The process always follows these three steps:
|
||||
|
||||
1. **Unlock (Make Mutable):** Remove the immutable flag so you can write to the file.
|
||||
2. **Edit:** Make your desired changes to the DNS servers.
|
||||
3. **Lock (Make Immutable):** Set the immutable flag again to protect the file from being overwritten.
|
||||
|
||||
---
|
||||
|
||||
## 3. The Commands
|
||||
|
||||
### Step 1: Unlock the File (Make it Editable)
|
||||
|
||||
To make changes to `/etc/resolv.conf`, you must first remove the immutable flag (`-i`).
|
||||
|
||||
```bash
|
||||
sudo chattr -i /etc/resolv.conf
|
||||
```
|
||||
|
||||
### Step 2: Edit the File
|
||||
|
||||
Once the file is unlocked, you can edit it with any command-line text editor. Using `nano` is a common and straightforward choice.
|
||||
|
||||
```bash
|
||||
sudo nano /etc/resolv.conf
|
||||
```
|
||||
|
||||
Inside the editor, add or change the `nameserver` lines to your desired DNS providers. For example:
|
||||
|
||||
```
|
||||
# Primary DNS (Cloudflare)
|
||||
nameserver 1.1.1.1
|
||||
# Secondary DNS (Google)
|
||||
nameserver 8.8.8.8
|
||||
# Tertiary DNS (Quad9)
|
||||
nameserver 9.9.9.9
|
||||
```
|
||||
|
||||
Save the file and exit the editor. (In `nano`, you do this by pressing `Ctrl+X`, then `Y` to confirm, and `Enter` to save).
|
||||
|
||||
### Step 3: Lock the File (Make it Read-Only)
|
||||
|
||||
This is the most important step. To prevent the system from overwriting your changes, you must make the file immutable again by adding the immutable flag (`+i`).
|
||||
|
||||
```bash
|
||||
sudo chattr +i /etc/resolv.conf
|
||||
```
|
||||
|
||||
Once this command is run, your DNS settings are saved and protected. The changes take effect immediately.
|
||||
@ -1,37 +0,0 @@
|
||||
# sample hypridle.conf
|
||||
# for more configuration options, refer https://wiki.hyprland.org/Hypr-Ecosystem/hypridle
|
||||
|
||||
general {
|
||||
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
|
||||
before_sleep_cmd = loginctl lock-session # lock before suspend.
|
||||
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 150 # 2.5min.
|
||||
on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor.
|
||||
on-resume = brightnessctl -r # monitor backlight restore.
|
||||
}
|
||||
|
||||
# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight.
|
||||
listener {
|
||||
timeout = 150 # 2.5min.
|
||||
on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 # turn off keyboard backlight.
|
||||
on-resume = brightnessctl -rd rgb:kbd_backlight # turn on keyboard backlight.
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 300 # 5min.
|
||||
on-timeout = loginctl lock-session # lock screen when timeout has passed.
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 330 # 5.5min.
|
||||
on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed.
|
||||
on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired.
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 1800 # 30min.
|
||||
on-timeout = systemctl suspend # suspend pc.
|
||||
}
|
||||
@ -1,445 +0,0 @@
|
||||
# This is an example Hyprland config file.
|
||||
# Refer to the wiki for more information.
|
||||
# https://wiki.hypr.land/Configuring/
|
||||
|
||||
# Please note not all available settings / options are set here.
|
||||
# For a full list, see the wiki
|
||||
|
||||
# You can split this configuration into multiple files
|
||||
# Create your files separately and then link them to this file like this:
|
||||
# source = ~/.config/hypr/myColors.conf
|
||||
|
||||
|
||||
################
|
||||
### MONITORS ###
|
||||
################
|
||||
|
||||
# See https://wiki.hypr.land/Configuring/Monitors/
|
||||
monitorv2 {
|
||||
output = eDP-1
|
||||
mode = 2256x1504@60
|
||||
position = auto
|
||||
scale = 1.33
|
||||
# icc = /home/user/.config/sway/FRAMEWORK_13_BOE_ICC/BOE_CQ_______NE135FBM_N41_03.icm
|
||||
}
|
||||
monitorv2 {
|
||||
output = DP-9
|
||||
mode = 2560x1440@100
|
||||
position = auto
|
||||
scale = 1.33
|
||||
# icc = /home/user/.config/sway/FRAMEWORK_13_BOE_ICC/BOE_CQ_______NE135FBM_N41_03.icm
|
||||
}
|
||||
monitor=,preferred,auto,auto
|
||||
|
||||
|
||||
###################
|
||||
### MY PROGRAMS ###
|
||||
###################
|
||||
|
||||
# See https://wiki.hypr.land/Configuring/Keywords/
|
||||
|
||||
# Set programs that you use
|
||||
$terminal = foot
|
||||
$fileManager = nautilus
|
||||
$menu = wofi -S drun -p Search -I -b -i
|
||||
|
||||
|
||||
#################
|
||||
### AUTOSTART ###
|
||||
#################
|
||||
|
||||
# Autostart necessary processes (like notifications daemons, status bars, etc.)
|
||||
# Or execute your favorite apps at launch like this:
|
||||
|
||||
# exec-once = $terminal
|
||||
# exec-once = nm-applet &
|
||||
# exec-once = waybar & hyprpaper & firefox
|
||||
|
||||
|
||||
#############################
|
||||
### ENVIRONMENT VARIABLES ###
|
||||
#############################
|
||||
|
||||
# See https://wiki.hypr.land/Configuring/Environment-variables/
|
||||
|
||||
env = XCURSOR_SIZE,24
|
||||
env = HYPRCURSOR_SIZE,24
|
||||
|
||||
|
||||
###################
|
||||
### PERMISSIONS ###
|
||||
###################
|
||||
|
||||
# See https://wiki.hypr.land/Configuring/Permissions/
|
||||
# Please note permission changes here require a Hyprland restart and are not applied on-the-fly
|
||||
# for security reasons
|
||||
|
||||
# ecosystem {
|
||||
# enforce_permissions = 1
|
||||
# }
|
||||
|
||||
# permission = /usr/(bin|local/bin)/grim, screencopy, allow
|
||||
# permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow
|
||||
# permission = /usr/(bin|local/bin)/hyprpm, plugin, allow
|
||||
|
||||
|
||||
#####################
|
||||
### LOOK AND FEEL ###
|
||||
#####################
|
||||
|
||||
# Refer to https://wiki.hypr.land/Configuring/Variables/
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Variables/#general
|
||||
general {
|
||||
gaps_in = 5
|
||||
gaps_out = 5
|
||||
|
||||
border_size = 2
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Variables/#variable-types for info about colors
|
||||
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
|
||||
col.inactive_border = rgba(595959aa)
|
||||
|
||||
# Set to true enable resizing windows by clicking and dragging on borders and gaps
|
||||
resize_on_border = false
|
||||
|
||||
# Please see https://wiki.hypr.land/Configuring/Tearing/ before you turn this on
|
||||
allow_tearing = false
|
||||
|
||||
layout = dwindle
|
||||
}
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Variables/#decoration
|
||||
decoration {
|
||||
rounding = 5
|
||||
rounding_power = 2
|
||||
|
||||
# Change transparency of focused and unfocused windows
|
||||
active_opacity = 1.0
|
||||
inactive_opacity = 1.0
|
||||
|
||||
shadow {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Variables/#blur
|
||||
blur {
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Variables/#animations
|
||||
animations {
|
||||
enabled = yes, please :)
|
||||
|
||||
# Default curves, see https://wiki.hypr.land/Configuring/Animations/#curves
|
||||
# NAME, X0, Y0, X1, Y1
|
||||
bezier = easeOutQuint, 0.23, 1, 0.32, 1
|
||||
bezier = easeInOutCubic, 0.65, 0.05, 0.36, 1
|
||||
bezier = linear, 0, 0, 1, 1
|
||||
bezier = almostLinear, 0.5, 0.5, 0.75, 1
|
||||
bezier = quick, 0.15, 0, 0.1, 1
|
||||
|
||||
# Default animations, see https://wiki.hypr.land/Configuring/Animations/
|
||||
# NAME, ONOFF, SPEED, CURVE, [STYLE]
|
||||
animation = global, 1, 10, default
|
||||
animation = border, 1, 5.39, easeOutQuint
|
||||
animation = windows, 1, 4.79, easeOutQuint
|
||||
animation = windowsIn, 1, 4.1, easeOutQuint, popin 87%
|
||||
animation = windowsOut, 1, 1.49, linear, popin 87%
|
||||
animation = fadeIn, 1, 1.73, almostLinear
|
||||
animation = fadeOut, 1, 1.46, almostLinear
|
||||
animation = fade, 1, 3.03, quick
|
||||
animation = layers, 1, 3.81, easeOutQuint
|
||||
animation = layersIn, 1, 4, easeOutQuint, fade
|
||||
animation = layersOut, 1, 1.5, linear, fade
|
||||
animation = fadeLayersIn, 1, 1.79, almostLinear
|
||||
animation = fadeLayersOut, 1, 1.39, almostLinear
|
||||
animation = workspaces, 1, 1.94, almostLinear, fade
|
||||
animation = workspacesIn, 1, 1.21, almostLinear, fade
|
||||
animation = workspacesOut, 1, 1.94, almostLinear, fade
|
||||
animation = zoomFactor, 1, 7, quick
|
||||
}
|
||||
|
||||
# Ref https://wiki.hypr.land/Configuring/Workspace-Rules/
|
||||
# "Smart gaps" / "No gaps when only"
|
||||
# uncomment all if you wish to use that.
|
||||
# workspace = w[tv1], gapsout:0, gapsin:0
|
||||
# workspace = f[1], gapsout:0, gapsin:0
|
||||
# windowrule {
|
||||
# name = no-gaps-wtv1
|
||||
# match:float = false
|
||||
# match:workspace = w[tv1]
|
||||
#
|
||||
# border_size = 0
|
||||
# rounding = 0
|
||||
# }
|
||||
#
|
||||
# windowrule {
|
||||
# name = no-gaps-f1
|
||||
# match:float = false
|
||||
# match:workspace = f[1]
|
||||
#
|
||||
# border_size = 0
|
||||
# rounding = 0
|
||||
# }
|
||||
|
||||
# See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more
|
||||
dwindle {
|
||||
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
|
||||
preserve_split = true # You probably want this
|
||||
}
|
||||
|
||||
# See https://wiki.hypr.land/Configuring/Master-Layout/ for more
|
||||
master {
|
||||
new_status = master
|
||||
}
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Variables/#misc
|
||||
misc {
|
||||
force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers
|
||||
disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :(
|
||||
}
|
||||
|
||||
|
||||
#############
|
||||
### INPUT ###
|
||||
#############
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Variables/#input
|
||||
input {
|
||||
kb_layout = us
|
||||
kb_variant =
|
||||
kb_model =
|
||||
kb_options =
|
||||
kb_rules =
|
||||
|
||||
follow_mouse = 1
|
||||
|
||||
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
|
||||
|
||||
touchpad {
|
||||
natural_scroll = true
|
||||
}
|
||||
}
|
||||
|
||||
# See https://wiki.hypr.land/Configuring/Gestures
|
||||
gesture = 3, horizontal, workspace, workspace_swipe_distance, 500
|
||||
|
||||
# Example per-device config
|
||||
# See https://wiki.hypr.land/Configuring/Keywords/#per-device-input-configs for more
|
||||
device {
|
||||
name = epic-mouse-v1
|
||||
sensitivity = -0.5
|
||||
}
|
||||
|
||||
|
||||
###################
|
||||
### KEYBINDINGS ###
|
||||
###################
|
||||
|
||||
# See https://wiki.hypr.land/Configuring/Keywords/
|
||||
$mainMod = SUPER # Sets "Windows" key as main modifier
|
||||
|
||||
# Example binds, see https://wiki.hypr.land/Configuring/Binds/ for more
|
||||
bind = $mainMod, Return, exec, $terminal
|
||||
bind = $mainMod SHIFT, Q, killactive,
|
||||
# bind = $mainMod, M, exec, command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch exit
|
||||
# bind = $mainMod, E, exec, $fileManager
|
||||
bind = $mainMod, F, togglefloating,
|
||||
bind = $mainMod, D, exec, $menu
|
||||
# bind = $mainMod, P, pseudo, # dwindle
|
||||
# bind = $mainMod, J, layoutmsg, togglesplit # dwindle
|
||||
bind = SUPER, V, exec, cliphist list | wofi --dmenu --pre-display-cmd "echo '%s' | cut -f 2" | cliphist decode | wl-copy
|
||||
bind = $mainMod, H, exec, handy --toggle-transcription
|
||||
|
||||
# Move focus with mainMod + arrow keys
|
||||
bind = $mainMod, left, movefocus, l
|
||||
bind = $mainMod, right, movefocus, r
|
||||
bind = $mainMod, up, movefocus, u
|
||||
bind = $mainMod, down, movefocus, d
|
||||
|
||||
# Move window
|
||||
bind = $mainMod SHIFT, left, movewindow, l
|
||||
bind = $mainMod SHIFT, right, movewindow, r
|
||||
bind = $mainMod SHIFT, up, movewindow, u
|
||||
bind = $mainMod SHIFT, down, movewindow, d
|
||||
|
||||
# Switch workspaces with mainMod + [0-9]
|
||||
bind = $mainMod, 1, workspace, 1
|
||||
bind = $mainMod, 2, workspace, 2
|
||||
bind = $mainMod, 3, workspace, 3
|
||||
bind = $mainMod, 4, workspace, 4
|
||||
bind = $mainMod, 5, workspace, 5
|
||||
bind = $mainMod, 6, workspace, 6
|
||||
bind = $mainMod, 7, workspace, 7
|
||||
bind = $mainMod, 8, workspace, 8
|
||||
bind = $mainMod, 9, workspace, 9
|
||||
bind = $mainMod, 0, workspace, 10
|
||||
|
||||
# Move active window to a workspace with mainMod + SHIFT + [0-9]
|
||||
bind = $mainMod SHIFT, 1, movetoworkspace, 1
|
||||
bind = $mainMod SHIFT, 2, movetoworkspace, 2
|
||||
bind = $mainMod SHIFT, 3, movetoworkspace, 3
|
||||
bind = $mainMod SHIFT, 4, movetoworkspace, 4
|
||||
bind = $mainMod SHIFT, 5, movetoworkspace, 5
|
||||
bind = $mainMod SHIFT, 6, movetoworkspace, 6
|
||||
bind = $mainMod SHIFT, 7, movetoworkspace, 7
|
||||
bind = $mainMod SHIFT, 8, movetoworkspace, 8
|
||||
bind = $mainMod SHIFT, 9, movetoworkspace, 9
|
||||
bind = $mainMod SHIFT, 0, movetoworkspace, 10
|
||||
|
||||
# Example special workspace (scratchpad)
|
||||
bind = $mainMod, S, togglespecialworkspace, magic
|
||||
bind = $mainMod SHIFT, S, movetoworkspace, special:magic
|
||||
|
||||
# Scroll through existing workspaces with mainMod + scroll
|
||||
bind = $mainMod, mouse_down, workspace, e+1
|
||||
bind = $mainMod, mouse_up, workspace, e-1
|
||||
|
||||
# Move/resize windows with mainMod + LMB/RMB and dragging
|
||||
bindm = $mainMod, mouse:272, movewindow
|
||||
bindm = $mainMod, mouse:273, resizewindow
|
||||
|
||||
# Media keys with visual notifications
|
||||
bindel = ,XF86AudioRaiseVolume, exec, ~/.config/hypr/scripts/notification-control.sh volume-up
|
||||
bindel = ,XF86AudioLowerVolume, exec, ~/.config/hypr/scripts/notification-control.sh volume-down
|
||||
bindel = ,XF86AudioMute, exec, ~/.config/hypr/scripts/notification-control.sh mute-toggle
|
||||
bindel = ,XF86AudioMicMute, exec, ~/.config/hypr/scripts/notification-control.sh mic-mute-toggle
|
||||
bindel = ,XF86MonBrightnessUp, exec, ~/.config/hypr/scripts/notification-control.sh brightness-up
|
||||
bindel = ,XF86MonBrightnessDown, exec, ~/.config/hypr/scripts/notification-control.sh brightness-down
|
||||
|
||||
# Media controls (playerctl)
|
||||
bindl = ,XF86AudioNext, exec, playerctl next
|
||||
bindl = ,XF86AudioPause, exec, playerctl play-pause
|
||||
bindl = ,XF86AudioPlay, exec, playerctl play-pause
|
||||
bindl = ,XF86AudioPrev, exec, playerctl previous
|
||||
|
||||
# Screenshots
|
||||
bind = ,Print, exec, grimshot --notify copy output && notify-send -u normal "📸 Screenshot" "Full screen copied to clipboard"
|
||||
bind = $mainMod, Print, exec, grimshot --notify copy area && notify-send -u normal "📸 Screenshot" "Selected area copied to clipboard"
|
||||
|
||||
# Screen recording
|
||||
bind = ,XF86AudioMedia, exec, ~/.config/hypr/scripts/screen-recording.sh
|
||||
bind = $mainMod, XF86AudioMedia, exec, ~/.config/hypr/scripts/screen-recording.sh audio
|
||||
|
||||
bind = $mainMod, Escape, exec, ~/.config/hypr/powermenu.sh
|
||||
|
||||
##############################
|
||||
### WINDOWS AND WORKSPACES ###
|
||||
##############################
|
||||
|
||||
# See https://wiki.hypr.land/Configuring/Window-Rules/ for more
|
||||
# See https://wiki.hypr.land/Configuring/Workspace-Rules/ for workspace rules
|
||||
|
||||
# Floating apps with custom sizes (ported from sway)
|
||||
|
||||
windowrule {
|
||||
name = float-blueman
|
||||
match:class = blueman-manager
|
||||
float = yes
|
||||
size = 70% 60%
|
||||
}
|
||||
|
||||
windowrule {
|
||||
name = float-keepassxc
|
||||
match:class = org.keepassxc.KeePassXC
|
||||
float = yes
|
||||
size = 70% 60%
|
||||
}
|
||||
|
||||
windowrule {
|
||||
name = float-pavucontrol
|
||||
match:class = pavucontrol
|
||||
float = yes
|
||||
size = 70% 60%
|
||||
}
|
||||
|
||||
windowrule {
|
||||
name = float-nautilus
|
||||
match:class = org.gnome.Nautilus
|
||||
float = yes
|
||||
size = 60% 50%
|
||||
}
|
||||
|
||||
windowrule {
|
||||
name = float-thunar
|
||||
match:class = thunar
|
||||
float = yes
|
||||
size = 60% 50%
|
||||
}
|
||||
|
||||
windowrule {
|
||||
name = float-file-progress
|
||||
match:title = File Operation Progress
|
||||
float = yes
|
||||
size = 40% 30%
|
||||
}
|
||||
|
||||
windowrule {
|
||||
name = float-pip
|
||||
match:title = Picture in picture
|
||||
float = yes
|
||||
pin = yes
|
||||
}
|
||||
|
||||
windowrule {
|
||||
name = float-save-file
|
||||
match:title = Save File
|
||||
float = yes
|
||||
}
|
||||
|
||||
windowrule {
|
||||
name = kill-firefox-sharing
|
||||
match:class = firefox
|
||||
match:title = Firefox — Sharing Indicator
|
||||
}
|
||||
|
||||
# Default windowrules
|
||||
|
||||
windowrule {
|
||||
# Ignore maximize requests from all apps. You'll probably like this.
|
||||
name = suppress-maximize-events
|
||||
match:class = .*
|
||||
|
||||
suppress_event = maximize
|
||||
}
|
||||
|
||||
windowrule {
|
||||
# Fix some dragging issues with XWayland
|
||||
name = fix-xwayland-drags
|
||||
match:class = ^$
|
||||
match:title = ^$
|
||||
match:xwayland = true
|
||||
match:float = true
|
||||
match:fullscreen = false
|
||||
match:pin = false
|
||||
|
||||
no_focus = true
|
||||
}
|
||||
|
||||
# Hyprland-run windowrule
|
||||
windowrule {
|
||||
name = move-hyprland-run
|
||||
|
||||
match:class = hyprland-run
|
||||
|
||||
move = 20 monitor_h-120
|
||||
float = yes
|
||||
}
|
||||
|
||||
|
||||
|
||||
exec-once = hyprpaper
|
||||
exec-once = hypridle
|
||||
exec-once = hyprsunset
|
||||
exec-once = systemctl --user start hyprpolkitagent
|
||||
exec-once = waybar
|
||||
exec-once = nm-applet --indicator
|
||||
exec-once = blueman-applet
|
||||
exec-once = --no-startup-id easyeffects --gapplication-service
|
||||
exec-once = nextcloud --background
|
||||
exec-once = keepassxc
|
||||
exec-once = wl-paste --type text --watch cliphist store # Stores only text data
|
||||
exec-once = wl-paste --type image --watch cliphist store # Stores only image data
|
||||
exec-once = handy --start-hidden # speek to text
|
||||
@ -1,60 +0,0 @@
|
||||
# sample hyprlock.conf
|
||||
# for more configuration options, refer https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock
|
||||
#
|
||||
# rendered text in all widgets supports pango markup (e.g. <b> or <i> tags)
|
||||
# ref. https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock/#general-remarks
|
||||
#
|
||||
# shortcuts to clear password buffer: ESC, Ctrl+U, Ctrl+Backspace
|
||||
#
|
||||
# you can get started by copying this config to ~/.config/hypr/hyprlock.conf
|
||||
#
|
||||
|
||||
$font = Monospace
|
||||
|
||||
general {
|
||||
hide_cursor = true
|
||||
}
|
||||
|
||||
# uncomment to enable fingerprint authentication
|
||||
auth {
|
||||
fingerprint {
|
||||
enabled = true
|
||||
ready_message = Scan fingerprint to unlock
|
||||
present_message = Scanning...
|
||||
retry_delay = 250 # in milliseconds
|
||||
}
|
||||
}
|
||||
|
||||
animations {
|
||||
enabled = true
|
||||
bezier = linear, 1, 1, 0, 0
|
||||
animation = fadeIn, 1, 5, linear
|
||||
animation = fadeOut, 1, 5, linear
|
||||
animation = inputFieldDots, 1, 2, linear
|
||||
}
|
||||
|
||||
background {
|
||||
monitor =
|
||||
path = ~/Nextcloud/wallpapers/laptop/hiroishi_nagasai.png
|
||||
blur_passes = 3
|
||||
}
|
||||
|
||||
input-field {
|
||||
monitor =
|
||||
size = 20%, 5%
|
||||
outline_thickness = 0
|
||||
inner_color = rgba(0, 0, 0, 0.0) # no fill
|
||||
|
||||
font_color = rgb(255, 255, 255)
|
||||
fade_on_empty = false
|
||||
rounding = 5
|
||||
|
||||
font_family = $font
|
||||
placeholder_text = Password
|
||||
fail_text = $PAMFAIL
|
||||
|
||||
dots_spacing = 0.3
|
||||
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
|
||||
|
||||
wallpaper {
|
||||
monitor =
|
||||
path = ~/Nextcloud/wallpapers/laptop/hiroishi_nagasai.png
|
||||
fit_mode = cover
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
max-gamma = 150
|
||||
|
||||
profile {
|
||||
time = 7:30
|
||||
identity = true
|
||||
}
|
||||
|
||||
profile {
|
||||
time = 21:00
|
||||
temperature = 5500
|
||||
gamma = 0.8
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
choice=$(echo -e "Lock\nLogout\nReboot\nShutdown" | wofi --dmenu --hide-search --lines 4 --hide-scroll --width 100)
|
||||
case "$(echo "$choice" | tr '[:upper:]' '[:lower:]')" in
|
||||
lock)
|
||||
hyprlock
|
||||
;;
|
||||
logout)
|
||||
# hyprctl dispatch exit
|
||||
command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch exit
|
||||
;;
|
||||
reboot)
|
||||
systemctl reboot
|
||||
;;
|
||||
shutdown)
|
||||
systemctl poweroff
|
||||
;;
|
||||
esac
|
||||
@ -1,69 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ACTION="$1"
|
||||
NOTIFICATION_TIME=1000
|
||||
|
||||
case "$ACTION" in
|
||||
volume-up)
|
||||
pactl set-sink-volume @DEFAULT_SINK@ +5%
|
||||
VALUE=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}')
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-h "int:value:$VALUE" -t $NOTIFICATION_TIME "🔊 Volume" "${VALUE}%"
|
||||
;;
|
||||
|
||||
volume-down)
|
||||
pactl set-sink-volume @DEFAULT_SINK@ -5%
|
||||
VALUE=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}')
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-h "int:value:$VALUE" -t $NOTIFICATION_TIME "🔉 Volume" "${VALUE}%"
|
||||
;;
|
||||
|
||||
mute-toggle)
|
||||
pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||
MUTED=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}')
|
||||
if [ "$MUTED" = "yes" ]; then
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-t $NOTIFICATION_TIME "🔇 Audio Muted" "Output muted"
|
||||
else
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-t $NOTIFICATION_TIME "🔊 Audio Unmuted" "Output active"
|
||||
fi
|
||||
;;
|
||||
|
||||
mic-mute-toggle)
|
||||
pactl set-source-mute @DEFAULT_SOURCE@ toggle
|
||||
MUTED=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk '{print $2}')
|
||||
if [ "$MUTED" = "yes" ]; then
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-t $NOTIFICATION_TIME "🎤 Microphone Muted" "Mic muted"
|
||||
else
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-t $NOTIFICATION_TIME "🎤 Microphone Active" "Mic unmuted"
|
||||
fi
|
||||
;;
|
||||
|
||||
brightness-up)
|
||||
brightnessctl s 10%+
|
||||
# Get current and max brightness values
|
||||
CURRENT=$(brightnessctl get)
|
||||
MAX=$(brightnessctl max)
|
||||
PERCENT=$((CURRENT * 100 / MAX))
|
||||
notify-send -e -h string:x-canonical-private-synchronous:brightness \
|
||||
-h "int:value:$PERCENT" -t $NOTIFICATION_TIME "☀️ Brightness" "${PERCENT}%"
|
||||
;;
|
||||
|
||||
brightness-down)
|
||||
brightnessctl s 10%-
|
||||
# Get current and max brightness values
|
||||
CURRENT=$(brightnessctl get)
|
||||
MAX=$(brightnessctl max)
|
||||
PERCENT=$((CURRENT * 100 / MAX))
|
||||
notify-send -e -h string:x-canonical-private-synchronous:brightness \
|
||||
-h "int:value:$PERCENT" -t $NOTIFICATION_TIME "🔅 Brightness" "${PERCENT}%"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {volume-up|volume-down|mute-toggle|mic-mute-toggle|brightness-up|brightness-down}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@ -1,30 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
RECORD_DIR="$HOME/Videos"
|
||||
TIMESTAMP=$(date +'%Y-%m-%d-%H-%M-%S')
|
||||
AUDIO_FLAG="$1"
|
||||
|
||||
# Create directory if it doesn't exist
|
||||
if [ ! -d "$RECORD_DIR" ]; then
|
||||
mkdir -p "$RECORD_DIR"
|
||||
notify-send -u low "📁 Directory Created" "$RECORD_DIR"
|
||||
fi
|
||||
|
||||
if pgrep -x wf-recorder > /dev/null; then
|
||||
killall -s SIGINT wf-recorder
|
||||
notify-send -u normal "🛑 Recording Stopped" "Saved to $RECORD_DIR/"
|
||||
else
|
||||
if [ "$AUDIO_FLAG" = "audio" ]; then
|
||||
notify-send -u normal "🔴 Recording Started" "With audio enabled"
|
||||
wf-recorder --audio --file "$RECORD_DIR/${TIMESTAMP}.mp4"
|
||||
else
|
||||
notify-send -u normal "🔴 Recording Started" "Video only"
|
||||
wf-recorder --file "$RECORD_DIR/${TIMESTAMP}.mp4"
|
||||
fi
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
notify-send -u normal "✅ Recording Complete" "Saved as ${TIMESTAMP}.mp4"
|
||||
else
|
||||
notify-send -u critical "❌ Recording Failed" "Check your configuration"
|
||||
fi
|
||||
fi
|
||||
7
link.sh
7
link.sh
@ -1,7 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/bash
|
||||
|
||||
# ln -s ~/Documents/dotfiles/alacritty ~/.config/
|
||||
ln -s ~/Documents/dotfiles/alacritty ~/.config/
|
||||
ln -s ~/Documents/dotfiles/foot ~/.config/
|
||||
ln -s ~/Documents/dotfiles/.gitconfig ~/
|
||||
ln -s ~/Documents/dotfiles/mako ~/.config/
|
||||
ln -s ~/Documents/dotfiles/mpv ~/.config/
|
||||
ln -s ~/Documents/dotfiles/nvim ~/.config/
|
||||
@ -13,6 +14,4 @@ ln -s ~/Documents/dotfiles/waybar ~/.config/
|
||||
ln -s ~/Documents/dotfiles/wofi ~/.config/
|
||||
ln -s ~/Documents/dotfiles/yt-dlp ~/.config/
|
||||
ln -s ~/Documents/dotfiles/zathura ~/.config/
|
||||
ln -s ~/Documents/dotfiles/opencode ~/.config/
|
||||
ln -s ~/Documents/dotfiles/.zshrc ~/
|
||||
ln -s ~/Documents/dotfiles/.gitconfig ~/
|
||||
|
||||
@ -22,6 +22,3 @@ profile=high-quality
|
||||
scale=ewa_lanczossharp
|
||||
cscale=ewa_lanczossharp
|
||||
|
||||
|
||||
loop-playlist=inf
|
||||
shuffle=yes
|
||||
|
||||
@ -1,243 +0,0 @@
|
||||
Excellent question. The fact that this happens *sometimes* is the key to understanding the problem. It points to a race condition or a conflict between the different services managing your network, specifically `NetworkManager` and `systemd-resolved`, based on the information your router is providing.
|
||||
|
||||
Here's a breakdown of the moving parts and why they sometimes fail to cooperate.
|
||||
|
||||
### The Actors on Your System
|
||||
|
||||
1. **The Router (The Source of Truth):**
|
||||
* When you connect to Wi-Fi, your router provides network configuration information.
|
||||
* For IPv4, it uses **DHCP** to give you an IP address, a gateway, and DNS servers.
|
||||
* For IPv6, it uses **Router Advertisements (RAs)** and/or **DHCPv6**. RAs can include information about which DNS servers to use.
|
||||
* **The Core Issue:** Some routers, especially consumer-grade ones, are poorly configured. They advertise their own **link-local** (`fe80::...`) address as the DNS server in their IPv6 RAs. This is technically valid but problematic for many client systems.
|
||||
|
||||
2. **NetworkManager (The Connection Manager):**
|
||||
* Its job is to manage network interfaces (like `wlp1s0`). It brings the Wi-Fi up, handles authentication, and listens for the configuration data from your router (both DHCP and RAs).
|
||||
* When it receives the DNS server information, it needs to pass it on to the system's resolver.
|
||||
|
||||
3. **systemd-resolved (The DNS Resolver):**
|
||||
* This is the service that actually performs the DNS lookups for your applications (like your web browser). It's designed to be a central clearinghouse for DNS. It maintains a list of all DNS servers learned from all network interfaces, caches results, and can handle advanced protocols like DNS-over-TLS.
|
||||
|
||||
### The Conflict: Who Controls `/etc/resolv.conf`?
|
||||
|
||||
The problem arises from how `NetworkManager` and `systemd-resolved` are configured to interact, and which one gets the final say over the `/etc/resolv.conf` file. There are two common modes:
|
||||
|
||||
1. **Mode A: `NetworkManager` is in control (Your likely situation).**
|
||||
* In this setup, `NetworkManager` takes the DNS server information it receives from the router and writes it *directly* into `/etc/resolv.conf`.
|
||||
* The file comment `# Generated by NetworkManager` is the evidence for this.
|
||||
* When your router sends that bad `fe80::1%wlp1s0` address, `NetworkManager` dutifully writes it into the file, and your system's DNS breaks.
|
||||
|
||||
2. **Mode B: `systemd-resolved` is in control (The modern, recommended setup).**
|
||||
* `NetworkManager` is configured to pass all the DNS information it learns to `systemd-resolved` via an internal system bus (D-Bus).
|
||||
* `systemd-resolved` then manages the DNS servers internally.
|
||||
* `/etc/resolv.conf` is then symlinked to a file managed by `systemd-resolved` (like `/run/systemd/resolve/stub-resolv.conf`), which contains only `nameserver 127.0.0.53`. This points all system queries to the local `systemd-resolved` daemon, which then intelligently forwards them to the correct upstream servers.
|
||||
|
||||
### Why "Sometimes"? The Race Condition
|
||||
|
||||
The fact that it's intermittent strongly suggests a race condition between your IPv4 and IPv6 configuration on startup or reconnect.
|
||||
|
||||
* **Scenario 1 (Everything Works):** Your system connects, the IPv4 DHCP negotiation finishes first. `NetworkManager` gets a valid IPv4 DNS server (e.g., `8.8.8.8` or your ISP's) and writes it to `/etc/resolv.conf`. A moment later, the problematic IPv6 RA arrives, but `NetworkManager` might prioritize or already be using the working IPv4 server.
|
||||
* **Scenario 2 (DNS Breaks):** Your system connects, but the IPv6 Router Advertisement is processed first. `NetworkManager` receives the `fe80::1%wlp1s0` address and writes it to `/etc/resolv.conf`. DNS is broken from the start. A few moments later, the IPv4 address might arrive, but `NetworkManager` might not update the config file, leaving the broken one in place. This can also happen after waking from suspend. Such intermittent failures are a known class of bugs [github.com](https://github.com/systemd/systemd/issues/21123).
|
||||
|
||||
As one user on a forum described a similar situation, "After doing a -Syu and reboot, I no longer have access to the internet system-wide. I can ping 8.8.8.8 but not ping google.com" – this is the classic symptom you are experiencing [forum.endeavouros.com](https://forum.endeavouros.com/t/no-internet-dns-issues-after-update-networkmanager-systemd-resolved-on-kde/69865).
|
||||
|
||||
---
|
||||
|
||||
### How to Verify and Fix This Permanently
|
||||
|
||||
The best solution is to switch to the modern setup where `systemd-resolved` is in full control.
|
||||
|
||||
#### Step 1: Check Your Current `resolv.conf` Setup
|
||||
|
||||
Run this command to see what `/etc/resolv.conf` really is:
|
||||
|
||||
```bash
|
||||
ls -l /etc/resolv.conf
|
||||
```
|
||||
|
||||
* **If it shows a file (`-rw-r--r-- ...`)**, you are in the problematic Mode A.
|
||||
* **If it shows a symlink (`lrwxrwxrwx ... -> ../run/systemd/resolve/stub-resolv.conf`)**, you are in Mode B, but `NetworkManager` might still be misconfigured.
|
||||
|
||||
#### Step 2: Configure NetworkManager to Use `systemd-resolved`
|
||||
|
||||
1. Edit the main NetworkManager configuration file:
|
||||
```bash
|
||||
sudo nano /etc/NetworkManager/NetworkManager.conf
|
||||
```
|
||||
|
||||
2. In the `[main]` section, add or uncomment the `dns` line and set it to `systemd-resolved`:
|
||||
```ini
|
||||
[main]
|
||||
plugins=ifupdown,keyfile
|
||||
dns=systemd-resolved
|
||||
|
||||
[ifupdown]
|
||||
managed=false
|
||||
```
|
||||
|
||||
3. Save the file and exit.
|
||||
|
||||
#### Step 3: Enable `systemd-resolved` and Create the Correct Symlink
|
||||
|
||||
1. First, ensure the service is running:
|
||||
```bash
|
||||
sudo systemctl enable systemd-resolved.service
|
||||
sudo systemctl start systemd-resolved.service
|
||||
```
|
||||
|
||||
2. Next, remove the static file and create the correct symlink. This forces the system to use the local `systemd-resolved` stub resolver.
|
||||
```bash
|
||||
# IMPORTANT: Back up the old file first
|
||||
sudo mv /etc/resolv.conf /etc/resolv.conf.bak
|
||||
|
||||
# Create the symlink
|
||||
sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
|
||||
```
|
||||
|
||||
#### Step 4: Restart and Verify
|
||||
|
||||
Restart `NetworkManager` to apply all the changes.
|
||||
|
||||
```bash
|
||||
sudo systemctl restart NetworkManager
|
||||
```
|
||||
|
||||
Now, your DNS should work reliably. Check your `resolv.conf` to confirm it points to `127.0.0.53`. To see the *actual* DNS servers your system is now using (which it gets from `NetworkManager`), use the `resolvectl` command:
|
||||
|
||||
```bash
|
||||
resolvectl status
|
||||
```
|
||||
|
||||
This will give you a detailed report, showing the DNS servers for each interface (like `wlp1s0`). Even if the problematic `fe80::` address is listed there, `systemd-resolved` is smart enough to ignore or fall back from it if it doesn't work, preventing a total DNS outage.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Excellent! You've correctly identified that you're in "Mode A," where `NetworkManager` writes directly to `/etc/resolv.conf`. Switching to the modern approach where `systemd-resolved` handles everything is the most robust and permanent solution.
|
||||
|
||||
Let's walk through the process step-by-step. This is a standard and safe procedure on most modern Linux distributions.
|
||||
|
||||
---
|
||||
|
||||
### Step-by-Step Guide to Switch to `systemd-resolved`
|
||||
|
||||
We are going to reconfigure your system so that:
|
||||
1. `NetworkManager` passes DNS information to `systemd-resolved`.
|
||||
2. `systemd-resolved` manages all DNS lookups.
|
||||
3. `/etc/resolv.conf` points to the local `systemd-resolved` service.
|
||||
|
||||
#### Step 1: Configure NetworkManager
|
||||
|
||||
First, we need to tell `NetworkManager` to stop managing `/etc/resolv.conf` by itself and start sending its DNS information to `systemd-resolved`.
|
||||
|
||||
1. Open the `NetworkManager.conf` file with a text editor and `sudo` privileges:
|
||||
```bash
|
||||
sudo nano /etc/NetworkManager/NetworkManager.conf
|
||||
```
|
||||
|
||||
2. Find the `[main]` section. Add a `dns` line and set it to `systemd-resolved`. If the line already exists but is set to something else (like `default`), change it.
|
||||
|
||||
**Your file should look like this:**
|
||||
```ini
|
||||
[main]
|
||||
plugins=ifupdown,keyfile
|
||||
dns=systemd-resolved
|
||||
|
||||
[ifupdown]
|
||||
managed=false
|
||||
```
|
||||
*(Note: You might have other settings in the `[main]` section. Just make sure the `dns=systemd-resolved` line is present and correct.)*
|
||||
|
||||
3. Save the file and exit the editor (in `nano`, press `Ctrl+O`, then `Enter` to save, and `Ctrl+X` to exit).
|
||||
|
||||
#### Step 2: Enable and Start `systemd-resolved`
|
||||
|
||||
Now, let's make sure the `systemd-resolved` service is active and will start automatically on boot.
|
||||
|
||||
```bash
|
||||
# Enable the service to start on every boot
|
||||
sudo systemctl enable systemd-resolved.service
|
||||
|
||||
# Start the service right now
|
||||
sudo systemctl start systemd-resolved.service
|
||||
```
|
||||
|
||||
#### Step 3: Recreate `/etc/resolv.conf` as a Symlink
|
||||
|
||||
This is the most important step. We will replace the static file that `NetworkManager` used to write with a symbolic link to the `resolv.conf` file that `systemd-resolved` provides.
|
||||
|
||||
1. **Important:** Back up your current `resolv.conf` file. This lets you easily revert if something goes wrong.
|
||||
```bash
|
||||
sudo mv /etc/resolv.conf /etc/resolv.conf.bak
|
||||
```
|
||||
This command safely renames the file.
|
||||
|
||||
2. Create the new symbolic link:
|
||||
```bash
|
||||
sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
|
||||
```
|
||||
This links `/etc/resolv.conf` to the "stub" resolver file, which correctly points all DNS queries to the local `systemd-resolved` daemon.
|
||||
|
||||
#### Step 4: Restart NetworkManager and Verify
|
||||
|
||||
Finally, restart `NetworkManager` to apply all the changes and verify that everything is working.
|
||||
|
||||
1. Restart the service:
|
||||
```bash
|
||||
sudo systemctl restart NetworkManager
|
||||
```
|
||||
|
||||
2. **Verify the symlink:** Check that `/etc/resolv.conf` is now a link.
|
||||
```bash
|
||||
ls -l /etc/resolv.conf
|
||||
```
|
||||
The output should look like this (colors and dates will vary):
|
||||
```
|
||||
lrwxrwxrwx 1 root root 39 Nov 18 10:30 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf
|
||||
```
|
||||
|
||||
3. **Verify the content:** Check what's inside the new `resolv.conf`.
|
||||
```bash
|
||||
cat /etc/resolv.conf
|
||||
```
|
||||
The output should show `127.0.0.53` as the nameserver. This is the local `systemd-resolved` stub resolver.
|
||||
```
|
||||
# This file is managed by man:systemd-resolved(8). Do not edit.
|
||||
...
|
||||
nameserver 127.0.0.53
|
||||
options edns0 trust-ad
|
||||
```
|
||||
|
||||
4. **Check the REAL DNS servers:** Use `resolvectl` to see which DNS servers `systemd-resolved` is actually using (which it learned from `NetworkManager`).
|
||||
```bash
|
||||
resolvectl status
|
||||
```
|
||||
This will give you a detailed report. Look for the section corresponding to your Wi-Fi interface (`wlp1s0`). You will see the actual IP addresses of the DNS servers it is using. Even if the problematic `fe80::` address is listed, `systemd-resolved` is much more resilient and will fall back to other working servers.
|
||||
|
||||
5. **Final Test:**
|
||||
```bash
|
||||
ping archlinux.org
|
||||
```
|
||||
If you get a reply, congratulations! Your DNS is now being managed robustly by `systemd-resolved`.
|
||||
|
||||
---
|
||||
|
||||
### How to Revert (If Needed)
|
||||
|
||||
If anything goes wrong, you can easily go back to the old setup:
|
||||
|
||||
1. **Restore the old `resolv.conf`:**
|
||||
```bash
|
||||
sudo mv /etc/resolv.conf.bak /etc/resolv.conf
|
||||
```
|
||||
|
||||
2. **Edit `NetworkManager.conf` again:**
|
||||
```bash
|
||||
sudo nano /etc/NetworkManager/NetworkManager.conf
|
||||
```
|
||||
Remove the `dns=systemd-resolved` line, or change it back to `dns=default`.
|
||||
|
||||
3. **Restart NetworkManager:**
|
||||
```bash
|
||||
sudo systemctl restart NetworkManager
|
||||
```
|
||||
@ -1,6 +1,5 @@
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*.lua]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
require("kanopo.options")
|
||||
require("kanopo.keymaps")
|
||||
require("kanopo.autocmds")
|
||||
require("kanopo.lazy")
|
||||
require("kanopo.plugins")
|
||||
|
||||
@ -1,3 +1,16 @@
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('my.lsp', {}),
|
||||
callback = function(args)
|
||||
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
|
||||
if client:supports_method('textDocument/completion') then
|
||||
-- Optional: trigger autocompletion on EVERY keypress. May be slow!
|
||||
local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end
|
||||
client.server_capabilities.completionProvider.triggerCharacters = chars
|
||||
vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Highlight yanked text
|
||||
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
-- Clear highlights on search when pressing <Esc> in normal mode
|
||||
-- See `:help hlsearch`
|
||||
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
|
||||
|
||||
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
||||
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
|
||||
-- is not what someone will guess without a bit more experience.
|
||||
--
|
||||
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
|
||||
-- or just use <C-\><C-n> to exit terminal mode
|
||||
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
|
||||
|
||||
-- TIP: Disable arrow keys in normal mode
|
||||
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
||||
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
||||
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
||||
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
||||
|
||||
-- Keybinds to make split navigation easier.
|
||||
-- Use CTRL+<hjkl> to switch between windows
|
||||
--
|
||||
-- See `:help wincmd` for a list of all window commands
|
||||
vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "Move focus to the left window" })
|
||||
vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Move focus to the right window" })
|
||||
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
|
||||
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })
|
||||
|
||||
-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
|
||||
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
|
||||
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
|
||||
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
|
||||
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
|
||||
|
||||
-- DAP keymaps
|
||||
vim.keymap.set("n", "<leader>db", "<cmd>lua require'dap'.toggle_breakpoint()<CR>", { desc = "Toggle [B]reakpoint" })
|
||||
vim.keymap.set("n", "<leader>dc", "<cmd>lua require'dap'.continue()<CR>", { desc = "[C]ontinue" })
|
||||
vim.keymap.set("n", "<leader>di", "<cmd>lua require'dap'.step_into()<CR>", { desc = "Step [I]nto" })
|
||||
vim.keymap.set("n", "<leader>do", "<cmd>lua require'dap'.step_over()<CR>", { desc = "Step [O]ver" })
|
||||
vim.keymap.set("n", "<leader>dO", "<cmd>lua require'dap'.step_out()<CR>", { desc = "Step [O]ut" })
|
||||
vim.keymap.set("n", "<leader>dr", "<cmd>lua require'dap'.repl.open()<CR>", { desc = "Open [R]EPL" })
|
||||
@ -1,18 +0,0 @@
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
require("lazy").setup("kanopo.plugins")
|
||||
@ -1,3 +1,31 @@
|
||||
--
|
||||
-- vim.o.relativenumber = true
|
||||
-- vim.o.wrap = false
|
||||
-- vim.o.tabstop = 4
|
||||
-- vim.o.swapfile = false
|
||||
-- vim.g.mapleader = " "
|
||||
-- vim.g.maplocalleader = " "
|
||||
-- vim.g.have_nerd_font = true
|
||||
-- vim.o.termguicolors = true
|
||||
-- vim.o.cursorline = true
|
||||
-- vim.o.clipboard = "unnamedplus"
|
||||
-- vim.o.signcolumn = "yes"
|
||||
-- vim.o.colorcolumn = "100"
|
||||
-- vim.o.winborder = "rounded"
|
||||
-- vim.o.completeopt = "menu,menuone,noinsert,noselect"
|
||||
--
|
||||
-- vim.o.shortmess = vim.o.shortmess .. "c" -- reduce “match 1 of 5” messages
|
||||
-- vim.opt.ignorecase = true
|
||||
-- vim.opt.smartcase = true
|
||||
-- vim.opt.wrap = true
|
||||
-- vim.opt.breakindent = true
|
||||
-- vim.opt.expandtab = true
|
||||
-- vim.opt.tabstop = 2
|
||||
-- vim.opt.softtabstop = 2
|
||||
-- vim.opt.shiftwidth = 2
|
||||
-- vim.opt.splitright = true
|
||||
-- vim.opt.splitbelow = true
|
||||
-- vim.opt.undofile = true
|
||||
-- Leader keys (set early)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
@ -21,13 +49,7 @@ vim.o.splitbelow = true -- open horizontal splits below
|
||||
-- Editing behavior
|
||||
vim.o.wrap = false -- do not wrap lines by default
|
||||
vim.o.breakindent = true -- keep indentation on wrapped lines (if wrap is enabled later)
|
||||
-- Sync clipboard between OS and Neovim.
|
||||
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
||||
-- Remove this option if you want your OS clipboard to remain independent.
|
||||
-- See `:help 'clipboard'`
|
||||
vim.schedule(function()
|
||||
vim.o.clipboard = "unnamedplus"
|
||||
end)
|
||||
vim.o.clipboard = "unnamedplus" -- use system clipboard
|
||||
vim.o.swapfile = false -- no swapfiles
|
||||
vim.o.undofile = true -- persistent undo
|
||||
vim.o.writebackup = false -- do not keep backup around
|
||||
@ -81,14 +103,26 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||
end,
|
||||
})
|
||||
|
||||
vim.o.mouse = "a"
|
||||
-- Example: make files that often use 4 spaces actually use 4
|
||||
-- Uncomment if you prefer 4 for these stacks
|
||||
-- vim.api.nvim_create_autocmd("FileType", {
|
||||
-- group = ft_augroup,
|
||||
-- pattern = { "python", "go", "rust" },
|
||||
-- callback = function()
|
||||
-- vim.bo.tabstop = 4
|
||||
-- vim.bo.shiftwidth = 4
|
||||
-- vim.bo.softtabstop = 4
|
||||
-- vim.bo.expandtab = true
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
vim.o.showmode = false
|
||||
|
||||
vim.o.list = true
|
||||
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
|
||||
|
||||
-- Preview substitutions live, as you type!
|
||||
vim.o.inccommand = "split"
|
||||
|
||||
vim.o.confirm = true
|
||||
-- Spell checking (optional; example)
|
||||
-- vim.opt.spell = true
|
||||
-- vim.opt.spelllang = "en,it"
|
||||
-- local spell_dir = vim.fn.stdpath("data") .. "/spell"
|
||||
-- vim.opt.spellfile = {
|
||||
-- spell_dir .. "/en.utf-8.add",
|
||||
-- spell_dir .. "/it.utf-8.add",
|
||||
-- "~/.config/nvim/spell/en.proj.spl",
|
||||
-- "~/.config/nvim/spell/it.proj.spl",
|
||||
-- }
|
||||
|
||||
17
nvim/lua/kanopo/plugins/auto-pairs.lua
Normal file
17
nvim/lua/kanopo/plugins/auto-pairs.lua
Normal file
@ -0,0 +1,17 @@
|
||||
-- autopairs.lua
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/windwp/nvim-autopairs" },
|
||||
})
|
||||
|
||||
-- Load packs on first InsertEnter and configure
|
||||
vim.api.nvim_create_autocmd("InsertEnter", {
|
||||
once = true,
|
||||
callback = function()
|
||||
if vim.pack and vim.pack.load then pcall(vim.pack.load) end
|
||||
pcall(function()
|
||||
require("nvim-autopairs").setup({
|
||||
disable_filetype = { "TelescopePrompt", "vim" },
|
||||
})
|
||||
end)
|
||||
end,
|
||||
})
|
||||
@ -1,9 +0,0 @@
|
||||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup({
|
||||
disable_filetype = { "TelescopePrompt", "vim" },
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = {
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
},
|
||||
config = function()
|
||||
local theme = require("gruvbox")
|
||||
require("lualine").setup({
|
||||
theme = theme,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -1,84 +1,28 @@
|
||||
return { -- Autocompletion
|
||||
"saghen/blink.cmp",
|
||||
event = "VimEnter",
|
||||
version = "1.*",
|
||||
dependencies = {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
version = "2.*",
|
||||
build = (function()
|
||||
if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
|
||||
return
|
||||
end
|
||||
return "make install_jsregexp"
|
||||
end)(),
|
||||
dependencies = {
|
||||
-- `friendly-snippets` contains a variety of premade snippets.
|
||||
-- See the README about individual language/framework/plugin snippets:
|
||||
-- https://github.com/rafamadriz/friendly-snippets
|
||||
{
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/saghen/blink.cmp", version = "1.*" },
|
||||
{ src = "https://github.com/rafamadriz/friendly-snippets" }
|
||||
})
|
||||
|
||||
-- Load packs on startup (guard for nightlies without load)
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
once = true,
|
||||
callback = function()
|
||||
if vim.pack and vim.pack.load then pcall(vim.pack.load) end
|
||||
|
||||
-- Preload neogit module if available (optional)
|
||||
pcall(function()
|
||||
require("blink").setup({
|
||||
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept):
|
||||
-- 'super-tab' for mappings similar to vscode (tab to accept)
|
||||
-- 'enter' for enter to accept
|
||||
-- 'none' for no mappings
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
keymap = { preset = 'default' },
|
||||
})
|
||||
end)
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
"folke/lazydev.nvim",
|
||||
},
|
||||
--- @module 'blink.cmp'
|
||||
--- @type blink.cmp.Config
|
||||
opts = {
|
||||
keymap = {
|
||||
-- set to 'none' to disable the 'default' preset
|
||||
preset = "none",
|
||||
|
||||
["<C-k>"] = { "select_prev", "fallback" },
|
||||
["<C-j>"] = { "select_next", "fallback" },
|
||||
["<C-b>"] = { "scroll_documentation_up", "fallback" },
|
||||
["<C-f>"] = { "scroll_documentation_down", "fallback" },
|
||||
["<Tab>"] = { "snippet_forward", "fallback" },
|
||||
["<S-Tab>"] = { "snippet_backward", "fallback" },
|
||||
-- ["<S-Tab>"] = { "select_prev", "fallback" },
|
||||
-- ["<Tab>"] = { "select_next", "fallback" },
|
||||
|
||||
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
|
||||
["<CR>"] = { "select_and_accept", "fallback" },
|
||||
["<C-e>"] = { "hide", "fallback" },
|
||||
|
||||
["<C-s>"] = { "show_signature", "hide_signature", "fallback" },
|
||||
},
|
||||
|
||||
appearance = {
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
completion = {
|
||||
-- By default, you may press `<c-space>` to show the documentation.
|
||||
-- Optionally, set `auto_show = true` to show the documentation after a delay.
|
||||
documentation = { auto_show = false, auto_show_delay_ms = 500 },
|
||||
},
|
||||
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "lazydev" },
|
||||
providers = {
|
||||
lazydev = { module = "lazydev.integrations.blink", score_offset = 100 },
|
||||
},
|
||||
},
|
||||
|
||||
snippets = { preset = "luasnip" },
|
||||
|
||||
-- Blink.cmp includes an optional, recommended rust fuzzy matcher,
|
||||
-- which automatically downloads a prebuilt binary when enabled.
|
||||
--
|
||||
-- By default, we use the Lua implementation instead, but you may enable
|
||||
-- the rust implementation via `'prefer_rust_with_warning'`
|
||||
--
|
||||
-- See :h blink-cmp-config-fuzzy for more information
|
||||
fuzzy = { implementation = "lua" },
|
||||
|
||||
-- Shows a signature help window while you type arguments for a function
|
||||
signature = { enabled = true },
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
signs = true,
|
||||
keywords = {
|
||||
TODO = { icon = "🤨", color = "info" },
|
||||
WIP = { icon = "🥵", color = "warning" },
|
||||
ERR = { icon = "🤬", color = "error" },
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,19 @@
|
||||
return {
|
||||
"stevearc/dressing.nvim",
|
||||
opts = {
|
||||
inputs = {
|
||||
enable = true,
|
||||
}
|
||||
-- dressing.lua
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/stevearc/dressing.nvim" },
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
once = true,
|
||||
callback = function()
|
||||
if vim.pack and vim.pack.load then pcall(vim.pack.load) end
|
||||
pcall(function()
|
||||
require("dressing").setup({
|
||||
input = {
|
||||
enabled = true, -- matches your opts.inputs.enable = true
|
||||
},
|
||||
}
|
||||
-- You can add selector config here if desired
|
||||
})
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
||||
14
nvim/lua/kanopo/plugins/fidget.lua
Normal file
14
nvim/lua/kanopo/plugins/fidget.lua
Normal file
@ -0,0 +1,14 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/j-hui/fidget.nvim", version = "main" },
|
||||
})
|
||||
|
||||
-- Load packs on startup and configure fidget safely
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
once = true,
|
||||
callback = function()
|
||||
if vim.pack and vim.pack.load then pcall(vim.pack.load) end
|
||||
pcall(function()
|
||||
require("fidget").setup({})
|
||||
end)
|
||||
end,
|
||||
})
|
||||
@ -1,41 +0,0 @@
|
||||
|
||||
return { -- Autoformat
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>f",
|
||||
function()
|
||||
require("conform").format({ async = true, lsp_format = "fallback" })
|
||||
end,
|
||||
mode = "",
|
||||
desc = "[F]ormat buffer",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
notify_on_error = false,
|
||||
format_on_save = function(bufnr)
|
||||
-- Disable "format_on_save lsp_fallback" for languages that don't
|
||||
-- have a well standardized coding style. You can add additional
|
||||
-- languages here or re-enable it for the disabled ones.
|
||||
local disable_filetypes = { c = true, cpp = true }
|
||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||
return nil
|
||||
else
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_format = "fallback",
|
||||
}
|
||||
end
|
||||
end,
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
-- Conform can also run multiple formatters sequentially
|
||||
-- python = { "isort", "black" },
|
||||
--
|
||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -1,16 +1,37 @@
|
||||
return {
|
||||
"NeogitOrg/neogit",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"sindrets/diffview.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
},
|
||||
-- config = function()
|
||||
-- require("neogit").setup()
|
||||
-- vim.keymap.set("n", "<leader>gg", "<cmd>Neogit<cr>", { desc = "Neogit" })
|
||||
-- end,
|
||||
opts = true,
|
||||
keys = {
|
||||
{ "<leader>gg", "<cmd>Neogit<cr>", desc = "Neogit" },
|
||||
},
|
||||
}
|
||||
-- Declare plugins
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/NeogitOrg/neogit" },
|
||||
{ src = "https://github.com/lewis6991/gitsigns.nvim" },
|
||||
})
|
||||
|
||||
-- Load packs on startup (guard for nightlies without load)
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
once = true,
|
||||
callback = function()
|
||||
if vim.pack and vim.pack.load then pcall(vim.pack.load) end
|
||||
|
||||
-- Configure gitsigns (safe pcall)
|
||||
pcall(function()
|
||||
require("gitsigns").setup()
|
||||
end)
|
||||
|
||||
-- Preload neogit module if available (optional)
|
||||
pcall(function()
|
||||
require("neogit")
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
||||
-- Keymap: open Neogit (on-demand load if needed)
|
||||
vim.keymap.set("n", "<leader>gg", function()
|
||||
local ok, neogit = pcall(require, "neogit")
|
||||
if not ok then
|
||||
if vim.pack and vim.pack.load then pcall(vim.pack.load) end
|
||||
ok, neogit = pcall(require, "neogit")
|
||||
end
|
||||
if ok then
|
||||
neogit.open({})
|
||||
else
|
||||
vim.notify("neogit not available yet", vim.log.levels.WARN)
|
||||
end
|
||||
end, { desc = "Open Neogit" })
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = "BufRead",
|
||||
opts = {},
|
||||
}
|
||||
|
||||
12
nvim/lua/kanopo/plugins/init.lua
Normal file
12
nvim/lua/kanopo/plugins/init.lua
Normal file
@ -0,0 +1,12 @@
|
||||
require("kanopo.plugins.lazydev")
|
||||
require("kanopo.plugins.oil")
|
||||
require("kanopo.plugins.theme")
|
||||
require("kanopo.plugins.treesitter")
|
||||
require("kanopo.plugins.telescope")
|
||||
require("kanopo.plugins.cmp")
|
||||
require("kanopo.plugins.lsp")
|
||||
require("kanopo.plugins.which-key")
|
||||
require("kanopo.plugins.git")
|
||||
require("kanopo.plugins.fidget")
|
||||
require("kanopo.plugins.dressing")
|
||||
require("kanopo.plugins.auto-pairs")
|
||||
@ -1,29 +0,0 @@
|
||||
return {
|
||||
"mfussenegger/nvim-jdtls",
|
||||
ft = "java",
|
||||
config = function()
|
||||
local lombok_dir = vim.fn.stdpath("data") .. "/lombok"
|
||||
local lombok_path = lombok_dir .. "/lombok.jar"
|
||||
|
||||
if not vim.loop.fs_stat(lombok_path) then
|
||||
vim.fn.mkdir(lombok_dir, "p")
|
||||
print("Downloading lombok.jar...")
|
||||
local lombok_url = "https://projectlombok.org/downloads/lombok.jar"
|
||||
vim.fn.system({ "curl", "-L", "-o", lombok_path, lombok_url })
|
||||
print("lombok.jar downloaded to " .. lombok_path)
|
||||
end
|
||||
|
||||
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
||||
|
||||
local config = {
|
||||
cmd = {
|
||||
"jdtls",
|
||||
"--jvm-arg=-javaagent:" .. lombok_path,
|
||||
},
|
||||
root_dir = vim.fs.root(0, { ".git", "mvnw", "gradlew" }) or vim.fn.getcwd(),
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
require("jdtls").start_or_attach(config)
|
||||
end,
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
|
||||
return {
|
||||
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
|
||||
-- used for completion, annotations and signatures of Neovim apis
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua",
|
||||
opts = {
|
||||
library = {
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||
},
|
||||
},
|
||||
}
|
||||
10
nvim/lua/kanopo/plugins/lazydev.lua
Normal file
10
nvim/lua/kanopo/plugins/lazydev.lua
Normal file
@ -0,0 +1,10 @@
|
||||
vim.pack.add({
|
||||
"https://github.com/folke/lazydev.nvim"
|
||||
})
|
||||
require("lazydev").setup({
|
||||
library = {
|
||||
-- See the configuration section for more details
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||
},
|
||||
})
|
||||
@ -1,173 +1,192 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
{ "mason-org/mason.nvim", opts = {} },
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/neovim/nvim-lspconfig" },
|
||||
{ src = "https://github.com/mason-org/mason.nvim" },
|
||||
{ src = "https://github.com/mason-org/mason-lspconfig.nvim" },
|
||||
{ src = "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim" }, -- optional for tools later
|
||||
|
||||
{ "j-hui/fidget.nvim", opts = {} },
|
||||
{ src = "https://github.com/saghen/blink.cmp", version = "1.*" },
|
||||
-- { src = "https://github.com/L3MON4D3/LuaSnip" },
|
||||
-- { src = "https://github.com/rafamadriz/friendly-snippets" },
|
||||
})
|
||||
|
||||
"saghen/blink.cmp",
|
||||
},
|
||||
config = function()
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
||||
callback = function(event)
|
||||
local map = function(keys, func, desc, mode)
|
||||
mode = mode or "n"
|
||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
||||
end
|
||||
|
||||
-- Rename the variable under your cursor.
|
||||
-- Most Language Servers support renaming across files, etc.
|
||||
map("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||
|
||||
-- Execute a code action, usually your cursor needs to be on top of an error
|
||||
-- or a suggestion from your LSP for this to activate.
|
||||
map("<leader>ca", vim.lsp.buf.code_action, "[G]oto Code [A]ction", { "n", "x" })
|
||||
|
||||
-- Find references for the word under your cursor.
|
||||
map("<leader>gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
|
||||
|
||||
-- Jump to the implementation of the word under your cursor.
|
||||
-- Useful when your language has ways of declaring types without an actual implementation.
|
||||
map("<leader>gi", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
|
||||
|
||||
-- Jump to the definition of the word under your cursor.
|
||||
-- This is where a variable was first declared, or where a function is defined, etc.
|
||||
-- To jump back, press <C-t>.
|
||||
map("<leader>gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
|
||||
|
||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||
-- For example, in C this would take you to the header.
|
||||
map("<leader>gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
|
||||
-- -- Fuzzy find all the symbols in your current document.
|
||||
-- -- Symbols are things like variables, functions, types, etc.
|
||||
-- map("gO", require("telescope.builtin").lsp_document_symbols, "Open Document Symbols")
|
||||
--
|
||||
-- -- Fuzzy find all the symbols in your current workspace.
|
||||
-- -- Similar to document symbols, except searches over your entire project.
|
||||
-- map("gW", require("telescope.builtin").lsp_dynamic_workspace_symbols, "Open Workspace Symbols")
|
||||
--
|
||||
-- -- Jump to the type of the word under your cursor.
|
||||
-- -- Useful when you're not sure what type a variable is and you want to see
|
||||
-- -- the definition of its *type*, not where it was *defined*.
|
||||
-- map("grt", require("telescope.builtin").lsp_type_definitions, "[G]oto [T]ype Definition")
|
||||
|
||||
map("<leader>e", vim.diagnostic.open_float, "Line Diagnostics")
|
||||
|
||||
-- The following code creates a keymap to toggle inlay hints in your
|
||||
-- code, if the language server you are using supports them
|
||||
--
|
||||
-- This may be unwanted, since they displace some of your code
|
||||
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
|
||||
map("<leader>th", function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
|
||||
end, "[T]oggle Inlay [H]ints")
|
||||
end
|
||||
-- Load packs early (guard API)
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
once = true,
|
||||
callback = function()
|
||||
if vim.pack and vim.pack.load then pcall(vim.pack.load) end
|
||||
end,
|
||||
})
|
||||
})
|
||||
|
||||
-- Diagnostic Config
|
||||
-- See :help vim.diagnostic.Opts
|
||||
vim.diagnostic.config({
|
||||
severity_sort = true,
|
||||
float = { border = "rounded", source = "if_many" },
|
||||
underline = { severity = vim.diagnostic.severity.ERROR },
|
||||
signs = vim.g.have_nerd_font and {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = " ",
|
||||
[vim.diagnostic.severity.WARN] = " ",
|
||||
[vim.diagnostic.severity.INFO] = " ",
|
||||
[vim.diagnostic.severity.HINT] = " ",
|
||||
},
|
||||
} or {},
|
||||
virtual_text = {
|
||||
source = "if_many",
|
||||
spacing = 2,
|
||||
format = function(diagnostic)
|
||||
local diagnostic_message = {
|
||||
[vim.diagnostic.severity.ERROR] = diagnostic.message,
|
||||
[vim.diagnostic.severity.WARN] = diagnostic.message,
|
||||
[vim.diagnostic.severity.INFO] = diagnostic.message,
|
||||
[vim.diagnostic.severity.HINT] = diagnostic.message,
|
||||
}
|
||||
return diagnostic_message[diagnostic.severity]
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
-- LSP servers and clients are able to communicate to each other what features they support.
|
||||
-- By default, Neovim doesn't support everything that is in the LSP specification.
|
||||
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
|
||||
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
|
||||
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
||||
|
||||
-- Enable the following language servers
|
||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||
--
|
||||
-- Add any additional override configuration in the following tables. Available keys are:
|
||||
-- - cmd (table): Override the default command used to start the server
|
||||
-- - filetypes (table): Override the default list of associated filetypes for the server
|
||||
-- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
|
||||
-- - settings (table): Override the default settings passed when initializing the server.
|
||||
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
||||
local servers = {
|
||||
texlab = {},
|
||||
|
||||
cssls = {},
|
||||
astro = {},
|
||||
tailwindcss = {},
|
||||
pylsp = {},
|
||||
ts_ls = {},
|
||||
gopls = {},
|
||||
postgres_lsp = {},
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||
-- diagnostics = { disable = { 'missing-fields' } },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Ensure the servers and tools above are installed
|
||||
--
|
||||
-- To check the current status of installed tools and/or manually install
|
||||
-- other tools, you can run
|
||||
-- :Mason
|
||||
--
|
||||
-- You can press `g?` for help in this menu.
|
||||
--
|
||||
-- `mason` had to be setup earlier: to configure its options see the
|
||||
-- `dependencies` table for `nvim-lspconfig` above.
|
||||
--
|
||||
-- You can add other tools here that you want Mason to install
|
||||
-- for you, so that they are available from within Neovim.
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
"stylua", -- Used to format Lua code
|
||||
})
|
||||
require("mason-tool-installer").setup({ ensure_installed = ensure_installed })
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
|
||||
automatic_installation = true,
|
||||
handlers = {
|
||||
function(server_name)
|
||||
local server = servers[server_name] or {}
|
||||
-- This handles overriding only values explicitly passed
|
||||
-- by the server configuration above. Useful when disabling
|
||||
-- certain features of an LSP (for example, turning off formatting for ts_ls)
|
||||
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
|
||||
require("lspconfig")[server_name].setup(server)
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
-- Servers you want
|
||||
local lsp_servers = {
|
||||
"lua_ls",
|
||||
"ts_ls",
|
||||
"texlab",
|
||||
"marksman",
|
||||
"docker_compose_language_service",
|
||||
"dockerls",
|
||||
"tailwindcss",
|
||||
"cssls",
|
||||
"clangd",
|
||||
"rust_analyzer",
|
||||
"gopls",
|
||||
}
|
||||
|
||||
-- Optional: tools you might install later (kept, but not used for formatting here)
|
||||
local tools = {
|
||||
"luacheck",
|
||||
"latexindent",
|
||||
"prettierd",
|
||||
}
|
||||
|
||||
-- Mason + mason-lspconfig
|
||||
do
|
||||
local ok, mason = pcall(require, "mason")
|
||||
if ok then mason.setup() end
|
||||
|
||||
local ok_mlsp, mlsp = pcall(require, "mason-lspconfig")
|
||||
if ok_mlsp then
|
||||
mlsp.setup({
|
||||
ensure_installed = lsp_servers,
|
||||
automatic_enable = true, -- v2
|
||||
})
|
||||
end
|
||||
|
||||
-- If you want mason-tool-installer to fetch tools only (no config in this file):
|
||||
local ok_mti, mti = pcall(require, "mason-tool-installer")
|
||||
if ok_mti then
|
||||
mti.setup({
|
||||
ensure_installed = tools, -- harmless to keep; you can remove if you prefer
|
||||
automatic_installation = true,
|
||||
})
|
||||
end
|
||||
local ok_ls, ls = pcall(require, "luasnip")
|
||||
if ok_ls then
|
||||
ls.config.set_config({
|
||||
history = true,
|
||||
enable_autosnippets = false,
|
||||
})
|
||||
|
||||
-- Load VSCode-style snippets from friendly-snippets (and any other VSCode snippet dirs on rtp)
|
||||
-- pcall(function()
|
||||
-- require("luasnip.loaders.from_vscode").lazy_load()
|
||||
-- end)
|
||||
|
||||
-- Your Tab/Shift-Tab mappings...
|
||||
end
|
||||
end
|
||||
|
||||
-- Shared on_attach: native omni + Telescope pickers
|
||||
local function on_attach(_, bufnr)
|
||||
vim.api.nvim_set_option_value("omnifunc", "v:lua.vim.lsp.omnifunc", { buf = bufnr })
|
||||
vim.api.nvim_set_option_value("tagfunc", "v:lua.vim.lsp.tagfunc", { buf = bufnr })
|
||||
|
||||
local function map(mode, lhs, rhs, desc)
|
||||
vim.keymap.set(mode, lhs, rhs, { buffer = bufnr, noremap = true, silent = true, desc = desc })
|
||||
end
|
||||
|
||||
-- Telescope-powered LSP navigation (loads telescope.builtin on demand)
|
||||
local function tb(fn)
|
||||
return function()
|
||||
local ok, builtin = pcall(require, "telescope.builtin")
|
||||
if not ok then
|
||||
if vim.pack and vim.pack.load then pcall(vim.pack.load) end
|
||||
ok, builtin = pcall(require, "telescope.builtin")
|
||||
end
|
||||
if ok and builtin[fn] then
|
||||
builtin[fn]()
|
||||
else
|
||||
vim.notify("Telescope not available", vim.log.levels.WARN)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
map("n", "gd", tb("lsp_definitions"), "Goto Definition (Telescope)")
|
||||
map("n", "gr", tb("lsp_references"), "Goto References (Telescope)")
|
||||
map("n", "gI", tb("lsp_implementations"), "Goto Implementations (Telescope)")
|
||||
map("n", "gt", tb("lsp_type_definitions"), "Goto Type Definitions (Telescope)")
|
||||
|
||||
-- LSP basics
|
||||
map("n", "K", vim.lsp.buf.hover, "Hover")
|
||||
map("n", "<leader>rn", vim.lsp.buf.rename, "Rename")
|
||||
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, "Code Action")
|
||||
map("n", "[d", vim.diagnostic.goto_prev, "Prev Diagnostic")
|
||||
map("n", "]d", vim.diagnostic.goto_next, "Next Diagnostic")
|
||||
map("n", "<leader>e", vim.diagnostic.open_float, "Line Diagnostics")
|
||||
|
||||
pcall(vim.lsp.inlay_hint.enable, true, { bufnr = bufnr })
|
||||
end
|
||||
|
||||
|
||||
-- Global LSP defaults
|
||||
vim.lsp.config("*", {
|
||||
on_attach = on_attach,
|
||||
capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
-- capabilities = (function()
|
||||
-- local caps = vim.lsp.protocol.make_client_capabilities()
|
||||
-- caps.textDocument = caps.textDocument or {}
|
||||
-- caps.textDocument.foldingRange = { dynamicRegistration = false, lineFoldingOnly = true }
|
||||
-- return caps
|
||||
-- end)(),
|
||||
})
|
||||
|
||||
-- -- Server-specific tweaks
|
||||
-- vim.lsp.config("lua_ls", {
|
||||
-- settings = {
|
||||
-- Lua = {
|
||||
-- diagnostics = { globals = { "vim", "require" } },
|
||||
-- completion = { callSnippet = "Replace" },
|
||||
-- workspace = { checkThirdParty = false },
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
|
||||
-- Enable servers (Neovim 0.11+)
|
||||
vim.lsp.enable(lsp_servers)
|
||||
|
||||
-- -- Trigger omni (like cmp.complete)
|
||||
-- vim.keymap.set("i", "<C-Space>", function()
|
||||
-- if vim.bo.omnifunc == "v:lua.vim.lsp.omnifunc" then
|
||||
-- return vim.api.nvim_replace_termcodes("<C-x><C-o>", true, true, true)
|
||||
-- end
|
||||
-- return ""
|
||||
-- end, { expr = true, silent = true, desc = "Trigger omni-completion" })
|
||||
--
|
||||
-- -- Navigate popup menu
|
||||
-- vim.keymap.set("i", "<C-j>", "<C-n>", { silent = true, desc = "Omni next item" })
|
||||
-- vim.keymap.set("i", "<C-k>", "<C-p>", { silent = true, desc = "Omni prev item" })
|
||||
--
|
||||
-- -- Enter to confirm when pum is visible, otherwise newline
|
||||
-- vim.keymap.set("i", "<CR>", function()
|
||||
-- if vim.fn.pumvisible() == 1 then
|
||||
-- -- Confirm current selection; if none selected, accept first
|
||||
-- return vim.api.nvim_replace_termcodes("<C-y>", true, true, true)
|
||||
-- end
|
||||
-- return vim.api.nvim_replace_termcodes("<CR>", true, true, true)
|
||||
-- end, { expr = true, silent = true, desc = "Confirm completion or newline" })
|
||||
--
|
||||
-- -- Requires your existing LuaSnip setup and mappings
|
||||
-- local ok_ls, ls = pcall(require, "luasnip")
|
||||
-- if ok_ls then
|
||||
-- -- Tab: if menu visible, next item; else snippet expand/jump; else literal Tab
|
||||
-- vim.keymap.set({ "i", "s" }, "<Tab>", function()
|
||||
-- if vim.fn.pumvisible() == 1 then
|
||||
-- return vim.api.nvim_replace_termcodes("<C-n>", true, true, true)
|
||||
-- elseif ls.expand_or_jumpable() then
|
||||
-- return "<Plug>luasnip-expand-or-jump"
|
||||
-- else
|
||||
-- return "<Tab>"
|
||||
-- end
|
||||
-- end, { expr = true, silent = true, desc = "Next item / Snippet jump / Tab" })
|
||||
--
|
||||
-- -- Shift-Tab: if menu visible, prev item; else snippet jump back; else literal
|
||||
-- vim.keymap.set({ "i", "s" }, "<S-Tab>", function()
|
||||
-- if vim.fn.pumvisible() == 1 then
|
||||
-- return vim.api.nvim_replace_termcodes("<C-p>", true, true, true)
|
||||
-- elseif ls.jumpable(-1) then
|
||||
-- return "<Plug>luasnip-jump-prev"
|
||||
-- else
|
||||
-- return "<S-Tab>"
|
||||
-- end
|
||||
-- end, { expr = true, silent = true, desc = "Prev item / Snippet back / Shift-Tab" })
|
||||
-- end
|
||||
|
||||
@ -1,9 +1,28 @@
|
||||
return {
|
||||
'stevearc/oil.nvim',
|
||||
opts = {},
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if prefer nvim-web-devicons
|
||||
config = function()
|
||||
require("oil").setup()
|
||||
vim.keymap.set('n', '<leader>fe', "<cmd>:Oil<cr>")
|
||||
-- Declare plugins
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/nvim-lua/plenary.nvim", version = "master" },
|
||||
{ src = "https://github.com/stevearc/oil.nvim", version = "master" },
|
||||
})
|
||||
|
||||
-- Try to load packs on startup
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
once = true,
|
||||
callback = function()
|
||||
if vim.pack.load then pcall(vim.pack.load) end
|
||||
|
||||
-- Configure oil (guarded)
|
||||
local ok, oil = pcall(require, "oil")
|
||||
if ok then
|
||||
pcall(oil.setup, {})
|
||||
else
|
||||
-- If it wasn't on rtp yet, try once shortly after
|
||||
vim.schedule(function()
|
||||
local ok2, oil2 = pcall(require, "oil")
|
||||
if ok2 then pcall(oil2.setup, {}) end
|
||||
end)
|
||||
end
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
-- Keymap (works whether eager or lazy)
|
||||
vim.keymap.set("n", "<leader>fe", "<cmd>Oil<cr>", { desc = "Open Oil" })
|
||||
|
||||
@ -1,49 +1,45 @@
|
||||
return { -- Fuzzy Finder (files, lsp, etc)
|
||||
"nvim-telescope/telescope.nvim",
|
||||
event = "VimEnter",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
-- Ensure packs are added
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/nvim-lua/plenary.nvim", version = "master" },
|
||||
{ src = "https://github.com/nvim-telescope/telescope.nvim", version = "master" },
|
||||
-- Optional native sorter (requires a C toolchain)
|
||||
{ src = "https://github.com/nvim-telescope/telescope-fzf-native.nvim", version = "main", build = "make" },
|
||||
})
|
||||
|
||||
-- `build` is used to run some command when the plugin is installed/updated.
|
||||
-- This is only run then, not every time Neovim starts up.
|
||||
build = "make",
|
||||
-- Helper: find fzf-native root and build/lib path if installed
|
||||
local function fzf_native_paths()
|
||||
local lua_file = vim.api.nvim_get_runtime_file("lua/fzf_lib.lua", true)[1]
|
||||
if not lua_file then return nil end
|
||||
local root = lua_file:gsub("/lua/fzf_lib.lua$", "")
|
||||
local lib = root .. "/build/libfzf.so"
|
||||
return { root = root, lib = lib }
|
||||
end
|
||||
|
||||
-- `cond` is a condition used to determine whether this plugin should be
|
||||
-- installed and loaded.
|
||||
cond = function()
|
||||
return vim.fn.executable("make") == 1
|
||||
end,
|
||||
},
|
||||
{ "nvim-telescope/telescope-ui-select.nvim" },
|
||||
-- Try to build fzf-native if the .so is missing
|
||||
local function ensure_fzf_native_built()
|
||||
local p = fzf_native_paths()
|
||||
if not p then return false end
|
||||
if vim.uv.fs_stat(p.lib) then return true end
|
||||
-- Attempt to run `make` in the plugin directory
|
||||
vim.notify("Building telescope-fzf-native (make)...", vim.log.levels.INFO)
|
||||
local ok = pcall(function()
|
||||
vim.system({ "make" }, { cwd = p.root }):wait()
|
||||
end)
|
||||
if ok and vim.uv.fs_stat(p.lib) then
|
||||
vim.notify("telescope-fzf-native built successfully", vim.log.levels.INFO)
|
||||
return true
|
||||
else
|
||||
vim.notify("telescope-fzf-native build failed or library missing", vim.log.levels.WARN)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- Useful for getting pretty icons, but requires a Nerd Font.
|
||||
{ "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
|
||||
},
|
||||
config = function()
|
||||
-- Telescope is a fuzzy finder that comes with a lot of different things that
|
||||
-- it can fuzzy find! It's more than just a "file finder", it can search
|
||||
-- many different aspects of Neovim, your workspace, LSP, and more!
|
||||
--
|
||||
-- The easiest way to use Telescope, is to start by doing something like:
|
||||
-- :Telescope help_tags
|
||||
--
|
||||
-- After running this command, a window will open up and you're able to
|
||||
-- type in the prompt window. You'll see a list of `help_tags` options and
|
||||
-- a corresponding preview of the help.
|
||||
--
|
||||
-- Two important keymaps to use while in Telescope are:
|
||||
-- - Insert mode: <c-/>
|
||||
-- - Normal mode: ?
|
||||
--
|
||||
-- This opens a window that shows you all of the keymaps for the current
|
||||
-- Telescope picker. This is really useful to discover what Telescope can
|
||||
-- do as well as how to actually do it!
|
||||
-- Configure Telescope when available; try on VimEnter, retry once
|
||||
local function telescope_setup()
|
||||
local ok, telescope = pcall(require, "telescope")
|
||||
if not ok then return false end
|
||||
|
||||
-- [[ Configure Telescope ]]
|
||||
-- See `:help telescope` and `:help telescope.setup()`
|
||||
require("telescope").setup({
|
||||
telescope.setup({
|
||||
pickers = {
|
||||
find_files = {
|
||||
theme = "ivy",
|
||||
@ -57,9 +53,6 @@ return { -- Fuzzy Finder (files, lsp, etc)
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown(),
|
||||
},
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
@ -69,44 +62,46 @@ return { -- Fuzzy Finder (files, lsp, etc)
|
||||
},
|
||||
})
|
||||
|
||||
-- Enable Telescope extensions if they are installed
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
pcall(require("telescope").load_extension, "ui-select")
|
||||
-- Load fzf extension only if built; call protected to avoid hard errors
|
||||
if ensure_fzf_native_built() then
|
||||
pcall(telescope.load_extension, "fzf")
|
||||
end
|
||||
|
||||
-- See `:help telescope.builtin`
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp" })
|
||||
vim.keymap.set("n", "<leader>sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" })
|
||||
vim.keymap.set("n", "<leader>sf", builtin.find_files, { desc = "[S]earch [F]iles" })
|
||||
vim.keymap.set("n", "<leader>ss", builtin.builtin, { desc = "[S]earch [S]elect Telescope" })
|
||||
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
|
||||
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
|
||||
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
||||
vim.keymap.set("n", "<leader>sr", builtin.resume, { desc = "[S]earch [R]esume" })
|
||||
vim.keymap.set("n", "<leader>s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
||||
vim.keymap.set("n", "<leader><leader>", builtin.buffers, { desc = "[ ] Find existing buffers" })
|
||||
return true
|
||||
end
|
||||
|
||||
-- Slightly advanced example of overriding default behavior and theme
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
|
||||
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end, { desc = "[/] Fuzzily search in current buffer" })
|
||||
|
||||
-- It's also possible to pass additional configuration options.
|
||||
-- See `:help telescope.builtin.live_grep()` for information about particular keys
|
||||
vim.keymap.set("n", "<leader>s/", function()
|
||||
builtin.live_grep({
|
||||
grep_open_files = true,
|
||||
prompt_title = "Live Grep in Open Files",
|
||||
})
|
||||
end, { desc = "[S]earch [/] in Open Files" })
|
||||
|
||||
-- Shortcut for searching your Neovim configuration files
|
||||
vim.keymap.set("n", "<leader>sn", function()
|
||||
builtin.find_files({ cwd = vim.fn.stdpath("config") })
|
||||
end, { desc = "[S]earch [N]eovim files" })
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
once = true,
|
||||
callback = function()
|
||||
if vim.pack and vim.pack.load then pcall(vim.pack.load) end
|
||||
if not telescope_setup() then
|
||||
vim.schedule(telescope_setup)
|
||||
end
|
||||
end,
|
||||
}
|
||||
})
|
||||
|
||||
-- Always define keymaps; they load telescope on first use if needed
|
||||
local function map(lhs, fn, desc)
|
||||
vim.keymap.set("n", lhs, fn, { noremap = true, silent = true, desc = desc })
|
||||
end
|
||||
|
||||
-- On-demand wrappers that require telescope.builtin when called
|
||||
local function with_builtin(name)
|
||||
return function()
|
||||
local ok, builtin = pcall(require, "telescope.builtin")
|
||||
if not ok then
|
||||
if vim.pack and vim.pack.load then pcall(vim.pack.load) end
|
||||
ok, builtin = pcall(require, "telescope.builtin")
|
||||
end
|
||||
if ok and builtin[name] then
|
||||
builtin[name]()
|
||||
else
|
||||
vim.notify("Telescope not available yet", vim.log.levels.WARN)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
map("<leader>ff", with_builtin("find_files"), "Find files")
|
||||
map("<leader>fg", with_builtin("live_grep"), "Live grep")
|
||||
map("<leader>fb", with_builtin("buffers"), "Buffers")
|
||||
map("<leader>fh", with_builtin("help_tags"), "Help tags")
|
||||
|
||||
@ -1,9 +1,29 @@
|
||||
return {
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
priority = 1000 ,
|
||||
config = function()
|
||||
vim.o.background = "dark" -- or "light" for light mode
|
||||
vim.cmd([[colorscheme gruvbox]])
|
||||
end
|
||||
}
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/nvim-lualine/lualine.nvim" },
|
||||
{ src = "https://github.com/ellisonleao/gruvbox.nvim" },
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
once = true,
|
||||
callback = function()
|
||||
if vim.pack and vim.pack.load then pcall(vim.pack.load) end
|
||||
pcall(function()
|
||||
-- Ensure colorscheme is available; set it if you want
|
||||
-- vim.cmd("colorscheme gruvbox")
|
||||
|
||||
-- lualine theme can be specified by name or theme table.
|
||||
-- Using the built-in "gruvbox" theme name is simplest:
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = "gruvbox",
|
||||
icons_enabled = true,
|
||||
always_divide_middle = true,
|
||||
component_separators = { left = "│", right = "│" },
|
||||
section_separators = { left = "", right = "" },
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd.colorscheme("gruvbox")
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
||||
@ -1,15 +1,41 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = { "VeryLazy" },
|
||||
lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline
|
||||
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
|
||||
opts = {
|
||||
highlight = { enable = true },
|
||||
-- Ensure packs are added
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" },
|
||||
})
|
||||
|
||||
|
||||
-- Configure after packs are loaded (PackLoad is emitted by vim.pack.load)
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "PackLoad",
|
||||
once = true,
|
||||
callback = function()
|
||||
local ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||
if not ok then
|
||||
vim.notify("nvim-treesitter not available yet", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
configs.setup({
|
||||
auto_install = true,
|
||||
highlight = { enable = true, additional_vim_regex_highlighting = false },
|
||||
indent = { enable = true },
|
||||
auto_install = { enable = true }
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
})
|
||||
end,
|
||||
}
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('PackChanged', {
|
||||
desc = 'Handle nvim-treesitter updates',
|
||||
group = vim.api.nvim_create_augroup('nvim-treesitter-pack-changed-update-handler', { clear = true }),
|
||||
callback = function(event)
|
||||
if event.data.kind == 'update' and event.data.spec.name == 'nvim-treesitter' then
|
||||
vim.notify('nvim-treesitter updated, running TSUpdate...', vim.log.levels.INFO)
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
local ok = pcall(vim.cmd, 'TSUpdate')
|
||||
if ok then
|
||||
vim.notify('TSUpdate completed successfully!', vim.log.levels.INFO)
|
||||
else
|
||||
vim.notify('TSUpdate command not available yet, skipping', vim.log.levels.WARN)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
3
nvim/lua/kanopo/plugins/which-key.lua
Normal file
3
nvim/lua/kanopo/plugins/which-key.lua
Normal file
@ -0,0 +1,3 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/folke/which-key.nvim"},
|
||||
})
|
||||
@ -1,52 +0,0 @@
|
||||
return { -- Useful plugin to show you pending keybinds.
|
||||
"folke/which-key.nvim",
|
||||
event = "VimEnter", -- Sets the loading event to 'VimEnter'
|
||||
opts = {
|
||||
-- delay between pressing a key and opening which-key (milliseconds)
|
||||
-- this setting is independent of vim.o.timeoutlen
|
||||
delay = 0,
|
||||
icons = {
|
||||
-- set icon mappings to true if you have a Nerd Font
|
||||
mappings = vim.g.have_nerd_font,
|
||||
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
|
||||
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
|
||||
keys = vim.g.have_nerd_font and {} or {
|
||||
Up = "<Up> ",
|
||||
Down = "<Down> ",
|
||||
Left = "<Left> ",
|
||||
Right = "<Right> ",
|
||||
C = "<C-…> ",
|
||||
M = "<M-…> ",
|
||||
D = "<D-…> ",
|
||||
S = "<S-…> ",
|
||||
CR = "<CR> ",
|
||||
Esc = "<Esc> ",
|
||||
ScrollWheelDown = "<ScrollWheelDown> ",
|
||||
ScrollWheelUp = "<ScrollWheelUp> ",
|
||||
NL = "<NL> ",
|
||||
BS = "<BS> ",
|
||||
Space = "<Space> ",
|
||||
Tab = "<Tab> ",
|
||||
F1 = "<F1>",
|
||||
F2 = "<F2>",
|
||||
F3 = "<F3>",
|
||||
F4 = "<F4>",
|
||||
F5 = "<F5>",
|
||||
F6 = "<F6>",
|
||||
F7 = "<F7>",
|
||||
F8 = "<F8>",
|
||||
F9 = "<F9>",
|
||||
F10 = "<F10>",
|
||||
F11 = "<F11>",
|
||||
F12 = "<F12>",
|
||||
},
|
||||
},
|
||||
|
||||
-- Document existing key chains
|
||||
spec = {
|
||||
{ "<leader>s", group = "[S]earch" },
|
||||
{ "<leader>t", group = "[T]oggle" },
|
||||
{ "<leader>h", group = "Git [H]unk", mode = { "n", "v" } },
|
||||
},
|
||||
},
|
||||
}
|
||||
0
nvim/main.ts
Normal file
0
nvim/main.ts
Normal file
@ -1,3 +0,0 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json"
|
||||
}
|
||||
@ -1,10 +0,0 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"theme": "gruvbox",
|
||||
"mcp": {
|
||||
"Figma": {
|
||||
"url": "https://mcp.figma.com/mcp",
|
||||
"enabled": true,
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/tui.json",
|
||||
"theme": "gruvbox"
|
||||
}
|
||||
@ -1,2 +0,0 @@
|
||||
# enable automatic env
|
||||
sdkman_auto_env=true
|
||||
@ -1,2 +0,0 @@
|
||||
[Sleep]
|
||||
HibernateDelaySec=30min
|
||||
@ -1,28 +0,0 @@
|
||||
```bash
|
||||
|
||||
sudo tee /etc/systemd/system/suspend-radios.service << 'EOF'
|
||||
[Unit]
|
||||
Description=Disable radios before suspend
|
||||
Before=sleep.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/sbin/rfkill block wifi bluetooth
|
||||
ExecStop=/usr/sbin/rfkill unblock wifi bluetooth
|
||||
|
||||
[Install]
|
||||
WantedBy=sleep.target
|
||||
EOF
|
||||
|
||||
sudo systemctl enable suspend-radios.service
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /etc/systemd/sleep.conf.d
|
||||
sudo tee /etc/systemd/sleep.conf.d/hibernate.conf << 'EOF'
|
||||
[Sleep]
|
||||
HibernateDelaySec=30min
|
||||
EOF
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
@ -1,11 +0,0 @@
|
||||
[Unit]
|
||||
Description=Disable radios before suspend
|
||||
Before=sleep.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/sbin/rfkill block wifi bluetooth
|
||||
ExecStop=/usr/sbin/rfkill unblock wifi bluetooth
|
||||
|
||||
[Install]
|
||||
WantedBy=sleep.target
|
||||
114
sway/config
114
sway/config
@ -4,7 +4,7 @@ set $left h
|
||||
set $down j
|
||||
set $up k
|
||||
set $right l
|
||||
set $term foot
|
||||
set $term ghostty
|
||||
# Launcher: wofi (sostituisce wmenu-run)
|
||||
set $menu wofi -S drun -p Search -I -b -i
|
||||
|
||||
@ -85,7 +85,7 @@ floating_modifier $mod normal
|
||||
bindsym $mod+Shift+c reload
|
||||
|
||||
# Esci da Sway (con conferma tramite swaynag)
|
||||
# bindsym $mod+Shift+e exec swaynag -t warning -m 'Hai premuto la scorciatoia per uscire. Vuoi davvero uscire da Sway?' -B 'Sì, esci' 'swaymsg exit'
|
||||
bindsym $mod+Shift+e exec swaynag -t warning -m 'Hai premuto la scorciatoia per uscire. Vuoi davvero uscire da Sway?' -B 'Sì, esci' 'swaymsg exit'
|
||||
|
||||
### Navigazione e spostamento tra finestre
|
||||
# Sposta il focus
|
||||
@ -177,15 +177,36 @@ bindsym $mod+r mode "resize"
|
||||
### Notifiche e Controlli Audio/Luminosità
|
||||
set $notification_time 1000
|
||||
|
||||
# Audio controls
|
||||
bindsym XF86AudioMute exec ~/.config/sway/scripts/notification-control.sh mute-toggle
|
||||
bindsym XF86AudioLowerVolume exec ~/.config/sway/scripts/notification-control.sh volume-down
|
||||
bindsym XF86AudioRaiseVolume exec ~/.config/sway/scripts/notification-control.sh volume-up
|
||||
bindsym XF86AudioMicMute exec ~/.config/sway/scripts/notification-control.sh mic-mute-toggle
|
||||
# Comandi per le notifiche (volume, mute, mic, luminosità)
|
||||
set $audio_notification_cmd command -v notify-send >/dev/null && \
|
||||
VALUE=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}') && \
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-h "int:value:$VALUE" -t $notification_time "Volume: ${VALUE}%"
|
||||
|
||||
# Brightness controls
|
||||
bindsym XF86MonBrightnessDown exec ~/.config/sway/scripts/notification-control.sh brightness-down
|
||||
bindsym XF86MonBrightnessUp exec ~/.config/sway/scripts/notification-control.sh brightness-up
|
||||
set $mute_notification_cmd command -v notify-send >/dev/null && \
|
||||
VALUE=$(pactl get-sink-mute @DEFAULT_SINK@ | head -n 1 | awk '{print $2}') && \
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-h "string:x-canonical-private-synchronous:audio" -t $notification_time "Mute: ${VALUE}"
|
||||
|
||||
set $mute_mic_notification_cmd command -v notify-send >/dev/null && \
|
||||
VALUE=$(pactl get-source-mute @DEFAULT_SOURCE@ | head -n 1 | awk '{print $2}') && \
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-h "string:x-canonical-private-synchronous:audio" -t $notification_time "Mic Mute: ${VALUE}"
|
||||
|
||||
set $brightness_notification_cmd command -v notify-send >/dev/null && \
|
||||
VALUE=$(brightnessctl get) && \
|
||||
MAX=255 && \
|
||||
PERCENT=$((VALUE * 100 / MAX)) && \
|
||||
notify-send -e -h string:x-canonical-private-synchronous:brightness \
|
||||
-h "int:value:$PERCENT" -t $notification_time "Brightness: ${PERCENT}%"
|
||||
|
||||
# Key bindings per audio e luminosità
|
||||
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle; exec $mute_notification_cmd
|
||||
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% && $audio_notification_cmd
|
||||
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% && $audio_notification_cmd
|
||||
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle && $mute_mic_notification_cmd
|
||||
bindsym XF86MonBrightnessDown exec brightnessctl s 10%- && $brightness_notification_cmd
|
||||
bindsym XF86MonBrightnessUp exec brightnessctl s 10%+ && $brightness_notification_cmd
|
||||
|
||||
# Controlli multimediali
|
||||
bindsym XF86AudioPlay exec playerctl play-pause
|
||||
@ -193,24 +214,18 @@ bindsym XF86AudioNext exec playerctl next
|
||||
bindsym XF86AudioPrev exec playerctl previous
|
||||
|
||||
### Screenshot e Registrazione Schermo
|
||||
bindsym Print exec grimshot --notify copy output && \
|
||||
notify-send -u normal "📸 Screenshot" "Full screen copied to clipboard"
|
||||
bindsym Print exec grimshot --notify copy output
|
||||
bindsym $mod+Print exec grimshot --notify copy area
|
||||
bindsym $mod+P exec grimshot --notify copy output
|
||||
bindsym $mod+Shift+P exec grimshot --notify copy area
|
||||
|
||||
# Screenshot selected area
|
||||
bindsym $mod+Print exec grimshot --notify copy area && \
|
||||
notify-send -u normal "📸 Screenshot" "Selected area copied to clipboard"
|
||||
bindsym $mod+XF86AudioMedia exec --no-startup-id \
|
||||
(pgrep -x wf-recorder > /dev/null && killall -s SIGINT wf-recorder && notify-send "Recording Stopped") || \
|
||||
(notify-send "Recording Started + Audio." && wf-recorder --audio --file ~/Videos/$(date +'%Y-%m-%d-%H-%M-%S').mp4)
|
||||
|
||||
# Alternative bindings
|
||||
bindsym $mod+P exec grimshot --notify copy output && \
|
||||
notify-send -u normal "📸 Screenshot" "Full screen copied to clipboard"
|
||||
|
||||
bindsym $mod+Shift+P exec grimshot --notify copy area && \
|
||||
notify-send -u normal "📸 Screenshot" "Selected area copied to clipboard"
|
||||
|
||||
# this one includes audio track in the recording
|
||||
bindsym $mod+XF86AudioMedia exec ~/.config/sway/scripts/screen-recording.sh audio
|
||||
# this one not
|
||||
bindsym XF86AudioMedia exec ~/.config/sway/scripts/screen-recording.sh
|
||||
bindsym XF86AudioMedia exec --no-startup-id \
|
||||
(pgrep -x wf-recorder > /dev/null && killall -s SIGINT wf-recorder && notify-send "Recording Stopped") || \
|
||||
(notify-send "Recording Started" && wf-recorder --file ~/Videos/$(date +'%Y-%m-%d-%H-%M-%S').mp4)
|
||||
|
||||
### Modalità per azioni di sistema (lock, logout, reboot, suspend, shutdown)
|
||||
set $mode_system "What to do? (l) lock, (e) logout, (r) reboot, (Shift+s) shutdown"
|
||||
@ -233,49 +248,37 @@ bar {
|
||||
### Borders e Gaps
|
||||
default_border pixel
|
||||
smart_gaps on
|
||||
gaps outer 2
|
||||
gaps inner 3
|
||||
gaps outer 3
|
||||
gaps inner 5
|
||||
|
||||
# Impostazioni dei colori per il focus delle finestre
|
||||
client.focused $gruvbox_orange $gruvbox_orange $gruvbox_bg_dark $gruvbox_orange
|
||||
hide_edge_borders smart
|
||||
|
||||
### Impostazioni GTK per tema scuro
|
||||
set $qt_theme qt5ct
|
||||
exec_always {
|
||||
# Questi servono ancora per le app GTK4/Libadwaita native
|
||||
gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3-dark'
|
||||
gsettings set org.gnome.desktop.interface icon-theme 'Adwaita'
|
||||
gsettings set org.gnome.desktop.interface cursor-theme 'Adwaita'
|
||||
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
||||
|
||||
# Forza il refresh delle variabili ambiente
|
||||
systemctl --user import-environment QT_QPA_PLATFORMTHEME
|
||||
}
|
||||
# sudo pacman -S xorg-xhost
|
||||
# xhost +SI:localuser:root
|
||||
exec xhost +SI:localuser:root
|
||||
|
||||
# Aggiungi QT_QPA_PLATFORMTHEME alla lista delle variabili da importare
|
||||
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP QT_QPA_PLATFORMTHEME
|
||||
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP SWAYSOCK QT_QPA_PLATFORMTHEME=$qt_theme
|
||||
|
||||
### Applicazioni in autostart
|
||||
exec keepassxc
|
||||
# exec flatpak run org.keepassxc.KeePassXC
|
||||
exec nextcloud
|
||||
# exec flatpak run com.nextcloud.desktopclient.nextcloud
|
||||
# exec keepassxc
|
||||
exec flatpak run org.keepassxc.KeePassXC
|
||||
# exec nextcloud
|
||||
exec flatpak run com.nextcloud.desktopclient.nextcloud
|
||||
exec wlsunset -S 08:00 -s 18:00
|
||||
exec blueman-applet
|
||||
exec xss-lock -- swaylock -f -i $wallpaper
|
||||
exec --no-startup-id easyeffects --gapplication-service
|
||||
# exec flatpak run com.github.wwmm.easyeffects --gapplication-service
|
||||
# exec --no-startup-id easyeffects --gapplication-service
|
||||
exec flatpak run com.github.wwmm.easyeffects --gapplication-service
|
||||
exec --no-startup-id wluma
|
||||
|
||||
# Avvio del polkit agent GNOME
|
||||
# exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||
# (Se preferisci il KDE agent, commenta la riga sopra e decommenta quella sottostante)
|
||||
# exec "/usr/lib/polkit-kde-authentication-agent-1"
|
||||
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||
exec "/usr/lib/polkit-kde-authentication-agent-1"
|
||||
exec --no-startup-id gnome-keyring-daemon --start --components=pkcs11,secrets,ssh
|
||||
|
||||
# Importa variabili ambiente per DBus e il desktop corrente
|
||||
@ -283,8 +286,7 @@ exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CU
|
||||
exec dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP SWAYSOCK I3SOCK XCURSOR_SIZE XCURSOR_THEME
|
||||
|
||||
### Notifiche Desktop e Clip History
|
||||
exec swaync
|
||||
# exec mako
|
||||
exec mako
|
||||
exec wl-paste --type text --watch cliphist store
|
||||
exec wl-paste --type image --watch cliphist store
|
||||
|
||||
@ -314,3 +316,15 @@ for_window [title="Picture in picture"] floating enable, sticky enable
|
||||
for_window [title="Save File"] floating enable
|
||||
for_window [app_id="firefox" title="Firefox — Sharing Indicator"] kill
|
||||
|
||||
# assign [app_id="configs"] workspace configs
|
||||
assign [class="Spotify"] workspace 10
|
||||
|
||||
for_window [app_id="keymapp"] floating enable
|
||||
for_window [app_id="keymapp"] resize set width 800 px height 600 px
|
||||
for_window [app_id="keymapp"] move position 100%-800px 100%-600px
|
||||
for_window [app_id="keymapp"] mark pin-keymapp
|
||||
no_focus [app_id="keymapp"]
|
||||
exec_always ~/.config/sway/scripts/pin-keymapp.sh
|
||||
|
||||
# Includi eventuali configurazioni aggiuntive
|
||||
# include /etc/sway/config.d/*
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ACTION="$1"
|
||||
NOTIFICATION_TIME=1000
|
||||
|
||||
case "$ACTION" in
|
||||
volume-up)
|
||||
pactl set-sink-volume @DEFAULT_SINK@ +5%
|
||||
VALUE=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}')
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-h "int:value:$VALUE" -t $NOTIFICATION_TIME "🔊 Volume" "${VALUE}%"
|
||||
;;
|
||||
|
||||
volume-down)
|
||||
pactl set-sink-volume @DEFAULT_SINK@ -5%
|
||||
VALUE=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}')
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-h "int:value:$VALUE" -t $NOTIFICATION_TIME "🔉 Volume" "${VALUE}%"
|
||||
;;
|
||||
|
||||
mute-toggle)
|
||||
pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||
MUTED=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}')
|
||||
if [ "$MUTED" = "yes" ]; then
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-t $NOTIFICATION_TIME "🔇 Audio Muted" "Output muted"
|
||||
else
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-t $NOTIFICATION_TIME "🔊 Audio Unmuted" "Output active"
|
||||
fi
|
||||
;;
|
||||
|
||||
mic-mute-toggle)
|
||||
pactl set-source-mute @DEFAULT_SOURCE@ toggle
|
||||
MUTED=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk '{print $2}')
|
||||
if [ "$MUTED" = "yes" ]; then
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-t $NOTIFICATION_TIME "🎤 Microphone Muted" "Mic muted"
|
||||
else
|
||||
notify-send -e -h string:x-canonical-private-synchronous:audio \
|
||||
-t $NOTIFICATION_TIME "🎤 Microphone Active" "Mic unmuted"
|
||||
fi
|
||||
;;
|
||||
|
||||
brightness-up)
|
||||
brightnessctl s 10%+
|
||||
# Get current and max brightness values
|
||||
CURRENT=$(brightnessctl get)
|
||||
MAX=$(brightnessctl max)
|
||||
PERCENT=$((CURRENT * 100 / MAX))
|
||||
notify-send -e -h string:x-canonical-private-synchronous:brightness \
|
||||
-h "int:value:$PERCENT" -t $NOTIFICATION_TIME "☀️ Brightness" "${PERCENT}%"
|
||||
;;
|
||||
|
||||
brightness-down)
|
||||
brightnessctl s 10%-
|
||||
# Get current and max brightness values
|
||||
CURRENT=$(brightnessctl get)
|
||||
MAX=$(brightnessctl max)
|
||||
PERCENT=$((CURRENT * 100 / MAX))
|
||||
notify-send -e -h string:x-canonical-private-synchronous:brightness \
|
||||
-h "int:value:$PERCENT" -t $NOTIFICATION_TIME "🔅 Brightness" "${PERCENT}%"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {volume-up|volume-down|mute-toggle|mic-mute-toggle|brightness-up|brightness-down}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
18
sway/scripts/pin-keymapp.sh
Executable file
18
sway/scripts/pin-keymapp.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
# Follow current workspace and place bottom-right at 800x600.
|
||||
# Requires the window to be marked "pin-keymapp" and floating.
|
||||
|
||||
# Subscribe to workspace changes
|
||||
swaymsg -t subscribe '["workspace"]' | while read -r _; do
|
||||
# Ensure the window exists before issuing moves
|
||||
if swaymsg -t get_tree | jq -e '.. | objects | select(.marks? and (index("pin-keymapp"))) ' >/dev/null; then
|
||||
# Move to current workspace
|
||||
swaymsg '[con_mark="pin-keymapp"] move container to workspace current'
|
||||
# Ensure size, then place. Order matters: floating -> resize -> move.
|
||||
swaymsg '[con_mark="pin-keymapp"] floating enable'
|
||||
swaymsg '[con_mark="pin-keymapp"] resize set width 800 px height 600 px'
|
||||
swaymsg '[con_mark="pin-keymapp"] move position 100%-800px 100%-600px'
|
||||
# If needed (multi-output absolute coords), use:
|
||||
# swaymsg '[con_mark="pin-keymapp"] move absolute position 100%-800px 100%-600px'
|
||||
fi
|
||||
done
|
||||
@ -1,30 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
RECORD_DIR="$HOME/Videos"
|
||||
TIMESTAMP=$(date +'%Y-%m-%d-%H-%M-%S')
|
||||
AUDIO_FLAG="$1"
|
||||
|
||||
# Create directory if it doesn't exist
|
||||
if [ ! -d "$RECORD_DIR" ]; then
|
||||
mkdir -p "$RECORD_DIR"
|
||||
notify-send -u low "📁 Directory Created" "$RECORD_DIR"
|
||||
fi
|
||||
|
||||
if pgrep -x wf-recorder > /dev/null; then
|
||||
killall -s SIGINT wf-recorder
|
||||
notify-send -u normal "🛑 Recording Stopped" "Saved to $RECORD_DIR/"
|
||||
else
|
||||
if [ "$AUDIO_FLAG" = "audio" ]; then
|
||||
notify-send -u normal "🔴 Recording Started" "With audio enabled"
|
||||
wf-recorder --audio --file "$RECORD_DIR/${TIMESTAMP}.mp4"
|
||||
else
|
||||
notify-send -u normal "🔴 Recording Started" "Video only"
|
||||
wf-recorder --file "$RECORD_DIR/${TIMESTAMP}.mp4"
|
||||
fi
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
notify-send -u normal "✅ Recording Complete" "Saved as ${TIMESTAMP}.mp4"
|
||||
else
|
||||
notify-send -u critical "❌ Recording Failed" "Check your configuration"
|
||||
fi
|
||||
fi
|
||||
@ -1,11 +1,7 @@
|
||||
// -*- mode: jsonc -*-
|
||||
{
|
||||
"height": 34, // Waybar height (to be removed for auto height)
|
||||
"modules-left": [
|
||||
"hyprland/workspaces"
|
||||
// // "hyprland/window",
|
||||
// "sway/workspaces", "sway/mode", "sway/scratchpad"
|
||||
],
|
||||
"modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad"],
|
||||
"modules-center": ["clock"],
|
||||
"modules-right": [
|
||||
"idle_inhibitor",
|
||||
@ -17,13 +13,7 @@
|
||||
"backlight",
|
||||
"battery",
|
||||
"tray",
|
||||
"custom/notification"
|
||||
],
|
||||
"hyprland/workspaces": {
|
||||
"format": "{icon}",
|
||||
"on-scroll-up": "hyprctl dispatch workspace e+1",
|
||||
"on-scroll-down": "hyprctl dispatch workspace e-1"
|
||||
},
|
||||
"sway/mode": {
|
||||
"format": "<span style=\"italic\">{}</span>",
|
||||
},
|
||||
@ -122,24 +112,4 @@
|
||||
},
|
||||
"on-click": "pavucontrol",
|
||||
},
|
||||
"custom/notification" : {
|
||||
"tooltip" : false,
|
||||
"format" : "{} {icon}",
|
||||
"format-icons" : {
|
||||
"notification" : "",
|
||||
"none" : "",
|
||||
"dnd-notification" : " ",
|
||||
"dnd-none" : "",
|
||||
"inhibited-notification" : " ",
|
||||
"inhibited-none" : "",
|
||||
"dnd-inhibited-notification" : " ",
|
||||
"dnd-inhibited-none" : " ",
|
||||
},
|
||||
"return-type" : "json",
|
||||
"exec-if" : "which swaync-client",
|
||||
"exec" : "swaync-client -swb",
|
||||
"on-click" : "sleep 0.1 && swaync-client -t -sw",
|
||||
"on-click-right" : "sleep 0.1 && swaync-client -d -sw",
|
||||
"escape" : true,
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
* {
|
||||
font-family: "Iosevka Nerd Font", "Font Awesome 6 Free", "monospace";
|
||||
font-size: 16px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@define-color background #282828;
|
||||
@ -27,18 +25,6 @@ window#waybar {
|
||||
background-color: @background;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.module-left * {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#custom-notification {
|
||||
/* padding: 0 20px; */
|
||||
padding-left: 10px;
|
||||
padding-right: 20px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#custom-scratch {
|
||||
@ -48,7 +34,6 @@ window#waybar {
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 10px;
|
||||
border-radius: 0px;
|
||||
color: @foreground;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user