Compare commits

...

3 Commits

Author SHA1 Message Date
d39c0c7892
sway/status.py: A few changes
- Switch to iwd for Wi-Fi
- Remove unused code
- Format with black
2020-12-13 17:10:25 +02:00
d0bf0819f7
.config/alacritty/alacritty.yml: Use Source Code Pro
I'm using Source Sans Pro for my Sway UI so it somehow feels right.
2020-12-13 17:07:33 +02:00
b11f450040
Add .psqlrc
From: https://github.com/eevee/rc/blob/master/.psqlrc
2020-12-13 12:42:30 +02:00
3 changed files with 27 additions and 34 deletions

View File

@ -110,7 +110,7 @@ font:
# - (macOS) Menlo
# - (Linux) monospace
# - (Windows) Consolas
family: Fira Mono
family: Source Code Pro
# The `style` can be specified to pick a specific face.
style: Medium
@ -121,10 +121,10 @@ font:
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
family: Fira Mono
family: Source Code Pro
# The `style` can be specified to pick a specific face.
style: Medium
style: Semibold
# Italic font face
italic:
@ -132,7 +132,7 @@ font:
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
family: Fira Mono
family: Source Code Pro
# The `style` can be specified to pick a specific face.
style: Italic
@ -143,13 +143,13 @@ font:
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
family: Fira Mono
family: Source Code Pro
# The `style` can be specified to pick a specific face.
style: Medium Italic
style: Semibold Italic
# Point size
size: 11.0
size: 12.0
# Offset is the extra space around each character. `offset.y` can be thought of
# as modifying the line spacing, and `offset.x` as modifying the letter spacing.

12
.psqlrc Normal file
View File

@ -0,0 +1,12 @@
\set QUIET 1
\timing on
\set ON_ERROR_ROLLBACK interactive
\set VERBOSITY verbose
\set PROMPT1 '%[%033[1;35m%]%M/%/%R%[%033[0m%]% ☘ '
\set PROMPT2 '%[%033[1;30m%]...%[%033[0m%] %R '
\set HISTFILE ~/.psql_history- :DBNAME
\set HISTCONTROL ignoredups
\set COMP_KEYWORD_CASE upper
\pset null ␀
\pset linestyle unicode
\unset QUIET

View File

@ -1,7 +1,9 @@
#!/usr/bin/env python3
#
# Install ttf-twemoji and make sure there are no other emoji fonts like
# noto-fonts-emoji.
# Requires the following packages on Arch Linux:
# - ttf-twemoji (and make sure there are no other emoji fonts like noto-fonts-emoji
# - networkmanager
# - pulsemixer
from datetime import datetime
from subprocess import check_output
@ -18,7 +20,10 @@ def write(data):
def refresh():
try:
ssid = (
check_output("nmcli -g general.connection device show wlan0", shell=True)
check_output(
"iwctl station wlan0 show | grep 'Connected network' | awk '{print $3}'",
shell=True,
)
.strip()
.decode("utf-8")
)
@ -27,31 +32,7 @@ def refresh():
wifi_status = f"{ssid} 📶"
try:
vpn_state = (
check_output("nmcli -g general.state connection show wg0", shell=True)
.strip()
.decode("utf-8")
)
except Exception:
vpn_state = ""
if vpn_state == "activated":
wifi_status = f"{wifi_status} 🔐"
battery_percent = int(sensors_battery().percent)
# if battery_percent >= 90:
# battery_icon = ""
# elif battery_percent < 90 and battery_percent >= 75:
# battery_icon = "🔋"
# elif battery_percent < 75 and battery_percent >= 50:
# battery_icon = ""
# elif battery_percent < 50 and battery_percent >= 25:
# battery_icon = ""
# elif battery_percent < 25:
# battery_icon = ""
battery_icon = "🔋"
battery_status = f"{battery_percent} {battery_icon}"
power_status = "🔌" if sensors_battery().power_plugged else ""