mirror of
https://github.com/ellmau/nixos.git
synced 2025-12-19 09:29:36 +01:00
Xmonad (#9)
* XMonad base config
* Polybar
* development environment for emacs
* flake bump
Flake lock file updates:
• Added input 'flake-utils':
'github:numtide/flake-utils/cfacdce06f30d2b68473a46042957675eebb3401' (2023-04-11)
• Added input 'flake-utils/systems':
'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09)
• Added input 'flake-utils-plus':
'github:gytis-ivaskevicius/flake-utils-plus/2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a' (2022-07-07)
• Added input 'flake-utils-plus/flake-utils':
'github:numtide/flake-utils/3cecb5b042f7f209c56ffd8371b2711a290ec797' (2022-02-07)
• Added input 'nixpkgs':
'github:NixOS/nixpkgs/7629f9b0680d87c7775f3261bee746da5dac76d1' (2023-05-08)
• Added input 'nixpkgs-unstable':
'github:NixOS/nixpkgs/897876e4c484f1e8f92009fd11b7d988a121a4e7' (2023-05-06)
This commit is contained in:
parent
ae484f8222
commit
9bdb9fe8d2
@ -577,6 +577,25 @@
|
||||
|
||||
(use-package lsp-ui)
|
||||
|
||||
;; haskell
|
||||
(use-package haskell-mode
|
||||
:diminish subword-mode
|
||||
:hook
|
||||
(haskell-mode . turn-on-haskell-doc)
|
||||
(haskell-mode . subword-mode))
|
||||
(use-package haskell
|
||||
:ensure haskell-mode)
|
||||
(use-package haskell-font-lock
|
||||
:ensure haskell-mode)
|
||||
(use-package lsp-haskell
|
||||
:demand t)
|
||||
(use-package shakespeare-mode)
|
||||
(use-package company-cabal
|
||||
:defer t
|
||||
:init
|
||||
(with-eval-after-load 'company
|
||||
(add-to-list 'company-backends '(company-cabal))))
|
||||
|
||||
;; misc
|
||||
(use-package academic-phrases
|
||||
:defer t
|
||||
|
||||
@ -1,31 +1,36 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
defaultEl = ./default.el;
|
||||
environment.systemPackages = [ pkgs.gdb ]; # use gdb for dap-mode
|
||||
environment.systemPackages = [pkgs.gdb]; # use gdb for dap-mode
|
||||
localsettings = pkgs.writeText "local-settings.el" ''
|
||||
(defconst elss/paths/cpptools "${pkgs.unstable.vscode-extensions.ms-vscode.cpptools}/share/vscode/extensions/ms-vscode.cpptools")
|
||||
(defconst elss/paths/cpptools-program "${pkgs.unstable.vscode-extensions.ms-vscode.cpptools}/share/vscode/extensions/ms-vscode.cpptools/debugAdapters/bin/OpenDebugAD7")
|
||||
(provide 'local-settings)
|
||||
'';
|
||||
|
||||
defaultConfig = pkgs.runCommand "default.el" { } ''
|
||||
defaultConfig = pkgs.runCommand "default.el" {} ''
|
||||
mkdir -p $out/share/emacs/site-lisp
|
||||
cp ${defaultEl} $out/share/emacs/site-lisp/default.el
|
||||
cp ${localsettings} $out/share/emacs/site-lisp/local-settings.el
|
||||
'';
|
||||
emacsPackage = (pkgs.emacsPackagesFor pkgs.emacs).emacsWithPackages (epkgs:
|
||||
let
|
||||
lpkgs = import ./packages.nix { inherit config lib pkgs epkgs; };
|
||||
#[ (defaultConfig lpkgs) ] ++ (with pkgs; [
|
||||
# aspell
|
||||
# emacs-all-the-icons-fonts
|
||||
# gnupg
|
||||
# nixpkgs-fmt
|
||||
#])
|
||||
in [ defaultConfig ]
|
||||
++ [ (with epkgs.elpaPackages; [ auctex org flymake ]) ]
|
||||
++ (with epkgs.melpaStablePackages; [ ]) ++ (with epkgs.melpaPackages;
|
||||
emacsPackage = (pkgs.emacsPackagesFor pkgs.emacs).emacsWithPackages (epkgs: let
|
||||
lpkgs = import ./packages.nix {inherit config lib pkgs epkgs;};
|
||||
#[ (defaultConfig lpkgs) ] ++ (with pkgs; [
|
||||
# aspell
|
||||
# emacs-all-the-icons-fonts
|
||||
# gnupg
|
||||
# nixpkgs-fmt
|
||||
#])
|
||||
in
|
||||
[defaultConfig]
|
||||
++ [(with epkgs.elpaPackages; [auctex org flymake])]
|
||||
++ (with epkgs.melpaStablePackages; [])
|
||||
++ (with epkgs.melpaPackages;
|
||||
[
|
||||
ac-helm
|
||||
academic-phrases
|
||||
@ -51,6 +56,7 @@ let
|
||||
docker-compose-mode
|
||||
flycheck
|
||||
free-keys
|
||||
haskell-mode
|
||||
highlight-indentation
|
||||
helm
|
||||
#helm-bbdb
|
||||
@ -62,6 +68,7 @@ let
|
||||
helm-rg
|
||||
json-mode
|
||||
less-css-mode
|
||||
lsp-haskell
|
||||
lsp-mode
|
||||
lsp-ui
|
||||
magit
|
||||
@ -87,7 +94,8 @@ let
|
||||
yaml-mode
|
||||
yasnippet
|
||||
#zenburn-theme
|
||||
] ++ (with lpkgs; [ org-roam-ui ligatures ])));
|
||||
]
|
||||
++ (with lpkgs; [org-roam-ui ligatures])));
|
||||
in {
|
||||
options.elss.programs.emacs.enable =
|
||||
mkEnableOption "Setup emacs package and install it";
|
||||
|
||||
@ -21,6 +21,11 @@ with lib; {
|
||||
DPI setting for the xserver
|
||||
'';
|
||||
};
|
||||
xserver.enable = mkEnableOption "enable X server";
|
||||
xmonad = {
|
||||
enable = mkEnableOption "enable xmonad";
|
||||
polybar.enable = mkEnableOption "enable Polybar for xmonad";
|
||||
};
|
||||
i3.enable = mkEnableOption "enable i3";
|
||||
};
|
||||
config = let
|
||||
@ -39,21 +44,20 @@ with lib; {
|
||||
};
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
elss.users.x11.enable =
|
||||
if cfg.i3.enable
|
||||
then true
|
||||
else false;
|
||||
# cfg.xserver.enable = cfg.i3.enable;
|
||||
elss.users.x11.enable = cfg.xserver.enable || cfg.xmonad.enable;
|
||||
|
||||
elss.networking.useNetworkManager = true;
|
||||
|
||||
services = {
|
||||
xserver = mkIf cfg.i3.enable {
|
||||
xserver = mkIf cfg.xserver.enable {
|
||||
enable = true;
|
||||
dpi = cfg.dpi;
|
||||
displayManager.lightdm = {
|
||||
enable = true;
|
||||
greeters.gtk.cursorTheme.size = cfg.greeterCursorsize;
|
||||
};
|
||||
windowManager.i3 = {
|
||||
windowManager.i3 = mkIf cfg.i3.enable {
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
rofi # launcher
|
||||
@ -81,6 +85,8 @@ with lib; {
|
||||
bluetooth.enable = true;
|
||||
};
|
||||
|
||||
security.pam.services.lightdm.enableGnomeKeyring = true;
|
||||
|
||||
services.blueman.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
||||
@ -11,6 +11,8 @@ with lib; {
|
||||
|
||||
x11.enable = mkEnableOption "Activate XSession related options in user-configs";
|
||||
|
||||
dunst.enable = mkEnableOption "Activate Dunst";
|
||||
|
||||
users = mkOption {
|
||||
description = "logins of non-admin users to configure";
|
||||
type = types.listOf types.str;
|
||||
|
||||
31
modules/xmonad.nix
Normal file
31
modules/xmonad.nix
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
config = let
|
||||
cfg = config.elss.graphical.xmonad;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
elss.graphical.xserver.enable = true;
|
||||
elss.users.dunst.enable = true;
|
||||
elss.graphical.xmonad.polybar.enable = true;
|
||||
services = {
|
||||
xserver = {
|
||||
startDbusSession = true;
|
||||
windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
};
|
||||
displayManager.defaultSession = "none+xmonad";
|
||||
libinput = {
|
||||
enable = true;
|
||||
disableWhileTyping = true;
|
||||
};
|
||||
};
|
||||
upower.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
195
users/ellmau/conf/rofi/theme.rafi
Normal file
195
users/ellmau/conf/rofi/theme.rafi
Normal file
@ -0,0 +1,195 @@
|
||||
/**
|
||||
* official theme arthur.rasi
|
||||
* ROFI Color theme
|
||||
* User: Qball
|
||||
* Copyright: Dave Davenport
|
||||
*/
|
||||
|
||||
configuration {
|
||||
|
||||
// The display name of this browser
|
||||
display-ssh: " ";
|
||||
// The display name of this browser
|
||||
display-run: "";
|
||||
// The display name of this browser
|
||||
display-drun: "";
|
||||
// The display name of this browser
|
||||
display-window: "";
|
||||
display-combi: "";
|
||||
show-icons: true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* User: Qball
|
||||
* Copyright: Dave Davenport
|
||||
*/
|
||||
* {
|
||||
foreground: #ffeedd;
|
||||
backlight: #ccffeedd;
|
||||
background-color: transparent;
|
||||
dark: #1c1c1c;
|
||||
// Black
|
||||
black: #3d352a;
|
||||
lightblack: #554444;
|
||||
tlightblack: #554444cc;
|
||||
//
|
||||
// Red
|
||||
red: #cd5c5c;
|
||||
lightred: #cc5533;
|
||||
//
|
||||
// Green
|
||||
green: #86af80;
|
||||
lightgreen: #88cc22;
|
||||
//
|
||||
// Yellow
|
||||
yellow: #e8ae5b;
|
||||
lightyellow: #ffa75d;
|
||||
//
|
||||
// Blue
|
||||
blue: #6495ed;
|
||||
lightblue: #87ceeb;
|
||||
//
|
||||
// Magenta
|
||||
magenta: #deb887;
|
||||
lightmagenta: #996600;
|
||||
//
|
||||
// Cyan
|
||||
cyan: #b0c4de;
|
||||
tcyan: #ccb0c4de;
|
||||
lightcyan: #b0c4de;
|
||||
//
|
||||
// White
|
||||
white: #bbaa99;
|
||||
lightwhite: #ddccbb;
|
||||
//
|
||||
// Bold, Italic, Underline
|
||||
highlight: underline bold #ffffff;
|
||||
|
||||
transparent: rgba(0,0,0,0);
|
||||
font: "Source Code Pro 10";
|
||||
}
|
||||
#window {
|
||||
location: center;
|
||||
anchor: center;
|
||||
transparency: "screenshot";
|
||||
padding: 10px;
|
||||
border: 0px;
|
||||
border-radius: 10px;
|
||||
color: @magenta;
|
||||
background-color: @transparent;
|
||||
spacing: 0;
|
||||
children: [mainbox];
|
||||
orientation: horizontal;
|
||||
}
|
||||
|
||||
#mainbox {
|
||||
spacing: 0;
|
||||
children: [ inputbar, message, listview ];
|
||||
}
|
||||
|
||||
#message {
|
||||
border-color: @foreground;
|
||||
border: 0px 2px 2px 2px;
|
||||
// border-radius: 10px;
|
||||
padding: 5;
|
||||
background-color: @tcyan;
|
||||
}
|
||||
#message {
|
||||
font: "Source Code Pro 8";
|
||||
color: @black;
|
||||
}
|
||||
|
||||
#inputbar {
|
||||
color: @lightgreen;
|
||||
padding: 11px;
|
||||
background-color: @tlightblack;
|
||||
border: 2px 2px 2px 2px;
|
||||
border-radius: 15px 15px 0px 0px;
|
||||
border-color: @foreground;
|
||||
font: "Source Code Pro 18";
|
||||
}
|
||||
#entry,prompt,case-indicator {
|
||||
text-font: inherit;
|
||||
text-color:inherit;
|
||||
}
|
||||
#prompt {
|
||||
margin: 0px 0.3em 0em 0em ;
|
||||
}
|
||||
#listview {
|
||||
padding: 8px;
|
||||
border-radius: 0px 0px 15px 15px;
|
||||
border-color: @foreground;
|
||||
border: 0px 2px 2px 2px;
|
||||
background-color: #1c1c1ccc;
|
||||
dynamic: false;
|
||||
lines: 10;
|
||||
}
|
||||
#element {
|
||||
padding: 3px;
|
||||
vertical-align: 0.5;
|
||||
// border: 2px;
|
||||
border-radius: 4px;
|
||||
background-color: transparent;
|
||||
color: @foreground;
|
||||
font:inherit;
|
||||
}
|
||||
#element selected.normal {
|
||||
background-color: @blue;
|
||||
}
|
||||
#element normal active {
|
||||
foreground: @lightblue;
|
||||
}
|
||||
#element normal urgent {
|
||||
foreground: @lightred;
|
||||
}
|
||||
#element alternate normal {
|
||||
}
|
||||
#element alternate active {
|
||||
foreground: @lightblue;
|
||||
}
|
||||
#element alternate urgent {
|
||||
foreground: @lightred;
|
||||
}
|
||||
#element selected active {
|
||||
background-color: @lightblue;
|
||||
foreground: @dark;
|
||||
}
|
||||
#element selected urgent {
|
||||
background-color: @lightred;
|
||||
foreground: @dark;
|
||||
}
|
||||
#element normal normal {
|
||||
|
||||
}
|
||||
|
||||
#vertb {
|
||||
expand: false;
|
||||
children: [ dummy0, mode-switcher, dummy1 ];
|
||||
}
|
||||
#dummy0, dummy1 {
|
||||
expand: true;
|
||||
}
|
||||
|
||||
#mode-switcher {
|
||||
expand: false;
|
||||
orientation: vertical;
|
||||
spacing: 0px;
|
||||
border: 0px 0px 0px 0px;
|
||||
}
|
||||
#button {
|
||||
font: "FontAwesome 22";
|
||||
padding: 6px;
|
||||
border: 2px 0px 2px 2px;
|
||||
border-radius: 4px 0px 0px 4px;
|
||||
background-color: @tlightblack;
|
||||
border-color: @foreground;
|
||||
color: @foreground;
|
||||
horizontal-align: 0.5;
|
||||
}
|
||||
#button selected normal {
|
||||
color: @dark;
|
||||
border: 2px 0px 2px 2px;
|
||||
background-color: @backlight;
|
||||
border-color: @foreground;
|
||||
}
|
||||
1
users/ellmau/conf/xmonad/.envrc
Normal file
1
users/ellmau/conf/xmonad/.envrc
Normal file
@ -0,0 +1 @@
|
||||
use flake
|
||||
112
users/ellmau/conf/xmonad/flake.lock
generated
Normal file
112
users/ellmau/conf/xmonad/flake.lock
generated
Normal file
@ -0,0 +1,112 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1681202837,
|
||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils-plus": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1657226504,
|
||||
"narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=",
|
||||
"owner": "gytis-ivaskevicius",
|
||||
"repo": "flake-utils-plus",
|
||||
"rev": "2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "gytis-ivaskevicius",
|
||||
"repo": "flake-utils-plus",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"locked": {
|
||||
"lastModified": 1644229661,
|
||||
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1683546353,
|
||||
"narHash": "sha256-zEfx6q4fXK5wq+RCsyM0FyWBKNNhHTKMpCWkEpKDe2g=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7629f9b0680d87c7775f3261bee746da5dac76d1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-22.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1683408522,
|
||||
"narHash": "sha256-9kcPh6Uxo17a3kK3XCHhcWiV1Yu1kYj22RHiymUhMkU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "897876e4c484f1e8f92009fd11b7d988a121a4e7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"flake-utils-plus": "flake-utils-plus",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
47
users/ellmau/conf/xmonad/flake.nix
Normal file
47
users/ellmau/conf/xmonad/flake.nix
Normal file
@ -0,0 +1,47 @@
|
||||
{
|
||||
description = "basic tool setup flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
|
||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
nixpkgs-unstable,
|
||||
flake-utils,
|
||||
flake-utils-plus,
|
||||
...
|
||||
} @ inputs:
|
||||
{}
|
||||
// (flake-utils.lib.eachDefaultSystem (
|
||||
system: let
|
||||
unstable = import nixpkgs-unstable {
|
||||
inherit system;
|
||||
};
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
in rec {
|
||||
devShell = pkgs.mkShell {
|
||||
name = "xmonad";
|
||||
nativeBuildInputs = [
|
||||
# add packages here, like
|
||||
# pkgs.clingo
|
||||
(pkgs.ghc.withPackages
|
||||
(haskellPackages: [
|
||||
haskellPackages.dbus
|
||||
haskellPackages.monad-logger
|
||||
haskellPackages.hostname
|
||||
haskellPackages.xmonad
|
||||
haskellPackages.xmonad-contrib
|
||||
]))
|
||||
pkgs.haskell-language-server
|
||||
];
|
||||
};
|
||||
}
|
||||
));
|
||||
}
|
||||
81
users/ellmau/conf/xmonad/xmonad.hs
Normal file
81
users/ellmau/conf/xmonad/xmonad.hs
Normal file
@ -0,0 +1,81 @@
|
||||
module Main where
|
||||
|
||||
import Data.Ratio
|
||||
import XMonad hiding ((|||))
|
||||
import XMonad.Hooks.FadeInactive
|
||||
import XMonad.Hooks.FadeWindows
|
||||
import XMonad.Hooks.EwmhDesktops
|
||||
import XMonad.Hooks.ManageDocks
|
||||
import XMonad.Hooks.ManageHelpers
|
||||
import XMonad.Hooks.StatusBar
|
||||
import XMonad.Util.EZConfig
|
||||
import Network.HostName (getHostName)
|
||||
-- Imports for Polybar --
|
||||
import qualified Codec.Binary.UTF8.String as UTF8
|
||||
import qualified DBus as D
|
||||
import qualified DBus.Client as D
|
||||
import XMonad.Hooks.DynamicLog
|
||||
|
||||
main :: IO ()
|
||||
main' :: D.Client -> IO ()
|
||||
main = mkDbusClient >>= main'
|
||||
|
||||
main' dbus = do
|
||||
hostname <- io $ getHostName
|
||||
xmonad . docks . ewmhFullscreen . ewmh $ def
|
||||
{ terminal = "alacritty"
|
||||
, logHook = polybarLogHook dbus
|
||||
}
|
||||
|
||||
mkDbusClient :: IO D.Client
|
||||
mkDbusClient = do
|
||||
dbus <- D.connectSession
|
||||
D.requestName dbus (D.busName_ "org.xmonad.log") opts
|
||||
return dbus
|
||||
where
|
||||
opts = [D.nameAllowReplacement, D.nameReplaceExisting, D.nameDoNotQueue]
|
||||
|
||||
-- Emit a DBus signal on log updates
|
||||
dbusOutput :: D.Client -> String -> IO ()
|
||||
dbusOutput dbus str =
|
||||
let opath = D.objectPath_ "/org/xmonad/Log"
|
||||
iname = D.interfaceName_ "org.xmonad.Log"
|
||||
mname = D.memberName_ "Update"
|
||||
signal = D.signal opath iname mname
|
||||
body = [D.toVariant $ UTF8.decodeString str]
|
||||
in D.emit dbus $ signal { D.signalBody = body }
|
||||
|
||||
polybarHook :: D.Client -> PP
|
||||
polybarHook dbus =
|
||||
let wrapper c s | s /= "NSP" = wrap ("%{F" <> c <> "} ") " %{F-}" s
|
||||
| otherwise = mempty
|
||||
blue = "#2E9AFE"
|
||||
gray = "#7F7F7F"
|
||||
orange = "#ea4300"
|
||||
purple = "#9058c7"
|
||||
red = "#722222"
|
||||
in def { ppOutput = dbusOutput dbus
|
||||
, ppCurrent = wrapper blue
|
||||
, ppVisible = wrapper gray
|
||||
, ppUrgent = wrapper orange
|
||||
, ppHidden = wrapper gray
|
||||
, ppHiddenNoWindows = wrapper red
|
||||
, ppTitle = shorten 100 . wrapper purple
|
||||
}
|
||||
|
||||
fadeHook :: Rational -> Rational -> X ()
|
||||
fadeHook act inact = fadeOutLogHook $ fadeAllBut exceptions act inact
|
||||
where exceptions = isFullscreen
|
||||
<||> className =? "firefox"
|
||||
<||> className =? "Chromium-browser"
|
||||
|
||||
fadeAllBut :: Query Bool -> Rational -> Rational -> Query Rational
|
||||
fadeAllBut qry amt inact = do isInactive <- isUnfocused
|
||||
isQry <- qry
|
||||
if isQry
|
||||
then return 1
|
||||
else if isInactive
|
||||
then return inact
|
||||
else return amt
|
||||
|
||||
polybarLogHook dbus = fadeHook 0.95 0.75 <+> dynamicLogWithPP (polybarHook dbus)
|
||||
@ -14,7 +14,8 @@
|
||||
./kanshi.nix
|
||||
./mako.nix
|
||||
./nextcloud.nix
|
||||
./polybar.nix
|
||||
./polybar_i3.nix
|
||||
./polybar_xmonad.nix
|
||||
./zsh.nix
|
||||
|
||||
./sway.nix
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
}:
|
||||
with lib; {
|
||||
config = let
|
||||
cfg = nixosConfig.elss.graphical.i3;
|
||||
cfg = nixosConfig.elss.users.dunst;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
services.dunst = {
|
||||
|
||||
216
users/ellmau/polybar_xmonad.nix
Normal file
216
users/ellmau/polybar_xmonad.nix
Normal file
@ -0,0 +1,216 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
nixosConfig,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
config = let
|
||||
cfg = nixosConfig.elss.graphical.xmonad.polybar;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
services.polybar = {
|
||||
enable = true;
|
||||
package = pkgs.polybarFull;
|
||||
settings = let
|
||||
fonts = [
|
||||
"Hasklig:style=Regular"
|
||||
"all-the-icons:style=Regular"
|
||||
"Webdings:style=Regular"
|
||||
"Noto Emoji:scale=10"
|
||||
"Unifont:style=Regular"
|
||||
"Material Icons:size=12;0"
|
||||
"Weather Icons:size=12;0"
|
||||
"Hasklug Nerd Font,Hasklig Medium:style=Medium,Regular"
|
||||
];
|
||||
in {
|
||||
"bar/main" = {
|
||||
font = fonts;
|
||||
modules = {
|
||||
left = "xmonad";
|
||||
center = "";
|
||||
right = "xbacklight xkeyboard eth wlan battery date powermenu dunst volume ";
|
||||
};
|
||||
tray = {
|
||||
position = "right";
|
||||
padding = 2;
|
||||
};
|
||||
|
||||
monitor = ''
|
||||
''${env:MONITOR:}
|
||||
'';
|
||||
};
|
||||
|
||||
"bar/aux" = {
|
||||
font = fonts;
|
||||
modules = {
|
||||
left = "xmonad";
|
||||
center = "";
|
||||
right = " xbacklight xkeyboard eth wlan battery date powermenu volume ";
|
||||
};
|
||||
monitor = ''
|
||||
''${env:MONITOR:}
|
||||
'';
|
||||
};
|
||||
|
||||
"module/xmonad" = {
|
||||
type = "custom/script";
|
||||
exec = "${pkgs.xmonad-log} /bin/xmonad-log";
|
||||
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 = ''
|
||||
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
|
||||
MONITOR=$m polybar --reload main &
|
||||
done;
|
||||
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep -v '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
|
||||
MONITOR=$m polybar --reload aux &
|
||||
done;
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
19
users/ellmau/rofi.nix
Normal file
19
users/ellmau/rofi.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
nixosConfig,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
config = let
|
||||
cfg = nixosConfig.elss.graphical.xmonad;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
terminal = ${pkgs.alacritty} /bin/alacritty;
|
||||
#theme = conf/rofi/theme.rafi;
|
||||
};
|
||||
};
|
||||
}
|
||||
37
users/ellmau/xmonad.nix
Normal file
37
users/ellmau/xmonad.nix
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
nixosConfig,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
config = let
|
||||
cfg = nixosConfig.elss.graphical.xmonad;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
xsession = {
|
||||
windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
enablePackages = hp: [
|
||||
hp.dbus
|
||||
hp.monad-logger
|
||||
hp.xmonad-contrib
|
||||
];
|
||||
config = conf/xmonad/xmonad.hs;
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
betterlockscreen = {
|
||||
enable = true;
|
||||
inactiveInterval = 10;
|
||||
};
|
||||
picom = {
|
||||
enable = true;
|
||||
backend = "glx";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user