From 162399ad8aa7e943977df4d7d569bd756ee18758 Mon Sep 17 00:00:00 2001 From: ryan4yin Date: Sun, 7 May 2023 19:57:25 +0800 Subject: [PATCH] feat: update hyprland's startup script to reduce start duration, update gtk theme configs --- flake.lock | 6 +++--- home/hyprland/default.nix | 5 +++++ home/hyprland/gtk-3.0/settings.ini | 16 ++++++++++++++++ home/hyprland/gtkrc-2.0 | 19 +++++++++++++++++++ home/hyprland/hypr-conf/scripts/gtkthemes | 19 ------------------- home/hyprland/hypr-conf/scripts/startup | 8 +------- modules/system.nix | 2 ++ 7 files changed, 46 insertions(+), 29 deletions(-) create mode 100644 home/hyprland/gtk-3.0/settings.ini create mode 100644 home/hyprland/gtkrc-2.0 delete mode 100755 home/hyprland/hypr-conf/scripts/gtkthemes diff --git a/flake.lock b/flake.lock index 4d2cc084..ab979a5c 100644 --- a/flake.lock +++ b/flake.lock @@ -62,11 +62,11 @@ ] }, "locked": { - "lastModified": 1683456233, - "narHash": "sha256-BUclM2YmS0rpkSlHSvJ+5aWTu+OcjFiI4iIMRt9qCuI=", + "lastModified": 1683459775, + "narHash": "sha256-Ab1pIKOj7XRZbJAv4g9937ElhaZF7Pob3hqGTDKt5w8=", "owner": "nix-community", "repo": "home-manager", - "rev": "990b82ecd31f6372bc4c3f39a9171961bc370a22", + "rev": "6fc82e56971523acfe1a61dbcb20f4bb969b3990", "type": "github" }, "original": { diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index 028c3e59..0afe7b3f 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -9,6 +9,11 @@ # copy the scripts directory recursively recursive = true; }; + home.file.".config/gtk-3.0" = { + source = ./gtk-3.0; + recursive = true; + }; + home.file.".gtkrc-2.0".source = ./gtkrc-2.0; home.file.".config/hypr/wallpapers/wallpaper.png".source = ../wallpapers/wallpaper.png; # allow fontconfig to discover fonts and configurations installed through home.packages diff --git a/home/hyprland/gtk-3.0/settings.ini b/home/hyprland/gtk-3.0/settings.ini new file mode 100644 index 00000000..ff698632 --- /dev/null +++ b/home/hyprland/gtk-3.0/settings.ini @@ -0,0 +1,16 @@ +[Settings] +gtk-theme-name=Arc-Dark +gtk-icon-theme-name=Qogir-dark +gtk-font-name=Noto Sans 10 +gtk-cursor-theme-name=Qogir-dark +gtk-cursor-theme-size=0 +gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-button-images=0 +gtk-menu-images=0 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=1 +gtk-xft-hinting=1 +gtk-xft-hintstyle=hintmedium +gtk-xft-rgba=rgb \ No newline at end of file diff --git a/home/hyprland/gtkrc-2.0 b/home/hyprland/gtkrc-2.0 new file mode 100644 index 00000000..87142647 --- /dev/null +++ b/home/hyprland/gtkrc-2.0 @@ -0,0 +1,19 @@ +# DO NOT EDIT! This file will be overwritten by LXAppearance. +# Any customization should be done in ~/.gtkrc-2.0.mine instead. + +include "~/.gtkrc-2.0.mine" +gtk-theme-name="Arc-Dark" +gtk-icon-theme-name="Qogir-dark" +gtk-font-name="Noto Sans 10" +gtk-cursor-theme-name="Qogir-dark" +gtk-cursor-theme-size=0 +gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-button-images=0 +gtk-menu-images=0 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=1 +gtk-xft-hinting=1 +gtk-xft-hintstyle="hintmedium" +gtk-xft-rgba="rgb" \ No newline at end of file diff --git a/home/hyprland/hypr-conf/scripts/gtkthemes b/home/hyprland/hypr-conf/scripts/gtkthemes deleted file mode 100755 index 8be7251d..00000000 --- a/home/hyprland/hypr-conf/scripts/gtkthemes +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -## Set GTK Themes, Icons, Cursor and Fonts - -THEME='Arc-Dark' -ICONS='Zafiro-Blue' -FONT='Noto Sans 9' -CURSOR='Qogirr' - -SCHEMA='gsettings set org.gnome.desktop.interface' - -apply_themes () { - ${SCHEMA} gtk-theme "$THEME" - ${SCHEMA} icon-theme "$ICONS" - ${SCHEMA} cursor-theme "$CURSOR" - ${SCHEMA} font-name "$FONT" -} - -apply_themes diff --git a/home/hyprland/hypr-conf/scripts/startup b/home/hyprland/hypr-conf/scripts/startup index b5178059..253df8f0 100755 --- a/home/hyprland/hypr-conf/scripts/startup +++ b/home/hyprland/hypr-conf/scripts/startup @@ -3,22 +3,16 @@ ## Autostart Programs # Kill already running process -_ps=(waybar mako mpd xfce-polkit) +_ps=(waybar mako mpd) for _prs in "${_ps[@]}"; do if [[ $(pidof ${_prs}) ]]; then killall -9 ${_prs} fi done -# Polkit agent -/usr/lib/xfce-polkit/xfce-polkit & - # Set wallpaper swaybg --output '*' --mode fill --image ~/.config/hypr/wallpapers/wallpaper.png & -# Apply themes -~/.config/hypr/scripts/gtkthemes & - # Lauch notification daemon (mako) ~/.config/hypr/scripts/notifications & diff --git a/modules/system.nix b/modules/system.nix index 48becbf4..ecd5359d 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -50,6 +50,8 @@ ];}) (pkgs.callPackage ../fonts/icomoon-feather-icon-font.nix { }) + + # arch linux icon, used temporarily in waybar (pkgs.callPackage ../fonts/archcraft-icon-font.nix { }) ];