From 4c0cc1237afb49c5802fefb46be3b81f3b3550d6 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 2 Mar 2024 22:35:43 +0700 Subject: [PATCH] hyprland: add custom config sourcing --- .config/hypr/custom/env.conf | 2 ++ .config/hypr/custom/execs.conf | 2 ++ .config/hypr/custom/general.conf | 2 ++ .config/hypr/custom/keybinds.conf | 2 ++ .config/hypr/custom/rules.conf | 3 +++ .config/hypr/hyprland.conf | 26 +++++++++++++++++++------- .config/hypr/hyprland/general.conf | 13 ++----------- .config/hypr/hyprland/keybinds.conf | 7 +++---- .config/hypr/hyprland/rules.conf | 1 + .config/hypr/hyprlock/status.sh | 13 ++++++++++--- 10 files changed, 46 insertions(+), 25 deletions(-) create mode 100644 .config/hypr/custom/env.conf create mode 100644 .config/hypr/custom/execs.conf create mode 100644 .config/hypr/custom/general.conf create mode 100644 .config/hypr/custom/keybinds.conf create mode 100644 .config/hypr/custom/rules.conf diff --git a/.config/hypr/custom/env.conf b/.config/hypr/custom/env.conf new file mode 100644 index 00000000..4390ed4f --- /dev/null +++ b/.config/hypr/custom/env.conf @@ -0,0 +1,2 @@ +## You can put extra environment variables here +## https://wiki.hyprland.org/Configuring/Environment-variables/ diff --git a/.config/hypr/custom/execs.conf b/.config/hypr/custom/execs.conf new file mode 100644 index 00000000..cae4ef6c --- /dev/null +++ b/.config/hypr/custom/execs.conf @@ -0,0 +1,2 @@ +# You can make apps auto-start here +# Relevant Hyprland wiki section: https://wiki.hyprland.org/Configuring/Keywords/#executing diff --git a/.config/hypr/custom/general.conf b/.config/hypr/custom/general.conf new file mode 100644 index 00000000..f88b956b --- /dev/null +++ b/.config/hypr/custom/general.conf @@ -0,0 +1,2 @@ +## Put general config stuff here +## Here's a list of every variable: https://wiki.hyprland.org/Configuring/Variables/ \ No newline at end of file diff --git a/.config/hypr/custom/keybinds.conf b/.config/hypr/custom/keybinds.conf new file mode 100644 index 00000000..fb337e90 --- /dev/null +++ b/.config/hypr/custom/keybinds.conf @@ -0,0 +1,2 @@ +## You can put your preferred keybinds here +## https://wiki.hyprland.org/Configuring/Binds/ \ No newline at end of file diff --git a/.config/hypr/custom/rules.conf b/.config/hypr/custom/rules.conf new file mode 100644 index 00000000..870a1143 --- /dev/null +++ b/.config/hypr/custom/rules.conf @@ -0,0 +1,3 @@ +## You can put custom rules here +## Window/layer rules: https://wiki.hyprland.org/Configuring/Window-Rules/ +## Workspace rules: https://wiki.hyprland.org/Configuring/Workspace-Rules/ diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index dc56d1c1..2a8706bb 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -1,12 +1,24 @@ -# General customization options -source=~/.config/hypr/hyprland/general.conf -# Environment variables +# This file sources other files in `hyprland` and `custom` folders +# You wanna add your stuff in file in `custom` + +# Defaults source=~/.config/hypr/hyprland/env.conf -# Startup executions, Auto-run stuff source=~/.config/hypr/hyprland/execs.conf -# Window and layer rules +source=~/.config/hypr/hyprland/general.conf source=~/.config/hypr/hyprland/rules.conf -# Dynamic colors source=~/.config/hypr/hyprland/colors.conf -# Keybinds variables source=~/.config/hypr/hyprland/keybinds.conf + +# Custom +source=~/.config/hypr/custom/env.conf +source=~/.config/hypr/custom/execs.conf +source=~/.config/hypr/custom/general.conf +source=~/.config/hypr/custom/rules.conf +source=~/.config/hypr/custom/keybinds.conf + +# Why is this even here?? cuz 🤓 +debug { + # overlay = true # Show fps n stuff + # damage_tracking = 0 + # damage_blink = yes +} diff --git a/.config/hypr/hyprland/general.conf b/.config/hypr/hyprland/general.conf index 1949f675..496406cf 100644 --- a/.config/hypr/hyprland/general.conf +++ b/.config/hypr/hyprland/general.conf @@ -1,7 +1,8 @@ # MONITOR CONFIG monitor=,preferred,auto,1 -monitor=,addreserved, 0, 0, 0, 0 +# monitor=,addreserved, 0, 0, 0, 0 # Custom reserved area +# HDMI port: mirror display. To see device name, use `hyprctl monitors` # monitor=HDMI-A-1,1920x1080@60,1920x0,1,mirror,eDP-1 input { @@ -138,13 +139,3 @@ misc { new_window_takes_over_fullscreen = 2 } -debug { - # overlay = true - # damage_tracking = 0 - - # damage_blink = yes -} - -# Window and layer rules -layerrule = noanim, selection -windowrulev2=rounding 20, onworkspace:1 diff --git a/.config/hypr/hyprland/keybinds.conf b/.config/hypr/hyprland/keybinds.conf index 6b099477..1951e77c 100644 --- a/.config/hypr/hyprland/keybinds.conf +++ b/.config/hypr/hyprland/keybinds.conf @@ -37,7 +37,7 @@ bind = Control+Shift+Alt, Delete, exec, pkill wlogout || wlogout -p layer-shell bind = Control+Shift+Alt+Super, Delete, exec, systemctl poweroff # Screenshot, Record, OCR, Color picker, Clipboard history -bind = Super+Shift+Alt, S, exec, grim -g $(slurp $SLURP_ARGS) - | swappy -f - +bind = Super+Shift+Alt, S, exec, grim -g $(slurp) - | swappy -f - bindl=,Print,exec,grim - | wl-copy bind = Super+Shift, S, exec, ~/.config/ags/scripts/grimblast.sh --freeze copy area bind = Super+Alt, R, exec, ~/.config/ags/scripts/record-script.sh @@ -99,9 +99,8 @@ bind = Control+Super, O, exec, hyprctl plugin unload "~/.config/hypr/plugins/dro ## Testing # bind = SuperAlt, f12, exec, notify-send "Hyprland version: $(hyprctl version | head -2 | tail -1 | cut -f2 -d ' ')" "owo" -a 'Hyprland keybind' # bind = Super+Alt, f12, exec, notify-send "Millis since epoch" "$(date +%s%N | cut -b1-13)" -a 'Hyprland keybind' -bind = Super+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 = Super+Alt, Equal, exec, notify-send "Urgent notification" "Ah hell no" -u critical -a 'Hyprland keybind' -bind = Super+Alt, Equal, exec, notify-send 'hmm' ${SLURP_ARGS} +bind = Super+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" -t 5000 +bind = Super+Alt, Equal, exec, notify-send "Urgent notification" "Ah hell no" -u critical -a 'Hyprland keybind' ############################ Keybinds for Hyprland ############################ # Swap windows diff --git a/.config/hypr/hyprland/rules.conf b/.config/hypr/hyprland/rules.conf index 996fa2fd..99ef146c 100644 --- a/.config/hypr/hyprland/rules.conf +++ b/.config/hypr/hyprland/rules.conf @@ -1,5 +1,6 @@ ######## Window rules ######## windowrule = noblur,.* # Disables blur for windows. Substantially improves performance. +layerrule = noanim, selection # windowrule = opacity 0.89 override 0.89 override, .* # Applies transparency to EVERY WINDOW windowrule = float, ^(steam)$ diff --git a/.config/hypr/hyprlock/status.sh b/.config/hypr/hyprlock/status.sh index 794c468f..dd806337 100755 --- a/.config/hypr/hyprlock/status.sh +++ b/.config/hypr/hyprlock/status.sh @@ -2,21 +2,28 @@ ############ Variables ############ enable_battery=false +battery_charging=false ####### Check availability ######## for battery in /sys/class/power_supply/*BAT*; do if [[ -f "$battery/uevent" ]]; then enable_battery=true + if [[ $(cat /sys/class/power_supply/*/status | head -1) == "Charging" ]]; then + battery_charging=true + fi break fi done ############# Output ############# if [[ $enable_battery == true ]]; then - if [[ $(cat /sys/class/power_supply/*/status | head -1) == "Charging" ]]; then + if [[ $battery_charging == true ]]; then echo -n "(+) " - fi - echo -n "$(cat /sys/class/power_supply/*/capacity | head -1)"% remaining + fi + echo -n "$(cat /sys/class/power_supply/*/capacity | head -1)"% + if [[ $battery_charging == false ]]; then + echo -n " remaining" + fi fi echo '' \ No newline at end of file