xmobar
This commit is contained in:
@@ -43,7 +43,13 @@
|
||||
defaultSession = "none+xmonad";
|
||||
};
|
||||
libinput.enable = true; # Enable touchpad.
|
||||
windowManager.xmonad.enable = true;
|
||||
windowManager.xmonad = {
|
||||
enable = true;
|
||||
flake = {
|
||||
enable = true;
|
||||
compiler = "ghc924";
|
||||
};
|
||||
};
|
||||
xkb.layout = "de";
|
||||
};
|
||||
# Enable CUPS to print.
|
||||
@@ -91,7 +97,10 @@
|
||||
'';
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.config = {
|
||||
allowUnfree = true;
|
||||
permittedInsecurePackages = [ "electron-25.9.0" ];
|
||||
};
|
||||
|
||||
# Enable zsh for setting it as shell for users.
|
||||
programs.zsh.enable = true;
|
||||
|
||||
13
flake.nix
13
flake.nix
@@ -26,8 +26,19 @@
|
||||
useUserPackages = true;
|
||||
users.elias = import ./home/default.nix;
|
||||
};
|
||||
nixpkgs.overlays = [ inputs.neovim-nightly-overlay.overlay ];
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
xmobar = final.haskellPackages.callPackage
|
||||
./home/programs/xmonad/src/xmobar/default.nix { };
|
||||
})
|
||||
inputs.neovim-nightly-overlay.overlay
|
||||
];
|
||||
}
|
||||
] ++ xmonad-contrib.nixosModules ++ [
|
||||
# `modernise` replaces the standard xmonad module and wrapper script
|
||||
# with those from unstable. This is currently a necessary workaround to
|
||||
# make Mod-q recompilation work.
|
||||
xmonad-contrib.modernise."x86_64-linux"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
13
home/programs/xmonad/src/xmobar/default.nix
Normal file
13
home/programs/xmonad/src/xmobar/default.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
with pkgs;
|
||||
haskellPackages.mkDerivation {
|
||||
pname = "xmobar";
|
||||
version = "0.1.0.0";
|
||||
src = /etc/nixos/home/programs/xmonad/src/xmobar/.;
|
||||
isLibrary = false;
|
||||
isExecutable = true;
|
||||
executableHaskellDepends = with haskellPackages; [ base xmobar ];
|
||||
license = "unknown";
|
||||
hydraPlatforms = lib.platforms.none;
|
||||
}
|
||||
|
||||
54
home/programs/xmonad/src/xmobar/xmobar-custom.cabal
Normal file
54
home/programs/xmonad/src/xmobar/xmobar-custom.cabal
Normal file
@@ -0,0 +1,54 @@
|
||||
cabal-version: 3.0
|
||||
-- The cabal-version field refers to the version of the .cabal specification,
|
||||
-- and can be different from the cabal-install (the tool) version and the
|
||||
-- Cabal (the library) version you are using. As such, the Cabal (the library)
|
||||
-- version used must be equal or greater than the version stated in this field.
|
||||
-- Starting from the specification version 2.2, the cabal-version field must be
|
||||
-- the first thing in the cabal file.
|
||||
|
||||
-- Initial package description 'xmobar-custom' generated by
|
||||
-- 'cabal init'. For further documentation, see:
|
||||
-- http://haskell.org/cabal/users-guide/
|
||||
--
|
||||
-- The name of the package.
|
||||
name: xmobar-custom
|
||||
|
||||
-- The package version.
|
||||
-- See the Haskell package versioning policy (PVP) for standards
|
||||
-- guiding when and how versions should be incremented.
|
||||
-- https://pvp.haskell.org
|
||||
-- PVP summary: +-+------- breaking API changes
|
||||
-- | | +----- non-breaking API additions
|
||||
-- | | | +--- code changes with no API change
|
||||
version: 0.1.0.0
|
||||
|
||||
-- The package author(s).
|
||||
author: einfischy
|
||||
|
||||
-- An email address to which users can send suggestions, bug reports, and patches.
|
||||
maintainer: accounts.codeberg@kstn.in
|
||||
|
||||
-- A copyright notice.
|
||||
-- copyright:
|
||||
build-type: Simple
|
||||
|
||||
common warnings
|
||||
ghc-options: -Wall -threaded
|
||||
|
||||
executable xmobar
|
||||
-- Import common warning flags.
|
||||
import: warnings
|
||||
|
||||
-- .hs or .lhs file containing the Main module.
|
||||
main-is: xmobar.hs
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base ^>=4.17.2.1,
|
||||
xmobar ^>=0.47.1
|
||||
|
||||
-- Directories containing source files.
|
||||
hs-source-dirs: .
|
||||
|
||||
-- Base language which the package is written in.
|
||||
default-language: Haskell2010
|
||||
|
||||
62
home/programs/xmonad/src/xmobar/xmobar.hs
Normal file
62
home/programs/xmonad/src/xmobar/xmobar.hs
Normal file
@@ -0,0 +1,62 @@
|
||||
import Xmobar
|
||||
|
||||
config :: Config
|
||||
config =
|
||||
defaultConfig
|
||||
{ font = "Fira Code"
|
||||
, position = TopH 30
|
||||
, borderColor = "#1e2030"
|
||||
, border = FullB
|
||||
, borderWidth = 3
|
||||
, bgColor = "#24273a"
|
||||
, fgColor = "#cad3f5"
|
||||
, commands = [ Run $ Cpu [ "--template", "<fc=#a9a1e1><fn=1>\xf085</fn></fc> <total>%"
|
||||
, "--Low","3"
|
||||
, "--High","50"
|
||||
, "--low","#bbc2cf"
|
||||
, "--normal","#bbc2cf"
|
||||
, "--high","#fb4934"] 50
|
||||
, Run $ Memory ["-t","<fc=#51afef><fn=1>\xF2DB</fn></fc> <usedratio>%"
|
||||
,"-H","80"
|
||||
,"-L","10"
|
||||
,"-l","#bbc2cf"
|
||||
,"-n","#bbc2cf"
|
||||
,"-h","#fb4934"] 50
|
||||
, Run $ Date "<fc=#ECBE7B><fn=1>\xf017</fn></fc> %a %b %_d %H:%M" "date" 300
|
||||
, Run $ DynNetwork ["-t","<fc=#4db5bd><fn=1>\xf063</fn></fc> <rx> <fc=#c678dd><fn=1>\xf062</fn></fc> <tx>"
|
||||
,"-H","200"
|
||||
,"-L","10"
|
||||
,"-h","#bbc2cf"
|
||||
,"-l","#bbc2cf"
|
||||
,"-n","#bbc2cf"] 50
|
||||
, Run $ CoreTemp ["-t", "<fc=#CDB464><fn=1>\xf2c7</fn></fc> <core0>°"
|
||||
, "-L", "30"
|
||||
, "-H", "75"
|
||||
, "-l", "lightblue"
|
||||
, "-n", "#bbc2cf"
|
||||
, "-h", "#aa4450"] 50
|
||||
, Run $ BatteryP [ "BAT1" ]
|
||||
[ "--template" , "<fc=#B1DE76><fn=1>\xf240</fn></fc> <acstatus>"
|
||||
, "--Low" , "10" -- units: %
|
||||
, "--High" , "80" -- units: %
|
||||
, "--low" , "#fb4934"
|
||||
, "--normal" , "#bbc2cf"
|
||||
, "--high" , "#98be65"
|
||||
, "--" -- battery specific options
|
||||
-- discharging status
|
||||
, "-o" , "<left>% (<timeleft>)"
|
||||
-- AC "on" status
|
||||
, "-O" , "<left>% (<fc=#98be65>Charging</fc>)"
|
||||
-- charged status
|
||||
, "-i" , "<fc=#98be65>Charged</fc>"
|
||||
] 50
|
||||
, Run XMonadLog
|
||||
]
|
||||
, sepChar = "%"
|
||||
, alignSep = "}{"
|
||||
, template = "%XMonadLog% }{ %cpu% | %coretemp% | %memory% | %battery% | %dynnetwork% | %date% |"
|
||||
}
|
||||
|
||||
main :: IO ()
|
||||
main = xmobar config
|
||||
|
||||
Reference in New Issue
Block a user