From 1c8d04a6e34b3697e20fc293f412b6815deafc18 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Sun, 28 Aug 2022 17:20:57 +0300 Subject: [PATCH] prog: remove xmobar --- programs/xmobar/.gitignore | 2 - programs/xmobar/README.md | 1 - programs/xmobar/Setup.hs | 2 - programs/xmobar/package.yaml | 21 ----- programs/xmobar/src/xmobar.hs | 132 -------------------------------- programs/xmobar/stack.yaml | 74 ------------------ programs/xmobar/stack.yaml.lock | 34 -------- programs/xmobar/xmobarrc.cabal | 26 ------- 8 files changed, 292 deletions(-) delete mode 100644 programs/xmobar/.gitignore delete mode 100644 programs/xmobar/README.md delete mode 100644 programs/xmobar/Setup.hs delete mode 100644 programs/xmobar/package.yaml delete mode 100644 programs/xmobar/src/xmobar.hs delete mode 100644 programs/xmobar/stack.yaml delete mode 100644 programs/xmobar/stack.yaml.lock delete mode 100644 programs/xmobar/xmobarrc.cabal diff --git a/programs/xmobar/.gitignore b/programs/xmobar/.gitignore deleted file mode 100644 index c368d45..0000000 --- a/programs/xmobar/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.stack-work/ -*~ \ No newline at end of file diff --git a/programs/xmobar/README.md b/programs/xmobar/README.md deleted file mode 100644 index 5e0b623..0000000 --- a/programs/xmobar/README.md +++ /dev/null @@ -1 +0,0 @@ -# xmobar diff --git a/programs/xmobar/Setup.hs b/programs/xmobar/Setup.hs deleted file mode 100644 index 9a994af..0000000 --- a/programs/xmobar/Setup.hs +++ /dev/null @@ -1,2 +0,0 @@ -import Distribution.Simple -main = defaultMain diff --git a/programs/xmobar/package.yaml b/programs/xmobar/package.yaml deleted file mode 100644 index 295f36f..0000000 --- a/programs/xmobar/package.yaml +++ /dev/null @@ -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 - diff --git a/programs/xmobar/src/xmobar.hs b/programs/xmobar/src/xmobar.hs deleted file mode 100644 index e0b1395..0000000 --- a/programs/xmobar/src/xmobar.hs +++ /dev/null @@ -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% %multicpu% | %memory% * %swap% | %wlxd03745e1e87bwi%" - <> "{ USD %usdrub% Vol: %volume% %kbd% %time%" - } - -myCommands :: [Runnable] -myCommands = - [ Run $ - MultiCpu - [ "--template", "Cpu: " - , "--suffix" , "True" - , "--Low" , "10" - , "--High" , "50" - , "--normal" , colorYellow - , "--high" , colorRed - ] - 10 - , Run $ Memory ["-t","Mem: %"] 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", " " - , "--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 "" - where - open :: String = concat [" 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 diff --git a/programs/xmobar/stack.yaml b/programs/xmobar/stack.yaml deleted file mode 100644 index bf45b68..0000000 --- a/programs/xmobar/stack.yaml +++ /dev/null @@ -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 diff --git a/programs/xmobar/stack.yaml.lock b/programs/xmobar/stack.yaml.lock deleted file mode 100644 index 02fcc33..0000000 --- a/programs/xmobar/stack.yaml.lock +++ /dev/null @@ -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 diff --git a/programs/xmobar/xmobarrc.cabal b/programs/xmobar/xmobarrc.cabal deleted file mode 100644 index 3c2c529..0000000 --- a/programs/xmobar/xmobarrc.cabal +++ /dev/null @@ -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