You are not logged in.

#1 2010-04-02 20:20:24

JonathanArcher
Member
From: San Francisco
Registered: 2008-11-12
Posts: 108

[Solved] I3 WM: date and time in statusbar?

Hey, just recently switched from xmonad to I3 and so far I really like it (never got around to learn haskell). The only thing still missing is to display at least the current time and maybe also the date in the statusbar. I at least couldn't find anything in the docs or manpage, so maybe there is no way to do that?

Last edited by JonathanArcher (2010-04-06 19:37:41)

Offline

#2 2010-04-02 20:32:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: [Solved] I3 WM: date and time in statusbar?

i3status: "i3status  – Generates a status line for dzen2 or wmii"
http://manpages.ubuntu.com/manpages/kar … tus.1.html

Last edited by karol (2010-04-02 20:34:02)

Offline

#3 2010-04-02 21:45:28

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: [Solved] I3 WM: date and time in statusbar?

or just conky


ᶘ ᵒᴥᵒᶅ

Offline

#4 2010-04-03 01:11:07

lasu1
Member
Registered: 2010-02-10
Posts: 83

Re: [Solved] I3 WM: date and time in statusbar?

You can also try Dzen2, which allows you to add pretty much anything to a status bar (its what I use...works well).

Offline

#5 2010-04-03 11:13:00

JonathanArcher
Member
From: San Francisco
Registered: 2008-11-12
Posts: 108

Re: [Solved] I3 WM: date and time in statusbar?

Thanks guys, I'm using i3status in combination with dzen2 now, you can't use one on its own can you?
Just need to get around and configure it properly as I only have a centered date and time at the top of my screen.

Offline

#6 2010-04-03 15:07:43

lasu1
Member
Registered: 2010-02-10
Posts: 83

Re: [Solved] I3 WM: date and time in statusbar?

Yeah, I just manually lowered (by using the -x and -y values in dzen) my dzen2 bar so that it fit in the area where the workspace tags are. I am quite sure there is a better way to do it...but that's how I did it smile

Offline

#7 2010-04-03 22:04:31

JonathanArcher
Member
From: San Francisco
Registered: 2008-11-12
Posts: 108

Re: [Solved] I3 WM: date and time in statusbar?

Me again, hopefully the last time. I just configured dzen2 and i3status (just like lasu1 was pointing it out), but I can't seem to get it to autostart properly.

I put the whole command to start both (i3status | dzen etc &) into my xinit.rc before the "exec i3" part, but what then happens is that I only see my background wallpaper and the dzen2 bar, but i3 does not load. When I comment the dzen part out of the xinit.rc everything works fine again, and I can start it manually without any problems.

Is there a different way to autostart the statusbar?

Offline

#8 2010-04-03 22:09:56

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 679
Website

Re: [Solved] I3 WM: date and time in statusbar?

i put this line in my .i3/config

# execute my startup programs
exec ~/.startup

then I create ~/.startup with the following

gary@Lister ~ $ cat .startup 
#!/bin/bash
# Login startup

xautolock -locker johnny -corners +000 -nocloseout &
xrdb ~/.Xdefaults
display -window root .wallpaper.png
sudo conky | dzen2 -x 100 -y 1009 -w 1180 -ta r -bg black -fg '#1793d1' -fn -*-terminus-*-*-*-*-12-*-*-*-*-*-iso8859 &

xclock -geometry 100x90+1170+893 &
sleep 2
i3-msg bb

don't forget to make ~/.startup executable

Offline

#9 2010-04-04 03:27:57

lasu1
Member
Registered: 2010-02-10
Posts: 83

Re: [Solved] I3 WM: date and time in statusbar?

What does i3-msg bb do?

I start the script from xinitrc. Here's mine:
.xinitrc:

exec i3 --force-xinerama & 
sh startup.sh

and the startup script:

i="1"
feh --bg-scale /media/sdb1/Documents/wall2copia.png

while [ $i = 1 ]
do
DATE=$(date)
MEMINFO=$(sed -n -e '3d' -e '1,4p' /proc/meminfo | awk '{printf "%d ", $2 }')
UPTIME=$(uptime | sed 's/.*://; s/,//g')
QUALITY=$(sed -e '1,2d' /proc/net/wireless | cut -d" " -f6,7)
UNAME=$(uname -a | cut -d" " -f1,2,3)
TEMPS=$(sensors | awk '/C/ { print $3}' | xargs | cut -d" " -f1,2,3,4)
echo "^fg(white)$DATE^fg(grey) | $UNAME | ^fg(white)^i(mem.xbm)^fg(grey) T/F/C $MEMINFO | ^fg(white)^i(net-wifi.xbm) $QUALITY ^fg(grey)| ^fg(white)^i(cpu.xbm)^fg(grey) $UPTIME | ^fg(white)^i(temp.xbm)^fg(grey) $TEMPS"
sleep 5

done | dzen2 -x 150 -y 1005 -w 1050 -bg black -fg grey -fn fixed

Offline

#10 2010-04-04 07:34:40

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 679
Website

Re: [Solved] I3 WM: date and time in statusbar?

i3-msg bb.  removes window decorations from the current window.  The last window I opened in my startup is xclock.  I use the sleep command to gaurantee it has finished drawing and has focus.  Then i3-msg bb removes the window borders on xclock.

bn borders-normal
bp borders-1pixel
bb borders-borderless

you can also bind keys to these commands

# Change window borders bn=normal border bp=1 pixel bb=borderless
bindsym Mod4+comma bn
bindsym Mod4+period bp
bindsym Mod4+slash bb

Last edited by gazj (2010-04-04 08:24:25)

Offline

#11 2010-04-04 08:25:59

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 679
Website

Re: [Solved] I3 WM: date and time in statusbar?

I also have this dmenu script bound to win+i for i3 commands

#!/bin/bash

#dmenu_i3
#Gazj 2010 garyjames82atgmaildotcom
#execute i3 commands using dmenu, history stored under ~/.i3/dmenu

if [ -f $HOME/.dmenurc ]; then
  . $HOME/.dmenurc
else
  DMENU='dmenu -i'
fi

GS=`cat ~/.i3/dmenu | $DMENU -p "i3 command:" $*`

if grep -q "$GS" "$HOME/.i3/dmenu" ; then
    echo already exists in history
else
    echo $GS >> ~/.i3/dmenu
fi

i3-msg $GS

You can then just press win+i type any i3-msg command and it will be applied to the selected window

Offline

#12 2010-04-04 09:36:49

JonathanArcher
Member
From: San Francisco
Registered: 2008-11-12
Posts: 108

Re: [Solved] I3 WM: date and time in statusbar?

Alright, it worked. I also made a startup script, executed by the i3 config. Strange was though that I again had to adjust the -y value of dzen2, the first time I started my bar was again at the top instead of the bottom.

Thanks a lot guys, I have now deleted xmonad and am happy to use i3 smile

Offline

Board footer

Powered by FluxBB