summaryrefslogtreecommitdiffhomepage
path: root/samples
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2018-11-25 15:26:44 +0000
committerjao <jao@gnu.org>2018-11-25 15:26:44 +0000
commitf86bbb8ca5d3ba0d18e333cbe6cb57cc17e3ae07 (patch)
treeba34733d783dfcb65234ed835deac13a9a9c100e /samples
parentb12fe3ebdaf3a4a539b85f742a582925d7e811f1 (diff)
downloadxmobar-f86bbb8ca5d3ba0d18e333cbe6cb57cc17e3ae07.tar.gz
xmobar-f86bbb8ca5d3ba0d18e333cbe6cb57cc17e3ae07.tar.bz2
doc, examples
Diffstat (limited to 'samples')
-rw-r--r--samples/Plugins/HelloWorld.hs24
-rw-r--r--samples/Plugins/helloworld.config12
-rwxr-xr-xsamples/padding-icon.sh56
-rwxr-xr-xsamples/status.sh54
-rw-r--r--samples/xmobar.config38
-rw-r--r--samples/xmonadpropwrite.hs41
6 files changed, 0 insertions, 225 deletions
diff --git a/samples/Plugins/HelloWorld.hs b/samples/Plugins/HelloWorld.hs
deleted file mode 100644
index d2267ae..0000000
--- a/samples/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 <jao@gnu.org>
--- Stability : unstable
--- Portability : unportable
---
--- A plugin example for Xmobar, a text based status bar
---
------------------------------------------------------------------------------
-
-module Xmobar.Plugins.HelloWorld where
-
-import Xmobar.Plugins
-
-data HelloWorld = HelloWorld
- deriving (Read, Show)
-
-instance Exec HelloWorld where
- alias HelloWorld = "helloWorld"
- run HelloWorld = return "<fc=red>Hello World!!</fc>"
diff --git a/samples/Plugins/helloworld.config b/samples/Plugins/helloworld.config
deleted file mode 100644
index 3818bfa..0000000
--- a/samples/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% | <fc=yellow>%date%</fc>"
- }
diff --git a/samples/padding-icon.sh b/samples/padding-icon.sh
deleted file mode 100755
index 31f5eeb..0000000
--- a/samples/padding-icon.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-
-# Detects the width of running window with name given as first
-# argument (xprop name '$1') and creates an XPM icon of that width,
-# 1px height, and transparent. Outputs an <icon>-tag for use in
-# xmobar to display the generated XPM icon.
-#
-# Run script from xmobar and trayer:
-# `Run Com "/where/ever/padding-icon.sh" ["panel"] "trayerpad" 10`
-# and use `%trayerpad%` in your template.
-# or, if you're using for instance stalonetray:
-# `Run Com "/where/ever/padding-icon.sh" ["stalonetray"] "tray" 10`
-
-# Very heavily based on Jonas Camillus Jeppensen code
-# https://github.com/jaor/xmobar/issues/239#issuecomment-233206552
-
-# Function to create a transparent Wx1 px XPM icon
-create_xpm_icon () {
-timestamp=$(date)
-pixels=$(for i in `seq $1`; do echo -n "."; done)
-
-cat << EOF > "$2"
-/* XPM *
-static char * trayer_pad_xpm[] = {
-/* This XPM icon is used for padding in xmobar to */
-/* leave room for trayer-srg. It is dynamically */
-/* updated by by trayer-pad-icon.sh which is run */
-/* by xmobar. */
-/* Created: ${timestamp} */
-/* <w/cols> <h/rows> <colors> <chars per pixel> */
-"$1 1 1 1",
-/* Colors (none: transparent) */
-". c none",
-/* Pixels */
-"$pixels"
-};
-EOF
-}
-
-# panel window name
-pname=${1:-panel}
-
-# Width of the trayer window
-width=$(xprop -name $pname | grep 'program specified minimum size' | cut -d ' ' -f 5)
-
-# Icon file name
-iconfile="/tmp/$pname-padding-${width:-0}px.xpm"
-
-# If the desired icon does not exist create it
-if [ ! -f $iconfile ]
-then
- create_xpm_icon $width $iconfile
-fi
-
-# Output the icon tag for xmobar
-echo "<icon=${iconfile}/>"
diff --git a/samples/status.sh b/samples/status.sh
deleted file mode 100755
index 94e8fe7..0000000
--- a/samples/status.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-
-STATUSPIPE="/tmp/xmobar_status_jrk"
-
-function isMuted () {
- # retrieve mute status
- # return an arbitrary string for true or nothing at all
- echo
-}
-
-function getPercent () {
- # somehow retrieve the percent value as plain int (e.g. "66")
- echo "66"
-}
-
-function percentBar () {
- local i=1 res=
- normal=47 high=80
- fgColor='#657b83' mutedColor='#cb4b16'
- lowColor='#859900' midColor='#b58900'
- highColor='#cb4b16'
-
- bar="$(echo -ne "\u2588")"
- percent="$( getPercent )"
- muted="$( isMuted )"
-
- if [ -n "$muted" ]; then
- res="<fc=$mutedColor>"
- else
- res="<fc=$lowColor>"
- fi
-
- while [ $i -lt $percent ]; do
- if [ $i -eq $normal -a -z "$muted" ]; then
- res+="</fc><fc=$midColor>"
- elif [ $i -eq $high -a -z "$muted" ]; then
- res+="</fc><fc=$highColor>"
- fi
-
- res+=$bar
- i=$((i+1))
- done
-
- res+="</fc><fc=$fgColor>"
-
- while [ $i -lt 100 ]; do
- res+='-'
- i=$((i+1))
- done
-
- echo "$res</fc>"
-}
-
-echo "$( percentBar )" > "$STATUSPIPE"
diff --git a/samples/xmobar.config b/samples/xmobar.config
deleted file mode 100644
index c0d4cdc..0000000
--- a/samples/xmobar.config
+++ /dev/null
@@ -1,38 +0,0 @@
-Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
- , additionalFonts = []
- , borderColor = "black"
- , border = TopB
- , bgColor = "black"
- , fgColor = "grey"
- , alpha = 255
- , position = Top
- , textOffset = -1
- , iconOffset = -1
- , lowerOnStart = True
- , pickBroadest = False
- , persistent = False
- , hideOnStart = False
- , iconRoot = "."
- , allDesktops = True
- , overrideRedirect = True
- , commands = [ Run Weather "EGPF" ["-t","<station>: <tempC>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: <usedratio>%"] 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% }\
- \{ <fc=#ee9a00>%date%</fc>| %EGPF% | %uname%"
- }
diff --git a/samples/xmonadpropwrite.hs b/samples/xmonadpropwrite.hs
deleted file mode 100644
index f3f4a5d..0000000
--- a/samples/xmonadpropwrite.hs
+++ /dev/null
@@ -1,41 +0,0 @@
--- Copyright Spencer Janssen <spencerjanssen@gmail.com>
--- Tomas Janousek <tomi@nomi.cz>
--- BSD3 (see LICENSE)
---
--- Reads from standard input and writes to an X propery on root window.
--- To be used with XPropertyLog:
--- Add it to commands:
--- Run XPropertyLog "_XMONAD_LOG_CUSTOM"
--- Add it to the template:
--- template = "... %_XMONAD_LOG_CUSTOM% ..."
--- Run:
--- $ blah blah | xmonadpropwrite _XMONAD_LOG_CUSTOM
-
-import Control.Monad
-import Graphics.X11
-import Graphics.X11.Xlib.Extras
-import qualified Data.ByteString as B
-import Foreign.C (CChar)
-import System.IO
-import System.Environment
-
-main = do
- atom <- flip fmap getArgs $ \args -> case args of
- [a] -> a
- _ -> "_XMONAD_LOG"
-
- d <- openDisplay ""
- xlog <- internAtom d atom False
- ustring <- internAtom d "UTF8_STRING" False
-
- root <- rootWindow d (defaultScreen d)
-
- forever $ do
- msg <- B.getLine
- changeProperty8 d root xlog ustring propModeReplace (encodeCChar msg)
- sync d True
-
- return ()
-
-encodeCChar :: B.ByteString -> [CChar]
-encodeCChar = map fromIntegral . B.unpack