fix datetime and readme

This commit is contained in:
koksnuss 2018-05-15 10:43:02 +02:00
parent 0621944365
commit 6ba071bebc
4 changed files with 37 additions and 19 deletions

View File

@ -17,12 +17,10 @@ backlight none, searches in /sys/class/backlight, intel and ati/amd supported
```
# Install
- If you already have a folder `~/.config/i3blocks` move it somewhere else:
`mv ~/.config/i3blocks{,.bak}`
- Clone this repo to `~/.config/i3blocks`:
`git clone https://will.kein.hk/git/koksnuss/simple-i3blocks.git ~/.config/i3blocks`
- Make sure you've added `bar { status_command i3blocks }` in `~/config/i3/config`:
- Backup: `mv ~/.config/i3blocks{,.bak}`
- Clone: `git clone https://will.kein.hk/git/koksnuss/simple-i3blocks.git ~/.config/i3blocks`
- Adjust `~/.config/i3blocks/config` to control i3 status bar output (see [Usage](#usage)).
- Make sure you've added `bar { status_command i3blocks }` in your i3-config file (i.e. `~/config/i3/config`).
- Finally reload your `i3` window manager. The default shortcut is `mod + SHIFT + r`, you should see a flickering.
# Usage

24
config
View File

@ -7,15 +7,18 @@ interval=5
[backlight]
# label=backlight
label=
label=☼
# label=☀,☼,✱,✲,✳,✴,✵,✺
[storage]
# label=storage
label=
label=⛁
# label=⛀,⛁,⛂,⛃
# if you want to display ram and swap seperately, you can assign another [ram] module
# with instance=ram or instance=swap
[ram]
label=⚟
# label=ram
# instance=ram
# [ram]
@ -24,11 +27,12 @@ label=
# separator_block_width=0
[cpu]
label=☷
# label=cpu
[ip]
# label=ip
label=
label=
interval=once
# if you have more than one batteries attached to your device and ou like
@ -37,16 +41,28 @@ interval=once
[battery]
# label=battery
# label=⚡
# ▁▂▃▄▅▆▇█
# █
# ▉
# ▊
# ▋
# ▌
# ▍⎋
# ▎⌨
# ▏⟠, ⟰, ⟱, ⟲, ⟳, ⤋, ⤊,
# [battery]
# instance=1
# separator_block_width=0
[audio]
# label=audio
label=♪
label=◍
# label=♩,♪,♫,♬
separator_block_width=0
[audio]
# label=mic
label=◎
#label=⋓ℹ⋒ⅈ
instance=mic
[datetime]

View File

@ -26,7 +26,7 @@ cat $BATS | gawk -F '=' '
if (status == "") {
status = $2
if (status == "Discharging") {
status = ""
status = ""
} else if (status == "Charging") {
status = "⚡"
} else {

View File

@ -1,13 +1,17 @@
#!/bin/bash
FULL=$(date '+%A, %_d.%_m. %_H:%M:%S')
SHORT=$(date '+%_H:%M')
a=$I3_LONG_DATETIME/1
FULL=$(date '+%A %-d.%-m.%Y W%V, %-H:%M:%S')
SHORT=$(date '+%-H:%M')
[[ "$BLOCK_INSTANCE" == "short" ]] && export I3_LONG_DATETIME=false
a+=$I3_LONG_DATETIME/2
[[ "$BLOCK_BUTTON" == "1" && $I3_LONG_DATETIME == "true" ]] && echo a; export I3_LONG_DATETIME=false;
a+=$I3_LONG_DATETIME/3
[[ "$BLOCK_BUTTON" == "1" && $I3_LONG_DATETIME == "false" ]] && echo b; export I3_LONG_DATETIME=true;
a+=$I3_LONG_DATETIME/4
echo $a
if [[ "$BLOCK_BUTTON" == "1" ]]; then
if [[ "$I3_LONG_DATETIME" == "true" ]]; then
export I3_LONG_DATETIME=false
else
export I3_LONG_DATETIME=true
fi
fi
[[ "$I3_LONG_DATETIME" == "true" ]] && echo $FULL || echo $SHORT
echo $SHORT