diff --git a/config/fabric/fabric_send b/config/fabric/fabric_send deleted file mode 100755 index 0cb5641d..00000000 --- a/config/fabric/fabric_send +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -dbus-send --session --print-reply --dest=org.Fabric.fabric.fabric-bar /org/Fabric/fabric org.Fabric.fabric.Evaluate string:"$1" >/dev/null 2>&1 diff --git a/config/fabric/main.py b/config/fabric/main.py index af9100a9..41a27955 100644 --- a/config/fabric/main.py +++ b/config/fabric/main.py @@ -35,7 +35,4 @@ if __name__ == "__main__": apply_style(app) - def quit_fabric(): - app.quit() - app.run() diff --git a/config/fabric/modules/launcher/widgets/clipboard.py b/config/fabric/modules/launcher/widgets/clipboard.py index 4b7b5cb2..29e4eb52 100644 --- a/config/fabric/modules/launcher/widgets/clipboard.py +++ b/config/fabric/modules/launcher/widgets/clipboard.py @@ -119,7 +119,7 @@ class ClipboardManager: def _add_text_button(self, viewport, item): label_button = Button( child=Label( - label=item["content"][:55], # Truncate text for display + label=item["content"][:35], # Truncate text for display h_expand=True, v_align="center", h_align="start", diff --git a/config/fabric/modules/launcher/widgets/emoji.py b/config/fabric/modules/launcher/widgets/emoji.py index f73e7feb..10d869d2 100644 --- a/config/fabric/modules/launcher/widgets/emoji.py +++ b/config/fabric/modules/launcher/widgets/emoji.py @@ -1,73 +1,46 @@ -import json import os import subprocess from typing import Generator, List +import ijson from fabric.widgets.box import Box from fabric.widgets.button import Button from fabric.widgets.label import Label from snippets import MaterialIcon -class EmojiItem: - def __init__(self, emoji_str: str, name: str, slug: str, group: str): - self.str = emoji_str - self.name = name - self.slug = slug - self.group = group - - class EmojiManager: def __init__(self, launcher): self.launcher = launcher - self.emojis: List[EmojiItem] = [] - self.query_cache: dict = {} + self.emoji_file_path = os.path.expanduser("~/fabric/assets/emoji.json") - def load_emojis(self) -> Generator[EmojiItem, None, None]: - emoji_path = os.path.expanduser("~/fabric/assets/emoji.json") - if not os.path.exists(emoji_path): + def load_emojis(self) -> Generator[tuple, None, None]: + if not os.path.exists(self.emoji_file_path): return - try: - with open(emoji_path, "r") as file: - data = json.load(file) - for emoji_str, item in data.items(): - yield EmojiItem( - emoji_str, item["name"], item["slug"], item["group"] - ) - except (json.JSONDecodeError, OSError): + with open(self.emoji_file_path, "r") as file: + for emoji_str, item in ijson.kvitems(file, ""): + yield emoji_str, item["name"], item["slug"], item["group"] + except (ijson.JSONError, KeyError, OSError): return - def get_emojis(self) -> List[EmojiItem]: - if not self.emojis: - self.emojis = list(self.load_emojis()) - return self.emojis - - def query_emojis(self, query: str) -> List[EmojiItem]: - if query in self.query_cache: - return self.query_cache[query] - - emojis = self.get_emojis() - filtered_emojis = [ - emoji - for emoji in emojis - if query.lower() in emoji.name.lower() - or query.lower() in emoji.slug.lower() - or query.lower() in emoji.group.lower() + def query_emojis(self, query: str) -> List[tuple]: + query = query.lower() + return [ + (emoji_str, name, slug, group) + for emoji_str, name, slug, group in self.load_emojis() + if query in name.lower() or query in slug.lower() or query in group.lower() ][:48] - self.query_cache[query] = filtered_emojis - return filtered_emojis - - def copy_emoji(self, emoji: EmojiItem): - subprocess.run(["wl-copy"], input=emoji.str.encode(), check=True) + def copy_emoji(self, emoji: tuple): + subprocess.run(["wl-copy"], input=emoji[0].encode(), check=True) self.launcher.set_visible(False) def show_emojis(self, viewport, query: str): filtered_emojis = self.query_emojis(query) self._display_emoji_grid(viewport, filtered_emojis) - def _display_emoji_grid(self, viewport, emojis: List[EmojiItem]): + def _display_emoji_grid(self, viewport, emojis: List[tuple]): row = Box(orientation="h", spacing=10) for emoji in emojis: button = self._create_emoji_button(emoji) @@ -80,10 +53,10 @@ class EmojiManager: if row.children: viewport.add(row) - def _create_emoji_button(self, emoji: EmojiItem) -> Button: + def _create_emoji_button(self, emoji: tuple) -> Button: return Button( - child=Label(label=emoji.str, h_pack="start"), - tooltip_text=f"Copy {emoji.name}", + child=Label(label=emoji[0], h_pack="start"), + tooltip_text=f"Copy {emoji[1]}", on_clicked=lambda *_: self.copy_emoji(emoji), name="emoji-item", ) diff --git a/config/fabric/modules/launcher/widgets/wallpaper.py b/config/fabric/modules/launcher/widgets/wallpaper.py index a0e99000..ee03d514 100644 --- a/config/fabric/modules/launcher/widgets/wallpaper.py +++ b/config/fabric/modules/launcher/widgets/wallpaper.py @@ -21,20 +21,20 @@ class WallpaperManager: Path.home() / ".cache" / "fabric" / "thumbnails" / "wallpapers" ) self.thumbnail_dir.mkdir(parents=True, exist_ok=True) - self.theme_toggle_button = self.create_theme_toggle_button() + self.theme_toggle_button = self._create_theme_toggle_button() self._update_button_style() - def create_theme_toggle_button(self): - button = Button( + def _create_theme_toggle_button(self): + return Button( child=MaterialIcon("contrast"), v_align="center", on_clicked=self.toggle_dark_mode, ) - return button def toggle_dark_mode(self, *_): - command = os.path.expanduser("~/fabric/assets/scripts/dark-theme.sh --toggle") - exec_shell_command(command) + exec_shell_command( + os.path.expanduser("~/fabric/assets/scripts/dark-theme.sh --toggle") + ) self._update_button_style() def check_dark_mode_state(self): @@ -44,47 +44,57 @@ class WallpaperManager: return result.strip().replace("'", "") == "prefer-dark" def _update_button_style(self): + dark_mode = self.check_dark_mode_state() style = ( "background-color: @surfaceVariant; border-radius:100px; min-height:50px; min-width:50px;" - if self.check_dark_mode_state() + if dark_mode else "background-color: transparent; border-radius:100px;" ) self.theme_toggle_button.set_style(style) def show_wallpaper_thumbnails(self, viewport, search_term: str = ""): - wallpapers = self._get_wallpapers(search_term) - self._populate_viewport(viewport, wallpapers) + wallpapers = list(self._get_wallpapers(search_term))[:24] + if not wallpapers: + self._show_no_wallpapers_message(viewport) + return - def _get_wallpapers(self, search_term: str): - return [ - f - for f in self.wallpaper_dir.iterdir() - if f.is_file() - and f.suffix.lower() in self.IMAGE_EXTENSIONS - and self._matches_search(f, search_term) - ] + self._display_thumbnails(viewport, wallpapers) - def _matches_search(self, file, search_term: str): - return not search_term or search_term.lower() in file.name.lower() + def _show_no_wallpapers_message(self, viewport): + viewport.add( + Box( + orientation="h", + style="padding:20px;", + children=[Button(child="No wallpapers found!", v_align="center")], + ) + ) - def _populate_viewport(self, viewport, wallpapers): - viewport.children.clear() + def _display_thumbnails(self, viewport, wallpapers): row = Box(orientation="h", spacing=10, style="margin:5px;") - for i, wallpaper in enumerate(wallpapers[:24]): # Limit to 24 wallpapers + for index, wallpaper in enumerate(wallpapers, 1): thumbnail_path = self._generate_thumbnail(wallpaper) - thumbnail_button = self._create_wallpaper_thumbnail( - thumbnail_path, wallpaper - ) - row.add(thumbnail_button) + row.add(self._create_wallpaper_thumbnail(thumbnail_path, wallpaper)) - if (i + 1) % 6 == 0: + if index % 6 == 0: viewport.add(row) row = Box(orientation="h", spacing=10, style="margin:5px;") if row.children: viewport.add(row) + def _get_wallpapers(self, search_term: str): + return ( + f + for f in self.wallpaper_dir.iterdir() + if f.is_file() + and f.suffix.lower() in self.IMAGE_EXTENSIONS + and self._matches_search(f, search_term) + ) + + def _matches_search(self, file, search_term: str): + return not search_term or search_term.lower() in file.name.lower() + def _generate_thumbnail(self, wallpaper_path): thumbnail_path = self.thumbnail_dir / wallpaper_path.name if not thumbnail_path.exists(): @@ -113,12 +123,13 @@ class WallpaperManager: ) def _create_wallpaper_thumbnail(self, thumbnail_path, wallpaper_path): - thumbnail_style = self._thumbnail_style(thumbnail_path) - thumbnail_box = Box( - orientation="h", h_align="center", v_align="center", style=thumbnail_style - ) return Button( - child=thumbnail_box, + child=Box( + orientation="h", + h_align="center", + v_align="center", + style=self._thumbnail_style(thumbnail_path), + ), h_align="start", v_align="center", name="wall-item", @@ -127,7 +138,7 @@ class WallpaperManager: def _thumbnail_style(self, thumbnail_path): return ( - f"background-image: url('{thumbnail_path }'); " + f"background-image: url('{thumbnail_path}'); " "min-width: 64px; min-height: 64px; " "background-repeat: no-repeat; " "background-size: cover; background-position: center;" diff --git a/config/fabric/start b/config/fabric/start deleted file mode 100755 index ee1249e0..00000000 --- a/config/fabric/start +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -cd ~/dotfiles/fabric/ - -python main.py diff --git a/config/hypr/UserConfigs/ENVariables.conf b/config/hypr/UserConfigs/ENVariables.conf index c60f3001..e9199da9 100644 --- a/config/hypr/UserConfigs/ENVariables.conf +++ b/config/hypr/UserConfigs/ENVariables.conf @@ -1,3 +1,5 @@ +# Environment variables. See https://wiki.hyprland.org/Configuring/Environment-variables/ + #environment-variables env = CLUTTER_BACKEND,wayland env = GDK_BACKEND,wayland,x11 diff --git a/config/hypr/UserConfigs/Laptops.conf b/config/hypr/UserConfigs/Laptops.conf index e3a500f6..f1b42582 100644 --- a/config/hypr/UserConfigs/Laptops.conf +++ b/config/hypr/UserConfigs/Laptops.conf @@ -3,18 +3,16 @@ # These configs are mostly for laptops. This is addemdum to Keybinds.conf $mainMod = SUPER -$fabric_send = ~/fabric/fabric_send #VolumeControl -bindle = ,XF86MonBrightnessUp, exec, ags -r 'brightness.screen_value += 0.1;' -bindle = ,XF86MonBrightnessDown, exec, ags -r 'brightness.screen_value -= 0.1;' -# bindle=,XF86MonBrightnessUp, exec, brightnessctl s 5%+ && $fabric_send 'systemOverlay.enable_popup("brightness")' -# bindle=,XF86MonBrightnessDown, exec, brightnessctl s 5%- && $fabric_send 'systemOverlay.enable_popup("brightness")' -bind = ,XF86AudioRaiseVolume, exec, pamixer -i 5 # Volume Higher key -bind = ,XF86AudioLowerVolume, exec, pamixer -d 5 # Volume lower key -bind = ,XF86AudioMute, exec, pamixer -t # Speaker Mute -# bindle=,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ && $fabric_send 'systemOverlay.enable_popup("sound")' -# bindle=,XF86AudioLowerVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%- && $fabric_send 'systemOverlay.enable_popup("sound")' -# bind =, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +bindle=,XF86MonBrightnessUp, exec, brightnessctl s 5%+ +bindle=,XF86MonBrightnessDown, exec, brightnessctl s 5%- + + + +bind =, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +bind = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ +bind = ,XF86AudioLowerVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%- + bind = ,XF86AudioMicMute, exec, pamixer --default-source -t # Mic mute key bind = ,XF86AudioNext, exec, playerctl next bind = ,XF86AudioPrev, exec, playerctl previous diff --git a/config/hypr/UserConfigs/Monitors.conf b/config/hypr/UserConfigs/Monitors.conf index e05c1e46..74531c73 100644 --- a/config/hypr/UserConfigs/Monitors.conf +++ b/config/hypr/UserConfigs/Monitors.conf @@ -10,16 +10,17 @@ monitor=,preferred,auto,1 # Created this inorder for the monitor display to not wake up if not intended. # See here: https://github.com/hyprwm/Hyprland/issues/4090 +# Some examples #monitor = eDP-1, preferred, auto, 1 -#monitor = eDP-1, 2560x1440@165, 0x0, 1 -#monitor = DP-3, preferred, auto, 1 +#monitor = eDP-1, 2560x1440@165, 0x0, 1 #own screen +#monitor = DP-3, 1920x1080@240, auto, 1 #monitor = DP-1, preferred, auto, 1 #monitor = HDMI-A-1, preferred,auto,1 -# QEMU-KVM or any virtual box +# QEMU-KVM, virtual box or vmware #monitor = Virtual-1, 1920x1080@60,auto,1 -# Hi Refresh Rate +# High Refresh Rate #monitor=,highrr,auto,1 # High Resolution @@ -28,17 +29,19 @@ monitor=,preferred,auto,1 # to disable a monitor #monitor=name,disable -# Mirror +# Mirror samples #monitor=DP-3,1920x1080@60,0x0,1,mirror,DP-2 -# monitor=,preferred,auto,1,mirror,eDP-1 - - -# Example : -#monitor=eDP-1,2560x1440@165,0x0,1 -#workspace=HDMI-A-1,1 +#monitor=,preferred,auto,1,mirror,eDP-1 #monitor=HDMI-A-1,2560x1440@144,0x0,1,mirror,eDP-1 -#workspace=HDMI-A-2,2 + +# 10 bit monitor support - See wiki https://wiki.hyprland.org/Configuring/Monitors/#10-bit-support - See NOTES below +# NOTE: Colors registered in Hyprland (e.g. the border color) do not support 10 bit. +# NOTE: Some applications do not support screen capture with 10 bit enabled. (Screen captures like OBS may render black screen) +# monitor=,preferred,auto,1,bitdepth,10 #monitor=eDP-1,transform,0 #monitor=eDP-1,addreserved,10,10,10,49 -#workspace=eDP-1,1 + +# workspaces - Monitor rules +# https://wiki.hyprland.org/Configuring/Workspace-Rules/ +# See ~/.config/hypr/UserConfigs/WorkspaceRules.conf diff --git a/config/hypr/UserConfigs/Startup_Apps.conf b/config/hypr/UserConfigs/Startup_Apps.conf index afe0de3c..0ecd3d48 100644 --- a/config/hypr/UserConfigs/Startup_Apps.conf +++ b/config/hypr/UserConfigs/Startup_Apps.conf @@ -12,10 +12,11 @@ exec-once = systemctl --user import-environment QT_QPA_PLATFORMTHEME # Polkit (Polkit Gnome / KDE) exec-once = $scriptsDir/Polkit.sh -# starup apps +# startup apps #exec-once = waybar & -#exec-once = ags & -exec-once = ~/dotfiles/fabric/start & +# exec-once = ~/fabric/start & +# exec-once = ags & +exec-once = cd ~/fabric && python main.py exec-once = wl-gammarelay-rs & exec-once = blueman-applet & exec-once = nm-applet --indicator & diff --git a/config/hypr/UserConfigs/UserDecorationAnimations.conf b/config/hypr/UserConfigs/UserDecorationAnimations.conf new file mode 100644 index 00000000..a8867c03 --- /dev/null +++ b/config/hypr/UserConfigs/UserDecorationAnimations.conf @@ -0,0 +1,69 @@ +# Decoration and Animations Settings + +# Hyprland Wiki Links +# Animation - https://wiki.hyprland.org/Configuring/Animations/ +# Decoration - https://wiki.hyprland.org/Configuring/Variables/#decoration + +decoration { + rounding = 20 + + active_opacity = 1 + inactive_opacity = 1 + fullscreen_opacity = 1 + + dim_inactive = true + dim_strength = 0.1 + dim_special = 0.8 + + +shadow { + enabled = false + range = 6 + render_power = 1 + color = 0x66000000 + } + + blur { + enabled = false + size = 4 + passes = 3 + ignore_opacity = true + new_optimizations = true + } +} + +animations { + enabled = true + # Animation curves + + bezier = linear, 0, 0, 1, 1 + bezier = md3_standard, 0.2, 0, 0, 1 + bezier = md3_decel, 0.05, 0.7, 0.1, 1 + bezier = md3_accel, 0.3, 0, 0.8, 0.15 + bezier = overshot, 0.05, 0.9, 0.1, 1.1 + bezier = crazyshot, 0.1, 1.5, 0.76, 0.92 + bezier = hyprnostretch, 0.05, 0.9, 0.1, 1.0 + bezier = menu_decel, 0.1, 1, 0, 1 + bezier = menu_accel, 0.38, 0.04, 1, 0.07 + bezier = easeInOutCirc, 0.85, 0, 0.15, 1 + bezier = easeOutCirc, 0, 0.55, 0.45, 1 + bezier = easeOutExpo, 0.16, 1, 0.3, 1 + bezier = softAcDecel, 0.26, 0.26, 0.15, 1 + bezier = md2, 0.4, 0, 0.2, 1 # use with .2s duration + # Animation configs + animation = windows, 1, 3, md3_decel, popin 60% + animation = windowsIn, 1, 3, md3_decel, popin 60% + animation = windowsOut, 1, 3, md3_accel, popin 60% + animation = border, 1, 10, default + animation = fade, 1, 3, md3_decel + animation = layers, 1, 2, md3_decel, slide + animation = layersIn, 1, 3, menu_decel, slide + animation = layersOut, 1, 1.6, menu_accel + animation = fadeLayersIn, 1, 2, menu_decel + animation = fadeLayersOut, 1, 4.5, menu_accel + animation = workspaces, 1, 7, menu_decel, slide + # animation = workspaces, 1, 2.5, softAcDecel, slide + # animation = workspaces, 1, 7, menu_decel, slidefade 15% + # animation = specialWorkspace, 1, 3, md3_decel, slidefadevert 15% + animation = specialWorkspace, 1, 3, md3_decel, slidevert +} diff --git a/config/hypr/UserConfigs/UserKeybinds.conf b/config/hypr/UserConfigs/UserKeybinds.conf index bf0aa8ee..980c3c20 100644 --- a/config/hypr/UserConfigs/UserKeybinds.conf +++ b/config/hypr/UserConfigs/UserKeybinds.conf @@ -7,55 +7,37 @@ $mainMod = SUPER $scriptsDir = $HOME/dotfiles/hypr/scripts $RunCMD = $scriptsDir/RunCMD.sh -$fabric = $HOME/dotfiles/fabric/fabric_send - -# Lock indicators -bindlni = , Caps_Lock, exec, ags -r 'updateCapsLock();' -bindlnri = , Caps_Lock, exec, ags -r 'updateCapsLock();' -bindlni = , Num_Lock, exec, ags -r 'updateNumLock();' -bindlnri = , Num_Lock, exec, ags -r 'updateNumLock();' - -# Categories (for script) -#! @actions: Actions -#! @tools: Tools -#! @apps: Applications -#! @windows: Windows -#! @workspaces: Workspaces -#! @misc: Misc +$fabric = python -m fabric execute quickbar # Testing -bind = Alt, f12, exec, notify-send 'Test notification' "Here's a really long message to test truncation and wrapping\nYou can middle click or flick this notification to dismiss it!" -a 'Shell' -A "Test1=I got it!" -A "Test2=Another action" -bind = Alt, Equal, exec, notify-send 'hmm' ${SLURP_ARGS} -bindr = ALT, R, exec, ags -r 'ReloadCSS();' +bind = Alt, f12, exec, notify-send 'Test notification' "Here's a really long message to test truncation and wrapping\nYou can middle click or flick this notification to dismiss it!" -a 'terminal' -A "Test1=I got it!" -A "Test2=Another action" +bind = Alt, Equal, exec, notify-send 'hmm' ${SLURP_ARGS} # Applications -bind = ALT SHIFT,Return, exec, kitty --title Kitty --single-instance #! @description: "Terminal Float"; @apps; -bind = $mainMod, Return, exec, $scriptsDir/apps.sh terminal #! @description: "Terminal"; @apps; -bind = $mainMod, E, exec, $scriptsDir/apps.sh filemanager #! @description: "File Manager"; @apps; -bind = $mainMod, B, exec, $scriptsDir/apps.sh browser #! @description: "Browser"; @apps; -bind = $mainMod, T, exec, materialgram #! @description: "Telegram", @apps; +bind = ALT SHIFT,Return, exec, kitty --title Kitty --single-instance +bind = $mainMod, Return, exec, kitty +bind = $mainMod, E, exec, thunar +bind = $mainMod, B, exec, firefox +bind = $mainMod, T, exec, materialgram # Actions -bind = $mainMod SHIFT, G, exec, $RunCMD gamemode #! @description: "Toggle animations"; @actions; -bind = $mainMod, F3, exec, $RunCMD kb_changer #! @description: "Change Keyboard Layout"; @actions; -bind = $mainMod, space, exec, $RunCMD change_layout #! @description: "Change Layout(master/dwindle)"; @actions; -bind = SHIFT ALT,W, exec, python -O $scriptsDir/wallpaper.py -R #! @description: "Random wallpaper"; @actions; -bind = $mainMod CTRL, L, exec, pidof hyprlock || hyprlock -q #! @description: "Lock screen"; @actions; -bind = $mainMod CTRL, P, exec, systemctl poweroff #! @description: "ShutDown"; @actions; -bind = $mainMod CTRL, R, exec, systemctl reboot #! @description: "Restart"; @actions; -bind = $mainMod, o, exec, $scriptsDir/ScreenShot.sh #! @description: "Screenshot"; @actions; -# bind = ALT SHIFT, S, exec, $scriptsDir/ScreenShot.sh --window #! @description: "Window screenshot"; @actions; -# bind = ,Print, exec, $scriptsDir/ScreenShot.sh --active #! @description: "Active screen screenshot"; @actions; -bind = $mainMod,Z, exec, $fabric_send 'sc.screenshot()' -bind = , Print, exec, $fabric_send 'sc.screenshot(True)' -bind = $mainMod, R, exec, $fabric_send 'sc.screencast_start(True)' -bind = Super, y, exec, XDG_CURRENT_DESKTOP="gnome" gnome-control-center -# Tools -# bind = $mainMod, D, exec, $fabric_send 'launcher.toggle()' -bind=CTRL SHIFT, R, exec, $fabric_send 'quit_fabric()' || sleep 0.5 && $fabric +bind = $mainMod SHIFT, G, exec, $RunCMD gamemode +bind = $mainMod, F3, exec, $RunCMD kb_changer +bind = $mainMod, space, exec, $RunCMD change_layout +bind = SHIFT ALT,W, exec, python -O $scriptsDir/wallpaper.py -R +bind = $mainMod CTRL, L, exec, pidof hyprlock || hyprlock -q +bind = $mainMod CTRL, P, exec, systemctl poweroff +bind = $mainMod CTRL, R, exec, systemctl reboot +bind = ALT, t, exec, killall quickbar || sleep 0.5 && python ~/fabric/main.py & + +bind = $mainMod, R, exec, $fabric 'sc.screencast_start(True)' +bind = $mainMod_SHIFT, R, exec, $fabric 'sc.screencast_stop()' + +bind=$mainMod,Z, exec, $fabric 'sc.screenshot()' +bind=,Print, exec, $fabric 'sc.screenshot(True)' + + +bind = Super, y, exec, XDG_CURRENT_DESKTOP="gnome" gnome-control-center +bind = $mainMod, D, exec, $fabric 'launcher.toggle()' + -# Misc -bind = $mainMod ALT, P, submap, passthru #! @description: "Passthrough mainMod key to Virtual Machine"; @misc; -submap = passthru -bind = $mainMod ALT, Escape, submap, reset #! @description: "Cancel passthrough"; @misc; -submap = reset diff --git a/config/hypr/UserConfigs/UserSettings.conf b/config/hypr/UserConfigs/UserSettings.conf index fe332ca2..8fc85202 100644 --- a/config/hypr/UserConfigs/UserSettings.conf +++ b/config/hypr/UserConfigs/UserSettings.conf @@ -15,80 +15,16 @@ master { } general { - # sensitivity = 1.00 - # apply_sens_to_raw = 1 - gaps_in = 6 + gaps_in = 5 gaps_out = 8 border_size = 0 col.active_border = $border_color_active col.inactive_border = $border_color_inactive - layout = master + layout = dwindle } -decoration { - rounding = 20 - - active_opacity = 1 - inactive_opacity = 1 - fullscreen_opacity = 1 - - dim_inactive = true - dim_strength = 0.1 - dim_special = 0.8 - - drop_shadow = false - shadow_range = 10 - shadow_render_power = 3 - col.shadow = 0x66000000 - - blur { - enabled = false - size = 4 - passes = 3 - ignore_opacity = true - new_optimizations = true - } -} - -animations { - enabled = true - # Animation curves - - bezier = linear, 0, 0, 1, 1 - bezier = md3_standard, 0.2, 0, 0, 1 - bezier = md3_decel, 0.05, 0.7, 0.1, 1 - bezier = md3_accel, 0.3, 0, 0.8, 0.15 - bezier = overshot, 0.05, 0.9, 0.1, 1.1 - bezier = crazyshot, 0.1, 1.5, 0.76, 0.92 - bezier = hyprnostretch, 0.05, 0.9, 0.1, 1.0 - bezier = menu_decel, 0.1, 1, 0, 1 - bezier = menu_accel, 0.38, 0.04, 1, 0.07 - bezier = easeInOutCirc, 0.85, 0, 0.15, 1 - bezier = easeOutCirc, 0, 0.55, 0.45, 1 - bezier = easeOutExpo, 0.16, 1, 0.3, 1 - bezier = softAcDecel, 0.26, 0.26, 0.15, 1 - bezier = md2, 0.4, 0, 0.2, 1 # use with .2s duration - # Animation configs - animation = windows, 1, 3, md3_decel, popin 60% - animation = windowsIn, 1, 3, md3_decel, popin 60% - animation = windowsOut, 1, 3, md3_accel, popin 60% - animation = border, 1, 10, default - animation = fade, 1, 3, md3_decel - animation = layers, 1, 2, md3_decel, slide - animation = layersIn, 1, 3, menu_decel, slide - animation = layersOut, 1, 1.6, menu_accel - animation = fadeLayersIn, 1, 2, menu_decel - animation = fadeLayersOut, 1, 4.5, menu_accel - animation = workspaces, 1, 7, menu_decel, slide - # animation = workspaces, 1, 2.5, softAcDecel, slide - # animation = workspaces, 1, 7, menu_decel, slidefade 15% - # animation = specialWorkspace, 1, 3, md3_decel, slidefadevert 15% - animation = specialWorkspace, 1, 3, md3_decel, slidevert -} - - input { kb_layout = us,np kb_variant = @@ -127,7 +63,6 @@ misc { disable_hyprland_logo = true disable_splash_rendering = true mouse_move_enables_dpms = true - #vrr = 0 vfr = 1 mouse_move_enables_dpms = true enable_swallow = true @@ -143,6 +78,7 @@ binds { } xwayland { + enabled = true force_zero_scaling = true } diff --git a/config/hypr/UserConfigs/WindowRules.conf b/config/hypr/UserConfigs/WindowRules.conf index 95aa93e2..00b41a78 100644 --- a/config/hypr/UserConfigs/WindowRules.conf +++ b/config/hypr/UserConfigs/WindowRules.conf @@ -38,6 +38,9 @@ windowrulev2 = size 35% 90%, $zathura windowrulev2 = center 1, $zathura +# Do not lose focus when gnome polkit is opened +windowrulev2 = stayfocused, class:(polkit-gnome-authentication-agent-1) + # OBS # Main window / Profile screen @@ -128,8 +131,6 @@ windowrule = size 800 500, title:^(Kitty)$ windowrule = move center, title:^(Kitty)$ windowrule = animation slide, title:^(Kitty)$ windowrule = float, title:^(Kitty)$ -windowrule = float, kitty_float - # Bluetooth applet windowrulev2 = float, class:(blueman) @@ -173,24 +174,21 @@ windowrulev2 = center, title:(File Operation Progress) +windowrulev2 = stayfocused, class:(launcher) # Layer Rules -layerrule = noanim, popup.* +# layerrule = noanim, popup.* layerrule = noanim, hyprpicker layerrule = noanim, selection layerrule = noanim, noanim -layerrule = blur, gtk-layer-shell layerrule = ignorezero, gtk-layer-shell -layerrule = blur, launcher -layerrule = ignorealpha 0.5, launcher layerrule = blur, notifications layerrule = ignorealpha 0.69, notifications layerrule = noanim,selection layerrule = noanim, notifications -# layerrule = animation fade, launcher +layerrule = animation slide, launcher # fabric -layerrule = noanim, fabric +# layerrule = noanim, fabric # layerrule = ignorezero, fabric - diff --git a/config/hypr/UserConfigs/WorkspaceRules.conf b/config/hypr/UserConfigs/WorkspaceRules.conf new file mode 100644 index 00000000..59e5309d --- /dev/null +++ b/config/hypr/UserConfigs/WorkspaceRules.conf @@ -0,0 +1,24 @@ +# You can set workspace rules to achieve workspace-specific behaviors. +# For instance, you can define a workspace where all windows are drawn without borders or gaps. + +# https://wiki.hyprland.org/Configuring/Workspace-Rules/ + +# Assigning workspace to a certain monitor. Below are just examples +# workspace = 1, monitor:eDP-1 +# workspace = 2, monitor:eDP-1 +# workspace = 3, monitor:eDP-1 +# workspace = 4, monitor:eDP-1 +# workspace = 5, monitor:DP-2 +# workspace = 6, monitor:DP-2 +# workspace = 7, monitor:DP-2 +# workspace = 8, monitor:DP-2 + + +# example rules (from wiki) +# workspace = 3, rounding:false, decorate:false +# workspace = name:coding, rounding:false, decorate:false, gapsin:0, gapsout:0, border:false, decorate:false, monitor:DP-1 +# workspace = 8,bordersize:8 +# workspace = name:Hello, monitor:DP-1, default:true +# workspace = name:gaming, monitor:desc:Chimei Innolux Corporation 0x150C, default:true +# workspace = 5, on-created-empty:[float] firefox +# workspace = special:scratchpad, on-created-empty:foot diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 0a3a5197..f5245ec2 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -17,7 +17,8 @@ source= $UserConfigs/LaptopDisplay.conf source= $UserConfigs/WindowRules.conf source= $UserConfigs/UserKeybinds.conf source= $UserConfigs/UserSettings.conf - +source = $UserConfigs/UserDecorationAnimations.conf +source = $UserConfigs/WorkspaceRules.conf # Material colors source = ~/.cache/material/colors-hyprland.conf diff --git a/config/material-colors/generate.py b/config/material-colors/generate.py index c389c686..5bd382be 100644 --- a/config/material-colors/generate.py +++ b/config/material-colors/generate.py @@ -1,28 +1,40 @@ -import os -import random -import subprocess -import json -from PIL import Image import argparse -from materialyoucolor.quantize import QuantizeCelebi # type: ignore -from materialyoucolor.score.score import Score # type: ignore -from materialyoucolor.hct import Hct # type: ignore -from materialyoucolor.dynamiccolor.material_dynamic_colors import MaterialDynamicColors # type: ignore # noqa -from materialyoucolor.scheme.dynamic_scheme import DynamicScheme # type: ignore # noqa -from materialyoucolor.scheme.scheme_tonal_spot import SchemeTonalSpot # type: ignore # noqa -from materialyoucolor.scheme.scheme_expressive import SchemeExpressive # type: ignore # noqa -from materialyoucolor.scheme.scheme_fruit_salad import SchemeFruitSalad # type: ignore # noqa -from materialyoucolor.scheme.scheme_monochrome import SchemeMonochrome # type: ignore # noqa -from materialyoucolor.scheme.scheme_rainbow import SchemeRainbow # type: ignore # noqa -from materialyoucolor.scheme.scheme_vibrant import SchemeVibrant # type: ignore # noqa -from materialyoucolor.scheme.scheme_neutral import SchemeNeutral # type: ignore # noqa -from materialyoucolor.scheme.scheme_fidelity import SchemeFidelity # type: ignore # noqa -from materialyoucolor.scheme.scheme_content import SchemeContent # type: ignore # noqa import hashlib +import json +import os import pickle -import numpy as np +import random import re +import subprocess +import numpy as np +from materialyoucolor.dynamiccolor.material_dynamic_colors import ( + MaterialDynamicColors, +) # type: ignore # noqa +from materialyoucolor.hct import Hct # type: ignore +from materialyoucolor.quantize import QuantizeCelebi # type: ignore +from materialyoucolor.scheme.dynamic_scheme import DynamicScheme # type: ignore # noqa +from materialyoucolor.scheme.scheme_content import SchemeContent # type: ignore # noqa +from materialyoucolor.scheme.scheme_expressive import ( + SchemeExpressive, +) # type: ignore # noqa +from materialyoucolor.scheme.scheme_fidelity import ( + SchemeFidelity, +) # type: ignore # noqa +from materialyoucolor.scheme.scheme_fruit_salad import ( + SchemeFruitSalad, +) # type: ignore # noqa +from materialyoucolor.scheme.scheme_monochrome import ( + SchemeMonochrome, +) # type: ignore # noqa +from materialyoucolor.scheme.scheme_neutral import SchemeNeutral # type: ignore # noqa +from materialyoucolor.scheme.scheme_rainbow import SchemeRainbow # type: ignore # noqa +from materialyoucolor.scheme.scheme_tonal_spot import ( + SchemeTonalSpot, +) # type: ignore # noqa +from materialyoucolor.scheme.scheme_vibrant import SchemeVibrant # type: ignore # noqa +from materialyoucolor.score.score import Score # type: ignore +from PIL import Image schemes = { "tonalSpot": SchemeTonalSpot, @@ -33,7 +45,7 @@ schemes = { "vibrant": SchemeVibrant, "neutral": SchemeNeutral, "fidelity": SchemeFidelity, - "content": SchemeContent + "content": SchemeContent, } @@ -41,7 +53,7 @@ def join(*args): return os.path.join(*args) -home = os.path.expanduser('~') +home = os.path.expanduser("~") script_dir = os.path.dirname(os.path.abspath(__file__)) cache_path = f"{home}/.cache/material/" @@ -49,14 +61,14 @@ os.makedirs(cache_path, exist_ok=True) def rgb_to_hex(rgb): - return '#{:02x}{:02x}{:02x}'.format(*rgb[:3]) + return "#{:02x}{:02x}{:02x}".format(*rgb[:3]) def rgba_to_rgb(rgba): - return f'{rgba[0]}, {rgba[1]}, {rgba[2]}' + return f"{rgba[0]}, {rgba[1]}, {rgba[2]}" -class Color(): +class Color: def __init__(self, scheme) -> None: self.scheme = scheme @@ -70,11 +82,18 @@ class Color(): class ColorsCache: def __init__( - self, colors: DynamicScheme | dict, wallpaper: str, original_color: int + self, + colors: DynamicScheme | dict, + wallpaper: str, + original_color: int, + contrast_level: int, + scheme_name: str, ) -> None: self.colors: dict[str, str] = {} self.wallpaper = wallpaper self.original_color = original_color + self.contrast_level = contrast_level + self.scheme_name = scheme_name if isinstance(colors, DynamicScheme): for color in vars(MaterialDynamicColors).keys(): color_name = getattr(MaterialDynamicColors, color) @@ -90,7 +109,9 @@ def colors_dict(cache: ColorsCache): dict = { "wallpaper": cache.wallpaper, "colors": cache.colors, - "original_color": cache.original_color + "original_color": cache.original_color, + "contrast_level": cache.contrast_level, + "scheme_name": cache.scheme_name, } return dict @@ -101,7 +122,9 @@ def get_cache_object(object: dict | str): colors = object["colors"] wallpaper = object["wallpaper"] original_color = object["original_color"] - return ColorsCache(colors, wallpaper, original_color) + contrast_level = object.get("contrast_level", 0) + scheme_name = object.get("scheme_name", "tonalSpot") + return ColorsCache(colors, wallpaper, original_color, contrast_level, scheme_name) def get_file_list(folder_path): @@ -114,11 +137,9 @@ def get_file_list(folder_path): ready_templates = { "colors.css": "@define-color {name} {hex};\n", - "colors.scss": "${name}: {hex};\n" -} -additional = { - "onBackground": "foreground" + "colors.scss": "${name}: {hex};\n", } +additional = {"onBackground": "foreground"} def generate_color_map(scheme: DynamicScheme): @@ -137,25 +158,23 @@ class ColorFormatter: def apply_transformations(self, value, transformations): intermediate_transforms = [ - t for t in transformations - if not (t.startswith("strip") or t == "rgb") + t for t in transformations if not (t.startswith("strip") or t == "rgb") ] final_transforms = [ - t for t in transformations - if t.startswith("strip") or t == "rgb" + t for t in transformations if t.startswith("strip") or t == "rgb" ] for transform in intermediate_transforms: if transform.startswith("lighten"): - percent = int(re.search(r'\d+', transform).group()) + percent = int(re.search(r"\d+", transform).group()) value = self.adjust_brightness(value, percent) elif transform.startswith("darken"): - percent = int(re.search(r'\d+', transform).group()) + percent = int(re.search(r"\d+", transform).group()) value = self.adjust_brightness(value, -percent) for transform in final_transforms: if transform.startswith("strip"): - value = value.lstrip('#') + value = value.lstrip("#") elif transform == "rgb": value = self.hex_to_rgb(value) @@ -165,24 +184,22 @@ class ColorFormatter: def min_max(v): return min(255, max(0, v)) - hex_color = hex_color.lstrip('#') - r, g, b = (int(hex_color[i:i+2], 16) for i in (0, 2, 4)) + hex_color = hex_color.lstrip("#") + r, g, b = (int(hex_color[i : i + 2], 16) for i in (0, 2, 4)) r = min_max(int(r * (1 + factor / 100))) g = min_max(int(g * (1 + factor / 100))) b = min_max(int(b * (1 + factor / 100))) - return f'#{r:02X}{g:02X}{b:02X}'.lower() + return f"#{r:02X}{g:02X}{b:02X}".lower() def hex_to_rgb(self, hex_color): - hex_color = hex_color.lstrip('#') - r, g, b = (int(hex_color[i:i+2], 16) for i in (0, 2, 4)) - return f'{r},{g},{b}' + hex_color = hex_color.lstrip("#") + r, g, b = (int(hex_color[i : i + 2], 16) for i in (0, 2, 4)) + return f"{r},{g},{b}" def parse_transformations(self, transformations_str): - transformations = re.findall( - r'(\w+)(?:\((\d*)\))?', transformations_str - ) + transformations = re.findall(r"(\w+)(?:\((\d*)\))?", transformations_str) result = [] for command, arg in transformations: if command: @@ -193,7 +210,7 @@ class ColorFormatter: return result def format(self, text): - pattern = r'(<(\w+)(?:\.(.+))?>)' + pattern = r"(<(\w+)(?:\.(.+))?>)" matches = re.findall(pattern, text) result = [] last_end = 0 @@ -201,27 +218,30 @@ class ColorFormatter: for match in matches: full_match, key, transformations_str = match if key in self.color_map: - result.append(text[last_end:text.find(full_match, last_end)]) + result.append(text[last_end : text.find(full_match, last_end)]) value = self.color_map[key] if transformations_str: - transformations = self.parse_transformations( - transformations_str - ) + transformations = self.parse_transformations(transformations_str) value = self.apply_transformations(value, transformations) result.append(value) last_end = text.find(full_match, last_end) + len(full_match) result.append(text[last_end:]) - result = ''.join(result) - pattern = r'<\\\\([^>]+)>' + result = "".join(result) + pattern = r"<\\\\([^>]+)>" - result = re.sub(pattern, r'<\1>', result) + result = re.sub(pattern, r"<\1>", result) return result -def generate_templates(folder: str, output_folder: str, scheme: DynamicScheme, - color_scheme: str, wallpaper: str = ''): +def generate_templates( + folder: str, + output_folder: str, + scheme: DynamicScheme, + color_scheme: str, + wallpaper: str = "", +): if not os.path.exists(output_folder): os.makedirs(output_folder) if not os.path.exists(folder): @@ -234,13 +254,12 @@ def generate_templates(folder: str, output_folder: str, scheme: DynamicScheme, formatter = ColorFormatter(scheme) template = formatter.format(template) template = ( - template - .replace("", color_scheme) + template.replace("", color_scheme) .replace("", output_folder) .replace("", wallpaper) ) new_path = join(output_folder, os.path.basename(file_path)) - with open(new_path, 'w') as f: + with open(new_path, "w") as f: f.write(template) for file in ready_templates: @@ -252,21 +271,17 @@ def generate_templates(folder: str, output_folder: str, scheme: DynamicScheme, hex_color = rgb_to_hex(rgba) rgb_color = rgba_to_rgb(rgba) new_line = ready_templates[file].format( - name=color, - hex=hex_color, - rgb=rgb_color + name=color, hex=hex_color, rgb=rgb_color ) _template += new_line if color in additional: new_line = ready_templates[file].format( - name=additional[color], - hex=hex_color, - rgb=rgb_color + name=additional[color], hex=hex_color, rgb=rgb_color ) _template += new_line new_path = join(output_folder, os.path.basename(file)) - with open(new_path, 'w') as f: + with open(new_path, "w") as f: f.write(_template) @@ -277,9 +292,9 @@ def run_hooks(folder: str): for file_path in file_list: file_name = os.path.basename(file_path) if str(file_name).endswith(".py"): - subprocess.run(['python', '-O', file_path]) + subprocess.run(["python", "-O", file_path]) elif str(file_name).endswith(".sh"): - subprocess.run(['sh', file_path]) + subprocess.run(["sh", file_path]) def process_image(image_path, quality=2, num_colors=128): @@ -287,18 +302,18 @@ def process_image(image_path, quality=2, num_colors=128): global cache_path _cache_path = join(cache_path, "cached_colors") hash_object = hashlib.md5(image_path.encode()) - cache_filename = hash_object.hexdigest() + '.pkl' + cache_filename = hash_object.hexdigest() + ".pkl" os.makedirs(_cache_path, exist_ok=True) return join(_cache_path, cache_filename) def load_from_cache(cache_path): if os.path.exists(cache_path): - with open(cache_path, 'rb') as f: + with open(cache_path, "rb") as f: return pickle.load(f) return None def save_to_cache(cache_path, data): - with open(cache_path, 'wb') as f: + with open(cache_path, "wb") as f: pickle.dump(data, f) cache_path = get_cache_path(image_path) @@ -307,7 +322,7 @@ def process_image(image_path, quality=2, num_colors=128): if cached_result is not None: return cached_result - image = Image.open(image_path).convert('RGB') + image = Image.open(image_path).convert("RGB") image_data = np.array(image) pixel_array = image_data[::quality, ::quality].reshape(-1, 3) @@ -322,9 +337,14 @@ def process_image(image_path, quality=2, num_colors=128): def main( - color_scheme: str, image_path: str, use_color: int | None = None, - scheme: DynamicScheme = schemes["tonalSpot"] + color_scheme: str, + image_path: str, + use_color: int | None = None, + scheme_name: str | None = None, + contrast_level: int = 0, ): + scheme_name = scheme_name or "tonalSpot" + scheme = schemes[scheme_name] is_dark = True if color_scheme == "dark" else False if use_color is None: color = process_image(image_path, 4, 1024) @@ -332,32 +352,31 @@ def main( else: color = use_color - scheme = scheme( - Hct.from_int(color), - is_dark, - 0.0, - ) + scheme = scheme(Hct.from_int(color), is_dark, contrast_level) # for color in vars(MaterialDynamicColors).keys(): # color_name = getattr(MaterialDynamicColors, color) # if hasattr(color_name, "get_hct"): # print(color, rgb_to_hex(color_name.get_hct(scheme).to_rgba())) - with open(join(cache_path, "colors.json"), 'w') as f: - object = ColorsCache(scheme, image_path, color) + with open(join(cache_path, "colors.json"), "w") as f: + object = ColorsCache(scheme, image_path, color, contrast_level, scheme_name) json.dump(colors_dict(object), f, indent=2) generate_templates( f"{script_dir}/templates", cache_path, scheme, color_scheme, image_path ) generate_templates( - f"{script_dir}/templates/svg", join(cache_path, "svg/"), scheme, - color_scheme, image_path + f"{script_dir}/templates/svg", + join(cache_path, "svg/"), + scheme, + color_scheme, + image_path, ) if is_dark: - subprocess.run(['sh', join(script_dir, 'gtk-material.sh')]) + subprocess.run(["sh", join(script_dir, "gtk-material.sh")]) else: - subprocess.run(['sh', join(script_dir, 'gtk-material.sh'), '--light']) + subprocess.run(["sh", join(script_dir, "gtk-material.sh"), "--light"]) run_hooks(join(script_dir, "hooks")) @@ -365,26 +384,27 @@ def main( def _argparse() -> tuple[bool, bool, str, str, str, str]: parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group(required=True) + group.add_argument("-R", help="Restore previous colorscheme.", action="store_true") group.add_argument( - "-R", help="Restore previous colorscheme.", action='store_true' - ) - group.add_argument( - "-w", help="Use last used wallpaper for color generation.", - action='store_true' - ) - group.add_argument( - "--image", type=str, help="Image for color scheme generation" + "-w", help="Use last used wallpaper for color generation.", action="store_true" ) + group.add_argument("--image", type=str, help="Image for color scheme generation") group.add_argument( "--color", type=str, help="Main color for color scheme generation" ) parser.add_argument( - '--color-scheme', type=str, default='dark', choices=['dark', 'light'], - help="Color scheme variant" + "--color-scheme", + type=str, + default="dark", + choices=["dark", "light"], + help="Color scheme variant", ) parser.add_argument( - '--scheme', type=str, default="tonalSpot", - choices=list(schemes.keys()), help="Scheme for color generation" + "--scheme", + type=str, + default="", + choices=list(schemes.keys()), + help="Scheme for color generation", ) args = parser.parse_args() @@ -396,51 +416,71 @@ def _argparse() -> tuple[bool, bool, str, str, str, str]: use_color = args.color scheme = args.scheme return ( - restore_palette, use_last_used_wallpaper, image, - color_scheme, use_color, scheme + restore_palette, + use_last_used_wallpaper, + image, + color_scheme, + use_color, + scheme, ) def _main(): ( - restore_palette, use_last_used_wallpaper, image, - color_scheme, use_color, _scheme + restore_palette, + use_last_used_wallpaper, + image, + color_scheme, + use_color, + scheme, ) = _argparse() - scheme = schemes[_scheme] + if not scheme: + scheme = None if use_color is not None: try: with open(join(cache_path, "colors.json")) as f: content = get_cache_object(f.read()) main( - color_scheme, image_path=content.wallpaper, - use_color=int(use_color.lstrip('#'), 16), scheme=scheme + color_scheme, + image_path=content.wallpaper, + use_color=int(use_color.lstrip("#"), 16), + scheme_name=scheme, ) except Exception: main( - color_scheme, image_path="/dev/null", - use_color=int(use_color.lstrip('#'), 16), scheme=scheme + color_scheme, + image_path="/dev/null", + use_color=int(use_color.lstrip("#"), 16), + scheme_name=scheme, ) elif restore_palette: with open(join(cache_path, "colors.json")) as f: content = get_cache_object(f.read()) main( - color_scheme, image_path=content.wallpaper, - use_color=content.original_color, scheme=scheme + color_scheme, + image_path=content.wallpaper, + use_color=content.original_color, + scheme_name=scheme or content.scheme_name, + contrast_level=content.contrast_level, ) elif use_last_used_wallpaper: with open(join(cache_path, "colors.json")) as f: - content = get_cache_object(f.read()).wallpaper - main(color_scheme, image_path=content, scheme=scheme) + content = get_cache_object(f.read()) + main( + color_scheme, + image_path=content.wallpaper, + scheme_name=scheme or content.scheme_name, + contrast_level=content.contrast_level, + ) else: if os.path.isdir(image): files = [ - f for f in os.listdir(image) - if f.endswith(('.png', '.jpg', '.jpeg')) + f for f in os.listdir(image) if f.endswith((".png", ".jpg", ".jpeg")) ] if files: image = join(image, random.choice(files)) - main(color_scheme, image_path=image, scheme=scheme) + main(color_scheme, image_path=image, scheme_name=scheme) if __name__ == "__main__": diff --git a/config/material-colors/templates/alacritty-dark.toml b/config/material-colors/templates/alacritty-dark.toml deleted file mode 100644 index f870c92f..00000000 --- a/config/material-colors/templates/alacritty-dark.toml +++ /dev/null @@ -1,72 +0,0 @@ -[colors.primary] -background = '' -foreground = '' - - -[colors.cursor] -text = '#1E1E2E' -cursor = '#F5E0DC' - -[colors.vi_mode_cursor] -text = '#1E1E2E' -cursor = '#B4BEFE' - - -[colors.search.matches] -foreground = '#1E1E2E' -background = '#A6ADC8' - -[colors.search.focused_match] -foreground = '#1E1E2E' -background = '#A6E3A1' - -[colors.footer_bar] -foreground = '#1E1E2E' -background = '#A6ADC8' - - -[colors.hints.start] -foreground = '#1E1E2E' -background = '#F9E2AF' - -[colors.hints.end] -foreground = '#1E1E2E' -background = '#A6ADC8' - - -[colors.selection] -text = '#1E1E2E' -background = '#F5E0DC' - - -[colors.normal] -black = '#45475A' -red = '#F38BA8' -green = '#A6E3A1' -yellow = '#F9E2AF' -blue = '#89B4FA' -magenta = '#F5C2E7' -cyan = '#94E2D5' -white = '#BAC2DE' - - -[colors.bright] -black = '#585B70' -red = '#F38BA8' -green = '#A6E3A1' -yellow = '#F9E2AF' -blue = '#89B4FA' -magenta = '#F5C2E7' -cyan = '#94E2D5' -white = '#A6ADC8' - - -[colors.dim] -black = '#45475A' -red = '#F38BA8' -green = '#A6E3A1' -yellow = '#F9E2AF' -blue = '#89B4FA' -magenta = '#F5C2E7' -cyan = '#94E2D5' -white = '#BAC2DE' \ No newline at end of file diff --git a/config/material-colors/templates/alacritty-light.toml b/config/material-colors/templates/alacritty-light.toml deleted file mode 100644 index 533fecf0..00000000 --- a/config/material-colors/templates/alacritty-light.toml +++ /dev/null @@ -1,72 +0,0 @@ -[colors.primary] -background = '' -foreground = '' - - -[colors.cursor] -text = '#EFF1F5' -cursor = '#DC8A78' - -[colors.vi_mode_cursor] -text = '#EFF1F5' -cursor = '#7287FD' - - -[colors.search.matches] -foreground = '#EFF1F5' -background = '#6C6F85' - -[colors.search.focused_match] -foreground = '#EFF1F5' -background = '#40A02B' - -[colors.footer_bar] -foreground = '#EFF1F5' -background = '#6C6F85' - - -[colors.hints.start] -foreground = '#EFF1F5' -background = '#DF8E1D' - -[colors.hints.end] -foreground = '#EFF1F5' -background = '#6C6F85' - - -[colors.selection] -text = '#EFF1F5' -background = '#DC8A78' - - -[colors.normal] -black = '#5C5F77' -red = '#D20F39' -green = '#40A02B' -yellow = '#DF8E1D' -blue = '#1E66F5' -magenta = '#EA76CB' -cyan = '#179299' -white = '#ACB0BE' - - -[colors.bright] -black = '#6C6F85' -red = '#D20F39' -green = '#40A02B' -yellow = '#DF8E1D' -blue = '#1E66F5' -magenta = '#EA76CB' -cyan = '#179299' -white = '#BCC0CC' - - -[colors.dim] -black = '#5C5F77' -red = '#D20F39' -green = '#40A02B' -yellow = '#DF8E1D' -blue = '#1E66F5' -magenta = '#EA76CB' -cyan = '#179299' -white = '#ACB0BE' \ No newline at end of file diff --git a/config/material-colors/templates/alacritty.toml b/config/material-colors/templates/alacritty.toml deleted file mode 100644 index ea81e141..00000000 --- a/config/material-colors/templates/alacritty.toml +++ /dev/null @@ -1,9 +0,0 @@ -import = [ - "/alacritty-.toml" -] -[font] -normal = { family = "MesloLGS NF", style = "Regular" } -bold = { family = "MesloLGS NF", style = "Bold" } -italic = { family = "MesloLGS NF", style = "Italic" } -bold_italic = { family = "MesloLGS NF", style = "Bold Italic" } -size = 12.0 diff --git a/config/material-colors/templates/colors-kitty.conf b/config/material-colors/templates/colors-kitty.conf new file mode 100644 index 00000000..eeebd865 --- /dev/null +++ b/config/material-colors/templates/colors-kitty.conf @@ -0,0 +1,27 @@ +foreground +background +cursor + +color0 +color8 + +color1 +color9 + +color2 +color10 + +color3 +color11 + +color4 +color12 + +color5 +color13 + +color6 +color14 + +color7 +color15 \ No newline at end of file diff --git a/config/material-colors/templates/hyprlock.conf b/config/material-colors/templates/hyprlock.conf index e7a518f5..c4c20a41 100644 --- a/config/material-colors/templates/hyprlock.conf +++ b/config/material-colors/templates/hyprlock.conf @@ -1,103 +1,172 @@ -general { - grace = 5 - hide_cursor = true - ignore_empty_input = true - text_trim = true -} +# Configuration + # (general settings) + general { + grace = 2 + hide_cursor = true + ignore_empty_input = true + text_trim = true + } + # (background config) + background { + monitor = + path = ~/.cache/current_wallpaper.png # only png supported for now + color = rgba(, 1.0) + blur_passes = 3 # 0 disables blurring + blur_size = 1 + noise = 0.01 + contrast = 0.8916 + brightness = 0.7 + vibrancy = 0.1696 + vibrancy_darkness = 0.0 + } +# -background { - monitor = - path = ~/.cache/current_wallpaper.png # only png supported for now - color = rgba(, 1.0) - blur_passes = 3 # 0 disables blurring - blur_size = 1 - noise = 0.01 - contrast = 0.8916 - brightness = 0.7 - vibrancy = 0.1696 - vibrancy_darkness = 0.0 -} +# Password input + input-field { + monitor = + size = 225, 50 + outline_thickness = 3 + dots_size = 0.33 + dots_spacing = 0.45 + dots_center = true + dots_rounding = -1 + outer_color = rgba(0,0,0,0) + inner_color = rgba(0,0,0,0) + font_color = rgba(, 1.0) + fade_on_empty = false + fade_timeout = 1000 + font_family = Product Sans + placeholder_text = + hide_input = false + rounding = 4 + check_color = rgba(0,0,0,0) + fail_color = rgba(0,0,0,0) + fail_text = $FAIL ($ATTEMPTS) + fail_transition = 200 + capslock_color = -1 + numlock_color = -1 + bothlock_color = -1 + invert_numlock = false + swap_font_color = false + position = 0, 150 + halign = center + valign = bottom + } +# -input-field { - monitor = - size = 200, 50 - outline_thickness = 3 - dots_size = 0.33 - dots_spacing = 0.15 - dots_center = true - dots_rounding = -1 - outer_color = rgb() - inner_color = rgb() - font_color = rgb() - fade_on_empty = false - fade_timeout = 1000 - font_family = Product Sans - placeholder_text = $USER - hide_input = false - rounding = 4 - check_color = rgb() - fail_color = rgb() - fail_text = $FAIL ($ATTEMPTS) - fail_transition = 200 - capslock_color = -1 - numlock_color = -1 - bothlock_color = -1 - invert_numlock = false - swap_font_color = false - position = 0, 70 - halign = center - valign = bottom -} -# DATE -label { - monitor = - text = cmd[update:1000] echo -e "$(date +"%d %b %A")" - color = rgba(, 1.0) - font_size = 14 - font_family = JetBrains Mono Nerd Font Mono ExtraBold - position = 0, -130 - halign = center - valign = center -} +# Time + # (hours) + label { + monitor = + text = cmd[update:1000] echo -e "$(date +"%H")" + color = rgba(, 1.0) + shadow_pass = 2 + shadow_size = 3 + shadow_color = rgb(0,0,0) + shadow_boost = 1.2 + font_size = 150 + font_family = Product Sans Light + position = 0, 90 + halign = center + valign = center + } + # (minutes) + label { + monitor = + text = cmd[update:1000] echo -e "$(date +"%M")" + color = rgba(, 1.0) + font_size = 150 + font_family = Product Sans Light + position = 0, -90 + halign = center + valign = center + } +# -# TIME HR -label { - monitor = - text = cmd[update:1000] echo -e "$(date +"%H")" - color = rgba(, 1.0) - shadow_pass = 2 - shadow_size = 3 - shadow_color = rgb(0,0,0) - shadow_boost = 1.2 - font_size = 150 - font_family = Product Sans Semibold - position = 0, -250 - halign = center - valign = top -} +# Date + # (label) + label { + monitor = + text = cmd[update:1000] echo -e "$(date +"%A, %B %d")" + color = rgba(, 1.0) + font_size = 15 + font_family = Product Sans Medium + position = 100, -75 + shadow_passes = 5 + shadow_size = 10 + halign = left + valign = top + } + # (icon) + label { + monitor = + text = calendar_today + color = rgba(, 1.0) + font_size = 15 + font_family = Material Symbols Outlined + position = 75, -75 + shadow_passes = 5 + shadow_size = 10 + halign = left + valign = top + } +# -# TIME -label { - monitor = - text = cmd[update:1000] echo -e "$(date +"%M")" - color = rgba(, 1.0) - font_size = 150 - font_family = Product Sans Semibold - position = 0, -420 - halign = center - valign = top -} +# Input layout + # (label) + label { + monitor = + text = $LAYOUT + color = rgba(, 1.0) + font_size = 15 + font_family = Product Sans Medium + position = 100, -110 + shadow_passes = 5 + shadow_size = 10 + halign = left + valign = top + } + # (icon) + label { + monitor = + text = keyboard + color = rgba(, 1.0) + font_size = 15 + font_family = Material Symbols Outlined + position = 75, -112 + shadow_passes = 5 + shadow_size = 10 + halign = left + valign = top + } +# -label { - monitor = - text = $LAYOUT - color = rgba(, 1.0) - font_size = 10 - font_family = Product Sans Semibold - position = 0, 130 - halign = center - valign = bottom - shadow_passes = 5 - shadow_size = 10 -} +# Battery + # (label) + label { + monitor = + text = cmd[update:1000] . ~/dotfiles/hypr/scripts/battery.sh status + color = rgba(, 1.0) + font_size = 15 + font_family = Product Sans Medium + position = 100, -145 + shadow_passes = 5 + shadow_size = 10 + halign = left + valign = top + } + # (icon) + label { + monitor = + text = cmd[update:1000] . ~/dotfiles/hypr/scripts/battery.sh icon + color = rgba(, 1.0) + font_size = 15 + font_family = Material Symbols Outlined + position = 78, -145 + shadow_passes = 5 + shadow_size = 10 + halign = left + valign = top + } +# diff --git a/config/material-colors/templates/material-discord.scss b/config/material-colors/templates/material-discord.scss index 7c8d1131..ca6cc513 100644 --- a/config/material-colors/templates/material-discord.scss +++ b/config/material-colors/templates/material-discord.scss @@ -1,11 +1,14 @@ +@use "sass:color"; + @import url(https://capnkitten.github.io/BetterDiscord/Themes/Material-Discord/css/source.css); @import "/colors.scss"; + $color-scheme: ; -$hue: round(hue($primary)); -$saturation: round(saturation($primary)); -$lightness: round(lightness($primary)); +$hue: round(color.channel($primary, "hue", $space: hsl)); +$saturation: round(color.channel($primary, "saturation", $space: hsl)); +$lightness: round(color.channel($primary, "lightness", $space: hsl)); * { transition: color 0.2s ease-in-out; @@ -50,3 +53,4 @@ $lightness: round(lightness($primary)); [class*="userPopoutOuter_"] { border-radius: 16px !important; } +