From eca02857ec4d6d44ffb0d655beb56c7609f12b39 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Tue, 5 Mar 2024 13:28:48 +0100 Subject: [PATCH] Updated config --- .config/fish/alias.fish | 1 + .config/fish/fish_variables | 2 +- .config/hypr/animations.conf | 12 ++++++ .config/hypr/environment.conf | 16 +++++--- .config/hypr/general.conf | 33 +++++++-------- .config/hypr/hyprland.conf | 1 + .config/nvim/lua/autocmds.lua | 29 +++++++------ .config/nvim/lua/keys.lua | 11 +++-- .config/waybar/config.jsonc | 21 ++++++++++ .config/waybar/{config => modules.jsonc} | 52 ++++++++++++++---------- .config/waybar/style.css | 50 +++++++++++++++-------- 11 files changed, 150 insertions(+), 78 deletions(-) create mode 100644 .config/hypr/animations.conf create mode 100644 .config/waybar/config.jsonc rename .config/waybar/{config => modules.jsonc} (64%) diff --git a/.config/fish/alias.fish b/.config/fish/alias.fish index 2ad34b6..74507c2 100644 --- a/.config/fish/alias.fish +++ b/.config/fish/alias.fish @@ -33,6 +33,7 @@ alias pu "sudo pacman -Syu" alias pl "pacman -Q" alias po "pacman -Qo" alias pc "sudo pacman -Sc" +alias paur "pacman -Qm" alias porphan "pacman -Qtdq" # Tmux diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index b26dc25..78ad882 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables @@ -5,7 +5,7 @@ SETUVAR fish_color_autosuggestion:707A8C SETUVAR fish_color_cancel:\x2d\x2dreverse SETUVAR fish_color_command:00ff00 SETUVAR fish_color_comment:5C6773 -SETUVAR fish_color_cwd:73D0FF +SETUVAR fish_color_cwd:66D9EF SETUVAR fish_color_cwd_root:red SETUVAR fish_color_end:F29E74 SETUVAR fish_color_error:FF3333 diff --git a/.config/hypr/animations.conf b/.config/hypr/animations.conf new file mode 100644 index 0000000..f106e03 --- /dev/null +++ b/.config/hypr/animations.conf @@ -0,0 +1,12 @@ +animations { + enabled = yes + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + animation = windows, 1, 2, myBezier + animation = windowsOut, 1, 2, default, popin 80% + animation = border, 1, 5, default + animation = borderangle, 1, 3, default + animation = fade, 1, 2, default + animation = workspaces, 1, 1, default +} diff --git a/.config/hypr/environment.conf b/.config/hypr/environment.conf index 4e737bd..ddf81bc 100644 --- a/.config/hypr/environment.conf +++ b/.config/hypr/environment.conf @@ -1,8 +1,3 @@ -# https://github.com/hyprwm/Hyprland/issues/2591 -$XDG_DATA_HOME=$HOME/.local/share -$XDG_CONFIG_HOME=$HOME/.config -$XDG_STATE_HOME=$HOME/.local/state -$XDG_CACHE_HOME=$HOME/.cache # Firefox env = MOZ_ENABLE_WAYLAND,1 @@ -32,6 +27,17 @@ env = GDK_BACKEND,wayland env = WLR_NO_HARDWARE_CURSORS,1 env = WLR_RENDERER,vulkan +# https://github.com/hyprwm/Hyprland/issues/2591 +$XDG_DATA_HOME=$HOME/.local/share +$XDG_CONFIG_HOME=$HOME/.config +$XDG_STATE_HOME=$HOME/.local/state +$XDG_CACHE_HOME=$HOME/.cache + +env = XDG_DATA_HOME,$XDG_DATA_HOME +env = XDG_CONFIG_HOME,$XDG_CONFIG_HOME +env = XDG_STATE_HOME,$XDG_STATE_HOME +env = XDG_CACHE_HOME,$XDG_CACHE_HOME + # Config directories env = HISTFILE,$XDG_STATE_HOME/bash/history env = CARGO_HOME,$XDG_DATA_HOME/cargo diff --git a/.config/hypr/general.conf b/.config/hypr/general.conf index 7e8bf61..54b0803 100644 --- a/.config/hypr/general.conf +++ b/.config/hypr/general.conf @@ -1,8 +1,9 @@ general { - gaps_in = 5 - gaps_out = 10 + gaps_in = 4 + gaps_out = 6 + + border_size = 0 - border_size = 2 col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) @@ -24,35 +25,29 @@ input { natural_scroll = no } - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. + sensitivity = 0 + accel_profile = flat } decoration { - rounding = 3 + rounding = 10 blur { enabled = true - size = 3 - passes = 1 + size = 4 + passes = 4 + new_optimizations = on + ignore_opacity = on + xray = false } drop_shadow = yes shadow_range = 4 shadow_render_power = 3 col.shadow = rgba(1a1a1aee) -} -animations { - enabled = yes - - bezier = myBezier, 0.05, 0.9, 0.1, 1.05 - - animation = windows, 1, 2, myBezier - animation = windowsOut, 1, 2, default, popin 80% - animation = border, 1, 5, default - animation = borderangle, 1, 3, default - animation = fade, 1, 2, default - animation = workspaces, 1, 1, default + #active_opacity = 1.0 + #inactive_opacity = 0.75 } dwindle { diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 283158b..99a7a02 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -3,5 +3,6 @@ source = programs.conf source = environment.conf source = autostart.conf source = general.conf +source = animations.conf source = rules.conf source = keys.conf diff --git a/.config/nvim/lua/autocmds.lua b/.config/nvim/lua/autocmds.lua index 241ec55..f19796b 100644 --- a/.config/nvim/lua/autocmds.lua +++ b/.config/nvim/lua/autocmds.lua @@ -33,8 +33,9 @@ on({ "VimEnter" }, { callback = function() -- Change file to its directory if needed local name = vim.api.nvim_buf_get_name(0) + local is_directory = vim.fn.isdirectory(name) - if vim.fn.isdirectory(name) == 0 then + if is_directory == 0 then name = vim.fs.dirname(name) end @@ -50,18 +51,22 @@ on({ "VimEnter" }, { else vim.api.nvim_set_current_dir(name) end - end, -}) -on({ "VimEnter" }, { - desc = "Open file explorer if there is enough horizontal space", - group = group, - callback = function() - local files = require("nvim-tree.api") - local width = vim.go.columns - - if width > 120 then - files.tree.toggle({ focus = false }) + if is_directory ~= 0 then + require("telescope.builtin").find_files() end end, }) + +-- on({ "VimEnter" }, { +-- desc = "Open file explorer if there is enough horizontal space", +-- group = group, +-- callback = function() +-- local files = require("nvim-tree.api") +-- local width = vim.go.columns +-- +-- if width > 120 then +-- files.tree.toggle({ focus = false }) +-- end +-- end, +-- }) diff --git a/.config/nvim/lua/keys.lua b/.config/nvim/lua/keys.lua index cf41158..a0ef0d2 100644 --- a/.config/nvim/lua/keys.lua +++ b/.config/nvim/lua/keys.lua @@ -4,13 +4,12 @@ end -- Basics map("n", ";", ":", "Command mode") -map("n", "U", "redo", "Redo") map({ "i", "n" }, "", "noh", "Clear search") map({"n", "v"}, "q", "qa!", "Quit all") -- Buffer management map("n", "", "enew", "New file") -map({ "i", "n", "s", "v" }, "", "w", "Save file") +map({ "i", "n", "s", "v" }, "", "w", "Save file") map("n", "", "bd", "Delete buffer") -- Copy and paste @@ -35,6 +34,10 @@ map("v", "", "y/\"N", "Search selection") map("n", "", "*#:%s///g", "Replace word under cursor") map("v", "", "y/\"N:%s//\"/g", "Replace selection") +-- Editing words +map("n", "", "ciw", "Rewrite word") +map("n", "", "ToggleWord", "Toggle word") + -- Indenting map("n", "", "V>gv") map("n", "", "V") @@ -46,11 +49,13 @@ map("n", "+", "", "Increase number") map("n", "-", "", "Decrease number") map("n", "", "", "Increase number") map("n", "", "", "Decrease number") -map("n", "", "ToggleWord", "Toggle word") -- Package manager map("n", "l", "Lazy", "Lazy") +-- Redo +map("n", "U", "redo", "Redo") + -- Shift arrow selection map("n", "", "v") map("n", "", "v") diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc new file mode 100644 index 0000000..93085e0 --- /dev/null +++ b/.config/waybar/config.jsonc @@ -0,0 +1,21 @@ +{ + "layer": "top", + "position": "bottom", + "modules-left": [ + "hyprland/workspaces", + "hyprland/window", + ], + "modules-center": [], + "modules-right": [ + "custom/updates", + "cpu", + "custom/gpu", + "memory", + "disk", + "network#up", + "network#down", + "wireplumber", + "clock", + ], + "include": "~/.config/waybar/modules.jsonc", +} diff --git a/.config/waybar/config b/.config/waybar/modules.jsonc similarity index 64% rename from .config/waybar/config rename to .config/waybar/modules.jsonc index ec2a080..5003834 100644 --- a/.config/waybar/config +++ b/.config/waybar/modules.jsonc @@ -1,12 +1,7 @@ { - "layer": "top", - "position": "bottom", - "modules-left": ["custom/os","hyprland/workspaces"], - "modules-center": ["clock"], - "modules-right": ["cpu","custom/gpu","memory","disk","network","custom/power"], "clock": { "interval": 60, - "format": "{:%H : %M}", + "format": " {:%H : %M}", "tooltip-format": "{:%A, %Y-%m-%d}", "on-click": "gnome-clocks", "on-click-right": "date -u +'%Y-%m-%dT%H:%M:%SZ' | wl-copy", @@ -18,12 +13,20 @@ "max-length": 10, "on-click": "$TERMINAL -e btop", }, + "custom/updates": { + "interval": 300, + "format": "󰏖 {}", + "exec": "~/.bin/updates", + "return-type": "json", + "on-click": "$TERMINAL -e yay", + }, "custom/gpu": { + "interval": 2, "exec": "nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits", "format": " {}%", "return-type": "", - "interval": 2, "on-click": "$TERMINAL -e nvtop", + "max-length": 10, }, "memory": { "interval": 2, @@ -31,28 +34,30 @@ "max-length": 10, "on-click": "$TERMINAL -e btop", }, - "network": { + "network#up": { "interval": 2, - "format": " {ifname}", - "format-wifi": " {essid}", - "format-ethernet": "{bandwidthUpBits} {bandwidthDownBits}", - "format-disconnected": "", - "tooltip-format": "{ifname} via {gwaddr}", - "tooltip-format-wifi": " {essid} ({signalStrength}%)", - "tooltip-format-ethernet": " {ifname}", - "tooltip-format-disconnected": "", - "max-length": 50, + "format": "{bandwidthUpBits}", + "tooltip-format": " {ifname} upload", + "max-length": 10, + "on-click": "$TERMINAL -e nethogs", + }, + "network#down": { + "interval": 2, + "format": "{bandwidthDownBits}", + "tooltip-format": " {ifname} download", + "max-length": 10, "on-click": "$TERMINAL -e nethogs", }, "disk": { "interval": 30, "format": "󰋊 {used}", "path": "/", + "max-length": 10, "on-click": "$TERMINAL -e dua i", }, "mpris": { - "format": "{player_icon} {title}", - "format-paused": "{status_icon} {title}", + "format": "{player_icon} {title}", + "format-paused": "{status_icon} {title}", "player-icons": { "default": "󰝚", "mpv": "󰝚" @@ -66,12 +71,16 @@ "format": "{icon} {volume}%", "format-muted": "", "scroll-step": 5, - "on-click": "helvum", "format-icons": ["", "", ""], + "max-length": 10, + "on-click": "helvum", + }, + "hyprland/window": { + "format": "󰘔 {initialTitle}", + "separate-outputs": true }, "hyprland/workspaces": { "format": "{icon}", - "on-click": "activate", "persistent-workspaces": { "*": 9 }, @@ -82,6 +91,7 @@ "urgent": "", }, "sort-by-number": true, + "on-click": "activate", }, "custom/os":{ "format": "", diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 92e1b84..e4d57b9 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -1,58 +1,74 @@ * { border: none; font-family: "Ubuntu Nerd Font"; - font-size: 11px; + font-size: 12px; padding: 0; margin: 0; } -window#waybar { - color: #F8F8F2; - background: #272822; - /* border: 2px solid rgba(255, 255, 255, 0.1); */ - /* border-radius: 3px; */ - /* border-bottom: 1px solid rgba(255, 255, 255, 0.25); */ +#waybar { + background: transparent; } -window#waybar.hidden { +#waybar.hidden { opacity: 0.2; } +#waybar #window { + opacity: 1; + transition: opacity 200ms ease; +} + +#waybar.empty #window { + opacity: 0; +} + #clock, #cpu, #disk, #memory, #mpris, #network, +#window, #wireplumber, #workspaces, #custom-os, -#custom-gpu { - margin: 0 8px; +#custom-gpu, +#custom-updates { + background: rgb(38, 41, 44); + border-radius: 10px; + padding: 4px 8px; + margin: 0px 4px; + margin-bottom: 4px; } -#workspaces {} +#custom-updates.disabled { + opacity: 0; +} #workspaces button { padding: 0px 5px; - color: rgba(255, 255, 255, 0.4); + opacity: 0.8; background: transparent; text-shadow: none; border-radius: 0; } #workspaces button.empty { - color: rgba(255, 255, 255, 0.2); + opacity: 0.2; } + +#workspaces button.active { + opacity: 1.0; +} + #workspaces button.visible {} #workspaces button.urgent {} #workspaces button.persistent {} #workspaces button.hidden {} -#workspaces button.active { - color: rgba(255, 255, 255, 1.0); -} - #custom-os { + font-size: 150%; color: rgb(137, 220, 235); + background: transparent; }