prog: remove xmobar
This commit is contained in:
parent
1333078a48
commit
1c8d04a6e3
8 changed files with 0 additions and 292 deletions
2
programs/xmobar/.gitignore
vendored
2
programs/xmobar/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
||||||
.stack-work/
|
|
||||||
*~
|
|
|
@ -1 +0,0 @@
|
||||||
# xmobar
|
|
|
@ -1,2 +0,0 @@
|
||||||
import Distribution.Simple
|
|
||||||
main = defaultMain
|
|
|
@ -1,21 +0,0 @@
|
||||||
name: xmobarrc
|
|
||||||
version: 0.1.0
|
|
||||||
synopsis: My xmobar configuration
|
|
||||||
license: Beerware
|
|
||||||
author: Pleshevskiy
|
|
||||||
maintainer: dmitriy@ideascup.me
|
|
||||||
homepage: https://github.com/pleshevskiy/myconfig
|
|
||||||
|
|
||||||
dependencies:
|
|
||||||
- base
|
|
||||||
- xmobar
|
|
||||||
|
|
||||||
executables:
|
|
||||||
xmobar:
|
|
||||||
source-dirs: src
|
|
||||||
main: xmobar.hs
|
|
||||||
ghc-options:
|
|
||||||
- -threaded
|
|
||||||
- -rtsopts
|
|
||||||
- -with-rtsopts=-N
|
|
||||||
|
|
|
@ -1,132 +0,0 @@
|
||||||
{-# LANGUAGE LambdaCase #-}
|
|
||||||
{-# LANGUAGE PostfixOperators #-}
|
|
||||||
{-# LANGUAGE ScopedTypeVariables #-}
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
-- |
|
|
||||||
-- Copyright: (c) 2018, 2019, 2022 Jose Antonio Ortega Ruiz
|
|
||||||
-- License: BSD3-style (see LICENSE)
|
|
||||||
--
|
|
||||||
-- Maintainer: jao@gnu.org
|
|
||||||
-- Stability: unstable
|
|
||||||
-- Portability: portable
|
|
||||||
-- Created: Sat Nov 24, 2018 21:03
|
|
||||||
--
|
|
||||||
--
|
|
||||||
-- An example of a Haskell-based xmobar. Compile it with
|
|
||||||
-- ghc --make -- xmobar.hs
|
|
||||||
-- with the xmobar library installed or simply call:
|
|
||||||
-- xmobar /path/to/xmobar.hs
|
|
||||||
-- and xmobar will compile and launch it for you and
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
import Xmobar
|
|
||||||
|
|
||||||
import System.Environment (getArgs)
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
main :: IO ()
|
|
||||||
main = getArgs >>= \case
|
|
||||||
["-x", n] -> xmobar . config $ read n
|
|
||||||
_ -> xmobar . config $ 0
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
config :: Int -> Config
|
|
||||||
config n = defaultConfig
|
|
||||||
-- fonts
|
|
||||||
{ font = regularFont 9
|
|
||||||
, additionalFonts =
|
|
||||||
[ boldFont 9
|
|
||||||
]
|
|
||||||
|
|
||||||
-- colors
|
|
||||||
, bgColor = colorBg
|
|
||||||
, fgColor = colorFg
|
|
||||||
|
|
||||||
-- general
|
|
||||||
, position = OnScreen n Top
|
|
||||||
, overrideRedirect = False
|
|
||||||
, commands = myCommands
|
|
||||||
, sepChar = "%"
|
|
||||||
, alignSep = "}{"
|
|
||||||
, template = "%XMonadLog%"
|
|
||||||
<> "} %date% <hspace=60/> %multicpu% | %memory% * %swap% | %wlxd03745e1e87bwi%"
|
|
||||||
<> "{ <fn=1>USD</fn> %usdrub% <hspace=3/> Vol: %volume% <fn=1><box> %kbd% </box> <fc=#ee9a00>%time%</fc></fn>"
|
|
||||||
}
|
|
||||||
|
|
||||||
myCommands :: [Runnable]
|
|
||||||
myCommands =
|
|
||||||
[ Run $
|
|
||||||
MultiCpu
|
|
||||||
[ "--template", "Cpu: <total>"
|
|
||||||
, "--suffix" , "True"
|
|
||||||
, "--Low" , "10"
|
|
||||||
, "--High" , "50"
|
|
||||||
, "--normal" , colorYellow
|
|
||||||
, "--high" , colorRed
|
|
||||||
]
|
|
||||||
10
|
|
||||||
, Run $ Memory ["-t","Mem: <usedratio>%"] 10
|
|
||||||
, Run $ Swap [] 10
|
|
||||||
, Run $ Date "%a %d %b %Y" "date" (10 `seconds`)
|
|
||||||
, Run $ Date "%H:%M:%S" "time" (1 `seconds`)
|
|
||||||
, Run $ Kbd [("us(dvorak)", "us"), ("ru", "ru")]
|
|
||||||
, Run $
|
|
||||||
Wireless
|
|
||||||
"wlxd03745e1e87b"
|
|
||||||
[ "--template", "<ssid> <quality>"
|
|
||||||
, "--suffix" , "True"
|
|
||||||
, "--Low" , "20"
|
|
||||||
, "--High" , "40"
|
|
||||||
, "--low" , colorRed
|
|
||||||
, "--normal" , colorYellow
|
|
||||||
]
|
|
||||||
(10 `seconds`)
|
|
||||||
, Run $ ComX "/bin/bash" ["-c", "~/scripts/get_volume.sh"] "N/A" "volume" 3
|
|
||||||
, Run $ ComX "/bin/bash" ["-c", "~/scripts/exchangerate.sh"] "N/A" "usdrub" (60 `seconds`)
|
|
||||||
, Run XMonadLog
|
|
||||||
]
|
|
||||||
where
|
|
||||||
seconds, minutes :: Int -> Int
|
|
||||||
seconds = (* 10)
|
|
||||||
minutes = (60 *) . seconds
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
colorBg, colorFg, colorRed, colorGreen, colorYellow, colorCyan :: String
|
|
||||||
colorBg = "#222222"
|
|
||||||
colorFg = "#cccccc"
|
|
||||||
colorRed = "#ff5555"
|
|
||||||
colorGreen = "#50fa7b"
|
|
||||||
colorYellow = "#f1fa8c"
|
|
||||||
colorCyan = "#8be9fd"
|
|
||||||
|
|
||||||
regularFont, boldFont :: Int -> String
|
|
||||||
regularFont size = "xft:Fira Code:size=" <> show size <> ":antialias=true"
|
|
||||||
boldFont size = "xft:Fira Code:bold:size=" <> show size <> ":antialias=true"
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
{- | Use xmobar escape codes to output a string with given foreground and
|
|
||||||
background colors.
|
|
||||||
|
|
||||||
Source: https://hackage.haskell.org/package/xmonad-contrib-0.15/docs/src/XMonad.Hooks.DynamicLog.html#xmobarColor
|
|
||||||
-}
|
|
||||||
xmobarColor
|
|
||||||
:: String -- ^ foreground color: a color name, or #rrggbb format
|
|
||||||
-> String -- ^ background color
|
|
||||||
-> String -- ^ output string
|
|
||||||
-> String
|
|
||||||
xmobarColor fg bg = wrap open "</fc>"
|
|
||||||
where
|
|
||||||
open :: String = concat ["<fc=", fg, if null bg then "" else "," <> bg, ">"]
|
|
||||||
|
|
||||||
-- | Wrap a string in delimiters, unless it is empty.
|
|
||||||
-- Source: https://hackage.haskell.org/package/xmonad-contrib-0.15/docs/src/XMonad.Hooks.DynamicLog.html#wrap
|
|
||||||
wrap
|
|
||||||
:: String -- ^ left delimiter
|
|
||||||
-> String -- ^ right delimiter
|
|
||||||
-> String -- ^ output string
|
|
||||||
-> String
|
|
||||||
wrap _ _ "" = ""
|
|
||||||
wrap l r m = l <> m <> r
|
|
|
@ -1,74 +0,0 @@
|
||||||
# This file was automatically generated by 'stack init'
|
|
||||||
#
|
|
||||||
# Some commonly used options have been documented as comments in this file.
|
|
||||||
# For advanced use and comprehensive documentation of the format, please see:
|
|
||||||
# https://docs.haskellstack.org/en/stable/yaml_configuration/
|
|
||||||
|
|
||||||
# Resolver to choose a 'specific' stackage snapshot or a compiler version.
|
|
||||||
# A snapshot resolver dictates the compiler version and the set of packages
|
|
||||||
# to be used for project dependencies. For example:
|
|
||||||
#
|
|
||||||
# resolver: lts-3.5
|
|
||||||
# resolver: nightly-2015-09-21
|
|
||||||
# resolver: ghc-7.10.2
|
|
||||||
#
|
|
||||||
# The location of a snapshot can be provided as a file or url. Stack assumes
|
|
||||||
# a snapshot provided as a file might change, whereas a url resource does not.
|
|
||||||
#
|
|
||||||
# resolver: ./custom-snapshot.yaml
|
|
||||||
# resolver: https://example.com/snapshots/2018-01-01.yaml
|
|
||||||
resolver:
|
|
||||||
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/2.yaml
|
|
||||||
|
|
||||||
# User packages to be built.
|
|
||||||
# Various formats can be used as shown in the example below.
|
|
||||||
#
|
|
||||||
# packages:
|
|
||||||
# - some-directory
|
|
||||||
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
|
|
||||||
# subdirs:
|
|
||||||
# - auto-update
|
|
||||||
# - wai
|
|
||||||
packages:
|
|
||||||
- .
|
|
||||||
|
|
||||||
# Dependency packages to be pulled from upstream that are not in the resolver.
|
|
||||||
# These entries can reference officially published versions as well as
|
|
||||||
# forks / in-progress versions pinned to a git hash. For example:
|
|
||||||
#
|
|
||||||
# extra-deps:
|
|
||||||
# - acme-missiles-0.3
|
|
||||||
# - git: https://github.com/commercialhaskell/stack.git
|
|
||||||
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
|
|
||||||
#
|
|
||||||
extra-deps:
|
|
||||||
- xmobar-0.42
|
|
||||||
- X11-xft-0.3.4
|
|
||||||
- iwlib-0.1.0
|
|
||||||
|
|
||||||
# Override default flag values for local packages and extra-deps
|
|
||||||
flags:
|
|
||||||
xmobar:
|
|
||||||
with_xft: true
|
|
||||||
with_iwlib: true
|
|
||||||
|
|
||||||
# Extra package databases containing global packages
|
|
||||||
# extra-package-dbs: []
|
|
||||||
|
|
||||||
# Control whether we use the GHC we find on the path
|
|
||||||
# system-ghc: true
|
|
||||||
#
|
|
||||||
# Require a specific version of stack, using version ranges
|
|
||||||
# require-stack-version: -any # Default
|
|
||||||
# require-stack-version: ">=2.7"
|
|
||||||
#
|
|
||||||
# Override the architecture used by stack, especially useful on Windows
|
|
||||||
# arch: i386
|
|
||||||
# arch: x86_64
|
|
||||||
#
|
|
||||||
# Extra directories used by stack for building
|
|
||||||
# extra-include-dirs: [/path/to/dir]
|
|
||||||
# extra-lib-dirs: [/path/to/dir]
|
|
||||||
#
|
|
||||||
# Allow a newer minor version of GHC than the snapshot specifies
|
|
||||||
# compiler-check: newer-minor
|
|
|
@ -1,34 +0,0 @@
|
||||||
# This file was autogenerated by Stack.
|
|
||||||
# You should not edit this file by hand.
|
|
||||||
# For more information, please see the documentation at:
|
|
||||||
# https://docs.haskellstack.org/en/stable/lock_files
|
|
||||||
|
|
||||||
packages:
|
|
||||||
- completed:
|
|
||||||
hackage: xmobar-0.42@sha256:a4583cea362e6e10a9633dc083987377a6016c1c0756802ef06dbb6c2ef77e30,14676
|
|
||||||
pantry-tree:
|
|
||||||
size: 9019
|
|
||||||
sha256: b35b11bd2c2656dc0f033c530a76a7803e48857859802551980fef35de112ba0
|
|
||||||
original:
|
|
||||||
hackage: xmobar-0.42
|
|
||||||
- completed:
|
|
||||||
hackage: X11-xft-0.3.4@sha256:e08bd69d24c40f1a33e6c87964f200656da77ad6a1fbdf6a4073dcb967e65599,1380
|
|
||||||
pantry-tree:
|
|
||||||
size: 330
|
|
||||||
sha256: 0dad74fea9135433d0f4ca7a65dba6c8ac99136bb6cacf901d2ddf795846d0f1
|
|
||||||
original:
|
|
||||||
hackage: X11-xft-0.3.4
|
|
||||||
- completed:
|
|
||||||
hackage: iwlib-0.1.0@sha256:226e4582d6878166a172ff98c868e25c4ed478ab28ab493498e464b1fe19d39a,921
|
|
||||||
pantry-tree:
|
|
||||||
size: 259
|
|
||||||
sha256: f867a93991b791adf4c65bb91f385effee7e18bd78d8e0a61fd03f42f6073705
|
|
||||||
original:
|
|
||||||
hackage: iwlib-0.1.0
|
|
||||||
snapshots:
|
|
||||||
- completed:
|
|
||||||
size: 617368
|
|
||||||
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/2.yaml
|
|
||||||
sha256: e7e57649a12f6178d1158e4b6f1f1885ed56d210ae6174385271cecc9b1ea974
|
|
||||||
original:
|
|
||||||
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/2.yaml
|
|
|
@ -1,26 +0,0 @@
|
||||||
cabal-version: 2.2
|
|
||||||
|
|
||||||
-- This file has been generated from package.yaml by hpack version 0.34.4.
|
|
||||||
--
|
|
||||||
-- see: https://github.com/sol/hpack
|
|
||||||
|
|
||||||
name: xmobarrc
|
|
||||||
version: 0.1.0
|
|
||||||
synopsis: My xmobar configuration
|
|
||||||
homepage: https://github.com/pleshevskiy/myconfig
|
|
||||||
author: Pleshevskiy
|
|
||||||
maintainer: dmitriy@ideascup.me
|
|
||||||
license: Beerware
|
|
||||||
build-type: Simple
|
|
||||||
|
|
||||||
executable xmobar
|
|
||||||
hs-source-dirs:
|
|
||||||
src
|
|
||||||
main-is: xmobar.hs
|
|
||||||
other-modules:
|
|
||||||
Paths_xmobarrc
|
|
||||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
|
||||||
build-depends:
|
|
||||||
base
|
|
||||||
, xmobar
|
|
||||||
default-language: Haskell2010
|
|
Loading…
Reference in a new issue