xmobar-config

This commit is contained in:
♥ Minnie ♥ 2023-04-25 21:28:53 +08:00
parent 061583c342
commit d8e21e872a
6 changed files with 55 additions and 48 deletions

View file

@ -1,27 +0,0 @@
cabal-version: 3.0
name: candybar
version: 0.1.0.0
-- synopsis:
-- description:
license: BSD-3-Clause
-- license-file: LICENSE
author: sajenim
maintainer: its.jassy@pm.me
-- copyright:
build-type: Simple
-- extra-doc-files: CHANGELOG.md
-- extra-source-files:
common warnings
ghc-options: -Wall
-threaded
executable candybar
import: warnings
main-is: candybar.hs
-- other-modules:
-- other-extensions:
build-depends: base,
xmobar
hs-source-dirs: .
default-language: Haskell2010

View file

@ -1,20 +0,0 @@
import Xmobar
config :: Config
config =
defaultConfig
{ font = "DejaVu Sans Mono 9",
allDesktops = True,
alpha = 200,
commands =
[ Run XMonadLog,
Run $ Memory ["t", "Mem: <usedratio>%"] 10,
Run $ Kbd [],
Run $ Date "%a %_d %b %Y <fc=#ee9a00>%H:%M:%S</fc>" "date" 10
],
template = "%XMonadLog% }{ %kbd% | %date% | %memory%",
alignSep = "}{"
}
main :: IO ()
main = xmobar config -- or: configFromArgs config >>= xmobar

View file

@ -3,5 +3,5 @@
{ pkgs ? (import ../nixpkgs.nix) { } }: {
# example = pkgs.callPackage ./example { };
candybar = pkgs.callPackage ./candybar { };
xmobar = pkgs.callPackage ./xmobar-config { };
}

View file

@ -0,0 +1,30 @@
import Xmobar
import System.Environment (getEnv)
import System.IO.Unsafe (unsafeDupablePerformIO)
-- | Candybar
config :: Config
config = defaultConfig
-- general settings
{ font = "Fira Code Semi Bold 9"
, additionalFonts = [ ]
, bgColor = "#282828"
, fgColor = "#d4be98"
, position = Static { xpos = 1920, ypos = 0, width = 2560, height = 24 }
, iconRoot = homeDir <> "/.config/xmonad/icons"
-- commands to run
, commands =
[ Run $ XMonadLog
]
-- format our bar
, sepChar = "%"
, alignSep = "}{"
, template = "\59255 %XMonadLog%"
}
-- | Get home directory
homeDir :: String
homeDir = unsafeDupablePerformIO (getEnv "HOME")
main :: IO ()
main = configFromArgs config >>= xmobar

View file

@ -0,0 +1,24 @@
cabal-version: 3.0
name: xmobar-config
version: 0.1.0.0
description: xmobar configs
author: sajenim
maintainer: its.jassy@pm.me
license: BSD-3-Clause
build-type: Simple
executable xmobar-top
main-is: xmobar-top.hs
hs-source-dirs: src
ghc-options: -Wall -threaded
build-depends: base,
xmobar
default-language: Haskell2010
-- executable xmobar-bottom
-- main-is: xmobar-bottom.hs
-- hs-source-dirs: src
-- ghc-options: -Wall -threaded
-- build-depends: base,
-- xmobar
-- default-language: Haskell2010