From 7696a056cb69649eae83eeea0bfa53575a1f405d Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sat, 7 Jul 2018 17:31:10 +0200 Subject: Setup twmn for displaying notifications --- gui/conf/xmonad.hs | 3 +++ gui/twmn.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++ gui/xmonad.nix | 1 + 3 files changed, 50 insertions(+) create mode 100644 gui/twmn.nix (limited to 'gui') diff --git a/gui/conf/xmonad.hs b/gui/conf/xmonad.hs index 9354c6d..cab108a 100644 --- a/gui/conf/xmonad.hs +++ b/gui/conf/xmonad.hs @@ -121,6 +121,9 @@ customKeybindings = , ("M-w S-k" , withFocused $ placeFloating dropDownLarge) , ("M-w h" , withFocused $ placeFloating sideBarLeft) , ("M-w l" , withFocused $ placeFloating sideBarRight) +-- system information + , ("M-i t" , spawn "notify-send \"`date +%T`\" \"`date +\"%Y-%m-%d\"`\"") + , ("M-i b" , spawn "notify-send Battery \"`acpi | cut -c 10-`\"") -- system control , ("M-c " , spawn "amixer sset Master 10%+") , ("M-c " , spawn "amixer sset Master 10%-") diff --git a/gui/twmn.nix b/gui/twmn.nix new file mode 100644 index 0000000..9ae6848 --- /dev/null +++ b/gui/twmn.nix @@ -0,0 +1,46 @@ +{ pkgs, ... }: + +{ + home.packages = with pkgs; [ + twmn + libnotify + ]; + + systemd.user.services.twmnd = { + Unit = { + Description = "twmn notification deamon"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + + Service = { + Environment = "PATH=%h/.nix-profile/bin"; + ExecStart = "${pkgs.twmn}/bin/twmnd"; + Restart = "on-failure"; + }; + }; + + home.file.".config/twmn/twmn.conf".text = '' + [gui] + always_on_top=true + background_color=#909737 + bounce=true + font=Iosevka + font_size=15 + foreground_color=#111111 + height=20 + in_animation=5 + in_animation_duration=500 + opacity=100 + out_animation=6 + out_animation_duration=500 + position=bottom_right + screen=0 + [main] + duration=5000 + ''; +} diff --git a/gui/xmonad.nix b/gui/xmonad.nix index bf7c0d5..31f5832 100644 --- a/gui/xmonad.nix +++ b/gui/xmonad.nix @@ -4,6 +4,7 @@ imports = [ ./gtk.nix ./rofi.nix + ./twmn.nix ]; xsession = { -- cgit v1.2.3