From 905edcbe535f0270cfae8e66e927a1e1ed49b89a Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Tue, 21 Dec 2010 12:19:30 +0100 Subject: Samples moved to samples/ --- README | 14 ++++++++------ samples/Plugins/HelloWorld.hs | 24 ++++++++++++++++++++++++ samples/Plugins/helloworld.config | 12 ++++++++++++ samples/xmobar.config | 18 ++++++++++++++++++ src/Plugins/HelloWorld.hs | 24 ------------------------ src/Plugins/helloworld.config | 12 ------------ xmobar.cabal | 8 +++++--- xmobar.config-sample | 18 ------------------ 8 files changed, 67 insertions(+), 63 deletions(-) create mode 100644 samples/Plugins/HelloWorld.hs create mode 100644 samples/Plugins/helloworld.config create mode 100644 samples/xmobar.config delete mode 100644 src/Plugins/HelloWorld.hs delete mode 100644 src/Plugins/helloworld.config delete mode 100644 xmobar.config-sample diff --git a/README b/README index 4abba31..9b9b9f7 100644 --- a/README +++ b/README @@ -6,7 +6,7 @@ About xmobar is a minimalistic, text based, status bar. It was originally designed and implemented by Andrea Rossato to work with [xmonad], -but it's actually window-manager-agnostic. +but it's actually usable with any window-manager. xmobar was inspired by the [Ion3] status bar, and supports similar features, like dynamic color management, output templates, and @@ -127,7 +127,9 @@ Configuration ## Quick Start -See [xmobar.config-sample] for an example. +See [samples/xmobar.config] for an example. + +[samples/xmobar.config]: http://github.com/jaor/xmobar/raw/master/samples/xmobar.config For the output template: @@ -836,13 +838,14 @@ configuration options. This requires importing your plugin into `Config.hs` and adding your type to the type list in the type signature of `Config.runnableTypes`. -For a very basic example see `Plugins/HelloWorld.hs` or the other -plugins that are distributed with xmobar. +For a very basic example see `samples/Plugins/HelloWorld.hs` or the +other plugins that are distributed with xmobar. ## Installing/Removing a Plugin Installing a plugin should require 3 steps. Here we are going to -install the HelloWorld plugin that comes with xmobar: +install the HelloWorld plugin that comes with xmobar, assuming that +you copied it to `src/Plugins`: 1. import the plugin module in `Config.hs`, by adding: @@ -974,4 +977,3 @@ Copyright © 2010 Jose Antonio Ortega Ruiz [libmpd]: http://hackage.haskell.org/package/libmpd/ [sawfish]: http://sawfish.wikia.com/ [utf8-string]: http://hackage.haskell.org/package/utf8-string/ -[xmobar.config-sample]: http://github.com/jaor/xmobar/raw/master/xmobar.config-sample diff --git a/samples/Plugins/HelloWorld.hs b/samples/Plugins/HelloWorld.hs new file mode 100644 index 0000000..df5cff6 --- /dev/null +++ b/samples/Plugins/HelloWorld.hs @@ -0,0 +1,24 @@ +----------------------------------------------------------------------------- +-- | +-- Module : Plugins.HelloWorld +-- Copyright : (c) Andrea Rossato +-- License : BSD-style (see LICENSE) +-- +-- Maintainer : Jose A. Ortega Ruiz +-- Stability : unstable +-- Portability : unportable +-- +-- A plugin example for Xmobar, a text based status bar +-- +----------------------------------------------------------------------------- + +module Plugins.HelloWorld where + +import Plugins + +data HelloWorld = HelloWorld + deriving (Read, Show) + +instance Exec HelloWorld where + alias HelloWorld = "helloWorld" + run HelloWorld = return "Hello World!!" diff --git a/samples/Plugins/helloworld.config b/samples/Plugins/helloworld.config new file mode 100644 index 0000000..3818bfa --- /dev/null +++ b/samples/Plugins/helloworld.config @@ -0,0 +1,12 @@ +Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" + , bgColor = "#000000" + , fgColor = "#BFBFBF" + , position = TopW C 90 + , commands = [ Run Cpu [] 10 + , Run Weather "LIPB" [] 36000 + , Run HelloWorld + ] + , sepChar = "%" + , alignSep = "}{" + , template = "%cpu% } %helloWorld% { %LIPB% | %date%" + } diff --git a/samples/xmobar.config b/samples/xmobar.config new file mode 100644 index 0000000..b061459 --- /dev/null +++ b/samples/xmobar.config @@ -0,0 +1,18 @@ +Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" + , bgColor = "black" + , fgColor = "grey" + , position = Top + , lowerOnStart = True + , commands = [ Run Weather "EGPF" ["-t",": C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000 + , Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10 + , Run Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"] 10 + , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10 + , Run Memory ["-t","Mem: %"] 10 + , Run Swap [] 10 + , Run Com "uname" ["-s","-r"] "" 36000 + , Run Date "%a %b %_d %Y %H:%M:%S" "date" 10 + ] + , sepChar = "%" + , alignSep = "}{" + , template = "%cpu% | %memory% * %swap% | %eth0% - %eth1% }{ %date%| %EGPF% | %uname%" + } diff --git a/src/Plugins/HelloWorld.hs b/src/Plugins/HelloWorld.hs deleted file mode 100644 index df5cff6..0000000 --- a/src/Plugins/HelloWorld.hs +++ /dev/null @@ -1,24 +0,0 @@ ------------------------------------------------------------------------------ --- | --- Module : Plugins.HelloWorld --- Copyright : (c) Andrea Rossato --- License : BSD-style (see LICENSE) --- --- Maintainer : Jose A. Ortega Ruiz --- Stability : unstable --- Portability : unportable --- --- A plugin example for Xmobar, a text based status bar --- ------------------------------------------------------------------------------ - -module Plugins.HelloWorld where - -import Plugins - -data HelloWorld = HelloWorld - deriving (Read, Show) - -instance Exec HelloWorld where - alias HelloWorld = "helloWorld" - run HelloWorld = return "Hello World!!" diff --git a/src/Plugins/helloworld.config b/src/Plugins/helloworld.config deleted file mode 100644 index 3818bfa..0000000 --- a/src/Plugins/helloworld.config +++ /dev/null @@ -1,12 +0,0 @@ -Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" - , bgColor = "#000000" - , fgColor = "#BFBFBF" - , position = TopW C 90 - , commands = [ Run Cpu [] 10 - , Run Weather "LIPB" [] 36000 - , Run HelloWorld - ] - , sepChar = "%" - , alignSep = "}{" - , template = "%cpu% } %helloWorld% { %LIPB% | %date%" - } diff --git a/xmobar.cabal b/xmobar.cabal index da7d9e5..ebc2236 100644 --- a/xmobar.cabal +++ b/xmobar.cabal @@ -11,14 +11,11 @@ description: Xmobar is a minimalistic text based status bar. category: System license: BSD3 license-file: LICENSE -extra-source-files: README, NEWS author: Andrea Rossato maintainer: Jose A. Ortega Ruiz cabal-version: >= 1.6 build-type: Simple -data-files: xmobar.config-sample - source-repository head type: git location: git://github.com/jaor/xmobar.git @@ -51,6 +48,11 @@ flag all_extensions description: Includes all optional extensions. default: False +data-files: samples/xmobar.config +extra-source-files: README, NEWS, + samples/Plugins/helloworld.config, + samples/Plugins/HelloWorld.hs + executable xmobar hs-source-dirs: src main-is: Main.hs diff --git a/xmobar.config-sample b/xmobar.config-sample deleted file mode 100644 index b061459..0000000 --- a/xmobar.config-sample +++ /dev/null @@ -1,18 +0,0 @@ -Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" - , bgColor = "black" - , fgColor = "grey" - , position = Top - , lowerOnStart = True - , commands = [ Run Weather "EGPF" ["-t",": C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000 - , Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10 - , Run Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"] 10 - , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10 - , Run Memory ["-t","Mem: %"] 10 - , Run Swap [] 10 - , Run Com "uname" ["-s","-r"] "" 36000 - , Run Date "%a %b %_d %Y %H:%M:%S" "date" 10 - ] - , sepChar = "%" - , alignSep = "}{" - , template = "%cpu% | %memory% * %swap% | %eth0% - %eth1% }{ %date%| %EGPF% | %uname%" - } -- cgit v1.2.3