vivien / i3blocks-contrib Goto Github PK
View Code? Open in Web Editor NEWOfficial repository for community contributed blocklets
Home Page: https://github.com/vivien/i3blocks
License: Other
Official repository for community contributed blocklets
Home Page: https://github.com/vivien/i3blocks
License: Other
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?
[volume-pulseaudio]
command=$HOME/.config/i3blocks/blocklets/volume-pulseaudio -F 1 -p -c dc322f -C eee8d5
interval=once
signal=-RTMIN+1
$ ./volume-pulseaudio -p -c dc322f -C eee8d5
15 [2:name: <combined>]
15 [2]
dc322f
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"
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:
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:
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.
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:
@kb100, would you mind if I assign this to you?
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.
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.
$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
[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.
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!
Since I am not using i3 anymore we could probably merge https://github.com/Anachron/i3blocks into this repo? What do you think?
[example]
command="~/src/i3blocks-contrib/monitor_manager/monitor_manager"
interval=5
[example]
command="~/src/i3blocks-contrib/monitor_manager/monitor_manager.py"
interval=5
# Just three out of eighteen.
./monitor_manager/monitor_manager.py
./battery/battery.py
./usb/usb.py
For anyone that cares about calendar as me:
PS: RIGHT-click to access calendar
PS2: Tested on Arch Linux and ubuntu
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
This is in reference to: i3blocks-contrib/key_layout/key_layout
Expect to get the current keyboard layout
It shows both of my layouts: "us,se
"
Irrelevant
"us,se
"
$ setxkbmap -query
rules: evdev
model: pc105
layout: us,se
options: terminate:ctrl_alt_bksp,grp_led:scroll,grp:alt_shift_toggle,ctrl:nocaps
I'm transfering @boolean-is-null's issue vivien/i3blocks#132 here since the openvpn blocklet has been moved to contrib.
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?
Kbdd should automatically detect when the keyboard is changed, and change accordingly.
Kbdd blocklet isn't updated before I restart i3.
[kbdd]
command=/home/[cencored]/.i3/scripts/kbdd_layout
Correct output.
Might consider adding recognition of Encfs for usb script?
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
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?
See the current status of my VPN on i3blocks.
OpenVPN is up and running, it shows down on i3blocks.
[openvpn]
command=~/.i3/i3scripts/openvpn
instance=tun0
interval=1
VPN: down
VPN: down
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
as per title, can it be flexible to change yaourt on "arch-update" to others?
an example, aurman, packer, and etc
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
Who knows? Must show something about my running VPN connection
Always shows VPN:down message
[openvpn]
instance=tun0
interval=10
VPN: down
VPN: down
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.
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!!!
/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
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>
Here is a screenshot of what it shows me when I have updates available, and when I did press $mod + shift + R :
(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 :) )
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
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.
Calendar should render above mouse pointer and should be visible. (As shown in screenshot)
Calendar renders below mouse pointer and goes out of visible screen.
command=$SCRIPT_DIR/rofi-calendar
label=
interval=3600
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.
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
The label
key is no longer supported in i3blocks. All blocks using this key in their default configuration should be updated to no longer use it.
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
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 defaultamixer -D "default" scontrols | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | head -n1
is Masteramixer -D default get Master | sed -n "s/ Capabilities:.*cvolume.*/Capture/p"
has no outputThere'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'
The volume-pulseaudio block is vertically centered in the status bar.
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:
~/.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
}
$~/scripts/i3blocks/volume-pulseaudio$ ./volume-pulseaudio -a
50% [1:ALC3235 Analog]
50% [1]
#ffffff
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
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
)
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
.
openvpn status show be 'up' when the openvpn interface is up
openvpn status is always down
[openvpn]
interval=20
down
down
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.
Showing nothing when no player is running.
Showing "(null) - (null)" when no player is running
[mediaplayer]
instance=Lollypop
interval=5
signal=10
nothing if player is running. If no player is running an error of no players found.
https://github.com/zetok/disk_io
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.
This is in reference to "battery" / "battery.py" script (not the original battery script)
Show proper (and only/single) battery status in i3 bar (currently 96% for example)
Shows status for "wrong battery or battery number [although there is only 1 battery]" (currently 32% for example)
[battery]
command=~/bin/battery/battery
markup=pango
interval=30
% ./battery <span font='FontAwesome'></span> <span color="#FF9900">32%</span> <span font='FontAwesome'></span> <span color="#FF9900">32%</span>
% 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.
adding desired options to ROFI_OPTIONS should not affect the succes of launching rofi
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
shutdown_menu
[shutdown_menu]
full_text=
color=#eee8d5
command=$HOME/.config/i3blocks/blocklets/shutdown_menu && echo ""
none, rofi fails though with an error about parsing
i suspect missing qutation of the options as the culprit
Hi,
in readme https://github.com/vivien/i3blocks-contrib/blob/master/keyindicator/README.md section
[keyindicator]
instance=CAPS
interval=once
signal=11
Should it be
[keyindicator]
command=/usr/local/libexec/i3blocks/keyindicator
instance=CAPS
interval=once
signal=11
instead? Thanks
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..?
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.
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.
If I don't give an exact instance in i3blocks, it should check for players and check for cmus
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
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.
Shows the artist name and the song played
(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
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)
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"
}
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.
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.
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!
cmus meta data output
Seems to be ignoring cmus
Connection to player failed: No players found
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).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.