From c09204c72d78f2e520e5ec08b8f36529a3d9e933 Mon Sep 17 00:00:00 2001 From: "mcmrcs@proton.me" Date: Sat, 4 May 2024 01:18:56 +0100 Subject: [PATCH] refact: restyling --- .config/aestuarium/config.ini.cgt | 8 ++ .config/aestuarium/fragment.glsl | 11 +++ .config/aestuarium/vertex.glsl | 13 +++ .config/foot/foot.ini.cgt | 2 +- .config/gtk-3.0/settings.ini.cgt | 2 +- .config/gtk-4.0/settings.ini.cgt | 2 +- .config/nvim/after/plugin/hardtime.lua | 3 + .config/nvim/after/plugin/ht.lua | 1 + .config/nvim/after/plugin/lsp.lua | 3 +- .config/nvim/after/plugin/treesitter.lua | 2 +- .config/nvim/lua/agentengine/packer.lua | 3 +- .config/river/init | 11 +-- .config/waybar/config.jsonc.cgt | 14 +-- .config/waybar/style.css.cgt | 110 ++++++++++------------- .config/waybar/theme.css.cgt | 6 +- .gtkrc-2.0.cgt | 2 +- cg_opts.lua | 8 +- scripts/aestuarium/README.md | 19 +++- scripts/aestuarium/src/Preload.zig | 2 +- scripts/aestuarium/src/args.zig | 22 +++-- scripts/aestuarium/src/main.zig | 25 +++++- scripts/aestuarium/src/socket/Client.zig | 76 ++++++++++++++++ scripts/aestuarium/src/socket/Server.zig | 3 +- 23 files changed, 250 insertions(+), 98 deletions(-) create mode 100644 .config/aestuarium/fragment.glsl create mode 100644 .config/aestuarium/vertex.glsl create mode 100644 .config/nvim/after/plugin/hardtime.lua create mode 100644 .config/nvim/after/plugin/ht.lua create mode 100644 scripts/aestuarium/src/socket/Client.zig diff --git a/.config/aestuarium/config.ini.cgt b/.config/aestuarium/config.ini.cgt index eddb1dc..3c2c349 100644 --- a/.config/aestuarium/config.ini.cgt +++ b/.config/aestuarium/config.ini.cgt @@ -1,2 +1,10 @@ [monitors] eDP-1=<% opt.wallpaper %> + +[shaders] +vertex=vertex.glsl +fragment=fragment.glsl + +[animations] +loop=true +fps=15 diff --git a/.config/aestuarium/fragment.glsl b/.config/aestuarium/fragment.glsl new file mode 100644 index 0000000..82622b7 --- /dev/null +++ b/.config/aestuarium/fragment.glsl @@ -0,0 +1,11 @@ +#version 330 core +out vec4 frag_color; + +in vec3 ourColor; +in vec2 TexCoord; + +uniform sampler2D ourTexture; + +void main() { + frag_color = texture(ourTexture, TexCoord); +} diff --git a/.config/aestuarium/vertex.glsl b/.config/aestuarium/vertex.glsl new file mode 100644 index 0000000..3d39e7c --- /dev/null +++ b/.config/aestuarium/vertex.glsl @@ -0,0 +1,13 @@ +#version 330 core +layout(location = 0) in vec3 aPos; +layout(location = 1) in vec3 aColor; +layout(location = 2) in vec2 aTexCoord; + +out vec3 ourColor; +out vec2 TexCoord; + +void main() { + gl_Position = vec4(aPos.x, -aPos.y, aPos.z, 1.0); + ourColor = aColor; + TexCoord = aTexCoord; +} diff --git a/.config/foot/foot.ini.cgt b/.config/foot/foot.ini.cgt index 3886ec7..88d4214 100644 --- a/.config/foot/foot.ini.cgt +++ b/.config/foot/foot.ini.cgt @@ -1,4 +1,4 @@ -font=<% opt.font_term %>:size=16size=11 +font=<% opt.font_term %>:size=15size=11 [cursor] color=<% opt.term.cursor_foreground %> <% opt.term.cursor_background %> diff --git a/.config/gtk-3.0/settings.ini.cgt b/.config/gtk-3.0/settings.ini.cgt index 4e882ed..0b446fa 100644 --- a/.config/gtk-3.0/settings.ini.cgt +++ b/.config/gtk-3.0/settings.ini.cgt @@ -1,6 +1,6 @@ [Settings] gtk-theme-name=<% opt.gtk_theme %> gtk-icon-theme-name=<% opt.icon_theme %> -gtk-font-name=<% opt.term.font %> 12 +gtk-font-name=<% opt.term.font %> 11 gtk-cursor-theme-name=<% opt.cursor.theme %> gtk-cursor-theme-size=0 diff --git a/.config/gtk-4.0/settings.ini.cgt b/.config/gtk-4.0/settings.ini.cgt index 87d6043..cd861d3 100644 --- a/.config/gtk-4.0/settings.ini.cgt +++ b/.config/gtk-4.0/settings.ini.cgt @@ -1,5 +1,5 @@ [Settings] gtk-theme-name=<% opt.term.font %> -gtk-icon-theme-name=<% opt.icon_theme %> 12 +gtk-icon-theme-name=<% opt.icon_theme %> 11 gtk-cursor-theme-name=<% opt.cursor.theme %> gtk-cursor-theme-size=0 diff --git a/.config/nvim/after/plugin/hardtime.lua b/.config/nvim/after/plugin/hardtime.lua new file mode 100644 index 0000000..572a293 --- /dev/null +++ b/.config/nvim/after/plugin/hardtime.lua @@ -0,0 +1,3 @@ +require("hardtime").setup() + + diff --git a/.config/nvim/after/plugin/ht.lua b/.config/nvim/after/plugin/ht.lua new file mode 100644 index 0000000..f5ef021 --- /dev/null +++ b/.config/nvim/after/plugin/ht.lua @@ -0,0 +1 @@ +require("hardtime").setup() diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index 905fc87..c8d0e37 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -26,7 +26,8 @@ require('mason-lspconfig').setup({ 'html', 'cssls', 'bashls', - 'pyre' + 'pyre', + 'glsl_analyzer' }, handlers = { lsp.default_setup, diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua index f746433..a5790b1 100644 --- a/.config/nvim/after/plugin/treesitter.lua +++ b/.config/nvim/after/plugin/treesitter.lua @@ -1,6 +1,6 @@ require'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = { "all" }, + ensure_installed = { "java", "zig", "javascript", "typescript", "c", "lua", "vim", "vimdoc", "query", "html", "css" }, -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, diff --git a/.config/nvim/lua/agentengine/packer.lua b/.config/nvim/lua/agentengine/packer.lua index e18c4d3..2c7033a 100644 --- a/.config/nvim/lua/agentengine/packer.lua +++ b/.config/nvim/lua/agentengine/packer.lua @@ -12,7 +12,8 @@ return require('packer').startup(function(use) use 'nvim-lualine/lualine.nvim' use 'norcalli/nvim-colorizer.lua' use 'lewis6991/gitsigns.nvim' - + use 'm4xshen/hardtime.nvim' + use {'akinsho/git-conflict.nvim', tag = "*"} use { diff --git a/.config/river/init b/.config/river/init index a2db423..629be92 100755 --- a/.config/river/init +++ b/.config/river/init @@ -123,7 +123,7 @@ do done # Recording -riverctl map normal Super Print spawn 'obs --startrecording --minimize-to-tray' +riverctl map normal Super Print spawn 'obs --startrecording' riverctl map normal Super None spawn "grim $HOME/media/images/screenshot/$(date +'%screenshot.jpeg') | wl-copy" # pre start up scripts @@ -132,12 +132,11 @@ echo 'cg.opt.compositor = "river"' >~/confgenfs/_cgfs/eval # start up scripts waybar & aestuarium & -swayidle -w timeout 150 ~/lock_screen_rand_wp.sh timeout 200 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' & gsettings set org.gnome.desktop.interface gtk-theme "Breeze-Dark" && gsettings set org.gnome.desktop.interface cursor-theme darkbolt-cursor && gsettings set org.gnome.desktop.wm.preferences button-layout "" gsettings set org.gnome.desktop.interface font-name "Iosevka NFM 12" -gsettings set org.gnome.desktop.interface text-scaling-factor 1.5 +gsettings set org.gnome.desktop.interface text-scaling-factor 1.0 # Set background and border color riverctl background-color 0x10002f @@ -148,10 +147,12 @@ riverctl input pointer-1267-12541-ELAN0712:00_04F3:30FD_Touchpad natural-scroll riverctl input pointer-1267-12541-ELAN0712:00_04F3:30FD_Touchpad tap enabled riverctl set-repeat 50 300 -riverctl hide-cursor when-typing enabled +riverctl hide-cursor when-typing disabled export XDG_CURRENT_DESKTOP=river dbus-update-activation-environment DISPLAY XAUTHORITY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP systemctl --user import-environment DISPLAY XAUTHORITY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP riverctl default-layout rivertile -rivertile -view-padding 6 -outer-padding 6 -main-count 2 -main-ratio 0.5 & +rivertile -view-padding 6 -outer-padding 6 -main-count 4 -main-ratio 0.5 & + +swayidle -w timeout 150 exec 'swaylock -f -i $(find $HOME/dev/wallpapers/ -type f | shuf -n 1)' timeout 200 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' & diff --git a/.config/waybar/config.jsonc.cgt b/.config/waybar/config.jsonc.cgt index 6acdd85..9c00f01 100644 --- a/.config/waybar/config.jsonc.cgt +++ b/.config/waybar/config.jsonc.cgt @@ -2,12 +2,15 @@ "spacing": 2, "layer": "top", "modules-left": [ - - "river/tags" - + "hyprland/workspaces" + + "river/tags" ], + "modules-center": [ + "clock" + ], "modules-right": [ "network", "temperature", @@ -16,7 +19,6 @@ "pulseaudio", "gamemode", "battery", - "clock", "tray" ], "river/tags": { @@ -87,8 +89,8 @@ }, "battery": { "states": { - "warning": 50, - "critical": 20 + "warning": 30, + "critical": 15 }, "format": "{capacity}% {icon} ", "format-charging": "{capacity}% 󰂄", diff --git a/.config/waybar/style.css.cgt b/.config/waybar/style.css.cgt index f66a96f..0629baf 100644 --- a/.config/waybar/style.css.cgt +++ b/.config/waybar/style.css.cgt @@ -1,65 +1,32 @@ @import "theme.css"; * { - border: none; - border-radius: 0; + border: none; + border-radius: 0px; font-family: "<% opt.font %>"; - min-height: 18px; transition: transform 250ms ease-in-out; } window#waybar { - background: rgba(1, 1, 1, 0.5); + background-color: #050505; + padding: 20px; } window#waybar.hidden { - opacity: 0.2; + padding: 20px; } -#window { - padding-top: 4px; - padding-bottom: 4px; - padding-left: 8px; - padding-right: 8px; -} - -#workspaces, #tags { - background: @base; -} - -#workspaces button{ +#workspaces button, +#tags button{ padding: 10px; - transition: none; - color: @text; - background: @base; - font-size: 16px; -} - -#tags button { - padding: 10px; - transition: none; - color: @text; - background: transparent; - font-size: 16px; -} - -#workspaces button.active, -#tags button.focused { - color: @text; - background: @active; + background: transparent; } #workspaces button:hover, -#tags button:hover{ - transition: none; - box-shadow: inherit; - text-shadow: inherit; - color: @subtext; - background: white; -} - -#tags button.occupied{ - background: @base; +#tags button:hover, +#clock:hover +{ + color: #F7A41D; } #tags button.urgent{ @@ -71,6 +38,11 @@ window#waybar.hidden { animation-direction: alternate; } +#tags button.focused, +#tags button.occupied { + color: #F7A41D; +} + #pulseaudio, #mpris, #temperature, #cpu, #memory, #battery, @@ -79,9 +51,24 @@ window#waybar.hidden { #network { padding: 8px; - transition: transform 250ms ease-in-out; - color: @text; - background: @base; + background: transparent; +} + +#pulseaudio:hover, #mpris:hover, +#temperature:hover, #cpu:hover, +#memory:hover, #battery:hover, +#clock:hover, #gamemode:hover, +#tray:hover, #window:hover, +#network:hover +{ + color: #F7A41D; +} +#clock, +#tags, +.modules-right { + border: 5px double white; + margin: 10px 0px; + border-radius: 100px; } #battery.warning { @@ -102,20 +89,13 @@ window#waybar.hidden { animation-direction: alternate; } -#clock:hover { - color: @subtext; - background: white; -} - -tooltip { - background: @base; -} - -window#waybar.empty #window { - padding: 0px; - margin: 0px; - border: 0px; - background-color: transparent; +#battery.charging { + background: @charging; + animation-name: charging-blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; } @keyframes critical-blink { @@ -129,3 +109,9 @@ window#waybar.empty #window { background-color: @warning_blink; } } + +@keyframes charging-blink { + to { + background-color: @charging_blink; + } +} diff --git a/.config/waybar/theme.css.cgt b/.config/waybar/theme.css.cgt index 6ded0b2..e1a7021 100644 --- a/.config/waybar/theme.css.cgt +++ b/.config/waybar/theme.css.cgt @@ -1,9 +1,11 @@ -@define-color base rgba(46, 142, 218, 0.2); -@define-color active rgba(50, 150, 250, 0.4); +@define-color base #050505; +@define-color active #202020; @define-color warning rgba(250, 250, 5, 0.2); @define-color warning_blink rgba(250, 250, 5, 0.5); @define-color critical rgba(250, 5, 5, 0.2); @define-color critical_blink rgba(250, 5, 5, 0.5); +@define-color charging rgba(5, 250, 5, 0.2); +@define-color charging_blink rgba(5, 250, 5, 0.5); @define-color crust grey; @define-color text white; diff --git a/.gtkrc-2.0.cgt b/.gtkrc-2.0.cgt index d500a78..d2e6c4b 100644 --- a/.gtkrc-2.0.cgt +++ b/.gtkrc-2.0.cgt @@ -1,5 +1,5 @@ gtk-icon-theme-name="<% opt.icon_theme %>" gtk-cursor-theme-name="<% opt.cursor.theme %>" gtk-theme-name="<% opt.gtk_theme %>" -gtk-font-name="<% opt.font %> 12" +gtk-font-name="<% opt.font %> 11" diff --git a/cg_opts.lua b/cg_opts.lua index 3046c43..8bab376 100644 --- a/cg_opts.lua +++ b/cg_opts.lua @@ -3,7 +3,7 @@ local opt = {} opt.default_editor = "nvim" opt.font = "HeavyData Nerd Font" -opt.font_term = "Iosevka NFM" +opt.font_term = "Hurmit Nerd Font" opt.font_size = "12" opt.gtk_theme = "Breeze-Dark" @@ -17,11 +17,11 @@ opt.cursor = { } opt.wallpapers_path = os.getenv("HOME") .. "/dev/wallpapers" -opt.wallpaper = opt.wallpapers_path .. "/aqua.png" +opt.wallpaper = opt.wallpapers_path .. "/zig.gif" opt.term = { - font = "Iosevka NFM", - alpha = 0.7, + font = "Hurmit Nerd Font", + alpha = 0.95, foreground = "bbbbbb", background = "090a18", regular0 = "090a18", diff --git a/scripts/aestuarium/README.md b/scripts/aestuarium/README.md index 8cc6cdd..c4f8e6a 100644 --- a/scripts/aestuarium/README.md +++ b/scripts/aestuarium/README.md @@ -1,3 +1,20 @@ # Aestuarium -Well, at the moment this is a complet copy of the original project but I plan to later on make some changes here +Yet another wayland background manager using openGL. This is still in very early stages of development and I don't recommend anyone to use it yet. + +### Why another tool for background in wayland? + +Because all other tools for background didn't have the features I want and also nothing bad in some competition + +### Why the name "Aestuarium" + +It is the latin for [Estuary](https://en.wikipedia.org/wiki/Estuary), I will leave the explanation to your imagination. + +### Dependencies + +- [zigimg/zigimg](https://github.com/zigimg/zigimg) +- [getty-zig/json](https://github.com/getty-zig/json) +- [ifeund/zig-wayland](https://codeberg.org/ifreund/zig-wayland) +- [ziglibs/known-folders](https://github.com/ziglibs/known-folders) +- [ziglibs/ini](https://github.com/ziglibs/ini) +- [MasterQ32/zig-args](https://github.com/MasterQ32/zig-args) diff --git a/scripts/aestuarium/src/Preload.zig b/scripts/aestuarium/src/Preload.zig index 1cd7447..6213300 100644 --- a/scripts/aestuarium/src/Preload.zig +++ b/scripts/aestuarium/src/Preload.zig @@ -16,6 +16,7 @@ const Preloaded = struct { height: c_int, width: c_int, bytes: []const u8, + // OpenGL Format format: c_int, zigimg: *Image, }; @@ -37,7 +38,6 @@ pub fn preload(self: *Preload, path: []const u8) !void { var preloaded = try self.alloc.create(Preloaded); - std.debug.print("to preload: {s}", .{path}); const new_mem_path = try self.alloc.alloc(u8, path.len); @memcpy(new_mem_path, path); preloaded.path = new_mem_path; diff --git a/scripts/aestuarium/src/args.zig b/scripts/aestuarium/src/args.zig index 59bfb9a..e323875 100644 --- a/scripts/aestuarium/src/args.zig +++ b/scripts/aestuarium/src/args.zig @@ -9,30 +9,38 @@ pub const Opts = struct { help: bool = false, outputs: bool = false, json: bool = false, - target: ?[]const u8 = null, + monitor: ?[]const u8 = null, + preload: ?[]const u8 = null, + unload: ?[]const u8 = null, + wallpaper: ?[]const u8 = null, pub const shorthands = .{ .h = "help", .j = "json", - .t = "target", + .m = "monitor", + .p = "preload", + .u = "unload", + .w = "wallpaper", }; }; pub const Args = union(enum) {}; const help_msg = - \\Aestuarium v{[version]s} - yet another wayland background manager + \\Aestuarium v{[version]s} - yet another wayland wallpaper manager \\ \\usage: {[a0]s} [options] \\ \\Options: - \\ --target, -t Target output to set wallpaper \\ --json, -j Returns the result in json format + \\ --monitor, -m Monitor to set wallpaper \\ \\Subcommands: - \\ {[a0]s} wallpaper Set wallpaper to output - \\ {[a0]s} outputs Lists the monitors currently available - \\ {[a0]s} help Print this help and exit + \\ {[a0]s} preload Preload file into memory + \\ {[a0]s} wallpaper Set wallpaper to output + \\ {[a0]s} unload Unload file/s from memory + \\ {[a0]s} outputs Lists the monitors currently available + \\ {[a0]s} help Print this help and exit ; pub fn printHelp(alloc: Allocator) !void { diff --git a/scripts/aestuarium/src/main.zig b/scripts/aestuarium/src/main.zig index 1f13be6..64f8722 100644 --- a/scripts/aestuarium/src/main.zig +++ b/scripts/aestuarium/src/main.zig @@ -8,6 +8,7 @@ const Outputs = @import("Outputs.zig"); const Config = @import("Config.zig"); const Render = @import("Render.zig"); const Server = @import("socket/Server.zig"); +const Client = @import("socket/Client.zig"); const Preload = @import("Preload.zig"); const Allocator = std.mem.Allocator; @@ -68,6 +69,28 @@ pub fn main() !u8 { return 1; } + const cl_state = if (opts.options.preload != null or opts.options.wallpaper != null or opts.options.unload != null) true else false; + if (opts.options.preload) |path| { + var client = try Client.init(alloc); + try client.preload(path); + client.deinit(); + } + + if (opts.options.wallpaper) |path| { + var client = try Client.init(alloc); + try client.wallpaper(opts.options.monitor, path); + client.deinit(); + } + if (opts.options.unload) |path| { + var client = try Client.init(alloc); + try client.unload(path); + client.deinit(); + } + + if (cl_state) { + return 0; + } + // TODO check for existing instances of the app running return try runMainInstance(alloc); } @@ -151,11 +174,9 @@ fn runMainInstance(alloc: Allocator) !u8 { var i: usize = 0; while (i <= ev_count) : (i += 1) { if (epoll_events[i].data.fd == display_fd) { - std.log.info("epoll display global event", .{}); if (globals.display.roundtrip() != .SUCCESS) return error.RoundTripFail; } if (epoll_events[i].data.fd == server.fd) { - std.log.info("epoll socket server event", .{}); try server.handleConnection(); } } diff --git a/scripts/aestuarium/src/socket/Client.zig b/scripts/aestuarium/src/socket/Client.zig new file mode 100644 index 0000000..da6e86e --- /dev/null +++ b/scripts/aestuarium/src/socket/Client.zig @@ -0,0 +1,76 @@ +const std = @import("std"); +const Globals = @import("../Globals.zig"); + +const fs = std.fs; +const Allocator = std.mem.Allocator; + +const Client = @This(); + +alloc: Allocator, +stream: std.net.Stream, + +pub fn init(alloc: Allocator) !Client { + var env_map = try std.process.getEnvMap(alloc); + defer env_map.deinit(); + + const xdg_runtime_dir = env_map.get("XDG_RUNTIME_DIR") orelse return error.MissingXDGRuntimeDir; + + var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined; + + const server_address = try std.fmt.bufPrintZ( + &buf, + "{s}/aestuarium.sock", + .{xdg_runtime_dir}, + ); + + const client = try std.net.connectUnixSocket(server_address); + + return Client{ + .alloc = alloc, + .stream = client, + }; +} + +pub fn preload(self: *Client, path: []const u8) !void { + var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined; + if (!std.fs.path.isAbsolute(path)) { + return error.PathNotAbsolute; + } + try self.stream.writeAll(try std.fmt.bufPrintZ(&buf, "preload {s}", .{path})); + const reply_len = try self.stream.read(&buf); + try std.io.getStdOut().writeAll(buf[0 .. reply_len - 1]); + try std.io.getStdOut().writer().writeByte('\n'); +} + +pub fn wallpaper(self: *Client, monitor: ?[]const u8, path: []const u8) !void { + var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined; + + if (!std.fs.path.isAbsolute(path)) { + return error.PathNotAbsolute; + } + + try self.stream.writeAll(try std.fmt.bufPrintZ(&buf, "wallpaper {s}={s}", .{ monitor orelse "", path })); + + const reply_len = try self.stream.read(&buf); + + try std.io.getStdOut().writeAll(buf[0 .. reply_len - 1]); + try std.io.getStdOut().writer().writeByte('\n'); +} + +// unload can be a path or "all" to unload all wallpapers +pub fn unload(self: *Client, path: []const u8) !void { + var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined; + + if (!std.fs.path.isAbsolute(path) and !std.mem.eql(u8, "all", path)) { + return error.PathNotAbsolute; + } + + try self.stream.writeAll(try std.fmt.bufPrintZ(&buf, "unload {s}", .{path})); + const reply_len = try self.stream.read(&buf); + try std.io.getStdOut().writeAll(buf[0 .. reply_len - 1]); + try std.io.getStdOut().writer().writeByte('\n'); +} + +pub fn deinit(self: *Client) void { + self.stream.close(); +} diff --git a/scripts/aestuarium/src/socket/Server.zig b/scripts/aestuarium/src/socket/Server.zig index 49c2983..8547751 100644 --- a/scripts/aestuarium/src/socket/Server.zig +++ b/scripts/aestuarium/src/socket/Server.zig @@ -65,7 +65,7 @@ pub fn handleConnection(self: *Server) !void { _ = try connection.stream.write(@errorName(err)); return; }; - _ = try connection.stream.write("preloaded successfully"); + _ = try connection.stream.write("preloaded successfully\n"); return; } } @@ -80,6 +80,7 @@ pub fn handleConnection(self: *Server) !void { self.globals.rendered_outputs.?[i].setWallpaper(std.mem.trim(u8, wallpaper, "\x0a")) catch |err| { std.log.err("{s}", .{@errorName(err)}); _ = try connection.stream.write(@errorName(err)); + connection.stream.close(); return; }; _ = try connection.stream.write("Changed successfully!\n");