Skip to content

Instantly share code, notes, and snippets.

@pinpox
Created February 15, 2016 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pinpox/3add36eef50cd9a46c6e to your computer and use it in GitHub Desktop.
Save pinpox/3add36eef50cd9a46c6e to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
import subprocess
from i3pystatus import Status
from i3pystatus.mail import notmuchmail
status = Status(standalone=True)
status.register("google_calendar",
credential_path='/home/binaryplease/Documents/google_api_credentials.json')
#Date
status.register("clock",
format="%a %-d %b %H:%M:%S",)
#CPU Temperature
status.register("temp",format="{temp}°C",file="/sys/class/thermal/thermal_zone1/temp")
status.register("cpu_usage",format="{usage_cpu0:3.0f}%{usage_cpu1:3.0f}%{usage_cpu2:3.0f}%{usage_cpu3:3.0f}%{usage_cpu4:3.0f}%{usage_cpu5:3.0f}%{usage_cpu6:3.0f}%{usage_cpu7:3.0f}%")
status.register("text", text="CPU",color="#104a58")
#RAM
status.register("mem",format="{percent_used_mem}%",)
status.register("text", text="RAM",color="#104a58")
#Battery
status.register("battery",
battery_ident="BAT1",
format="{status}/{consumption:.2f}W {percentage:.2f}% {remaining:%E%hh:%Mm}",
alert=True,
alert_percentage=5,
status={
"DIS": "↓",
"CHR": "↑",
"FULL": "=",
},)
status.register("text", text="BATTERY",color="#104a58")
# Network
status.register("runwatch",
name="DHCP",
path="/var/run/dhc*.pid",)
status.register("network",
interface="enp3s0",
format_up="{v4} {bytes_recv:04.0f}kbs",
format_down="")
status.register("network",
interface="wlp4s0",
format_up="{essid} {quality:03.0f}% {v4} {bytes_recv:04.0f}kbs",
format_down="")
#status.register("network_traffic",
## interface="wlp3s0",
# format="{bytes_recv}/{bytes_sent}")
status.register("text", text="NETWORK",color="#104a58")
#status.register("text", text="NETWORK",color="#104a58",cmd_leftclick="urxvt -e bash -c 'ip addr && zsh'")
#Disk
status.register("disk",
path="/",
format="/ {percentage_used}% [{avail}G]",)
#status.register("text", text="DISK",color="#104a58",cmd_leftclick="urxvt -e bash -c 'lsblk && df && zsh'")
status.register("text", text="DISK",color="#104a58")
#spotify
status.register("spotify")
#Audio
status.register("alsa",
format="♪ {volume}",format_muted="♪ MUTE")
status.register("text", text="VOLUME",color="#104a58")
#Backlight
status.register("backlight",
format="☀ {percentage}",)
#Mail
status.register("mail",
backends=[ notmuchmail.Notmuch( account="personal")
],
hide_if_null=True,
format="{unread}",
format_plural="{unread}")
status.register("text", text="MAIL",color="#104a58")
#status.register("text", text="MAIL",color="#104a58",cmd_leftclick="thunderbird &> /dev/null")
#Weather
status.register("weather",
format="{current_temp} - {humidity}%",location_code="GMXX5686",colorize=True)
status.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment