From 9983d0d2dfef941a2649f9ad06f8779f94764f4d Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Wed, 17 Jun 2020 14:23:37 -0600 Subject: [PATCH] xmonad: use volnoti and eliminate dzvol --- pkgs/applications/misc/dzvol.nix | 18 ------------------ pkgs/default.nix | 1 - profiles/graphical/default.nix | 2 +- profiles/graphical/{sway => misc}/volnoti.nix | 2 +- profiles/graphical/sway/default.nix | 17 ++++++++--------- profiles/graphical/xmonad/_xmonad.nix | 12 ++++-------- profiles/graphical/xmonad/default.nix | 1 - profiles/graphical/xmonad/xmonad.hs.nix | 6 ++++-- 8 files changed, 18 insertions(+), 41 deletions(-) delete mode 100644 pkgs/applications/misc/dzvol.nix rename profiles/graphical/{sway => misc}/volnoti.nix (92%) diff --git a/pkgs/applications/misc/dzvol.nix b/pkgs/applications/misc/dzvol.nix deleted file mode 100644 index 2532c0d..0000000 --- a/pkgs/applications/misc/dzvol.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ stdenv, pkgconfig, alsaLib, x11, fetchFromGitHub }: -stdenv.mkDerivation { - name = "dzvol"; - src = fetchFromGitHub { - owner = "allevaton"; - repo = "dzvol"; - rev = "ca7099520525df2d54ad24f6def22819d5f36b3b"; - sha256 = "1xx7xai6hzrm3gs026z41pl877y849vpfi71syj6cj3ir9h16lpz"; - }; - - installPhase = '' - mkdir -p $out/bin - cp dzvol $out/bin - ''; - - buildInputs = [ pkgconfig alsaLib x11 ]; - hardeningDisable = [ "format" ]; -} diff --git a/pkgs/default.nix b/pkgs/default.nix index 759901c..d4fe75e 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -4,6 +4,5 @@ final: prev: { dejavu_nerdfont = prev.callPackage ./data/fonts/dejavu-nerdfont { }; purs = prev.callPackage ./shells/zsh/purs { }; pure = prev.callPackage ./shells/zsh/pure { }; - dzvol = prev.callPackage ./applications/misc/dzvol.nix { }; wii-u-gc-adapter = prev.callPackage ./misc/drivers/wii-u-gc-adapter { }; } diff --git a/profiles/graphical/default.nix b/profiles/graphical/default.nix index ed98d1b..88ed480 100644 --- a/profiles/graphical/default.nix +++ b/profiles/graphical/default.nix @@ -5,7 +5,7 @@ in { hardware.opengl.enable = true; hardware.opengl.driSupport = true; - hardware.pulseaudio.enable = true; + hardware.pulseaudio.enable = false; environment = { etc = { diff --git a/profiles/graphical/sway/volnoti.nix b/profiles/graphical/misc/volnoti.nix similarity index 92% rename from profiles/graphical/sway/volnoti.nix rename to profiles/graphical/misc/volnoti.nix index c8a545b..e07fed4 100644 --- a/profiles/graphical/sway/volnoti.nix +++ b/profiles/graphical/misc/volnoti.nix @@ -1,6 +1,6 @@ { pkgs, ... }: let inherit (pkgs) alsaUtils bash gnugrep volnoti; -in '' +in pkgs.writeScript "volnoti.sh" '' #!${bash}/bin/bash declare -i current=$(${alsaUtils}/bin/amixer get Master | ${gnugrep}/bin/grep -m1 -Po "[0-9]+(?=%)") diff --git a/profiles/graphical/sway/default.nix b/profiles/graphical/sway/default.nix index ea31c5d..e1826ca 100644 --- a/profiles/graphical/sway/default.nix +++ b/profiles/graphical/sway/default.nix @@ -36,17 +36,16 @@ in { }; environment.etc = { - "sway/config".text = let - volnoti = - pkgs.writeScript "volnoti.sh" (import ./volnoti.nix { inherit pkgs; }); - in '' - set $volume ${volnoti} + "sway/config".text = + let volnoti = import ../misc/volnoti.nix { inherit pkgs; }; + in '' + set $volume ${volnoti} - # set background - output * bg ${pkgs.adapta-backgrounds}/share/backgrounds/adapta/tri-fadeno.jpg fill + # set background + output * bg ${pkgs.adapta-backgrounds}/share/backgrounds/adapta/tri-fadeno.jpg fill - ${readFile ./config} - ''; + ${readFile ./config} + ''; "xdg/waybar".source = ./waybar; }; diff --git a/profiles/graphical/xmonad/_xmonad.nix b/profiles/graphical/xmonad/_xmonad.nix index 20ee86c..34c5d60 100644 --- a/profiles/graphical/xmonad/_xmonad.nix +++ b/profiles/graphical/xmonad/_xmonad.nix @@ -1,4 +1,4 @@ -{ autostart, screenshots, touchtoggle, dzvol, pkgs, stoggle }: '' +{ autostart, screenshots, touchtoggle, pkgs, stoggle, volnoti }: '' -- Function for fullscreen toggle fullToggle :: X () fullToggle = do @@ -6,10 +6,6 @@ sendMessage $ Toggle NBFULL sendMessage $ SetStruts [] [minBound .. maxBound] - -- function to call dzen2 and show volume in the middle of the screen - dzcall :: String - dzcall = "${dzvol}/bin/dzvol -fn 'monospace'" - myAutostart :: X () myAutostart = do spawn "${autostart}" @@ -45,15 +41,15 @@ ) -- lower volume , ( ( 0 , xF86XK_AudioLowerVolume ) - , spawn dzcall + , spawn "${volnoti}" ) -- raise volume , ( ( 0 , xF86XK_AudioRaiseVolume ) - , spawn dzcall + , spawn "${volnoti}" ) -- mute volume , ( ( 0 , xF86XK_AudioMute ) - , spawn dzcall + , spawn "${volnoti}" ) -- start qutebrowser , ( ( myModKey , xK_b ) diff --git a/profiles/graphical/xmonad/default.nix b/profiles/graphical/xmonad/default.nix index 4950144..83acb8c 100644 --- a/profiles/graphical/xmonad/default.nix +++ b/profiles/graphical/xmonad/default.nix @@ -3,7 +3,6 @@ farbfeld xss-lock imgurbash2 - dzvol maim xclip xorg.xdpyinfo diff --git a/profiles/graphical/xmonad/xmonad.hs.nix b/profiles/graphical/xmonad/xmonad.hs.nix index 93ece50..1583129 100644 --- a/profiles/graphical/xmonad/xmonad.hs.nix +++ b/profiles/graphical/xmonad/xmonad.hs.nix @@ -1,7 +1,7 @@ { pkgs, ... }: let inherit (builtins) readFile; - inherit (pkgs) writeScript dzvol; + inherit (pkgs) writeScript; screenshots = "Pictures/shots"; @@ -11,9 +11,11 @@ let touchtoggle = writeScript "xmonad-touchtoggle" (readFile ./scripts/touchtoggle); + + volnoti = import ../misc/volnoti.nix { inherit pkgs; }; in '' ${readFile ./_xmonad.hs} ${import ./_xmonad.nix { - inherit screenshots touchtoggle autostart dzvol stoggle pkgs; + inherit screenshots touchtoggle autostart stoggle pkgs volnoti; }} ''