From 37fef5cbd46e83a89f4121414656798e48a2ba10 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Fri, 29 May 2026 17:02:59 -0400 Subject: [PATCH] update: init cursor config --- lua/conf/cursor.lua | 24 ++++++++++++++++++++++++ lua/conf/init.lua | 1 + lua/lib/globals.lua | 5 +++++ 3 files changed, 30 insertions(+) create mode 100644 lua/conf/cursor.lua diff --git a/lua/conf/cursor.lua b/lua/conf/cursor.lua new file mode 100644 index 0000000..d3d58a9 --- /dev/null +++ b/lua/conf/cursor.lua @@ -0,0 +1,24 @@ +local M = {} +local utils = require("lua.lib.utils") +require("lua.lib.globals") + +M.cursor = "Vimix-Hyprcursor" +M.size = 32 + +function M.fetch_Vimix_hyprcursor() + if M.cursor == "Vimix-Hyprcursor" then + if not utils.is_file_exists(DATA_HOME .. "/icons/Vimix-Hyprcursor") then + local tmppath = "/tmp/Vimix-Hyprcursor" + os.execute("git clone https://gitea.phy-yingjie.wang/wyj/Vimix-Hyprcursor.git " .. tmppath) + os.execute("cp " .. tmppath .. "/theme_Vimix-Hyprcursor " .. DATA_HOME .. "/icons/Vimix-Hyprcursor") + end + end +end + +function M.load() + M.fetch_Vimix_hyprcursor() + hl.env("HYPRCURSOR_THEME", M.cursor) + hl.env("HYPRCURSOR_SIZE", tostring(M.size)) +end + +return M diff --git a/lua/conf/init.lua b/lua/conf/init.lua index 66c90a7..7b5b606 100644 --- a/lua/conf/init.lua +++ b/lua/conf/init.lua @@ -4,6 +4,7 @@ require("lua.lib.globals") require("lua.conf.monitor") require("lua.conf.wallpaper").load() +require("lua.conf.cursor").load() require("lua.modules").load() diff --git a/lua/lib/globals.lua b/lua/lib/globals.lua index 73f1d14..9ad1663 100644 --- a/lua/lib/globals.lua +++ b/lua/lib/globals.lua @@ -5,3 +5,8 @@ if not CONFIG_HOME then end HYPR = CONFIG_HOME .. "/hypr" USER_CONFIG = HYPR .. "/lua/user" + +DATA_HOME = os.getenv("XDG_DATA_HOME") +if not DATA_HOME then + DATA_HOME = HOME .. "/.local/share" +end