diff --git a/avatar/avatar_sloth_no_bg.png b/avatar/avatar_sloth_no_bg.png new file mode 100644 index 0000000..82a97d0 Binary files /dev/null and b/avatar/avatar_sloth_no_bg.png differ diff --git a/avatar/avatar_weather.png b/avatar/avatar_weather.png new file mode 100644 index 0000000..5f6e018 Binary files /dev/null and b/avatar/avatar_weather.png differ diff --git a/avatar/avatar_weather_no_bg.png b/avatar/avatar_weather_no_bg.png new file mode 100644 index 0000000..b5d5f5a Binary files /dev/null and b/avatar/avatar_weather_no_bg.png differ diff --git a/modules/fonts.nix b/modules/fonts.nix index 20f430d..4fe3a91 100644 --- a/modules/fonts.nix +++ b/modules/fonts.nix @@ -11,6 +11,7 @@ material-icons material-design-icons icomoon-feather + nixos-icons noto-fonts-color-emoji diff --git a/programs/wm/common/neovim/config.lua b/programs/wm/common/neovim/config.lua index 7ced0ac..485c9cb 100644 --- a/programs/wm/common/neovim/config.lua +++ b/programs/wm/common/neovim/config.lua @@ -82,16 +82,32 @@ cmp.setup({ }), }) -local lspconfig = require("lspconfig") local capabilities = require("cmp_nvim_lsp").default_capabilities() + +-- Keymaps vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) vim.keymap.set("n", "rn", vim.lsp.buf.rename, {}) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) --- Setup language servers -lspconfig.lua_ls.setup({ +-- Set default capabilities for all servers +vim.lsp.config("*", { capabilities = capabilities, +}) + +-- Configure lua_ls with specific settings +vim.lsp.config("lua_ls", { + cmd = { "lua-language-server" }, + root_markers = { + ".luarc.json", + ".luarc.jsonc", + ".luacheckrc", + ".stylua.toml", + "stylua.toml", + "selene.toml", + "selene.yml", + ".git", + }, settings = { Lua = { runtime = { version = "LuaJIT" }, @@ -102,15 +118,20 @@ lspconfig.lua_ls.setup({ }, }) -lspconfig.nil_ls.setup({ capabilities = capabilities }) -lspconfig.rust_analyzer.setup({ capabilities = capabilities }) -lspconfig.pylsp.setup({ capabilities = capabilities }) -lspconfig.stylelint_lsp.setup({ +-- Configure stylelint_lsp with custom cmd and filetypes +vim.lsp.config("stylelint_lsp", { cmd = { "stylelint-lsp", "--stdio" }, filetypes = { "css", "scss", "rasi" }, - capabilities = vim.lsp.protocol.make_client_capabilities(), + root_markers = { ".stylelintrc", ".stylelintrc.json", "stylelint.config.js", ".git" }, }) +-- Enable all language servers +vim.lsp.enable("lua_ls") +vim.lsp.enable("nil_ls") +vim.lsp.enable("rust_analyzer") +vim.lsp.enable("pylsp") +vim.lsp.enable("stylelint_lsp") + -- Conform require("conform").setup({ formatters_by_ft = { diff --git a/programs/wm/common/waybar/common.nix b/programs/wm/common/waybar/common.nix index a21b609..ad02608 100644 --- a/programs/wm/common/waybar/common.nix +++ b/programs/wm/common/waybar/common.nix @@ -26,6 +26,7 @@ "custom/cava" = { exec = "sh ~/.config/waybar/cava.sh"; format = "{} ♪"; + on-click = "hyprctl dispatch focuswindow class:spotify"; }; wireplumber = { @@ -141,16 +142,30 @@ }; "custom/nixicon" = { - format = ""; + format = " "; on-click = "rofi -show drun -theme $HOME/.config/rofi/custom.rasi"; tooltip = false; }; "custom/weather" = { format = "{}"; - exec = "curl -s 'wttr.in/52.281311,10.527029?format=2'"; - interval = 60; - tooltip = false; + return-type = "json"; + exec = '' + curl -s -X GET "https://api.openweathermap.org/data/2.5/weather?lat=52.281311&lon=10.527029&appid=7c70fbfd89c7be3d5c8c552ec52064f8&units=metric&lang=en" | jq -c '{text: "\(.name) \(.main.temp)C°"}' + ''; + interval = 120; + on-click = '' + data=$(curl -s -X GET "https://api.openweathermap.org/data/2.5/weather?lat=52.281311&lon=10.527029&appid=7c70fbfd89c7be3d5c8c552ec52064f8&units=metric&lang=en") + city=$(echo "$data" | jq -r '.name') + temp=$(echo "$data" | jq -r '.main.temp') + feels=$(echo "$data" | jq -r '.main.feels_like') + humidity=$(echo "$data" | jq -r '.main.humidity') + wind=$(echo "$data" | jq -r '.wind.speed') + clouds=$(echo "$data" | jq -r '.clouds.all') + sunrise=$(echo "$data" | jq -r '.sys.sunrise | strftime("%H:%M")') + sunset=$(echo "$data" | jq -r '.sys.sunset | strftime("%H:%M")') + notify-send "$city" "Temperature: $temp °C\nFeels Like: $feels °C\nHumidity: $humidity%\nWind: $wind m/s\nClouds: $clouds%\nSunrise at: $sunrise\nSunset at: $sunset" -u normal --icon="$HOME/Pictures/Avatar/avatar_weather_no_bg.png" + ''; }; "custom/weather-side" = { @@ -180,6 +195,16 @@ on-click-right = "swaync-client -d -sw"; escape = true; }; + + "custom/wallpaper" = { + format = "【{} 】"; + exec = "basename $(swww query | grep -oP 'image: \\K.*')"; + interval = 5; + on-click = "waypaper"; + tooltip = true; + tooltip-format = "{}"; + max-length = 30; + }; }; } diff --git a/programs/wm/common/waybar/configs/nix-snowflake-white.svg b/programs/wm/common/waybar/configs/nix-snowflake-white.svg new file mode 100755 index 0000000..8a939a2 --- /dev/null +++ b/programs/wm/common/waybar/configs/nix-snowflake-white.svg @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/programs/wm/common/waybar/configs/nix-snowflake.svg b/programs/wm/common/waybar/configs/nix-snowflake.svg new file mode 100755 index 0000000..bf048a4 --- /dev/null +++ b/programs/wm/common/waybar/configs/nix-snowflake.svg @@ -0,0 +1,329 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/programs/wm/common/waybar/configs/style.css b/programs/wm/common/waybar/configs/style.css index 0efb5fe..aea1696 100644 --- a/programs/wm/common/waybar/configs/style.css +++ b/programs/wm/common/waybar/configs/style.css @@ -23,7 +23,10 @@ window#waybar.hidden { #memory, #disk, #temperature, -#network { +#network, +#custom-wallpaper, +#media, +#custom-weather { color: @crust; margin-top: 6px; margin-bottom: 6px; @@ -51,9 +54,13 @@ window#waybar.hidden { /* -- Specific styles -- */ #custom-nixicon { - font-size: 20px; - color: @sapphire; - background: @overlay1; + background-image: url("nix-snowflake.svg"); + background-size: contain; + background-repeat: no-repeat; + background-position: center; + min-height: 24px; + min-width: 24px; + padding: 0px; padding-right: 15px; padding-left: 10px; @@ -125,8 +132,8 @@ window#waybar.hidden { #media { background: @overlay2; border-radius: 10px; - margin: 5px; color: @crust; + margin-left: 20px; } #custom-cava { @@ -145,11 +152,10 @@ window#waybar.hidden { /* Weather */ #custom-weather { - background: @overlay2; + background: @sky; color: @crust; border-radius: 10px; - margin: 5px 20px; - padding: 0px 10px; + margin-right: 20px; } /* SwayNC */ @@ -160,3 +166,11 @@ window#waybar.hidden { padding-left: 10px; padding-right: 5px; } + +/* Wallpaper */ +#custom-wallpaper { + background: @red; + color: @mantle; + border-radius: 10px; + margin-left: 5px; +} diff --git a/programs/wm/common/waybar/default.nix b/programs/wm/common/waybar/default.nix index 36868e8..6b5321b 100644 --- a/programs/wm/common/waybar/default.nix +++ b/programs/wm/common/waybar/default.nix @@ -4,24 +4,20 @@ ... }: { - programs.waybar = - { - enable = true; - package = pkgs.waybar; - } - // ( - if monitorSetup == "single" then - import ./single.nix - else if monitorSetup == "dual" then - import ./dual.nix - else if monitorSetup == "side" then - import ./side.nix - else - { } - ); - - home.file.".config/waybar/cava.sh".source = ./configs/cava.sh; - home.file.".config/waybar/mocha.css".source = ./configs/mocha.css; + programs.waybar = { + enable = true; + package = pkgs.waybar; + } + // ( + if monitorSetup == "single" then + import ./single.nix + else if monitorSetup == "dual" then + import ./dual.nix + else if monitorSetup == "side" then + import ./side.nix + else + { } + ); home.file.".config/waybar" = { source = ./configs; diff --git a/programs/wm/common/waybar/dual.nix b/programs/wm/common/waybar/dual.nix index 8e8e3f9..89bd9d8 100644 --- a/programs/wm/common/waybar/dual.nix +++ b/programs/wm/common/waybar/dual.nix @@ -5,43 +5,44 @@ in { enable = true; settings = { - mainBar = - { - layer = "top"; - position = "top"; - height = 30; - output = [ "DP-1" ]; - modules-left = [ - "custom/nixicon" - "clock" - ]; - modules-center = [ - "hyprland/workspaces" - "niri/workspaces" - "custom/notification" - ]; - modules-right = [ - "group/hardware" - ]; - } - // common.widgets - // wm.widgets; + mainBar = { + layer = "top"; + position = "top"; + height = 30; + output = [ "DP-1" ]; + modules-left = [ + "custom/nixicon" + "clock" + ]; + modules-center = [ + "hyprland/workspaces" + "niri/workspaces" + "custom/notification" + ]; + modules-right = [ + "group/hardware" + ]; + } + // common.widgets + // wm.widgets; - secondBar = - { - layer = "top"; - position = "top"; - height = 30; - output = [ "HDMI-A-2" ]; - modules-left = [ "group/media" ]; - modules-center = [ - "hyprland/workspaces" - "niri/workspaces" - ]; - modules-right = [ "custom/weather" ]; - } - // common.widgets - // wm.widgets; + secondBar = { + layer = "top"; + position = "top"; + height = 30; + output = [ "HDMI-A-2" ]; + modules-left = [ + "group/media" + "custom/wallpaper" + ]; + modules-center = [ + "hyprland/workspaces" + "niri/workspaces" + ]; + modules-right = [ "custom/weather" ]; + } + // common.widgets + // wm.widgets; }; }