Giter Club home page Giter Club logo

i3blocks-contrib's Introduction

Community contributed blocklets

This repository contains a set of scripts (a.k.a. blocklets) for i3blocks, contributed by the community.

Blocklet

Description

afs

Show usage information for an AFS directory

apt-upgrades

Show system upgrades using aptitude

arch-update

Show AUR updates using yaourt

aur-update

Show AUR updates

backlight

Show the screen brightness value given by xbacklight

bandwidth

Show bandwidth information (default bash version)

bandwidth2

Show bandwidth information (C version)

bandwidth3

Show bandwidth information (another bash version)

battery-poly

Show multi-battery info

battery

Show battery info

battery2

Pretty battery info

batterybar

Show battery info graphically as a bar

calendar

Current date/time and click for calendar

cpu_usage

Show current CPU usage

cpu_usage2

Show current CPU usage (C version)

disk

Show disk usage (space used) for a given directory

disk-io

Monitor disk reads and writes

docker

Show the number of Docker containers and container IP

dunst

Toggle Dunst notifications using a simple Do-Not-Disturb button

email

Show the number of unread IMAP messages

essid

Show the wifi ESSID you are connected to (dep: iwconfig, perl)

gpu-load

Shows load of Nvidia GPUs

go

Show the currently installed Go version

iface

Show network interface IP/status

kbdd_layout

Show the keyboard layout using dbus and kbdd

keyindicator

Show the status of capslock or numlock

key_layout

Show the current keyboard layout using setxkbmap

key_light

Control the keyboard backlight

kubernetes

Show the kubernetes current context and namespace

load_average

Show the system 1 minute load average

mediaplayer

Generic media player status/controls using playerctl

memory

Show ram or swap usage

monitor_manager

Manage monitor on/off, resolution, extend, clone

nm-vpn

Show vpn status using network manager

openvpn

Show openvpn status

rofi-calendar

Current date/time and click for calendar using rofi

rofi-wttr

Current weather and click for weather forecast using rofi

shutdown_menu

Shutdown menu using rofi or zenity

systemctl

Startup and Shutdown system services

tahoe-lafs

Show status of your tahoe-lafs grid

temperature

Show system temperatures using lm-sensors

time

Show the current date/time and click to change timezones

ssid

Show the wifi SSID you are connected to (dep: iw, awk)

usb

Show connected usb storage device info

volume

Show the current system volume (default)

volume-pulseaudio

Pretty print system volume for pulseaudio

wifi

Show the strength of your wifi connection in percent

wlan-dbm

Show wifi interface link quality in dBm or percent

ytdl-mpv

Play youtube videos from your clipboard using youtube-dl

It is officially maintained by @kb100 with the help of a bench of active i3blocks crafters.

Each release of this repository will be guaranteed to work against a given release of i3blocks (a.k.a. core).

contrib

core

master

master

next

next

You may want to take a look at the individual blocklet directories, which contain descriptions, screenshots, and installation/configuration instructions.

Note
configurations reference $SCRIPT_DIR, meaning the directory that you put the script into.
You must change $SCRIPT_DIR appropriately to coincide with where you put your scripts, for more info see the FAQ.

Want to contribute? Great! Check the contribution guidelines in order to get started.

Note
i3blocks-contrib REQUIRES i3blocks v1.5 or higher, since it uses i3blocks dynamic properties.

Happy crafting!

i3blocks-contrib's People

Contributors

aster89 avatar basploeger avatar captn3m0 avatar cc-a avatar cnt0 avatar denisse-dev avatar dkuku avatar falkecarlsen avatar gangelop avatar greenlly avatar hseg avatar initialxy avatar jcinis avatar jolange avatar jpleau avatar kb100 avatar kierendavies avatar kingelilol avatar knowledgejunkie avatar majorde1 avatar nolanl avatar roobre avatar runverzagt avatar skidnik avatar thiagowfx avatar vivien avatar vknmnn avatar vladvasiliu avatar xinye1 avatar zeioth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

i3blocks-contrib's Issues

shutdown_menu editing options makes rofi fail

Expected behavior

adding desired options to ROFI_OPTIONS should not affect the succes of launching rofi

Actual behavior

shutdown_menu or rather rofi produces rubbish, when the following is added to ROFI_OPTIONS
-m -3 -theme-str '#window { anchor: southeast;}'
-m -3 puts rofi to the location of the cursor,
-theme-str '#window { anchor: southeast;}' should make rofi display to the northwest of the cursor

this is not a rofi issue, as it works in other scripts

i3blocks config relevant to blocklet(s)

shutdown_menu

i3blocks.conf

[shutdown_menu]
full_text=
color=#eee8d5
command=$HOME/.config/i3blocks/blocklets/shutdown_menu && echo ""

Output of blocklet(s) when run from command line

none, rofi fails though with an error about parsing
i suspect missing qutation of the options as the culprit

[mediaplayer] Make playerctl a dependency

I don't see any mention of dependencies in the mediaplayer script, but it doesn't work on my machine. I think it doesn't work because I have no playerctl. I don't know what package this comes in, but I can't find it. Dependencies need to be added.

battery script showing only wrong battery number

This is in reference to "battery" / "battery.py" script (not the original battery script)

Expected behavior

Show proper (and only/single) battery status in i3 bar (currently 96% for example)

Actual behavior

Shows status for "wrong battery or battery number [although there is only 1 battery]" (currently 32% for example)

i3blocks config relevant to blocklet(s)

[battery]
command=~/bin/battery/battery
markup=pango
interval=30

Output of blocklet(s) when run from command line

% ./battery <span font='FontAwesome'></span> <span color="#FF9900">32%</span> <span font='FontAwesome'></span> <span color="#FF9900">32%</span>

Output of any relevant other commands that might help diagnostics

% acpi -b Battery 0: Discharging, 0%, rate information unavailable Battery 1: Unknown, 96% Battery 2: Discharging, 0%, rate information unavailable

%uname -sr Linux 4.13.4

% ibam -ra       
Bios percentage:            97 %
Battery percentage:         96 %
Soft low percentage limit:  5 %
Charge percentage:          88 %
Bios time left:              1:56:24
Battery time left:           1:38:30
Adapted battery time left:   1:45:15
Charge time left:            0:17:52
Adapted charge time left:    0:16:43
Total battery time:          1:42:25
Adapted total battery time:  1:49:26
Total charge time:           2:23:01
Adapted total charge time:   2:13:50

Ibam detects battery correctly.

So does %dstat --battery

Small app called Qbat as well.

Update all blocklets to be configured via injected config properties (next branch)

In the upcoming release of i3blocks, arbitrary properties will be able to be injected into a blocklet's environment. The readability of the i3blocks configuration file will be substantially improved by making all block configuration done through these injected environmental variables.

By way of example, the volume-pulseaudio blocklet previously had an example config:

[volume-pulseaudio]
command=$SCRIPT_DIR/volume-pulseaudio -a
interval=once
signal=1

This should be replaced by something like

[volume-pulseaudio]
command=$SCRIPT_DIR/volume-pulseaudio
interval=once
signal=1
USE_ALSA_NAME=1

More generally, the README should include something like:

[volume-pulseaudio]
command=$SCRIPT_DIR/volume-pulseaudio
interval=once
signal=1
# exposed format variables: %s symbol, %v volume, %i index, %n name
#FORMAT_LONG=%s %v\% [%i:%n]
#FORMAT_SHORT=%s %v\% [%i]
#SUBSCRIBE=0
USE_ALSA_NAME=1
#USE_DEVICE_NAME=0
#AUDIO_HIGH_SYMBOL='  '
#AUDIO_MED_SYMBOL='  '
#AUDIO_LOW_SYMBOL='  '
#AUDIO_MUTED_SYMBOL='  '
#AUDIO_MED_THRESHOLD=50
#AUDIO_LOW_THRESHOLD=0
#COLOR_NON_MUTED=#ffffff
#COLOR_MUTED=#a0a0a0

For each blocklet, we must:

  1. Update the script itself to use environmental variables for all possible configuration. Command line argument code should not be deleted if possible in order to avoid breaking existing configurations.
  2. Update the README to include an example config which shows all configurable parameters. Parameters that are not used in the example config should still be included, but commented out with their default value.
  3. Update all example configs with the new syntax.

Note that while we are at it, now is a great time to implement format string options FORMAT_LONG and FORMAT_SHORT as above, or allowing different formats like FORMAT_UP and FORMAT_DOWN.
This can cut down on a lot of format specific configuration options. For instance, in the volume-pulseaudio block above, we could have FORMAT_HIGH, FORMAT_MED, FORMAT_LOW, FORMAT_MUTED and just let the user do exactly what they want.

All work done towards this end should be on the next branch, not the master branch.
If you want to help, submit pull requests against the next branch.

Here is a list of the status of all files in the repo and their conversion status:

  • afs
  • apt-upgrades
  • arch-update
  • bandwidth
  • bandwidth2
  • bandwidth3
  • battery
  • battery2
  • batterybar
  • calendar
  • cpu_usage
  • disk
  • disk-io
  • email
  • gpu-load
  • iface
  • kbdd_layout
  • keyindicator
  • key_layout
  • kubernetes
  • load_average
  • mediaplayer
  • memory
  • monitor_manager
  • openvpn
  • rofi-calendar
  • shutdown_menu
  • tahoe-lafs
  • temperature
  • time
  • usb
  • volume
  • volume-pulseaudio
  • wifi
  • wlan-dbm
  • ytdl-mpv
  • config.example
  • CONTRIBUTING.md
  • ISSUE_TEMPLATE.md
  • LICENSE.md
  • README.md

I will begin slowly working on this once the convention for how variables are injected is finalized. (Cf. vivien/i3blocks#279). Help is greatly welcomed.

Slighty non-consistent naming conventions

expected behavior
[example]  
command="~/src/i3blocks-contrib/monitor_manager/monitor_manager"
interval=5 
actual behavior
[example]  
command="~/src/i3blocks-contrib/monitor_manager/monitor_manager.py"
interval=5
blocklet(s) in question
# Just three out of eighteen.

./monitor_manager/monitor_manager.py
./battery/battery.py
./usb/usb.py

mediaplayer shows "(null) - (null)" when no player is open

Expected behavior

Showing nothing when no player is running.

Actual behavior

Showing "(null) - (null)" when no player is running

i3blocks config relevant to blocklet(s)

[mediaplayer]
instance=Lollypop
interval=5
signal=10

Output of blocklet(s) when run from command line

nothing if player is running. If no player is running an error of no players found.

wifi-connection manager block. kind of.

I wrote a patch to netctl/wifi-menu to get a rofi-wifi-menu
since it's more a netctl patch than a blocklet, would you still consider adding it?
If you would like to check it out, you can find it here on github.
the corresponding blocklet is a slightly edited version of the ssid blocklet i had in my blocklets folder.
It displays red output when no internet connection is available and has added click options for the wifi-menu

Scrolling in volume-pulseaudio isn't working properly

If I use scroll's click, I can't use toggle mode now. It just muted and can't unmuted again. But if on the keyboard it works.

And when scrolling volume, the percentage volume becomes increased and decreased than before, but not when using the keyboard. Previously is like 5%→10%→15%. Now 5%→7%→8%→10%→14%

The output of some commands from ee9986f

  • amixer info | head -1 | cut -d ' ' -f 2 is default
  • amixer -D "default" scontrols | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | head -n1 is Master
  • amixer -D default get Master | sed -n "s/ Capabilities:.*cvolume.*/Capture/p" has no output

Consider renaming blocklets which conflict with non-contrib scripts

Hello,

I'm considering to write a PKGBUILD for this repo, to allow easy deployment and updating of contrib blocklets.

I think the better approach is to install these scripts to the same path where the non-contib scripts are located (/usr/lib/i3blocks on archlinux), as not using additional command= lines makes the i3blocks.conf cleaner. However, as some of the contrib scripts share names with the original ones, most package managers (pacman included) complains about conflicting files.

Can we consider renaming those blocklets whose name conflicts with the default i3blocks scripts? (bandwidth, battery)

Openvpn indicator does not work

Expected behavior

Who knows? Must show something about my running VPN connection

Actual behavior

Always shows VPN:down message

i3blocks config relevant to blocklet(s)

[openvpn]
instance=tun0
interval=10

Output of blocklet(s) when run from command line

VPN: down
VPN: down

Output of any relevant other commands that might help diagnostics

  1. I am on Mangaro XFCE 17.
  2. There is no /run/openvpn folder.
  3. There are /run/openvpn-client and /run/openvpn-server folders but they are always empty no meter if my VPN is running or not.
  4. folder in /sys/class/net/tun0 exists and is not empty
  5. I searched all my system for *.pid files, found only 3 total not related to openvpn
    VPN is working ok

key_layout toggle

I have this line in my i3 config file in order to toggle between two keyboard layouts:
exec --no-startup-id "setxkbmap -layout us,se -option 'grp:ctrl_alt_toggle'"
But the query of setxkbmap's layout returns "us, se", so I never know what the current layout is (cause the block just shows "us, se"). What am I missing..?

i3 blocks manager

It would be great to have a plugin like vundle for vim, or antigen for zsh, or tpm for tmux, where we'd only need to list the blocks we want to use (from their name or git path), and get them automatically happened.

That would probably be more useful as a i3 manager than a i3blocks one though.

Battery not showing in staus bar (solved)

so i copied the battery folder into:
~/.i3/blocks/battery

in my i3blocks.conf i added:
[battery]
command=$SCRIPT_DIR/battery.py
markup=pango
interval=30

was not 100% sure so i also played with command syntax:
command=~/.i3/blocks/battery/battery.py

unfortunately the only thing that shows in my status bar is the label.

would be most grateful if someone could point me in the right direction. Thxs!

all dependencies are installed

Explicitly allow/encourage multiple blocks that accomplish the same task

The purpose of this issue is to resolve the logistical details of allowing multiple scripts that support the same functionality. The result will hopefully be a section in the contributing guidelines making clear our policies on the matter.

There are many different ways to write the same blocklet. Some people don't want certain dependencies. Some people like one look and feel over another. Some people want bells and whistles. Some people want minimalism. Users should have the ability to easily browse all their options and pick the one that is best for them, without necessarily altering a script themselves.

I think that we should pave a road for contributers to develop scripts that accomplish the same task as other scripts.

I propose leaving the directory structure the same as it is currently until a duplicate or similar purpose script wants to be contributed. In that event, we will make a directory for the category of script being contributed, and migrate the preexisting script's folder into that directory. For example.

Before:

/script1
/script2
/batteryscript
/script4

After:

/script1
/script2
/battery
    README.md
    /batteryscript
    /batteryalt
/script4

where the README.md delineates what types of scripts should be put in that folder.

What are your thoughts on duplicate blocklets, naming conventions, etc?

mpd not working

I try mpd but not working. i3block panel does not seem
playerctl installed
script installed

# Blocks
# Display current song
[mediaplayer]
command=~/.config/i3/blocks/mediaplayer
instance=mpd
interval=5
signal=10

compiled blocklet for disk io

https://github.com/zetok/disk_io with_i3blocks

Since it's not a script, it can't be included here, but given that currently (arguably) no script offers the functionality, I thought that I'd share here, so that you could perhaps link to it, or something.

At first I've tried to do the same via script/tool, but it appeared to me that my script-fu is not strong enough, and there are no tools that would do the job.

Given that it's written in Rust, static binary in releases will just work™ on any x86_64 Linux from last ~half a decade (possibly more), provided that /proc/diskstats is available.
No other arch in releases, since playing with cross-compiling isn't really my thing.
If someone would be willing to, code will compile for whatever platform they're running, provided that Rust compiler is already ~supported there.

Cheers.

[shutdown_menu] blocket disappears after mouse click

When using the [shutdown_menu] blocklet with rofi, the blocklet disappears after clicking on it. I haven't tested how it behaves with zenity, but I don't see why it should be any different. a simple fix is to echo the value of full_text, i.e.

command=$SCRIPTS_DIR/shutdown_menu -c ; echo $FULL_TEXT

I'll probably make a pull request at some point, but I'll leave this here in the mean time for anyone who experiences the same issue.

openvpn status always down

Expected behavior

openvpn status show be 'up' when the openvpn interface is up

Actual behavior

openvpn status is always down

i3blocks config relevant to blocklet(s)

[openvpn]
interval=20

Output of blocklet(s) when run from command line

down
down

Output of any relevant other commands that might help diagnostics

I run openvpn with the packaged systemd service file, like this: "systemctl start [email protected]". udp-ch indicates which configuration file to use; my configuration file is "/etc/openvpn/udp-ch.conf". It creates this pid: /run/[email protected]

I tried changing line 134 to:
my @pid_file=glob '/run/openvpn@*.pid';
... but then it says:
Can't read config file 'udp-ch.conf': No such file or directory

I don't really know perl, so I'm not going to dig deeper for now. I suppose it'd be easier to just check the status with systemctl or ifconfig. Just providing some feedback, in case you'd like to adapt this script to be useful to more people.

Capitalized entries (dynamic properties?) in the `i3blocks.conf` file break the status line

After reading the small section A blocklet doesn't work or I've found a bug, how can I best report it? at the FAQ page, I hope I'm not wrong in assuming this is the right place to post this question about a non-working option in a blocklet.

It's been a while since last time I monkeyed around with i3blocks. Now I tried to download and use the gpu-load script, in the way it is suggested in the corresponding README.md, and it apparently works, as long as I keep the lines

#T_WARN=70
#T_CRIT=90

commented, otherwise I get the error (obviously appearing in place of the expected status line.)

Error: satus_command process exited unexpectedly (exit 1)

Experimenting a bit I've noticed that this happens for other blocklets as well, which all have these (commented) "capitalized" lines in their i3blocks.conf entry (it was not the case last time I tinkered with it). I hope not to be wrong in assuming that this problem is related to what I read in the README.md,

Note: i3blocks now supports dynamics properties,
and all scripts have been updated to do the same.
i3blocks-contrib requires a version of i3blocks that
supports dynamics properties, so upgrade as necessary.

but I think I've not done anything esotic since last time I installed a blocklet.

My version of i3blocks (installed by sudo pacman -S i3blocks) is the following

$ i3blocks -V
i3blocks 1.4 © 2014 Vivien Didelot and contributors

and I've copied the gpu-load script and its entry in the i3blocks.conf file from the master branch.

Btw, I've also clicked on the the link in the i3blocks 's webpage about what were the "official" scripts (the link is in the line starting with You can use your own scripts, or the ones provided with i3blocks.), but it is broken.

[monitor manager] Option Menu has no attribute

There's an error in the Menu duplicating toggle

Seems that it can't find an attribute

$ scripts/monitor_manager 

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib64/python3.4/tkinter/__init__.py", line 1533, in __call__
    return self.func(*args)
  File "/usr/lib64/python3.4/tkinter/__init__.py", line 582, in callit
    func(*args)
  File "./scripts/monitor_manager", line 430, in populateGrid
    self.makeLabelRow(output, row)
  File "./scripts/monitor_manager", line 456, in makeLabelRow
    self.setMenuToDuplicate(statusOptionMenu)
  File "./scripts/monitor_manager", line 498, in setMenuToDuplicate
    output = optionMenu.output
AttributeError: 'OptionMenu' object has no attribute 'output'

tkinter info

>>> import tkinter
>>> tkinter.Tcl().eval('info patchlevel')
'8.6.4'

Kbdd blocklet isn't updated before i3 is restarted.

Expected behavior

Kbdd should automatically detect when the keyboard is changed, and change accordingly.

Actual behavior

Kbdd blocklet isn't updated before I restart i3.

i3blocks config relevant to blocklet(s)

[kbdd]
command=/home/[cencored]/.i3/scripts/kbdd_layout

Output of blocklet(s) when run from command line

Correct output.

(Request) ability to set background color

Hi,

First of all thanks for keyindcator.

Would you consider adding an option for setting the background color for the block? I have a bunch of coloured blocks and I tend to miss it if I accidentally press the Caps key, I'm sure a red background would help to notice. Not sure if other people have the same problem, but I guess why not have the option.

Cheers

FontAwesome 5 not backwards compatible, broken glyphs in most scripts using FontAwesome 4

This is a PSA to anyone whose bar looks messed up when upgrading to FontAwesome 5. I haven't come up with a good solution yet, but some quick fixes are: for each script change the name of the font FontAwesome to FontAwesome5Free in the script, and if that doesn't work, copy and paste the glyph from the FontAwesome website into the script. Feel free to investigate and let me know what a good solution is (hopefully that works both for people who haven't upgraded and those who have).

Does anyone interested in yet another kbd layout script based on xkblayout-state?

key_layout doesn't show currently active keyboard layout; instead, I get a list of all enabled layouts: like "us, it"

kbdd_layout uses kbdd for the same, but I don't want to keep another process running for such small purpose (at least this process stores some state in memory, but mentioned script is just a stateless query tool).

There's a small program https://github.com/nonpop/xkblayout-state
For Arch Linux users, it's available in AUR, others can simply clone repo and make it manually.

Usage:
$ xkblayout-state print %s
us

Include default scripts

In order to simplify the maintainability of i3blocks and prevent duplicates, it would be preferable to move the default scripts out of the i3blocks repository into this i3blocks-contrib repository.

Things to do:

  • move scripts and handle duplicates (e.g. what we want to do with the bandwidth script?)
  • add a default configuration file in the root directory pointing to default scripts
  • remove scripts from i3blocks source

@kb100, would you mind if I assign this to you?

Battery module on click action, doesn't want to work

Expected behavior

When I do a left-click on my battery icon in the i3 bar, it changes the display from "battery bar" to "battery bar + time left". When I right click it, it comes back to only displaying "battery bar" again.

Actual behavior

When I put my little piece of code in the script, it simply wouldn't work at all. I don't have any display of battery no more with my little mod in.

i3blocks config relevant to blocklet(s)

        $full_text .= '';
} elsif ($status eq 'Charging') {
        $full_text .= ' ';
        $full_text .= " ($percent%)";
}

$short_text = $full_text;

######### MY MOD ###########

case $BLOCK_BUTTON in
    1) $full_text .= " ($1)";} ;;
    3) $full_text = $short_text ;;
esac

Output of blocklet(s) when run from command line

[pomme@david i3blocks]$ ./battery
Number found where operator expected at ./battery line 71, near "in
    1"
	(Do you need to predeclare in?)
Scalar found where operator expected at ./battery line 71, near ") $full_text"
	(Missing operator before $full_text?)
Scalar found where operator expected at ./battery line 72, near ") $full_text"
	(Missing operator before $full_text?)
Global symbol "$BLOCK_BUTTON" requires explicit package name (did you forget to declare "my $BLOCK_BUTTON"?) at ./battery line 70.
syntax error at ./battery line 71, near "in
    1"
Unmatched right curly bracket at ./battery line 71, at end of line
syntax error at ./battery line 72, near "3) "
syntax error at ./battery line 81, near "esac


################################



# print text
print"
Execution of ./battery aborted due to compilation errors.

Output of any relevant other commands that might help diagnostics

I just want to say that, my battery sends the good information to my system, because when I only try to display $1, which is the variable that contains the estimated time left, it works without a problem.

Also, please excuse me for any bad english I might have used here : it is not my native tongue.

Thanks!

Default player doesn't consider cmus

Expected behavior

If I don't give an exact instance in i3blocks, it should check for players and check for cmus

Actual behavior

It just checks for players, not cmus
if I make it instance=cmus it works, but then the other players are ignored
if I make it instance=mps-youtube it works, but then cmus is ignored

Some help with CPU TEMP

I have this CPU Temp, the temperature and is not reading right. it says 34.7 pretty much all and 33.7 doesn't go any higher than that.

When i put these in the terminal it shows CPU temp higher or lower as being Right. How can i fix for the i3blocks if somebody can help please thank you
sensors coretemp-isa-0000

Compiled programs in “contrib”

Hello fellow contributors,

I see that repo standards allow for compiled programs. I wrote a smallish C script that uses libpulse and listens for changes in pulseaudio sinks so the volume stays up-to-date whenever something changes, even if there is no signal sent to i3blocks (for instance, you cannot send a signal when changing volume in pavucontrol). That would work fine with interval=persist blocks and is near to impossible to do using shell scripts. Would you be interested in that kind of “blocklets“?

Please note that in this particular example, it would compete with the built-in volume script, but I guess I could just name it pulse-volume.

Maintainership

This is a simple ticket to track i3blocks-contrib maintainers. It is subject to change.

Actual maintainers (who owns write access):

  • @jpleau contributor and Debian package maintainer
  • @Nycroth active contributor (code and documentation)
  • @kb100 active contributor and reviewer

key_layout script shows all layouts, not current

This is in reference to: i3blocks-contrib/key_layout/key_layout

Expected behavior

Expect to get the current keyboard layout

Actual behavior

It shows both of my layouts: "us,se"

i3blocks config relevant to blocklet(s)

Irrelevant

Output of blocklet(s) when run from command line

"us,se"

Output of any relevant other commands that might help diagnostics

$ setxkbmap -query
rules:      evdev
model:      pc105
layout:     us,se
options:    terminate:ctrl_alt_bksp,grp_led:scroll,grp:alt_shift_toggle,ctrl:nocaps

Can't cut kbdd_layout output down to 2 characters?

I've been trying to cut down the output of kbdd_layout down to only the first 2 characters of the active keyboard layout.
My modifications work in terminal, the output is indeed what I want, but somehow i3blocks doesn't update properly.

First modification on line 37:

echo $( ( dbus-send --print-reply=literal --dest=ru.gentoo.KbddService \
         /ru/gentoo/KbddService ru.gentoo.kbdd.getLayoutName uint32:$N ) | cut -c 4-5 )

This works in i3blocks fine, I get "En" as expected for the initial state.

But then, my second modification on line 41:

# Parse dbus output
dbus-monitor "interface='ru.gentoo.kbdd',member='layoutNameChanged'" | sed -un '0~2p' | \
        sed -un 's:.*string "\(.*\)".*:\1:p' | sed -u '/:/d' | sed -r 's/(.{2}).*/\1/'

Even if I replace the last sed by a cut -c '1-2', i3blocks doesn't update the output properly. Only this modification on line 41 makes this blocks to not work right. That last operation is causing issues, no matter which one it is...
Am I missing something obvious?

Ability to blacklist battery percentage sources in battery block

Battery block is missing the ability to blacklist battery percentage sources in battery block.

I say this because of problem I recently encountered:
I got a new Dell keyboard/mouse, which is actually manufactured by Logitech, and implements some kind of HID device that that should report the battery status of both keyboard and mouse.
Apart from the fact that those values are not related to the laptop battery, and they are thrown into the overall calculation, they don't really seem to work on my keyboard/mouse and are reporting zero values.
This causes of course, a weird battery level on my i3-bar.

lsusb for reference:

Bus 003 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver

Values that acpi reports:

Battery 0: Discharging, 0%, rate information unavailable
Battery 1: Full, 100%
Battery 2: Discharging, 0%, rate information unavailable

ls /sys/class/power_supply

AC  BAT0  hidpp_battery_4  hidpp_battery_5

upower -e

/org/freedesktop/UPower/devices/line_power_AC
/org/freedesktop/UPower/devices/battery_BAT0
/org/freedesktop/UPower/devices/unknown_0003o046Do4048x0014
/org/freedesktop/UPower/devices/unknown_0003o046Do4049x0015
/org/freedesktop/UPower/devices/DisplayDevice

I'd try to implement such a feature myself, but it seems this will require a change in the way the battery block queries the battery percentage currently, and I'm not sure which way this should go, thus I'd like to open this up for conversation.

Volume-pulseaudio block is not vertically centered in status bar

Expected behavior

The volume-pulseaudio block is vertically centered in the status bar.

Actual behavior

The volume-pulseaudio block is not vertically centered in the status bar. Instead, it is truncated on the top. All other blocks are vertically centered. See this image:

selection_001

i3blocks config relevant to blocklet(s)

~/.i3blocks.conf:

[volume-pulseaudio]
command=$HOME/scripts/i3blocks/volume-pulseaudio/volume-pulseaudio -a
interval=once
signal=1

~/.config/i3/config:

bar {
        status_command i3blocks
        i3bar_command i3bar -t
        position bottom
}

Output of blocklet(s) when run from command line

$~/scripts/i3blocks/volume-pulseaudio$ ./volume-pulseaudio -a
  50% [1:ALC3235 Analog]
  50% [1]
#ffffff

Output of any relevant other commands that might help diagnostics

i3 version 4.13-277-g86b7183 (2017-08-28, branch "gaps-next") © 2009 Michael Stapelberg and contributors

i3blocks 1.4 © 2014 Vivien Didelot and contributors

OpenVPN block not detecting VPN even when it's working.

Expected behavior

See the current status of my VPN on i3blocks.

Actual behavior

OpenVPN is up and running, it shows down on i3blocks.

i3blocks config relevant to blocklet(s)

[openvpn]
command=~/.i3/i3scripts/openvpn
instance=tun0
interval=1

Output of blocklet(s) when run from command line

VPN: down
VPN: down

Output of any relevant other commands that might help diagnostics

systemctl status [email protected]

   Loaded: loaded (/usr/lib/systemd/system/[email protected]; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2018-03-19 01:14:54 CST; 3min 42s ago
     Docs: man:openvpn(8)
           https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
           https://community.openvpn.net/openvpn/wiki/HOWTO
 Main PID: 31332 (openvpn)
   Status: "Initialization Sequence Completed"
    Tasks: 1 (limit: 4915)
   Memory: 3.8M
   CGroup: /system.slice/system-openvpn\x2dclient.slice/[email protected]
           └─31332 /usr/bin/openvpn --suppress-timestamps --nobind --config japan.conf --writepid /var/run/openvpn-client/japan.pid

mar 19 01:14:57 Oblivion openvpn[31332]: /etc/openvpn/scripts/update-systemd-resolved tun0 1500 1585 10.8.0.7 255.255.0.0 init
mar 19 01:14:57 Oblivion openvpn[31332]: <14>Mar 19 01:14:57 update-systemd-resolved: Link 'tun0' coming up
mar 19 01:14:57 Oblivion update-systemd-resolved[31888]: Adding IPv4 DNS Server 10.8.0.1
mar 19 01:14:57 Oblivion openvpn[31332]: <14>Mar 19 01:14:57 update-systemd-resolved: Adding IPv4 DNS Server 10.8.0.1
mar 19 01:14:57 Oblivion update-systemd-resolved[31889]: SetLinkDNS(6 1 2 4 10 8 0 1)
mar 19 01:14:57 Oblivion openvpn[31332]: <14>Mar 19 01:14:57 update-systemd-resolved: SetLinkDNS(6 1 2 4 10 8 0 1)
mar 19 01:14:57 Oblivion openvpn[31332]: /usr/bin/ip route add 185.161.200.10/32 via 192.168.1.254
mar 19 01:14:57 Oblivion openvpn[31332]: /usr/bin/ip route add 0.0.0.0/1 via 10.8.0.1
mar 19 01:14:57 Oblivion openvpn[31332]: /usr/bin/ip route add 128.0.0.0/1 via 10.8.0.1
mar 19 01:14:57 Oblivion openvpn[31332]: Initialization Sequence Completed 

My japan.conf used by openvpn-client
In my .conf I'm using tun0 and not tun, I've added --writepid /var/run/openvpn-client/%i.pid to openvenpn service, I'm able to access the PID file without root permission.

dev tun0
proto udp

remote jp-free-01.protonvpn.com 1194

remote-random
resolv-retry infinite
nobind
cipher AES-256-CBC
auth SHA512
comp-lzo
verb 3

tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
persist-key
persist-tun

ping 15
ping-restart 0
ping-timer-rem
reneg-sec 0

remote-cert-tls server
auth-user-pass
pull
fast-io

script-security 2
setenv PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
up /etc/openvpn/scripts/update-systemd-resolved
down /etc/openvpn/scripts/update-systemd-resolved
down-pre

Is it possible to use the openvpn block with networkmanager-openvpn?

I want to use networkmanager to manage my OpenVPN connection, as it's the only way I can get it to reliably restart after suspend. However, with this setup, the OpenVPN script in this repository just says 'down', even though vpn is working.

I can change the dev name of the vpn connection to 'tun0' instead of 'tun' in /etc/NetworkManager/system-connections/vpn_id , but I don't know how to make it write a pid file.

Is there a way to make the [openvpn] block work with my setup?

Or is it easy enough to make a new block for this? i3status for example supports networkmanager-openvpn setups with this sort of configuration:

path_exists VPN {
        # path exists when a VPN tunnel launched by nmcli/nm-applet is active
        path = "/proc/sys/net/ipv4/conf/tun0"
}  

Ignoring cmus

Expected behavior

cmus meta data output

Actual behavior

Seems to be ignoring cmus

Output of blocklet(s) when run from command line

Connection to player failed: No players found

Issues with Google Play Music Desktop Player on mediaplayer

Google Play Music Desktop Player works fine on playerctl, so I decided to test it as an instance name on i3blocks (it works on playerctl as google-play-music-desktop-player, according to the dbus mpris service).

I understand that this can be solved without specifying instance, but this behavior is not the correct.

Expected behavior

Shows the artist name and the song played

Actual behavior

(null) - (null)

The settings I have on i3blocks config file on mediaplayer are the following:

[mediaplayer]
instance=google-play-music-desktop-player
interval=5
signal=10

Relevant commands

  • playerctl --player='google-play-music-desktop-player' metadata artist
    Shows some warnings but at the end shows the artist

  • playerctl metadata artist
    Shows some warnings but at the end shows the artist

  • ./mediaplayer
    Shows the artist correctly, because instance is not specified, so it works as the case before

  • Executing with the settings indicated on config file
    (null) - (null)

Pictures

Without instance
capture

With instance google-play-music-desktop-player
capture

I'm having some weird troubles with arch-update blocklet

Expected behavior

Check every 10 minutes if new update available. If so, show a red " 1" on my bar (using awesome fonts which is of course installed on my arch)

If no new update is available, simply display a white " 0" on my bar.

Actual behavior

I have two issues which are very weird to me with this.

First one : I can't get any display on my bar when there is no update available. I would like to have a white " 0" on my bar, so I know that the script is running, that it checked for me and that there is in fact no new updates for me to do... I did everything in the script for that to happen, but still : nothing.

Second one : it seems to not run the script automatically every ten minutes as it's supposed to, because sometimes, I manually check for updates available (pacman -Syyu), and there is, but nothing is up on my bar... Then I press $mod + shift + R to reload i3, and then it shows  1 on my bar!!!

i3blocks config relevant to blocklet(s)

/usr/lib/i3blocks/arch-update.py :

#!/usr/bin/env python3
#
# Copyright (C) 2017 Marcel Patzwahl
# Licensed under the terms of the GNU GPL v3 only.
#
# i3blocks blocklet script to see the available updates of pacman and the AUR
from subprocess import check_output
import argparse


def create_argparse():
    parser = argparse.ArgumentParser(description='Check for pacman updates')
    parser.add_argument(
        '-b',
        '--base_color',
        default='white',
        help='base color of the output(default=green)'
    )
    parser.add_argument(
        '-u',
        '--updates_available_color',
        default='red',
        help='color of the output, when updates are available(default=yellow)'
    )
    parser.add_argument(
        '-a',
        '--aur',
        action='store_true',
        help='Include AUR packages. Attn: Yaourt must be installed'
    )
    return parser.parse_args()


def get_update_count():
    output = check_output(['checkupdates']).decode('utf-8')
    if not output:
        return 0

    updates = [line
               for line in output.split('\n')
               if line]

    return len(updates)


def get_aur_update_count():
    output = check_output(['yaourt', '-Qua']).decode('utf-8')
    if not output:
        return 0

    aur_updates = [line
                   for line in output.split('\n')
                   if line.startswith('aur/')]

    return len(aur_updates)


message = "<span color='{0}'>{1}</span>"
args = create_argparse()

update_count = get_update_count()

if args.aur:
    update_count += get_aur_update_count()
if update_count == 0:
    info = ' ' + str(update_count)
    print(message.format(args.base_color, info))
else:
    info = ' ' + str(update_count)
    print(message.format(args.updates_available_color, info))

~/.config/i3/i3blocks.conf :

# i3blocks config file
#
# Please see man i3blocks for a complete reference!
# The man page is also hosted at http://vivien.github.io/i3blocks
#
# List of valid properties:
#
# align
# color
# command
# full_text
# instance
# interval
# label
# min_width
# name
# separator
# separator_block_width
# short_text
# signal
# urgent

# Global properties
#
# The top properties below are applied to every block, but can be overridden.
# Each block command defaults to the script name to avoid boilerplate.
command=/usr/lib/i3blocks/$BLOCK_NAME
separator_block_width=15
markup=none

# Memory usage
#
# The type defaults to "mem" if the instance is not specified.
[memory]
label=
separator=false
interval=30

# CPU usage
#
# The script may be called with -w and -c switches to specify thresholds,
# see the script for details.
[cpu_usage]
label=
interval=2
min_width=CPU:
separator=false


#[memory]
#label=SWAP
#instance=swap
#separator=false
#interval=30

# Disk usage
#
# The directory defaults to $HOME if the instance is not specified.
# The script may be called with a optional argument to set the alert
# (defaults to 10 for 10%).
[disk]
label=
#instance=/mnt/data
interval=30

[wifi]
instance=wlp3s0
interval=10
separator=false

# Network interface monitoring
#
# If the instance is not specified, use the interface used for default route.
# The address can be forced to IPv4 or IPv6 with -4 or -6 switches.
#[iface]
#instance=wlan0
#color=#00FF00
#interval=10
#separator=true

#[bandwidth]
#instance=eth0
#interval=5

#[load_average]
#interval=10

# Battery indicator
#
# The battery instance defaults to 0.
[battery]
#instance=1
interval=60

# Volume indicator
#
# The first parameter sets the step (and units to display)
# The second parameter overrides the mixer selection
# See the script for details.
[volume]
label=♪
instance=Master
#instance=PCM
interval=1
signal=10

[arch-update]
command=/usr/lib/i3blocks/arch-update.py -a -b "#FFFFFF" -u "#FF0000"
markup=pango
interval=600
separator=true

[email]
command=/usr/lib/i3blocks/email
label=
interval=120
separator=true

# Date Time
#
[time]
command=date '+%Hh%M '
interval=1

# Generic media player support
#
# This displays "ARTIST - SONG" if a music is playing.
# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
#[mediaplayer]
#interval=1
#instance=vlc

# OpenVPN support
#
# Support multiple VPN, with colors.
#[openvpn]
#interval=20

# Temperature
#
# Support multiple chips, though lm-sensors.
# The script may be called with -w and -c switches to specify thresholds,
# see the script for details.
#[temperature]
#label=TEMP
#interval=10

# Key indicators
#
# Add the following bindings to i3 config file:
#
# bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks
# bindsym --release Num_Lock  exec pkill -SIGRTMIN+11 i3blocks
#[keyindicator]
#instance=CAPS
#interval=once
#signal=11

#[keyindicator]
#instance=NUM
#interval=once
#signal=11

Output of blocklet(s) when run from command line

WHEN NO UPDATE AVAILABLE :

$ python /usr/lib/i3blocks/arch-update.py 
<span color='white'> 0</span>

WHEN UPDATE AVAILABLE

python /usr/lib/i3blocks/arch-update.py 
<span color='red'> 2</span>

Output of any relevant other commands that might help diagnostics

Here is a screenshot of what it shows me when I have updates available, and when I did press $mod + shift + R :

2017-06-15-jun-1497479640_1366x768

(please don't pay attention to the display order being 8 instead of  8, I changed it between the time I took this scrot and now :) )

Packaging default scripts

Hi Blocklet Crafters!

Again, thanks @kb100 for your great work maintaining the contrib scripts, as well as all other contributors.

I'm currently working on the next version of i3blocks, in the (instable) next branch. The main feature being dynamic properties: you will be able to pass any property in the config file. In addition to supporting @Airblader's i3-gaps extra properties, dynamic properties can be a way to provide temporary variables if they are passed to the script's environment (a convention still needs to be defined here.)

Now, my next step is to make it easier to maintain i3blocks and its scripts. I'm considering moving out the default scripts into this repository, so that i3blocks only contains the C core, no scripts. Is there anything that can improve the experience with i3blocks-contrib scripts?

edit: focus the issue on the default scripts packaging.

Cheers!

Calendar renders below screen on click.

Expected behavior

Calendar should render above mouse pointer and should be visible. (As shown in screenshot)

Actual behavior

Calendar renders below mouse pointer and goes out of visible screen.

i3blocks config relevant to blocklet(s)

command=$SCRIPT_DIR/rofi-calendar
label=
interval=3600

batterybar: Bad output if battery unplugged

@lathan

With my battery unplugged (laptop plugged into charger):

$ ./batterybar               
<span foreground="">■</span>
$ BLOCK_BUTTON=1 ./batterybar
 <span foreground="">%</span>
<span foreground="">■</span>

My acpi battery output is empty. Also note the extra space at the beginning of line 4.

volume-pulseaudio fails to grep "proper" device name

The volume-pulseaudio block should output a nice-to-read name for all output sinks.
That's not the case for (my) virtual output devices. I have a combined device, that outputs sound to two devices simultaneously and a virtual output sink for dlna via pulseaudio-dlna. Hence the block fails to get a good name from pacmd list-sinks.

The culprit is sed in lin 81:
81: NAME=$(echo "$NAME" | sed 's/.*\.\(.*\)>/\1/')

Maybe the block should check the name string for dots " . " and if no dots are there, set the name to the string betwen the "<>".
The device.descripton in properties seems like a good source for device names also, if long Strings were cut to a minimum in length. portability remains a problem then.
There's also alsa.mixer_name and alsa.card_name, but these also do not apply to virtual devices.
What do?

i3blocks config relevant to blocklet(s)

[volume-pulseaudio]
command=$HOME/.config/i3blocks/blocklets/volume-pulseaudio -F 1 -p -c dc322f -C eee8d5
interval=once
signal=-RTMIN+1

Output of blocklet(s) when run from command line

$ ./volume-pulseaudio -p  -c dc322f -C eee8d5 
  15 [2:name: <combined>]
  15 [2]
dc322f

Output of any relevant other commands that might help diagnostics

the package paprefs offers the option to add a virtual device,
pulseaudi-dlna offers a dlna sink. both deliver names that fail to get red by the block:

$ pacmd list-sinks   #omitted the first two devices since those work fine
* index: 2
	name: <combined>
	driver: <module-combine-sink.c>
	flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: SUSPENDED
	suspend cause: IDLE 
	priority: 1000
	volume: front-left: 0 /   0% / -inf dB,   front-right: 0 /   0% / -inf dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: yes
	current latency: 0.00 ms
	max request: 4 KiB
	max rewind: 0 KiB
	monitor source: 2
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 1
	configured latency: 0.00 ms; range is 0.50 .. 200.00 ms
	module: 16
	properties:
		device.class = "filter"
		device.description = "Simultaneous output to Built-in Audio Digital Surround 7.1 (HDMI), Built-in Audio Analog Stereo"
		device.icon_name = "audio-card"
* index: 3
	name: <np1100_dlna>
	driver: <module-null-sink.c>
	flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: IDLE
	suspend cause: 
	priority: 1000
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 13.14 ms
	max request: 6 KiB
	max rewind: 6 KiB
	monitor source: 3
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 1
	configured latency: 40.00 ms; range is 0.50 .. 2000.00 ms
	module: 30
	properties:
		device.description = "NP1100 (DLNA)"
		device.class = "abstract"
		device.icon_name = "audio-card"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.