SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-04-13 23:52:18

dinner
Member
Registered: 2012-03-15
Posts: 20

Few questions about WMFS

So I have 2 different things I would like to try, but I would like to know how to do them both

status.sh:

#!/bin/sh
#WMFS status.sh example file

TIMING=10
#colors
default="#222222"
green="#4E9A06"
lightgreen="#6DDD00"
grey="#7D7D7D"
dark="#1A1A1A"
dblue="#1874cd"
blue="#63b8ff"
red="#CC0000"
orange="#FFB000"
purple="#8E00FF"
# separator
sep="^R[right;2;10;$default]"
# mail

# power
pwr(){
    pwrperc="$awk 'sub(/,/,"") {print $4}' <(acpi -b) | cut -d , -f 1 $1)"
    if [ "$pwrperc" == "100%" ]; then
        pwr="100"
    else
        pwr="$(echo $pwrperc | cut -c1-2)"
    fi
    if (( $pwr > 30 )); then
        barcolor="$dblue"
    else
        barcolor="$red"
    fi
    echo "^s[70;10;$grey;bat]^p[90;2;40;8;0;$pwr;100;$dark;$barcolor](1;spawn;~/.config/wmfs/scripts/dzen_battery.sh)^R[110;2;1;10;$default]"
} 

day(){
    day="$(date +"%d")"
    echo "^s[630;10;$grey;date](1;spawn;~/.config/wmfs/scripts/dzen_calendar.sh)^p[660;2;100;4;0;$day;31;$dark;$grey]"
}
month(){
    month="(date +"%m")"
    echo "^p[660;7;100;4;0;$month;12;$dark;$grey]"
}
hour(){
    hour="$(date +"%I")"
    echo "^s[770;10;$grey;time ](1;spawn;~/.config/wmfs/scripts/dzen_time.sh)^p[800;2;80;4;0;$hour;12;$dark;$green]"
}
minut(){
    minut="$(date +"%M")"
    echo "^p[800;7;80;4;0;$minut;60;$dark;$green]^R[820;0;1;12;$default]^R[840;0;1;12;$default]^R[860;0;1;12;$default]"
}
cpugraph(){
    cpu="$(eval $(awk '/^cpu /{print "previdle=" $5 "; prevtotal=" $2+$3+$4+$5 }' /proc/stat); sleep 0.4;
          eval $(awk '/^cpu /{print "idle=" $5 "; total=" $2+$3+$4+$5 }' /proc/stat);
          intervaltotal=$((total-${prevtotal:-0}));
          echo "$((100*( (intervaltotal) - ($idle-${previdle:-0}) ) / (intervaltotal) ))")"
    if (( $cpu > 80 )); then
        graphcolor="$red"
    else
        graphcolor="$orange"
    fi
    echo "^s[140;10;$grey;core]^g[170;2;80;8;$cpu;100;$dark;$graphcolor;cpugraph](1;spawn;urxvtc -e htop)"
}
# membar
membar(){
    memu="$(free -m | sed -n 's|^-.*:[ \t]*\([0-9]*\) .*|\1|gp')"
    memt="$(free -m | sed -n 's|^M.*:[ \t]*\([0-9]*\) .*|\1|gp')"
    if (( $memu > 800 )); then
        barcolor="$red"
    else
        barcolor="$lightgreen"
    fi
    echo "^s[260;10;$grey;mem ]^p[290;2;80;8;0;$memu;$memt;$dark;$barcolor](1;spawn;urxvtc -e htop)^R[330;2;1;10;$default]"
}
# hdd section
hdd(){
    hdd="$(df -h|grep sda3|awk '{print $5}' | cut -c1-2)"
    if (( $hdd > 90 )); then
        barcolor="$red"
    else
        barcolor="$grey"
    fi
    echo "^s[390;10;$grey;hdd]^p[415;2;40;8;0;$hdd;100;$dark;$barcolor](1;spawn;~/.config/wmfs/scripts/dzen_disks.sh)(3;spawn;urxvt -e ncdu)"
}
#statustext


conky -q | while read LINE; do wmfs -c status "default $LINE"; done
conky -q | while read LINE; do wmfs -c status "1 $(pwr)  $(cpugraph) $(membar) $(hdd)"; done

wmfsrc

#
# WMFS2 configuration file
#

# Possible file inclusion:
# @include "file"

# Multi theme section
[themes]
  [theme]
     # No name mean default
     # name = "default"

     font = "ProFont"
     

     
     # Bars
     bars_width = 14
     bars_fg = "#FFFFFF"
     bars_bg = "#000000"

     # Element tags
     tags_normal_fg = "#FFFFFF"
     tags_normal_bg = "#000000"
#     tags_normal_bg = "#ffffff"
     # tags_normal_statusline = ""

     tags_sel_fg    = "#000000"
     tags_sel_bg    = "#3B6686"
     # tags_sel_statusline = ""

     tags_occupied_fg = "#AABBAA"
     tags_occupied_bg = "#000000"
     # tags_occupied_statusline = ""

     tags_urgent_fg    = "#AABBAA"
     tags_urgent_bg    = "#000000"
     tags_urgent_statusline = "\R[0;0;100;1;#AABBAA]"

     tags_border_color = "#112211"
     tags_border_width = 0

     # Frame / Client
     client_normal_fg = "#000000"
     client_normal_bg = "#AABBAA"
     client_normal_statusline = "\s[3;9;#121212;x] \s[2;8;#ff0000;x](1;client_close)"

     client_sel_fg = "#000000"
     client_sel_bg = "#AABBAA"
     client_sel_statusline = "\s[3;9;#121212;x] \s[2;8;#ff0000;x](1;client_close)"

     # client_free_statusline = ""

     frame_bg = "#FFFFFF"
     client_titlebar_width = 1
     client_border_width = 1


   [/theme]

[/themes]

[bars]

  # Position:
  #
  # 0  Top
  # 1  Bottom
  # 2  Hide

  # Element type:
  #
  # t  Tags
  # s  Statustext (will take available space)
  # y  Systray (can be set only ONE time among all element)
  # l  Launcher (will be expended at launcher use)

  [bar]
     position = 0
     screen = 0
     elements = "tlsy"   # element order in bar
     theme = "default"
     
        bg     = "#0C0C0C"
        fg     = "#ffffff"
        border = false 
        height = 19
        # selbar = false   #not worked now, see section [selbar]

        [systray]
                # Enable/disable systray
                active = true

                # Screen of systray
                screen = 0

                # Spacing between tray icons
                spacing = 2
        [/systray]

        # Remove this section to disable the selbar.
        [selbar]
                bg     = "#0c0c0c"
                fg     = "#ffffff"

                # Cut title length
                 max_length = 90

                [mouse] button = "3" func = "clientlist"  [/mouse]
                [mouse] button = "4" func = "client_next" [/mouse]
                [mouse] button = "5" func = "client_prev" [/mouse]
        [/selbar]
  [/bar]

  [bar]
     position = 1
     screen = 0
     elements = "s"
     theme = "default"
  [/bar]



[/bars]

[tags]

  # Use no screen option or screen = -1 to set tag on each screen
  [tag]
      screen = -1
      name = "main"
   
  [/tag]

  [tag] name = "web" screen = 0 layout = "title_right" [/tag]
  [tag] name = "term" screen = 0 layout = "center" [/tag]
  [tag] name = "chat" [/tag]
  [tag] name = "media" [/tag]
  [tag] name = "edit" [/tag]
  [tag] name = "xtra" [/tag]

  # Mousebinds associated to Tags element button
  [mouse] button = "1" func = "tag_click" [/mouse]
  [mouse] button = "4" func = "tag_next"  [/mouse]
  [mouse] button = "5" func = "tag_prev"  [/mouse]


[/tags]

[client]

  theme = "default"
  key_modifier = "Super"
  [mouse] button = "1" func = "client_focus_click"    [/mouse]
  [mouse] button = "1" func = "mouse_swap"            [/mouse]
  [mouse] button = "2" func = "mouse_tab"             [/mouse]
  [mouse] button = "3" func = "mouse_resize"          [/mouse]
  [mouse] button = "4" func = "client_focus_next_tab" [/mouse]
  [mouse] button = "5" func = "client_focus_prev_tab" [/mouse]

[/client]

[rules]


  
  [rule]
    instance = "x-www-browser"
    tag    = 1  # 2nd tag
    free = false
  [/rule]
  
  [rule]
        instance = "terminator"
        tag = 2 # 3rd tag
        free = true
        screen = 0
  [/rule]
  
  [rule]
    instance = "xchat"
    tag = 3
    free = true
    screen = 0
  [/rule]
  
  [rule]
    instance = "vlc"
    tag = 4
    free = true
  [/rule]
  
  [rule]
    instance = "banshee"
    tag = 4
    free = true
  [/rule]
  
  [rule]
    instance = "smplayer"
    tag = 4
    free = true
  [/rule]
  
  [rule]
    instance = "viewnior"
    tag = 4
    free = true
  [/rule]
  
  [rule]
    instance = "geany"
    tag = 5
    free = false
  [/rule]
  
  [rule]
    instance = "abiword"
    tag = 5
    free = false
  [/rule]
  
  [rule]
    instance = "libreoffice"
    tag = 5
    free = false
  [/rule]
  
  [rule]
    instance = "emacs"
    tag = 5
    free = false
  [/rule]
  
  [rule]
    instance = "thunar"
    tag = 6 #which is the final one, xtra (7)
    free = false
  [/rule]
  
  [rule]
    instance = "virtualbox"
    tag = 6
    free = true
  [/rule]


[/rules]

[launchers]

  # command can be an uicb function or an uicb function + extension (see example)
  [launcher]
     name = "exec"
     prompt = "Run:"

     # Example of uicb + ext:
     #   command = "spawn xterm -e"
     command = "spawn"

     width = 150
  [/launcher]

[/launchers]

[root]

        #background_command = "bash /home/dinner/.config/wmfs/autostart.sh"

        #background_command = "/home/r00ted/.config/wmfs/autostart.sh"
        #Command you can execute to set the background.
        #background_command = "nitrogen --set-scaled /home/dinner/images/wallpapers/cb971b249bc3af2069702e919a712894.jpg"
        #background_command = "nitrogen --restore"
        #background_command = "parcellite"
        #background_command = "nm-applet"
        #background_command = "volumeicon"
        #[mouse] button = "4" func = "tag_next"              [/mouse]
        #[mouse] button = "5" func = "tag_prev"              [/mouse]
        [mouse] button = "2" func = "menu" cmd = "rootmenu" [/mouse]
[/root]

[menu]
        # Default menu, binded on the root window, button 3.
        [set_menu]
                name = "rootmenu"

                # place_at_mouse = false
                # x = 40 y = 50

                # Available "center", "left", "right" menu align. Default: "center".
                align = "left"

                fg_focus  = "#191919" bg_focus  = "#7E89A2"
                fg_normal = "#9F9AB3" bg_normal = "#191919"

                [item] name = "Applications" submenu = "appmenu"                                     [/item]
                [item] name = "Shutdown"        func = "spawn" cmd = "urxvt -e sudo shutdown -h now" [/item]
                [item] name = "Restart"         func = "spawn" cmd = "urxvt -e sudo shutdown -r now" [/item]  
        [/set_menu]

        [set_menu]
                name = "appmenu"
                align = "left"

                fg_focus  = "#191919" bg_focus  = "#7E89A2"
                fg_normal = "#9F9AB3" bg_normal = "#191919"

                [item] name = "Browser"         func = "spawn" cmd = "x-www-browser"           [/item]
                [item] name = "Terminal"        func = "spawn" cmd = "terminator"              [/item]
                [item] name = "File Manager"    func = "spawn" cmd = "urxvt -e thunar"        [/item]
                [item] name = "Volume Control"  func = "spawn" cmd = "urxvt -e alsamixer" [/item]
        [/set_menu]

        [set_menu]
                name = "clientmenu"

                fg_focus  = "#D4D4D4" bg_focus  = "#003366"
                fg_normal = "#D4D4D4" bg_normal = "#191919"

                # Check items: possible 'check_max' or 'check_free'.
                [item] name = "Close"    func = "client_kill"                      [/item]
                [item] name = "Maximize" func = "toggle_max"  check = "check_max"  [/item]
                [item] name = "Free"     func = "toggle_free" check = "check_free" [/item]
        [/set_menu]
[/menu]

[keys]

  [key] mod = {"Super"} key = "Return" func = "spawn" cmd = "terminator" [/key]
  

  [key] mod = {"Control", "Alt"} key = "q" func = "quit" [/key]
  [key] mod = {"Control", "Alt"} key = "r" func = "reload" [/key]

  # Tag manipulation
  [key] mod = {"Super"} key = "F1" func = "tag_set" cmd = "0" [/key]
  [key] mod = {"Super"} key = "F2" func = "tag_set" cmd = "1" [/key]
  [key] mod = {"Super"} key = "F3" func = "tag_set" cmd = "2" [/key]
  [key] mod = {"Super"} key = "F4" func = "tag_set" cmd = "3" [/key]
  [key] mod = {"Super"} key = "F5" func = "tag_set" cmd = "4" [/key]
  [key] mod = {"Super"} key = "F6" func = "tag_set" cmd = "5" [/key]
  [key] mod = {"Super"} key = "F7" func = "tag_set" cmd = "6" [/key]
  [key] mod = {"Super"} key = "F8" func = "tag_set" cmd = "7" [/key]

  [key] mod = {"Super", "Shift"} key = "F1" func = "tag_client" cmd = "0" [/key]
  [key] mod = {"Super", "Shift"} key = "F2" func = "tag_client" cmd = "1" [/key]
  [key] mod = {"Super", "Shift"} key = "F3" func = "tag_client" cmd = "2" [/key]
  [key] mod = {"Super", "Shift"} key = "F4" func = "tag_client" cmd = "3" [/key]
  [key] mod = {"Super", "Shift"} key = "F5" func = "tag_client" cmd = "4" [/key]
  [key] mod = {"Super", "Shift"} key = "F6" func = "tag_client" cmd = "5" [/key]
  [key] mod = {"Super", "Shift"} key = "F7" func = "tag_client" cmd = "6" [/key]
  [key] mod = {"Super", "Shift"} key = "F8" func = "tag_client" cmd = "7" [/key]

  [key] mod = {"Super"} key = "minus" func = "tag_del" [/key]
  [key] mod = {"Super", "Shift"} key = "minus" func = "tag_new" [/key]

  # tag function: cmd = nameofthetag
  #[key] mod = {"Super"} key = "z" func = "tag" cmd = "2" [/key]

  [key] mod = {"Control"} key = "Right" func = "tag_next" [/key]
  [key] mod = {"Control"} key = "Left"  func = "tag_prev" [/key]

  [key] mod = {"Control"} key = "Up"  func = "screen_next" [/key]
  [key] mod = {"Control"} key = "Down" func = "screen_prev" [/key]

  [key] mod = {"Super"} key = "q" func = "client_close" [/key]

  # Focus next / prev client and next / prev tabbed client
  [key] mod = { "Alt" }            key = "Tab" func = "client_focus_next" [/key]
  [key] mod = { "Alt", "Shift" }   key = "Tab" func = "client_focus_prev" [/key]
  [key] mod = { "Super" }          key = "Tab" func = "client_focus_next_tab" [/key]
  [key] mod = { "Super", "Shift" } key = "Tab" func = "client_focus_prev_tab" [/key]

  # Focus next client with direction
  [key] mod = {"Alt"} key = "h" func = "client_focus_left"   [/key]
  [key] mod = {"Alt"} key = "l" func = "client_focus_right"  [/key]
  [key] mod = {"Alt"} key = "k" func = "client_focus_top"    [/key]
  [key] mod = {"Alt"} key = "j" func = "client_focus_bottom" [/key]

  # swap next client with direction:
  [key] mod = {"Control", "Shift"} key = "h" func = "client_swap_left"   [/key]
  [key] mod = {"Control", "Shift"} key = "l" func = "client_swap_right"  [/key]
  [key] mod = {"Control", "Shift"} key = "k" func = "client_swap_top"    [/key]
  [key] mod = {"Control", "Shift"} key = "j" func = "client_swap_bottom" [/key]

  # Resize selected tiled client with direction
  [key] mod = {"Super"} key = "h" func = "client_resize_left"   cmd = "20" [/key]
  [key] mod = {"Super"} key = "l" func = "client_resize_left"   cmd = "-20" [/key]
  [key] mod = {"Super"} key = "k" func = "client_resize_top"    cmd = "20" [/key]
  [key] mod = {"Super"} key = "j" func = "client_resize_top"    cmd = "-20" [/key]
  [key] mod = {"Super", "Control"} key = "h" func = "client_resize_right"  cmd = "-20" [/key]
  [key] mod = {"Super", "Control"} key = "l" func = "client_resize_right"  cmd = "20" [/key]
  [key] mod = {"Super", "Control"} key = "k" func = "client_resize_bottom" cmd = "-20" [/key]
  [key] mod = {"Super", "Control"} key = "j" func = "client_resize_bottom" cmd = "20" [/key]

  # Tabbing command
  [key] mod = {"Alt", "Shift"} key = "h" func = "client_tab_left"   [/key]
  [key] mod = {"Alt", "Shift"} key = "l" func = "client_tab_right"  [/key]
  [key] mod = {"Alt", "Shift"} key = "k" func = "client_tab_top"    [/key]
  [key] mod = {"Alt", "Shift"} key = "j" func = "client_tab_bottom" [/key]
  [key] mod = {"Alt", "Shift"} key = "u" func = "client_untab" [/key]
  [key] mod = {"Super"}        key = "t" func = "client_tab_next_opened" [/key]

  # Layout manipulation
  [key] mod = {"Super"}          key = "m" func = "layout_vmirror" [/key]
  [key] mod = {"Super", "Shift"} key = "m" func = "layout_hmirror" [/key]
  [key] mod = {"Super"}          key = "r" func = "layout_rotate_right" [/key]
  [key] mod = {"Super", "Shift"} key = "r" func = "layout_rotate_left" [/key]

  [key] mod = {"Control", "Super", "Alt"} key = "h" func = "layout_integrate_left" [/key]
  [key] mod = {"Control", "Super", "Alt"} key = "j" func = "layout_integrate_bottom" [/key]
  [key] mod = {"Control", "Super", "Alt"} key = "k" func = "layout_integrate_top" [/key]
  [key] mod = {"Control", "Super", "Alt"} key = "l" func = "layout_integrate_right" [/key]

  # Layout set historic travelling function (TESTING)
  [key] mod = {"Super"} key = "o" func = "layout_prev_set" [/key]
  [key] mod = {"Super", "Shift"} key = "o" func = "layout_next_set" [/key]

  # Toggle client free/tile
  [key] mod = {"Super"} key = "f" func = "client_toggle_free" [/key]

  # Launcher
  [key] mod = {"Super"} key = "p" func = "launcher" cmd = "exec" [/key]

[/keys]

The first thing is that at the very bottom of the status.sh, I tried having
conky -q | while read LINE; do wmfs -c status "1 $(pwr)  $(cpugraph) $(membar) $(hdd) $LINE"; done

line being what pulls from conky and puts the date time and mpd song when one is playing.
But it wasn't showing the $LINE part. When I have just $LINE it shows the conky stuff, but when I try to mix it in with the other stuff it only shows the other stuff (sorry if I'm not making any sense, I'm rushing and can't find the right words.
So that is the first question I have, is how to have all of that in one bar.

My 2nd question is how to have 2 seperate bars, the top being the $line one
and the bottom bar showing all the little graphs.

Thank you!

Last edited by dinner (2012-04-13 23:53:52)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo