From 377fd1081891ae9277693f5bfd1b778b53736e9b Mon Sep 17 00:00:00 2001 From: Frost-Phoenix <67cyril6767@gmail.com> Date: Fri, 10 Nov 2023 20:38:11 +0100 Subject: [PATCH] change hyprland congif (change bg utils && startup procedure) --- modules/home/hyprland/config.nix | 11 +++-- modules/home/hyprland/hyprland.nix | 5 +- modules/home/scripts/default.nix | 74 +++++++----------------------- modules/home/scripts/toggle_layout | 19 -------- 4 files changed, 26 insertions(+), 83 deletions(-) delete mode 100755 modules/home/scripts/toggle_layout diff --git a/modules/home/hyprland/config.nix b/modules/home/hyprland/config.nix index 7f6ab14..5bb9053 100644 --- a/modules/home/hyprland/config.nix +++ b/modules/home/hyprland/config.nix @@ -8,16 +8,17 @@ in extraConfig = " $mainMod = SUPER - monitor = ,highrr,auto,1 - monitor = ,highres,auto,1 + monitor=,preferred,auto,auto + monitor=,1920x1200,auto,auto # autostart exec-once = hyprctl setcursor Catppuccin-Frappe-Dark 15 exec-once = systemctl --user import-environment & exec-once = hash dbus-update-activation-environment 2>/dev/null & exec-once = dbus-update-activation-environment --systemd & - exec-once = swww init && swaylock && load-env - exec-once = wl-paste --type text --watch cliphist store && wl-paste --type image --watch cliphist store && mako & + exec-once = swaybg -m fill -i ~/Pictures/wallpapers/wallpaper.png && swaylock + # exec-once = + exec-once = mako & exec-once = waybar & input { @@ -129,7 +130,7 @@ in bind = $mainMod, D, exec, pkill wofi || wofi --show drun bind = $mainMod, Escape, exec, swaylock bind = $mainMod, Suppr, exec, pkill wlogout || wlogout -b 4 - bind = SUPER, V, exec, cliphist list | wofi -dmenu | cliphist decode | wl-copy + # bind = SUPER, V, exec, cliphist list | wofi -dmenu | cliphist decode | wl-copy bind = $mainMod, P, pseudo, bind = $mainMod, J, togglesplit, bind = $mainMod, E, exec, thunar diff --git a/modules/home/hyprland/hyprland.nix b/modules/home/hyprland/hyprland.nix index 6ffbc1c..c74c9a8 100644 --- a/modules/home/hyprland/hyprland.nix +++ b/modules/home/hyprland/hyprland.nix @@ -1,7 +1,8 @@ { inputs, pkgs, ...}: { home.packages = with pkgs; [ - swww + # swww + swaybg inputs.hypr-contrib.packages.${pkgs.system}.grimblast hyprpicker wofi @@ -10,7 +11,7 @@ grim slurp wl-clipboard - cliphist + # cliphist wf-recorder glib wayland diff --git a/modules/home/scripts/default.nix b/modules/home/scripts/default.nix index 4dc229d..29f70ec 100644 --- a/modules/home/scripts/default.nix +++ b/modules/home/scripts/default.nix @@ -1,25 +1,16 @@ {pkgs, ...}: let wall-change = pkgs.writeShellScriptBin "wall-change" '' - swww img $1 --transition-type random --transition-pos "$(hyprctl cursorpos)" --transition-duration 3 + swaybg -m fill -i $1 ''; - load-env = pkgs.writeShellScriptBin "load-env" '' - bash ~/.local/bin/env/animation - bash ~/.local/bin/env/layout - bash ~/.local/bin/env/opacity - bash ~/.local/bin/env/blur - bash ~/.local/bin/env/wallpaper - ''; - toggle-animation = pkgs.writeShellScriptBin "toggle-animation" '' - blur_val=$(hyprctl getoption animations:enabled | grep int) - echo "$blur_val" - if [[ "$blur_val" == " int: 1" ]]; then - rm -rf ~/.local/bin/env/animation - echo "hyprctl --batch 'keyword animations:enabled 0'" > ~/.local/bin/env/animation - hyprctl --batch "keyword animations:enabled 0" + wallpaper-picker = pkgs.writeShellScriptBin "wallpaper-picker" '' + wallpaper_folder=$HOME/Pictures/wallpapers + wallpaper_location="$(ls $wallpaper_folder | wofi -n --show dmenu)" + if [[ -d $wallpaper_folder/$wallpaper_location ]]; then + wallpaper_temp="$wallpaper_location" + elif [[ -f $wallpaper_folder/$wallpaper_location ]]; then + wall-change $wallpaper_folder/$wallpaper_temp/$wallpaper_location else - rm -rf ~/.local/bin/env/animation - echo "hyprctl --batch 'keyword animations:enabled 1'" > ~/.local/bin/env/animation - hyprctl --batch "keyword animations:enabled 1" + exit 1 fi ''; push = pkgs.writeShellScriptBin "push" '' @@ -33,53 +24,22 @@ echo "Git wasn't initialized here." fi ''; - toggle-blur = pkgs.writeShellScriptBin "toggle-blur" '' - blur_val=$(hyprctl getoption decoration:blur | grep int) - echo "$blur_val" - if [[ "$blur_val" == " int: 1" ]]; then - rm -rf ~/.local/bin/env/blur - echo "hyprctl --batch 'keyword decoration:blur 0'" > ~/.local/bin/env/blur - hyprctl --batch "keyword decoration:blur 0" + push = pkgs.writeShellScriptBin "commit" '' + git_directory=$PWD/.git + if [[ -d $git_directory ]];then + git add . + read -p "Enter commit name: " commit_name + git commit -m "$commit_name" else - rm -rf ~/.local/bin/env/blur - echo "hyprctl --batch 'keyword decoration:blur 1'" > ~/.local/bin/env/blur - hyprctl --batch "keyword decoration:blur 1" - fi - ''; - toggle-opacity = pkgs.writeShellScriptBin "toggle-opacity" '' - opacity_val=$(hyprctl getoption decoration:active_opacity | grep float) - echo "$opacity_val" - if [[ "$opacity_val" == " float: 0.850000" ]]; then - rm -rf ~/.local/bin/env/opacity - echo "hyprctl --batch 'keyword decoration:active_opacity 1.0 ; keyword decoration:inactive_opacity 1.0 ; keyword decoration:fullscreen_opacity 1.0'" > ~/.local/bin/env/opacity - hyprctl --batch "keyword decoration:active_opacity 1.0 ; keyword decoration:inactive_opacity 1.0 ; keyword decoration:fullscreen_opacity 1.0" - else - rm -rf ~/.local/bin/env/opacity - echo "hyprctl --batch 'keyword decoration:active_opacity 0.8500 ; keyword decoration:inactive_opacity 0.76 ; keyword decoration:fullscreen_opacity 1.0'" > ~/.local/bin/env/opacity - hyprctl --batch "keyword decoration:active_opacity 0.8500 ; keyword decoration:inactive_opacity 0.76 ; keyword decoration:fullscreen_opacity 1.0" - fi - ''; - wallpaper-picker = pkgs.writeShellScriptBin "wallpaper-picker" '' - wallpaper_folder=$HOME/Pictures/wallpapers - wallpaper_location="$(ls $wallpaper_folder | wofi -n --show dmenu)" - if [[ -d $wallpaper_folder/$wallpaper_location ]]; then - wallpaper_temp="$wallpaper_location" - elif [[ -f $wallpaper_folder/$wallpaper_location ]]; then - wall-change $wallpaper_folder/$wallpaper_temp/$wallpaper_location - else - exit 1 + echo "Git wasn't initialized here." fi ''; in { - home.file.".local/bin/toggle_layout".source = ./toggle_layout; home.file.".local/bin/anime".source = ./ani-cli; home.packages = with pkgs; [ wall-change wallpaper-picker - load-env - toggle-animation - toggle-blur - toggle-opacity push + commit ]; } diff --git a/modules/home/scripts/toggle_layout b/modules/home/scripts/toggle_layout deleted file mode 100755 index 6159878..0000000 --- a/modules/home/scripts/toggle_layout +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -current_layout=$(hyprctl getoption general:layout) - -for word in $current_layout -do - temp="${word%\"}" - temp="${temp#\"}" - if [ $temp == "dwindle" ]; then - rm -rf ~/.local/bin/env/layout - echo "hyprctl --batch 'keyword general:layout master;'" > ~/.local/bin/env/layout - hyprctl --batch "keyword general:layout master;" - fi - if [ $temp == "master" ]; then - rm -rf ~/.local/bin/env/layout - echo "hyprctl --batch 'keyword general:layout dwindle;'" > ~/.local/bin/env/layout - hyprctl --batch "keyword general:layout dwindle;" - fi -done