Commit 3f84ab63 authored by Joris's avatar Joris

Adapt scripts

parent 171ff6bb
......@@ -9,7 +9,7 @@ exec --no-startup-id xss-lock -- i3lock -n -c 222222
# Exec at startup and at reload
exec_always --no-startup-id ~/.bin/typematrix
exec_always --no-startup-id xrdb -merge .config/Xresources
exec_always --no-startup-id xrandr --auto
exec_always --no-startup-id xrandr --output eDP-1 --same-as HDMI-2
# Font
font pango:Inconsolata 10
......@@ -241,11 +241,12 @@ mode $mode_player {
}
# System
set $mode_system "(l)ock (e)xit (s)uspend (r)eboot (p)oweroff"
set $mode_system "(l)ock (e)xit (s)uspend (h)ibernate (r)eboot (p)oweroff"
mode $mode_system {
bindsym l exec --no-startup-id xset s activate, mode "default"
bindsym e exec --no-startup-id i3-msg exit, mode "default"
bindsym s exec --no-startup-id systemctl suspend, mode "default"
bindsym h exec --no-startup-id systemctl hibernate, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym p exec --no-startup-id systemctl poweroff -i, mode "default"
......
......@@ -19,8 +19,11 @@ markup=pango
[song]
command=~/.systray/current-song
[gateway]
command=~/.systray/gateway
[wifi]
command=~/.systray/wifi
[ethernet]
command=~/.systray/ethernet
[battery]
command=~/.systray/battery
......
......@@ -62,29 +62,3 @@ c.scrolling.bar = 'always'
c.tabs.background = True
c.tabs.title.format = '{title}'
c.tabs.padding = { 'top': 5, 'right': 5, 'bottom': 5, 'left': 5 }
# Disable javascript
config.set('content.javascript.enabled', False)
js_whitelist = [
'*://localhost/*',
'*://127.0.0.1/*',
'*://guyonvarch.gitlab.io',
'*://*.atl-paas.net',
'*://*.atlassian.com',
'*://*.atlassian.io',
'*://*.atlassian.net',
'*://*.jira.com',
# '*://ajax.googleapis.com',
'*://cdnjs.cloudflare.com',
'*://github.com'
]
for site in js_whitelist:
with config.pattern(site) as p:
p.content.javascript.enabled = True
# Search engines
config.set('url.searchengines', {'DEFAULT': 'https://duckduckgo.com/html?q={}'})
......@@ -5,10 +5,9 @@ if [ "$IN" == 1 ]
then
STATUS=$(cat /sys/class/power_supply/BAT0/status 2> /dev/null)
if ! echo "$STATUS" | grep -q "Full"
then
REM=$(cat /sys/class/power_supply/BAT0/charge_now 2> /dev/null)
FULL=$(cat /sys/class/power_supply/BAT0/charge_full 2> /dev/null)
if ! echo "$STATUS" | grep -q "Unknown"; then
REM=$(cat /sys/class/power_supply/BAT0/energy_now 2> /dev/null)
FULL=$(cat /sys/class/power_supply/BAT0/energy_full 2> /dev/null)
PERCENT=$(expr $REM \* 100 / $FULL)
if echo "$STATUS" | grep -q "Charging"
......@@ -25,5 +24,7 @@ then
echo "Bat: $PERCENT%"
fi
fi
else
echo ""
fi
fi
#!/usr/bin/env bash
ESSID="$(nmcli device status | grep ethernet | grep connected)"
if [ -n "$ESSID" ]; then
echo "ETH"
else
echo ""
fi
#!/bin/sh
CONFIG="$(iwconfig 2> /dev/null)"
ESSID="$(echo $CONFIG | grep -oP 'ESSID:"\K[^"]+')"
echo "${ESSID::-4}"
#!/bin/sh
CONFIG=`iwconfig 2> /dev/null`
ESSID=`echo $CONFIG | grep -oP 'ESSID:"\K[^"]+'`
# ESSID is non null=
if [ -n "$ESSID" ]
then
AQ=`echo $CONFIG | grep -oP 'Link Quality=\K\d+'`
MQ=`echo $CONFIG | grep -oP 'Link Quality=\d+/\K\d+'`
if [ "$AQ" -lt 0 ]
then
AQ=0
else
if [ "$AQ" -gt "$MQ" ]
then
AQ="$MQ"
fi
fi
PERCENT=`expr "$AQ" \* 100 / "$MQ"`
printf "%s %3d" "$ESSID" "$PERCENT"
echo "% ~ "
fi
#!/bin/sh
if [[ "$(pamixer --get-mute)" == "false" ]]
then
if [[ "$(pamixer --get-mute)" == "false" ]]; then
VOLUME=$(pamixer --get-volume)
echo "Vol: $VOLUME%"
fi
#!/usr/bin/env bash
ESSID="$(nmcli device status | grep wifi | grep connected | grep --invert-match disconnected | awk 'NF>1{print $NF}')"
if [ -n "$ESSID" ]; then
echo "$ESSID"
else
echo ""
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment