From f0d81507e7b38237d2338fb2a7db3cf79c9a6474 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Mon, 30 Jun 2025 10:30:44 +0800 Subject: [PATCH] update --- .config/gtk-3.0/settings.ini | 2 +- .config/lite-xl/plugins/autosave.lua | 74 +++++++++++++++++++ .config/ml4w/cache/current_wallpaper.rasi | 2 +- .config/ml4w/settings/rofi-border-radius.rasi | 2 +- .config/ml4w/settings/rofi-border.rasi | 2 +- .config/ml4w/settings/rofi_bordersize.sh | 2 +- .config/rofi/colors.rasi | 4 +- .config/rofi/config.rasi | 8 +- .config/waybar/config.jsonc | 25 ++++++- .config/waybar/style.css | 35 ++++++--- 10 files changed, 133 insertions(+), 23 deletions(-) create mode 100644 .config/lite-xl/plugins/autosave.lua diff --git a/.config/gtk-3.0/settings.ini b/.config/gtk-3.0/settings.ini index f03260b..0a67b8d 100644 --- a/.config/gtk-3.0/settings.ini +++ b/.config/gtk-3.0/settings.ini @@ -13,7 +13,7 @@ gtk-enable-input-feedback-sounds=0 gtk-xft-antialias=1 gtk-xft-hinting=1 gtk-xft-hintstyle=hintslight -gtk-xft-rgba=rgb +gtk-xft-rgba=vrgb gtk-application-prefer-dark-theme=1 gtk-cursor-blink=true gtk-cursor-blink-time=1000 diff --git a/.config/lite-xl/plugins/autosave.lua b/.config/lite-xl/plugins/autosave.lua new file mode 100644 index 0000000..55d9e46 --- /dev/null +++ b/.config/lite-xl/plugins/autosave.lua @@ -0,0 +1,74 @@ +-- mod-version:3 +local core = require "core" +local config = require "core.config" +local Doc = require "core.doc" +local command = require "core.command" +local common = require "core.common" +-- this is used to detect the wait time +local last_keypress = os.time() +-- this exists so that we don't end up with multiple copies of the loop running at once +local looping = false +local on_text_change = Doc.on_text_change + +config.plugins.autosave = common.merge({ + enabled = true, + -- the approximate amount of time, in seconds, that it takes to trigger an autosave + timeout = 1, + -- The config specification used by the settings gui + config_spec = { + name = "Auto Save", + { + label = "Enable", + description = "Enable or disable the auto save feature.", + path = "enabled", + type = "toggle", + default = true + }, + { + label = "Timeout", + description = "Approximate amount of time in seconds it takes to trigger an autosave.", + path = "timeout", + type = "number", + default = 1, + min = 1, + max = 30 + } + } +}, config.plugins.autosave) + + +local function loop_for_save() + while looping do + if os.difftime(os.time(), last_keypress) >= config.plugins.autosave.timeout then + command.perform "doc:save" + -- stop loop + looping = false + end + -- wait the timeout. may cause timeout to be slightly imprescise + coroutine.yield(config.plugins.autosave.timeout) + end +end + + +local function updatepress() + -- set last keypress time to now + last_keypress = os.time() + -- put loop in coroutine so it doesn't lag out this script + if not looping then + looping = true + core.add_thread(loop_for_save) + end +end + + +function Doc:on_text_change(type) + -- check if file is saved + if config.plugins.autosave.enabled and self.filename + and self.abs_filename ~= system.absolute_path(USERDIR .. PATHSEP .. "init.lua") + and self.abs_filename ~= system.absolute_path(".lite_project.lua") + then + updatepress() + end + return on_text_change(self, type) +end + diff --git a/.config/ml4w/cache/current_wallpaper.rasi b/.config/ml4w/cache/current_wallpaper.rasi index b217257..eec1110 100644 --- a/.config/ml4w/cache/current_wallpaper.rasi +++ b/.config/ml4w/cache/current_wallpaper.rasi @@ -1 +1 @@ -* { current-image: url("/home/patrick/.config/ml4w/cache/blurred_wallpaper.png", height); } +* { current-image: url("/home/patrick/.config/ml4w/assets/wallhaven1.png", height); } diff --git a/.config/ml4w/settings/rofi-border-radius.rasi b/.config/ml4w/settings/rofi-border-radius.rasi index 7cbaeeb..a21fa36 100644 --- a/.config/ml4w/settings/rofi-border-radius.rasi +++ b/.config/ml4w/settings/rofi-border-radius.rasi @@ -1 +1 @@ -* { border-radius: 2em; } \ No newline at end of file +* { border-radius: 1em; } diff --git a/.config/ml4w/settings/rofi-border.rasi b/.config/ml4w/settings/rofi-border.rasi index e533468..f514350 100644 --- a/.config/ml4w/settings/rofi-border.rasi +++ b/.config/ml4w/settings/rofi-border.rasi @@ -1 +1 @@ -* { border-width: 3px; } \ No newline at end of file +* { border-width: 0px; } diff --git a/.config/ml4w/settings/rofi_bordersize.sh b/.config/ml4w/settings/rofi_bordersize.sh index 00750ed..d00491f 100644 --- a/.config/ml4w/settings/rofi_bordersize.sh +++ b/.config/ml4w/settings/rofi_bordersize.sh @@ -1 +1 @@ -3 +1 diff --git a/.config/rofi/colors.rasi b/.config/rofi/colors.rasi index c8fdebc..dd70e67 100644 --- a/.config/rofi/colors.rasi +++ b/.config/rofi/colors.rasi @@ -1,9 +1,9 @@ * { - background: #152B39FF; + background: #152B39DD; //Selection Background background-alt: #26385FFF; foreground: #C7CFE0FF; selected: #61AFEFFF; active: #98C379FF; urgent: #E06C75FF; - color: #B7CCD9FF; + color: #B7CCD9FF; //Text Color } diff --git a/.config/rofi/config.rasi b/.config/rofi/config.rasi index e56d017..8767490 100644 --- a/.config/rofi/config.rasi +++ b/.config/rofi/config.rasi @@ -81,10 +81,10 @@ mainbox { inputbar { enabled: true; spacing: 0em; - padding: 5em; + padding: 4em; children: [ "textbox-prompt-colon", "entry" ]; background-color: transparent; - background-image: url("~/.config/ml4w/cache/current_wallpaper", width); + //background-image: url("~/.config/ml4w/cache/current_wallpaper", width); } textbox-prompt-colon { @@ -92,7 +92,7 @@ textbox-prompt-colon { expand: false; str: " "; padding: 1em 0.2em 0em 0em; - text-color: @foreground; + text-color: #152B39DD; border-radius: 2em 0em 0em 2em; background-color: @color5; background-image: url("~/.config/ml4w/cache/current_wallpaper", width); @@ -104,7 +104,7 @@ entry { spacing: 1em; padding: 1em; background-color: @color5; - text-color: @foreground; + text-color: #152B39DD; cursor: text; placeholder: "Search"; placeholder-color: inherit; diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc index c8f2778..ac6c056 100644 --- a/.config/waybar/config.jsonc +++ b/.config/waybar/config.jsonc @@ -13,6 +13,7 @@ "cpu", "memory", "pulseaudio", + "custom/notification", "clock", ], // Modules configuration @@ -20,7 +21,7 @@ "disable-scroll": true, "disable-markup": false, "all-outputs": false, - "format": "{name}", + "format": "{id}", "persistent-workspaces": { "HDMI-A-1": [1, 2, 3, 4, 5], }, @@ -47,7 +48,7 @@ // "format": "{}", // }, "tray": { - "icon-size": 16, + "icon-size": 24, "spacing": 4, }, "clock": { @@ -111,6 +112,26 @@ "default": ["🔈️", "🔊"], }, "on-click": "pavucontrol", + }, + "custom/notification": { + "tooltip": false, + "format": "{icon}", + "format-icons": { + "notification": "", + "none": "", + "dnd-notification": "", + "dnd-none": "", + "inhibited-notification": "", + "inhibited-none": "", + "dnd-inhibited-notification": "", + "dnd-inhibited-none": "" + }, + "return-type": "json", + "exec-if": "which swaync-client", + "exec": "swaync-client -swb", + "on-click": "swaync-client -t -sw", + "on-click-right": "swaync-client -d -sw", + "escape": true }, // "custom/media": { // "format": "{icon} {}", diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 528d67f..edcb01f 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -6,7 +6,8 @@ font-size: 16px; font-weight: 700; min-height: 0; - margin: 4px 0 0 0; + padding: 0; + margin: 0; } window#waybar { @@ -23,21 +24,29 @@ window#waybar { window#waybar.hidden { opacity: 0; } -/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ + +#workspaces { + /* border: 1px solid red; */ + /* padding: 0.5rem 1.25rem 0.5rem 1rem; */ +} + #workspaces button { padding: 0 8px; - /* background: transparent; */ - color: #ffffff; - /* border-bottom: 3px solid transparent; */ + color: rgba(255, 255, 255, 0.3); + background: transparent; } -#workspaces button.focused { - background: #64727d; - border-bottom: 3px solid #ffffff; -} +/* #workspaces button.focused { */ +/* background: #64727d; */ +/* border-bottom: 3px solid #ffffff; */ +/* } */ #workspaces button.urgent { - background-color: #eb4d4b; + background-color: rgba(128,157,170, 0.8); +} + +#workspaces button.active { + color: rgba(255, 255, 255, 0.8); } #mode { @@ -158,6 +167,12 @@ tooltip label { color: #ffffff; } +#custom-notification { + background: transparent; + border: 2px solid rgba(154, 177, 187, 0.2); + padding: 0.5rem 1.25rem 0.5rem 1rem; +} + /* #idle_inhibitor { background-color: #2d3436; }