mirror of
https://github.com/ellmau/nixos.git
synced 2025-12-19 09:29:36 +01:00
Update XMonad setup
This commit is contained in:
parent
897fa059bc
commit
ca537a05d9
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, inputs, nixos-hardware, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
inputs,
|
|
||||||
nixos-hardware,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
imports = [
|
||||||
../../common/users.nix
|
../../common/users.nix
|
||||||
./printer.nix
|
./printer.nix
|
||||||
@ -25,9 +19,10 @@
|
|||||||
# enable X11 with lightdm and i3
|
# enable X11 with lightdm and i3
|
||||||
graphical = {
|
graphical = {
|
||||||
enable = true;
|
enable = true;
|
||||||
sway.enable = true;
|
sway.enable = false;
|
||||||
i3.enable = false;
|
i3.enable = false;
|
||||||
plasma.enable = false;
|
plasma.enable = false;
|
||||||
|
xmonad.enable = true;
|
||||||
# set dpi if used in mobile applications
|
# set dpi if used in mobile applications
|
||||||
# dpi = 180;
|
# dpi = 180;
|
||||||
};
|
};
|
||||||
@ -39,15 +34,10 @@
|
|||||||
openvpn.enable = true;
|
openvpn.enable = true;
|
||||||
|
|
||||||
# nm-networks
|
# nm-networks
|
||||||
networking.nmConnections = [
|
networking.nmConnections = [ "tartaros" "eduroam" ];
|
||||||
"tartaros"
|
|
||||||
"eduroam"
|
|
||||||
];
|
|
||||||
|
|
||||||
# enable sops
|
# enable sops
|
||||||
sops = {
|
sops = { enable = true; };
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# enable wireguard
|
# enable wireguard
|
||||||
wireguard.enable = true;
|
wireguard.enable = true;
|
||||||
@ -55,8 +45,8 @@
|
|||||||
# user setup
|
# user setup
|
||||||
users = {
|
users = {
|
||||||
enable = true;
|
enable = true;
|
||||||
admins = ["ellmau"];
|
admins = [ "ellmau" ];
|
||||||
users = [];
|
users = [ ];
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
ellmau.git = {
|
ellmau.git = {
|
||||||
@ -69,13 +59,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
extraModulePackages = [
|
extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
|
||||||
config.boot.kernelPackages.v4l2loopback
|
|
||||||
];
|
|
||||||
|
|
||||||
kernelModules = [
|
kernelModules = [ "v4l2loopback" ];
|
||||||
"v4l2loopback"
|
|
||||||
];
|
|
||||||
|
|
||||||
plymouth.enable = true;
|
plymouth.enable = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -21,7 +21,10 @@ with lib; {
|
|||||||
DPI setting for the xserver
|
DPI setting for the xserver
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
xserver.enable = mkEnableOption "enable X server";
|
xserver = {
|
||||||
|
enable = mkEnableOption "enable X server";
|
||||||
|
autorandr.enable = mkEnableOption "enable autorandr";
|
||||||
|
};
|
||||||
xmonad = {
|
xmonad = {
|
||||||
enable = mkEnableOption "enable xmonad";
|
enable = mkEnableOption "enable xmonad";
|
||||||
polybar.enable = mkEnableOption "enable Polybar for xmonad";
|
polybar.enable = mkEnableOption "enable Polybar for xmonad";
|
||||||
|
|||||||
@ -1,20 +1,15 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib; {
|
with lib; {
|
||||||
config = let
|
config = let cfg = config.elss.graphical.xmonad;
|
||||||
cfg = config.elss.graphical.xmonad;
|
in mkIf cfg.enable {
|
||||||
in
|
elss.graphical.xserver = {
|
||||||
mkIf cfg.enable {
|
enable = true;
|
||||||
elss.graphical.xserver.enable = true;
|
autorandr.enable = true;
|
||||||
|
};
|
||||||
elss.users.dunst.enable = true;
|
elss.users.dunst.enable = true;
|
||||||
elss.graphical.xmonad.polybar.enable = true;
|
elss.graphical.xmonad.polybar.enable = true;
|
||||||
services = {
|
services = {
|
||||||
xserver = {
|
xserver = {
|
||||||
startDbusSession = true;
|
|
||||||
windowManager.xmonad = {
|
windowManager.xmonad = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableContribAndExtras = true;
|
enableContribAndExtras = true;
|
||||||
@ -22,10 +17,11 @@ with lib; {
|
|||||||
displayManager.defaultSession = "none+xmonad";
|
displayManager.defaultSession = "none+xmonad";
|
||||||
libinput = {
|
libinput = {
|
||||||
enable = true;
|
enable = true;
|
||||||
disableWhileTyping = true;
|
touchpad = { disableWhileTyping = true; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
upower.enable = true;
|
upower.enable = true;
|
||||||
};
|
};
|
||||||
|
environment.systemPackages = with pkgs; [ firefox thunderbird ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,22 +1,17 @@
|
|||||||
{
|
{ config, pkgs, lib, nixosConfig, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
nixosConfig,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib; {
|
with lib; {
|
||||||
config = let
|
config = let cfg = nixosConfig.elss.graphical.xserver.autorandr;
|
||||||
cfg = nixosConfig.elss.graphical.i3;
|
in mkIf cfg.enable {
|
||||||
in
|
#services.autorandr = { enable = true; };
|
||||||
mkIf cfg.enable {
|
|
||||||
programs.autorandr = {
|
programs.autorandr = {
|
||||||
enable = true;
|
enable = true;
|
||||||
profiles = {
|
profiles = {
|
||||||
"home" = {
|
"home" = {
|
||||||
fingerprint = {
|
fingerprint = {
|
||||||
DP-1 = "00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
|
DP-1 =
|
||||||
eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
"00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
|
||||||
|
eDP-1 =
|
||||||
|
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
eDP-1.enable = false;
|
eDP-1.enable = false;
|
||||||
@ -31,7 +26,8 @@ with lib; {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
"mobile" = {
|
"mobile" = {
|
||||||
fingerprint.eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
fingerprint.eDP-1 =
|
||||||
|
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||||
config = {
|
config = {
|
||||||
eDP-1 = {
|
eDP-1 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -43,8 +39,10 @@ with lib; {
|
|||||||
};
|
};
|
||||||
"work" = {
|
"work" = {
|
||||||
fingerprint = {
|
fingerprint = {
|
||||||
eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
eDP-1 =
|
||||||
DP-2 = "00ffffffffffff0010acb5414c4133452c1e0104b53c22783eee95a3544c99260f5054a54b00e1c0d100d1c0b300a94081808100714f4dd000a0f0703e803020350055502100001a000000ff0031444e593132330a2020202020000000fd00184b1e8c36010a202020202020000000fc0044454c4c205532373230510a2001af020319f14c101f2005140413121103020123097f0783010000a36600a0f0703e803020350055502100001a565e00a0a0a029503020350055502100001a114400a0800025503020360055502100001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9";
|
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||||
|
DP-2 =
|
||||||
|
"00ffffffffffff0010acb5414c4133452c1e0104b53c22783eee95a3544c99260f5054a54b00e1c0d100d1c0b300a94081808100714f4dd000a0f0703e803020350055502100001a000000ff0031444e593132330a2020202020000000fd00184b1e8c36010a202020202020000000fc0044454c4c205532373230510a2001af020319f14c101f2005140413121103020123097f0783010000a36600a0f0703e803020350055502100001a565e00a0a0a029503020350055502100001a114400a0800025503020360055502100001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9";
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
eDP-1 = {
|
eDP-1 = {
|
||||||
@ -67,7 +65,8 @@ with lib; {
|
|||||||
};
|
};
|
||||||
"home-nuc" = {
|
"home-nuc" = {
|
||||||
fingerprint = {
|
fingerprint = {
|
||||||
DP-2 = "00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
|
DP-2 =
|
||||||
|
"00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
DP-2 = {
|
DP-2 = {
|
||||||
@ -83,8 +82,10 @@ with lib; {
|
|||||||
|
|
||||||
"e3027" = {
|
"e3027" = {
|
||||||
fingerprint = {
|
fingerprint = {
|
||||||
e-DP1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
e-DP1 =
|
||||||
DP-1 = "00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
|
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||||
|
DP-1 =
|
||||||
|
"00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
eDP-1 = {
|
eDP-1 = {
|
||||||
@ -104,8 +105,10 @@ with lib; {
|
|||||||
|
|
||||||
"e3027-clone" = {
|
"e3027-clone" = {
|
||||||
fingerprint = {
|
fingerprint = {
|
||||||
e-DP1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
e-DP1 =
|
||||||
DP-1 = "00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
|
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||||
|
DP-1 =
|
||||||
|
"00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
eDP-1 = {
|
eDP-1 = {
|
||||||
|
|||||||
7
users/ellmau/conf/keyboard/keyboard_layout_toggle.sh
Executable file
7
users/ellmau/conf/keyboard/keyboard_layout_toggle.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [[ `setxkbmap -query | awk '$1 == "layout:"{print($2)}'` = "us" ]]; then
|
||||||
|
setxkbmap -layout de
|
||||||
|
else
|
||||||
|
setxkbmap -layout us
|
||||||
|
fi
|
||||||
@ -1,30 +1,52 @@
|
|||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
|
import ELSS
|
||||||
|
|
||||||
import Data.Ratio
|
import Data.Ratio
|
||||||
import XMonad hiding ((|||))
|
import XMonad hiding ((|||))
|
||||||
|
import XMonad.Actions.FindEmptyWorkspace
|
||||||
|
import XMonad.Layout
|
||||||
import XMonad.Hooks.FadeInactive
|
import XMonad.Hooks.FadeInactive
|
||||||
import XMonad.Hooks.FadeWindows
|
import XMonad.Hooks.FadeWindows
|
||||||
import XMonad.Hooks.EwmhDesktops
|
import XMonad.Hooks.EwmhDesktops
|
||||||
import XMonad.Hooks.ManageDocks
|
import XMonad.Hooks.ManageDocks
|
||||||
import XMonad.Hooks.ManageHelpers
|
import XMonad.Hooks.ManageHelpers
|
||||||
|
import XMonad.Hooks.Place
|
||||||
import XMonad.Hooks.StatusBar
|
import XMonad.Hooks.StatusBar
|
||||||
import XMonad.Util.EZConfig
|
import XMonad.Util.EZConfig
|
||||||
import Network.HostName (getHostName)
|
import Network.HostName (getHostName)
|
||||||
|
|
||||||
|
import qualified XMonad.StackSet as W
|
||||||
-- Imports for Polybar --
|
-- Imports for Polybar --
|
||||||
import qualified Codec.Binary.UTF8.String as UTF8
|
import qualified Codec.Binary.UTF8.String as UTF8
|
||||||
import qualified DBus as D
|
import qualified DBus as D
|
||||||
import qualified DBus.Client as D
|
import qualified DBus.Client as D
|
||||||
import XMonad.Hooks.DynamicLog
|
import XMonad.Hooks.DynamicLog
|
||||||
|
-- Code Action Imports
|
||||||
|
import System.Exit
|
||||||
|
import XMonad.Actions.PhysicalScreens
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main' :: D.Client -> IO ()
|
main' :: D.Client -> IO ()
|
||||||
main = mkDbusClient >>= main'
|
main = mkDbusClient >>= main'
|
||||||
|
|
||||||
|
layout = avoidStruts $
|
||||||
|
(Full ||| tall ||| Mirror tall)
|
||||||
|
where tall = Tall 1 (3/100) (1/2)
|
||||||
|
|
||||||
main' dbus = do
|
main' dbus = do
|
||||||
hostname <- io $ getHostName
|
hostname <- io $ getHostName
|
||||||
xmonad . docks . ewmhFullscreen . ewmh $ def
|
xmonad . docks . ewmhFullscreen . ewmh $ def
|
||||||
{ terminal = "alacritty"
|
{ terminal = "alacritty"
|
||||||
, logHook = polybarLogHook dbus
|
, logHook = polybarLogHook dbus
|
||||||
|
, layoutHook = layout
|
||||||
|
, modMask = mod4Mask -- rebind mod to super key
|
||||||
|
, keys = keyMap
|
||||||
|
, manageHook = composeAll [ manageDocks
|
||||||
|
, isFullscreen --> doFullFloat
|
||||||
|
, placeHook $ withGaps (32, 32, 32, 32) $ smart (0.5, 0.5)
|
||||||
|
, manageHook def
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
mkDbusClient :: IO D.Client
|
mkDbusClient :: IO D.Client
|
||||||
@ -45,22 +67,62 @@ dbusOutput dbus str =
|
|||||||
body = [D.toVariant $ UTF8.decodeString str]
|
body = [D.toVariant $ UTF8.decodeString str]
|
||||||
in D.emit dbus $ signal { D.signalBody = body }
|
in D.emit dbus $ signal { D.signalBody = body }
|
||||||
|
|
||||||
|
keyMap c = mkKeymap c $
|
||||||
|
[ ("M-<Return>" , spawn $ XMonad.terminal c)
|
||||||
|
, ("M-d" , spawn "rofi -show drun")
|
||||||
|
, ("M-<Tab>" , spawn "rofi -show window")
|
||||||
|
, ("M-S-q" , kill)
|
||||||
|
, ("M-<Space>" , sendMessage NextLayout)
|
||||||
|
, ("M-S-r" , refresh)
|
||||||
|
, ("M-j" , windows W.focusUp)
|
||||||
|
, ("M-k" , windows W.focusDown)
|
||||||
|
, ("M-S-j" , windows W.swapUp)
|
||||||
|
, ("M-S-k" , windows W.swapDown)
|
||||||
|
, ("M-;" , viewEmptyWorkspace)
|
||||||
|
, ("M-S-;" , tagToEmptyWorkspace)
|
||||||
|
, ("M-S-<Backspace>" , io exitSuccess)
|
||||||
|
, ("M-C-r" , broadcastMessage ReleaseResources >> restart "xmonad" True)
|
||||||
|
, ("M-C-j" , sendMessage Expand)
|
||||||
|
, ("M-C-k" , sendMessage Shrink)
|
||||||
|
, ("M-w" , viewScreen def 0)
|
||||||
|
, ("M-e" , viewScreen def 1)
|
||||||
|
, ("M-r" , viewScreen def 2)
|
||||||
|
, ("M-S-w" , sendToScreen def 0)
|
||||||
|
, ("M-S-e" , sendToScreen def 1)
|
||||||
|
, ("M-S-r" , sendToScreen def 2)
|
||||||
|
, ("M-t" , withFocused $ windows . W.sink)
|
||||||
|
, ("M-C-l" , spawn "betterlockscreen -l --show-layout -u ~/.background-image.png")
|
||||||
|
, ("M-S-<Tab>" , spawn keyboardtoggle)
|
||||||
|
] ++
|
||||||
|
[(m ++ k, windows $ f w)
|
||||||
|
| (w, k) <- zip (XMonad.workspaces c) (map show $ [1..9] ++ [0]),
|
||||||
|
(m, f) <- [("M-", W.greedyView), ("M-S-", W.shift)]
|
||||||
|
]
|
||||||
|
++
|
||||||
|
[ ("<XF86AudioMute>", spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle")
|
||||||
|
, ("<XF86AudioLowerVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ -5%")
|
||||||
|
, ("<XF86AudioRaiseVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ +5%")
|
||||||
|
, ("<XF86AudioMicMute>", spawn "pactl set-source-mute @DEFAULT_SOURCE@ toggle")
|
||||||
|
]
|
||||||
|
|
||||||
polybarHook :: D.Client -> PP
|
polybarHook :: D.Client -> PP
|
||||||
polybarHook dbus =
|
polybarHook dbus =
|
||||||
let wrapper c s | s /= "NSP" = wrap ("%{F" <> c <> "} ") " %{F-}" s
|
let wrapper c b "NSP" = mempty
|
||||||
| otherwise = mempty
|
wrapper c (Just b) s = wrap ("%{F" <> c <> "}%{B" <> b <> "}") "%{F-}%{B-}" s
|
||||||
blue = "#2E9AFE"
|
wrapper c Nothing s = wrap ("%{F" <> c <> "}") "%{F-}" s
|
||||||
gray = "#7F7F7F"
|
current = "#859900"
|
||||||
orange = "#ea4300"
|
visible = "#eee8d5"
|
||||||
purple = "#9058c7"
|
urgent = "#d33682"
|
||||||
red = "#722222"
|
highlighted = "#fdf6e3"
|
||||||
|
title = "#657b83"
|
||||||
|
free = "#93a1a1"
|
||||||
in def { ppOutput = dbusOutput dbus
|
in def { ppOutput = dbusOutput dbus
|
||||||
, ppCurrent = wrapper blue
|
, ppCurrent = wrapper highlighted $ Just current
|
||||||
, ppVisible = wrapper gray
|
, ppVisible = wrapper title Nothing
|
||||||
, ppUrgent = wrapper orange
|
, ppUrgent = wrapper highlighted $ Just urgent
|
||||||
, ppHidden = wrapper gray
|
, ppHidden = wrapper free Nothing
|
||||||
, ppHiddenNoWindows = wrapper red
|
, ppHiddenNoWindows = mempty
|
||||||
, ppTitle = shorten 100 . wrapper purple
|
, ppTitle = wrapper title Nothing . shorten 60
|
||||||
}
|
}
|
||||||
|
|
||||||
fadeHook :: Rational -> Rational -> X ()
|
fadeHook :: Rational -> Rational -> X ()
|
||||||
@ -68,6 +130,7 @@ fadeHook act inact = fadeOutLogHook $ fadeAllBut exceptions act inact
|
|||||||
where exceptions = isFullscreen
|
where exceptions = isFullscreen
|
||||||
<||> className =? "firefox"
|
<||> className =? "firefox"
|
||||||
<||> className =? "Chromium-browser"
|
<||> className =? "Chromium-browser"
|
||||||
|
<||> className =? "Emacs"
|
||||||
|
|
||||||
fadeAllBut :: Query Bool -> Rational -> Rational -> Query Rational
|
fadeAllBut :: Query Bool -> Rational -> Rational -> Query Rational
|
||||||
fadeAllBut qry amt inact = do isInactive <- isUnfocused
|
fadeAllBut qry amt inact = do isInactive <- isUnfocused
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
./nextcloud.nix
|
./nextcloud.nix
|
||||||
./polybar_i3.nix
|
./polybar_i3.nix
|
||||||
./polybar_xmonad.nix
|
./polybar_xmonad.nix
|
||||||
|
./xmonad.nix
|
||||||
./zsh.nix
|
./zsh.nix
|
||||||
|
|
||||||
./sway.nix
|
./sway.nix
|
||||||
|
|||||||
@ -1,15 +1,7 @@
|
|||||||
{
|
{ config, pkgs, lib, nixosConfig, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
nixosConfig,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib; {
|
with lib; {
|
||||||
config = let
|
config = let cfg = nixosConfig.elss.users.dunst;
|
||||||
cfg = nixosConfig.elss.users.dunst;
|
in mkIf cfg.enable {
|
||||||
in
|
|
||||||
mkIf cfg.enable {
|
|
||||||
services.dunst = {
|
services.dunst = {
|
||||||
iconTheme = {
|
iconTheme = {
|
||||||
package = pkgs.numix-icon-theme;
|
package = pkgs.numix-icon-theme;
|
||||||
@ -21,7 +13,7 @@ with lib; {
|
|||||||
geometry = "800x5-30+50";
|
geometry = "800x5-30+50";
|
||||||
transparency = 10;
|
transparency = 10;
|
||||||
frame_color = "#839496";
|
frame_color = "#839496";
|
||||||
font = "Hasklug Nerd Font 10";
|
font = "Hasklug Nerd Font 11";
|
||||||
timeout = 5;
|
timeout = 5;
|
||||||
follow = "mouse";
|
follow = "mouse";
|
||||||
markup = "full";
|
markup = "full";
|
||||||
|
|||||||
@ -1,28 +1,19 @@
|
|||||||
{
|
{ config, pkgs, lib, nixosConfig, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
nixosConfig,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib; {
|
with lib; {
|
||||||
config = let
|
config = let cfg = nixosConfig.elss.graphical.xmonad.polybar;
|
||||||
cfg = nixosConfig.elss.graphical.xmonad.polybar;
|
in mkIf cfg.enable {
|
||||||
in
|
|
||||||
mkIf cfg.enable {
|
|
||||||
services.polybar = {
|
services.polybar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.polybarFull;
|
package = pkgs.polybarFull;
|
||||||
settings = let
|
settings = let
|
||||||
fonts = [
|
fonts = [
|
||||||
"Hasklig:style=Regular"
|
"Weather Icons:size=12;0"
|
||||||
|
"Hasklug Nerd Font,Hasklig Medium:style=Medium,Regular"
|
||||||
"all-the-icons:style=Regular"
|
"all-the-icons:style=Regular"
|
||||||
"Webdings:style=Regular"
|
"Webdings:style=Regular"
|
||||||
"Noto Emoji:scale=10"
|
"Noto Emoji:scale=10"
|
||||||
"Unifont:style=Regular"
|
"Unifont:style=Regular"
|
||||||
"Material Icons:size=12;0"
|
"Material Icons:size=12;0"
|
||||||
"Weather Icons:size=12;0"
|
|
||||||
"Hasklug Nerd Font,Hasklig Medium:style=Medium,Regular"
|
|
||||||
];
|
];
|
||||||
in {
|
in {
|
||||||
"bar/main" = {
|
"bar/main" = {
|
||||||
@ -30,13 +21,17 @@ with lib; {
|
|||||||
modules = {
|
modules = {
|
||||||
left = "xmonad";
|
left = "xmonad";
|
||||||
center = "";
|
center = "";
|
||||||
right = "xbacklight xkeyboard eth wlan battery date powermenu dunst volume ";
|
# right = "xbacklight xkeyboard eth wlan battery date powermenu dunst volume ";
|
||||||
|
right = "";
|
||||||
};
|
};
|
||||||
tray = {
|
tray = {
|
||||||
position = "right";
|
position = "right";
|
||||||
padding = 2;
|
padding = 2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
background = "FFFFFF";
|
||||||
|
foreground = "000000";
|
||||||
|
|
||||||
monitor = ''
|
monitor = ''
|
||||||
''${env:MONITOR:}
|
''${env:MONITOR:}
|
||||||
'';
|
'';
|
||||||
@ -47,7 +42,8 @@ with lib; {
|
|||||||
modules = {
|
modules = {
|
||||||
left = "xmonad";
|
left = "xmonad";
|
||||||
center = "";
|
center = "";
|
||||||
right = " xbacklight xkeyboard eth wlan battery date powermenu volume ";
|
right =
|
||||||
|
" xbacklight xkeyboard eth wlan battery date powermenu volume ";
|
||||||
};
|
};
|
||||||
monitor = ''
|
monitor = ''
|
||||||
''${env:MONITOR:}
|
''${env:MONITOR:}
|
||||||
@ -56,152 +52,9 @@ with lib; {
|
|||||||
|
|
||||||
"module/xmonad" = {
|
"module/xmonad" = {
|
||||||
type = "custom/script";
|
type = "custom/script";
|
||||||
exec = "${pkgs.xmonad-log} /bin/xmonad-log";
|
exec = "${pkgs.xmonad-log}/bin/xmonad-log";
|
||||||
tail = true;
|
tail = true;
|
||||||
};
|
};
|
||||||
"module/xkeyboard" = {
|
|
||||||
type = "internal/xkeyboard";
|
|
||||||
blacklist-0 = "num lock";
|
|
||||||
interval = "5";
|
|
||||||
|
|
||||||
format-prefix = ''""'';
|
|
||||||
label-layout = "%layout%";
|
|
||||||
|
|
||||||
label-indicator-padding = "2";
|
|
||||||
label-indicator-margin = "1";
|
|
||||||
};
|
|
||||||
"module/wlan" = {
|
|
||||||
type = "internal/network";
|
|
||||||
interface = "wlp0s20f3";
|
|
||||||
interval = "3.0";
|
|
||||||
|
|
||||||
format-connected = " <ramp-signal> <label-connected>";
|
|
||||||
format-connected-underline = "#9f78e1";
|
|
||||||
label-connected = "%essid%";
|
|
||||||
|
|
||||||
ramp-signal-0 = ''"0.0"'';
|
|
||||||
ramp-signal-1 = ''"0.5"'';
|
|
||||||
ramp-signal-2 = ''"1.0"'';
|
|
||||||
ramp-signal-3 = ''"1.0"'';
|
|
||||||
ramp-signal-4 = ''"1.0"'';
|
|
||||||
|
|
||||||
format-disconnected = "";
|
|
||||||
# ;format-disconnected = <label-disconnected>
|
|
||||||
#;format-disconnected-underline = ${self.format-connected-underline}
|
|
||||||
#;label-disconnected = %ifname% disconnected
|
|
||||||
#;label-disconnected-foreground = ${colors.foreground-alt}
|
|
||||||
};
|
|
||||||
"module/eth" = {
|
|
||||||
type = "internal/network";
|
|
||||||
interface = "eno1";
|
|
||||||
interval = "3.0";
|
|
||||||
|
|
||||||
format-connected-underline = "#55aa55";
|
|
||||||
format-connected = " <label-connected>";
|
|
||||||
label-connected = "%local_ip%";
|
|
||||||
|
|
||||||
format-disconnected = "";
|
|
||||||
format-disconnected-background = "#5479b7";
|
|
||||||
#;format-disconnected = <label-disconnected>
|
|
||||||
#;format-disconnected-underline = ${self.format-connected-underline}
|
|
||||||
#;label-disconnected = %ifname% disconnected
|
|
||||||
#;label-disconnected-foreground = ${colors.foreground-alt}
|
|
||||||
};
|
|
||||||
"module/date" = {
|
|
||||||
type = "internal/date";
|
|
||||||
interval = "5";
|
|
||||||
|
|
||||||
date = ''" %Y-%m-%d"'';
|
|
||||||
date-alt = ''" %Y-%m-%d"'';
|
|
||||||
|
|
||||||
time = "%H:%M";
|
|
||||||
time-alt = "%H:%M:%S";
|
|
||||||
|
|
||||||
#format-prefix = "";
|
|
||||||
#format-prefix-foreground = foreground_altcol;
|
|
||||||
format-underline = "#0a6cf5";
|
|
||||||
|
|
||||||
label = "%{A} %date% %time%";
|
|
||||||
};
|
|
||||||
"module/battery" = {
|
|
||||||
type = "internal/battery";
|
|
||||||
battery = "BAT0";
|
|
||||||
adapter = "ADP1";
|
|
||||||
full-at = "98";
|
|
||||||
|
|
||||||
format-charging-background = "#689d6a";
|
|
||||||
format-charging-prefix = ''" "'';
|
|
||||||
format-charging = "<label-charging>";
|
|
||||||
format-discharging-prefix = ''" "'';
|
|
||||||
format-discharging = "<label-discharging>";
|
|
||||||
format-discharging-background = "#689d6a";
|
|
||||||
format-full-prefix = ''" "'';
|
|
||||||
|
|
||||||
format-charging-underline = "#ffaa55";
|
|
||||||
format-full-underline = "#ffaa55";
|
|
||||||
|
|
||||||
ormat-full-padding = "1";
|
|
||||||
format-charging-padding = "1";
|
|
||||||
format-discharging-padding = "1";
|
|
||||||
};
|
|
||||||
"module/temperature" = {
|
|
||||||
type = "internal/temperature";
|
|
||||||
thermal-zone = "0";
|
|
||||||
warn-temperature = "60";
|
|
||||||
|
|
||||||
format = "<ramp> <label>";
|
|
||||||
format-underline = "#f50a4d";
|
|
||||||
format-warn = "<ramp> <label-warn>";
|
|
||||||
format-warn-underline = "#f50a4d";
|
|
||||||
|
|
||||||
label = " %temperature-c%";
|
|
||||||
label-warn = "%temperature-c%";
|
|
||||||
|
|
||||||
ramp-0 = "l";
|
|
||||||
ramp-1 = "m";
|
|
||||||
ramp-2 = "h";
|
|
||||||
};
|
|
||||||
|
|
||||||
"module/powermenu" = {
|
|
||||||
type = "custom/menu";
|
|
||||||
|
|
||||||
expand-right = "true";
|
|
||||||
|
|
||||||
format-spacing = "1";
|
|
||||||
|
|
||||||
label-open = ''""'';
|
|
||||||
label-close = " cancel";
|
|
||||||
label-separator = "|";
|
|
||||||
|
|
||||||
menu-0-0 = "reboot";
|
|
||||||
menu-0-0-exec = "menu-open-1";
|
|
||||||
menu-0-1 = "power off";
|
|
||||||
menu-0-1-exec = "menu-open-2";
|
|
||||||
|
|
||||||
menu-1-0 = "cancel";
|
|
||||||
menu-1-0-exec = "menu-open-0";
|
|
||||||
menu-1-1 = "reboot";
|
|
||||||
menu-1-1-exec = "sudo reboot";
|
|
||||||
|
|
||||||
menu-2-0 = "power off";
|
|
||||||
menu-2-0-exec = "sudo poweroff";
|
|
||||||
menu-2-1 = "cancel";
|
|
||||||
menu-2-1-exec = "menu-open-0";
|
|
||||||
};
|
|
||||||
|
|
||||||
"module/xbacklight" = {
|
|
||||||
type = "internal/xbacklight";
|
|
||||||
|
|
||||||
format = "<label> <bar>";
|
|
||||||
label = "BL";
|
|
||||||
};
|
|
||||||
|
|
||||||
"module/dunst" = {
|
|
||||||
type = "custom/script";
|
|
||||||
exec = "PATH=${pkgs.dbus}/bin/:$PATH ${pkgs.dunst}/bin/dunstctl is-paused | ${pkgs.gnugrep}/bin/grep -q true && echo || echo ";
|
|
||||||
interval = 10;
|
|
||||||
click-left = "PATH=${pkgs.dbus}/bin/:$PATH ${pkgs.dunst}/bin/dunstctl set-paused toggle";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
script = ''
|
script = ''
|
||||||
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
|
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
|
||||||
@ -212,5 +65,9 @@ with lib; {
|
|||||||
done;
|
done;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.user.services.polybar = {
|
||||||
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,26 +1,24 @@
|
|||||||
{
|
{ config, pkgs, lib, nixosConfig, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
nixosConfig,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib; {
|
with lib; {
|
||||||
config = let
|
config = let cfg = nixosConfig.elss.graphical.xmonad;
|
||||||
cfg = nixosConfig.elss.graphical.xmonad;
|
in mkIf cfg.enable {
|
||||||
in
|
|
||||||
mkIf cfg.enable {
|
|
||||||
xsession = {
|
xsession = {
|
||||||
windowManager.xmonad = {
|
windowManager.xmonad = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableContribAndExtras = true;
|
enableContribAndExtras = true;
|
||||||
enablePackages = hp: [
|
extraPackages = hp: [
|
||||||
hp.dbus
|
hp.dbus
|
||||||
|
hp.hostname
|
||||||
hp.monad-logger
|
hp.monad-logger
|
||||||
hp.xmonad-contrib
|
hp.xmonad-contrib
|
||||||
];
|
];
|
||||||
|
libFiles."ELSS.hs" = pkgs.writeText "ELSS.hs" ''
|
||||||
|
module ELSS where
|
||||||
|
keyboardtoggle = "${../keyboard/keyboardtoggle.sh}"
|
||||||
|
'';
|
||||||
config = conf/xmonad/xmonad.hs;
|
config = conf/xmonad/xmonad.hs;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
@ -33,5 +31,9 @@ with lib; {
|
|||||||
backend = "glx";
|
backend = "glx";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
gtk.enable = true;
|
||||||
|
|
||||||
|
home.packages = with pkgs; [ rofi polybarFull firefox pulseaudioFull ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user