From 9b2bf745a7fb050725bcf0196ecbaf8b335cb1e8 Mon Sep 17 00:00:00 2001 From: Dmitri Date: Thu, 5 Feb 2026 15:52:40 +0100 Subject: [PATCH] ciao --- .zshrc | 13 +++---- dns.md | 60 +++++++++++++++++++++++++++++++++ nvim/lua/kanopo/keymaps.lua | 8 +++++ nvim/lua/kanopo/plugins/lsp.lua | 7 ++-- sway/config | 16 +++++++-- 5 files changed, 90 insertions(+), 14 deletions(-) create mode 100644 dns.md diff --git a/.zshrc b/.zshrc index f7c8456..ab51e07 100644 --- a/.zshrc +++ b/.zshrc @@ -37,13 +37,8 @@ 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 -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - - - -#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! -export SDKMAN_DIR="$HOME/.sdkman" -[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" -# [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion diff --git a/dns.md b/dns.md new file mode 100644 index 0000000..205e9f9 --- /dev/null +++ b/dns.md @@ -0,0 +1,60 @@ +# 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. diff --git a/nvim/lua/kanopo/keymaps.lua b/nvim/lua/kanopo/keymaps.lua index 5450cc9..cb64c0b 100644 --- a/nvim/lua/kanopo/keymaps.lua +++ b/nvim/lua/kanopo/keymaps.lua @@ -33,3 +33,11 @@ vim.keymap.set("n", "", "", { desc = "Move focus to the upper win -- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) -- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) -- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) + +-- DAP keymaps +vim.keymap.set("n", "db", "lua require'dap'.toggle_breakpoint()", { desc = "Toggle [B]reakpoint" }) +vim.keymap.set("n", "dc", "lua require'dap'.continue()", { desc = "[C]ontinue" }) +vim.keymap.set("n", "di", "lua require'dap'.step_into()", { desc = "Step [I]nto" }) +vim.keymap.set("n", "do", "lua require'dap'.step_over()", { desc = "Step [O]ver" }) +vim.keymap.set("n", "dO", "lua require'dap'.step_out()", { desc = "Step [O]ut" }) +vim.keymap.set("n", "dr", "lua require'dap'.repl.open()", { desc = "Open [R]EPL" }) diff --git a/nvim/lua/kanopo/plugins/lsp.lua b/nvim/lua/kanopo/plugins/lsp.lua index 498304a..553aa50 100644 --- a/nvim/lua/kanopo/plugins/lsp.lua +++ b/nvim/lua/kanopo/plugins/lsp.lua @@ -115,10 +115,11 @@ return { -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { texlab = {}, - -- clangd = {}, - gopls = {}, jdtls = {}, - -- nil_ls = {}, + cssls = {}, + astro = {}, + tailwindcss = {}, + pylsp = {}, ts_ls = {}, lua_ls = { settings = { diff --git a/sway/config b/sway/config index 5847c10..9fc9697 100644 --- a/sway/config +++ b/sway/config @@ -241,12 +241,23 @@ 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 @@ -263,7 +274,8 @@ 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 "/usr/lib/polkit-kde-authentication-agent-1" +exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec --no-startup-id gnome-keyring-daemon --start --components=pkcs11,secrets,ssh # Importa variabili ambiente per DBus e il desktop corrente