dotfiles

My PC Dotfiles & Website
commit 90b854db00992a5f304b27ba58f05cca73f9706d
parent 720ed779afc5683ce26e09e226f91e89990d742a
Author: maydayv7 <maydayv7@gmail.com>
Date:   Mon, 26 Feb 2024 14:56:52 +0530

fix: Niggles

Diffstat:

9 files changed, 62 insertions(+), 55 deletions(-)

diff --git a/modules/gui/desktop/hyprland/README.md b/modules/gui/desktop/hyprland/README.md @@ -6,8 +6,6 @@ | <kbd>$mod P</kbd> | pin | | Pin window on all Workspaces | | <kbd>$mod M</kbd> | fullscreen | 1 | Maximize window | | <kbd>$mod SHIFT M</kbd> | fullscreen | | Fullscreen window | -| <kbd>$mod U</kbd> | focusurgentorlast | | Activate urgent/last window | -| <kbd>$mod U</kbd> | bringactivetotop | | | | <kbd>ALT Q</kbd> | hych:minimize | | Minimize window | | <kbd>ALT SHIFT Q</kbd> | hych:toggle_restore_window | | Show minimized windows | | <kbd>$mod left</kbd> | movefocus | l | Switch focus to left window | @@ -27,6 +25,8 @@ | <kbd>$mod C</kbd> | centerwindow | | Center window | | <kbd>ALT Tab</kbd> | cyclenext | | Cycle through open applications | | <kbd>ALT Tab</kbd> | bringactivetotop | | | +| <kbd>ALT SHIFT Tab</kbd> | focusurgentorlast | | Activate urgent/last window | +| <kbd>ALT SHIFT Tab</kbd> | bringactivetotop | | | | <kbd>ALT CTRL Tab</kbd> | cyclenext | prev | Cycle through grouped applications backward | | <kbd>ALT CTRL Tab</kbd> | bringactivetotop | | | | <kbd>ALT grave</kbd> | hycov:toggleoverview | | Show overview | @@ -55,7 +55,7 @@ | <kbd>$mod 1</kbd> | workspace | num | Create workspace 'num' | | <kbd>$mod SHIFT 1</kbd> | movetoworkspace | num | Move window to workspace 'num' | | <kbd>$mod A</kbd> | exec | nwg-drawer | Application Drawer | -| <kbd>$mod C</kbd> | exec | hyprpicker -arf hex | Color Picker | +| <kbd>$mod SHIFT C</kbd> | exec | hyprpicker -arf hex | Color Picker | | <kbd>$mod D</kbd> | exec | pypr toggle displays | Monitor Configuration | | <kbd>$mod F</kbd> | exec | thunar | File Manager | | <kbd>$mod T</kbd> | exec | kitty | Terminal | diff --git a/modules/gui/desktop/hyprland/apps/bar.nix b/modules/gui/desktop/hyprland/apps/bar.nix @@ -194,7 +194,7 @@ in rec { reverse-scrolling = 1; format = "{icon}"; tooltip-format = "Volume: {volume}%\nDevice: {node_name}"; - format-muted = " Mute"; + format-muted = ""; format-icons = ["" "" "󰕾" ""]; on-click = "pypr show volume"; }; diff --git a/modules/gui/desktop/hyprland/apps/default.nix b/modules/gui/desktop/hyprland/apps/default.nix @@ -97,7 +97,7 @@ in { # Shortcuts wayland.windowManager.hyprland.settings.bind = [ "$mod, A, exec, nwg-drawer" - "$mod, C, exec, hyprpicker -arf hex" + "$mod SHIFT, C, exec, hyprpicker -arf hex" "$mod, D, exec, pypr toggle displays" "$mod, F, exec, thunar" "$mod, N, exec, dunstctl history-pop" diff --git a/modules/gui/desktop/hyprland/settings/keybindings.nix b/modules/gui/desktop/hyprland/settings/keybindings.nix @@ -24,8 +24,6 @@ in { "$mod, P, pin" "$mod, M, fullscreen, 1" "$mod SHIFT, M, fullscreen," - "$mod, U, focusurgentorlast" - "$mod, U, bringactivetotop," # Focus Change "$mod, left, movefocus, l" @@ -53,6 +51,8 @@ in { # Window Switcher "ALT, Tab, cyclenext," "ALT, Tab, bringactivetotop," + "ALT SHIFT, Tab, focusurgentorlast" + "ALT SHIFT, Tab, bringactivetotop," "ALT CTRL, Tab, cyclenext, prev" "ALT CTRL, Tab, bringactivetotop," diff --git a/packages/desktop-icons.nix b/packages/desktop-icons.nix @@ -1,41 +0,0 @@ -{ - lib, - pkgs, - ... -}: -with pkgs; - stdenv.mkDerivation rec { - pname = "desktop-icons"; - version = "2023-10-16"; - - src = fetchFromGitHub { - owner = "Geronymos"; - repo = pname; - rev = "71998254e3e304b8cdc2b168a54bb7c79376fbcc"; - sha256 = "sha256-22L1WFSQRVq7c7IZbdZ4hYVpxccSnxKfpLMLASwXD+Y="; - }; - - patches = [ - (fetchpatch { - url = "https://github.com/maydayv7/desktop-icons/commit/a70833a88d52aeb3a6c4d044b124b012fd607b9b.patch"; - sha256 = "sha256-8RlUKyXNt1xfiiBsYKuZYljYSzzsNJSQXBPfmi+DGcY="; - }) - ]; - - buildInputs = [gtk3 pkg-config]; - propagatedBuildInputs = [glib gtk-layer-shell]; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; - - installPhase = '' - mkdir -p $out/bin - cp -r dicons $out/bin/dicons - ''; - - meta = with lib; { - mainProgram = "dicons"; - description = "Show Files from a Directory on Wayland Desktop"; - homepage = "https://github.com/Geronymos/desktop-icons"; - license = licenses.gpl3Only; - maintainers = ["maydayv7"]; - }; - } diff --git a/packages/desktop-icons/default.nix b/packages/desktop-icons/default.nix @@ -0,0 +1,33 @@ +{ + lib, + pkgs, + ... +}: +with pkgs; let + metadata = import ./metadata.nix; +in + stdenv.mkDerivation rec { + pname = "desktop-icons"; + version = metadata.rev; + + src = fetchFromGitHub { + owner = "Geronymos"; + repo = pname; + inherit (metadata) rev sha256; + }; + + buildInputs = [gtk3 gtk-layer-shell pkg-config]; + NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + installPhase = '' + mkdir -p $out/bin + cp -r dicons $out/bin/dicons + ''; + + meta = with lib; { + mainProgram = "dicons"; + description = "Show Files from a Directory on Wayland Desktop"; + homepage = metadata.repo; + license = licenses.gpl3Only; + maintainers = ["maydayv7"]; + }; + } diff --git a/packages/desktop-icons/metadata.nix b/packages/desktop-icons/metadata.nix @@ -0,0 +1,6 @@ +{ + repo = "https://github.com/Geronymos/desktop-icons"; + branch = "main"; + rev = "5a1f4e12fcf405df7daf0986eb580efaad37c3c2"; + sha256 = "sha256-Hp+eMai0KhFsD8rgs5TaEVSNviF9MhyNfKttzekAgQg="; +} diff --git a/scripts/nixos.nix b/scripts/nixos.nix @@ -304,11 +304,12 @@ in esac ;; "run") + export NIXPKGS_ALLOW_UNFREE=1 if [[ "$2" == *[:/]* ]] || grep -wq "$2" <<<"${list inputs + "nixpkgs"}" then - nix run "$2"#"$3" -- "''${@:4}" + nix run "$2"#"$3" --impure -- "''${@:4}" else - nix run ${path.system}#"$2" -- "''${@:3}" + nix run ${path.system}#"$2" --impure -- "''${@:3}" fi ;; "save") diff --git a/scripts/utils.sh b/scripts/utils.sh @@ -30,7 +30,7 @@ function get_album_art { function volume_notification { volume=$(amixer get Master | grep '%' | head -n 1 | cut -d '[' -f 2 | cut -d '%' -f 1) mute=$(amixer get Master | grep '%' | grep -oE '[^ ]+$' | grep off | head -n1) - if [ "$volume" -eq 0 ] || [ "$mute" == "[yes]" ] + if [ "$volume" -eq 0 ] || [ "$mute" == "[off]" ] then volume_icon="" else @@ -41,9 +41,13 @@ function volume_notification { if $show_music_in_volume_indicator && [ -n "$song_title" ] then song_artist=$(playerctl -f "{{artist}}" metadata) - if [ -z "$song_artist" ]; then song_artist="Unknown"; fi if $show_album_art; then get_album_art; fi - notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:volume -h int:value:"$volume" -i "$album_art" "$volume_icon $volume%" "$song_title\nBy $song_artist" -h string:hlcolor:#ffffff + if [ -z "$song_artist" ] + then + notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:volume -h int:value:"$volume" -i "$album_art" "$volume_icon $volume%" "$song_title" -h string:hlcolor:#ffffff + else + notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:volume -h int:value:"$volume" -i "$album_art" "$volume_icon $volume%" "$song_title\nBy $song_artist" -h string:hlcolor:#ffffff + fi else notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:volume -h int:value:"$volume" "$volume_icon $volume%" -h string:hlcolor:#ffffff fi @@ -52,12 +56,16 @@ function volume_notification { function music_notification { song_title=$(playerctl -f "{{title}}" metadata) song_artist=$(playerctl -f "{{artist}}" metadata) - if [ -z "$song_artist" ]; then song_artist="Unknown"; fi if $show_album_art; then get_album_art; fi song_album=$(playerctl -f "{{album}}" metadata) if [ -z "$song_album" ] then - notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:music -i "$album_art" "$song_title" "By $song_artist" + if [ -z "$song_artist" ] + then + notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:music -i "$album_art" "$song_title" + else + notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:music -i "$album_art" "$song_title" "By $song_artist" + fi else notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:music -i "$album_art" "$song_title" "By $song_artist from $song_album" fi