Browse Source

Export Xresources colors, use these in i3blocks

master
Riyyi 6 years ago
parent
commit
9269c10c04
  1. 2
      .config/i3/blocks
  2. 35
      .config/i3/config
  3. 5
      .config/xorg/xinitrc
  4. 4
      .scripts/wm/battery.sh
  5. 5
      .scripts/wm/brightness.sh
  6. 4
      .scripts/wm/iface.sh
  7. 6
      .scripts/wm/volume.sh
  8. 14
      .scripts/wm/wifi.sh

2
.config/i3/blocks

@ -27,7 +27,7 @@
command=$HOME/.scripts/wm/$BLOCK_NAME
separator_block_width=20
markup=none
# separator=false
separator=false
align=center
[volume.sh]

35
.config/i3/config

@ -21,11 +21,11 @@ exec --no-startup-id thunar
exec --no-startup-id xss-lock -- $HOME/.scripts/wm/lock.sh &
# Colors
set $bg-color #404552
set $bg-color-inactive #2B2E39
set $bg-color-urgent #DC7A43
set $text-color #FFFFFF
set $text-color-inactive #676E7D
set $bgcolor #404552
set $bgcolor-inactive #2b2e39
set $bgcolor-urgent #dc7a43
set $text-color #ffffff
set $textcolor-inactive #676e7d
# Xresources colors
set_from_resource $darkblack color0 #000000
@ -47,22 +47,23 @@ set_from_resource $white color15 #000000
set $transparent #00000000
# Window colors
# border background text indicator
client.focused $text-color-inactive $text-color-inactive $text-color $darkgreen
client.unfocused $bg-color-inactive $bg-color-inactive $text-color-inactive $darkgreen
client.focused_inactive $bg-color-inactive $bg-color-inactive $text-color-inactive $darkgreen
client.urgent $bg-color-urgent $bg-color-urgent $text-color $darkgreen
# border background text indicator
client.focused $textcolor-inactive $textcolor-inactive $white $darkgreen
client.unfocused $bgcolor-inactive $bgcolor-inactive $darkwhite $darkgreen
client.focused_inactive $bgcolor-inactive $bgcolor-inactive $darkwhite $darkgreen
client.urgent $bgcolor-urgent $bgcolor-urgent $white $darkgreen
bar {
colors {
background $bg-color-inactive
separator #757575
# border background text
focused_workspace $bg-color $bg-color $text-color
inactive_workspace $bg-color-inactive $bg-color-inactive $text-color-inactive
urgent_workspace $bg-color-urgent $bg-color-urgent $text-color
background $bgcolor-inactive
separator $darkwhite
statusline $white
# border background text
focused_workspace $bgcolor $bgcolor $white
inactive_workspace $bgcolor-inactive $bgcolor-inactive $darkwhite
urgent_workspace $bgcolor-urgent $bgcolor-urgent $white
}
font pango:DejaVu Sans Mono, FontAwesome5Free Solid, FontAwesome5Brands 8
font pango:DejaVu Sans, FontAwesome5Free Solid, FontAwesome5Brands 8
status_command i3blocks -c $HOME/.config/i3/blocks
#strip_workspace_numbers yes
tray_output primary

5
.config/xorg/xinitrc

@ -2,6 +2,7 @@
xrdb "$XDG_CONFIG_HOME/xorg/Xresources"
# Setup display
xrandr --newmode "3000x2000_48.00" 405.25 3000 3232 3552 4104 2000 2003 2013 2058 -hsync +vsync
xrandr --addmode eDP-1 3000x2000_48.00
xrandr --output eDP-1 --mode 3000x2000_48.00 --primary
@ -30,4 +31,8 @@ setxkbmap -option ''
# Swap capslock with escape
setxkbmap -option caps:swapescape
# Export Xresources colors
COLORS="$(xrdb -query | grep '^*.color' | sort -V | awk '{print $NF}')"
$(echo "$COLORS" | awk '$0 = "export COLOR" NR - 1 "=" $0')
exec i3

4
.scripts/wm/battery.sh

@ -12,7 +12,7 @@ else
TIME=""
fi
COLOR="#FFFFFF"
COLOR="$COLOR15"
if [ "$(echo $BAT_INFO | awk '{ print $6 }')" = "remaining" ]; then
if [ "$CAPACITY" -ge "80" ]; then
ICON=""
@ -24,7 +24,7 @@ if [ "$(echo $BAT_INFO | awk '{ print $6 }')" = "remaining" ]; then
ICON=""
else
ICON=""
COLOR="#DC7A43"
COLOR="$COLOR9"
notify-send -u critical -r 1 "Battery critically low!"
fi

5
.scripts/wm/brightness.sh

@ -16,5 +16,6 @@ else
ICON=""
fi
echo $ICON $PERCENTAGE%
echo "$ICON $PERCENTAGE%"
echo "$ICON $PERCENTAGE%"
echo "$COLOR15"

4
.scripts/wm/iface.sh

@ -7,7 +7,7 @@ echo ""
if [ ! -d /sys/class/net/${WIRED} ] ||
[ "$(cat /sys/class/net/$WIRED/operstate)" = 'down' ] ||
[ "$(ip a | grep $WIRED | awk '/inet / {print $2}')" = "" ]; then
echo "#676E7D"
echo "$COLOR7"
else
echo "#FFFFFF"
echo "$COLOR15"
fi

6
.scripts/wm/volume.sh

@ -11,11 +11,11 @@ case $BLOCK_BUTTON in
esac
if [ "$($MEDIACONTROL getmute)" == "0" ]; then
COLOR="#676E7D"
COLOR="$COLOR7"
VOLUME="MUTE"
SYMBOL=""
else
COLOR="#FFF"
COLOR="$COLOR15"
VOLUME="$($MEDIACONTROL getvolume)%"
if [ "${VOLUME%?}" -ge "50" ]; then
@ -27,4 +27,4 @@ else
fi
fi
echo "<span color='$COLOR'>$SYMBOL</span> $VOLUME"
echo "<span color='$COLOR'>$SYMBOL $VOLUME</span>"

14
.scripts/wm/wifi.sh

@ -2,19 +2,21 @@
WIRELESS="${BLOCK_INSTANCE:-wlan0}"
ICON=""
if [ ! -d /sys/class/net/${WIRELESS}/wireless ] ||
[ "$(cat /sys/class/net/$WIRELESS/operstate)" = 'down' ]; then
echo ""
echo ""
echo "#676E7D"
echo "$ICON"
echo "$ICON"
echo "$COLOR7"
else
SSID="$(iw dev $WIRELESS link | awk '/SSID/ { print $2 }')"
QUALITY=$(grep $WIRELESS /proc/net/wireless | \
awk '{ print int($3 * 100 / 70) }')
echo " $QUALITY%"
echo " $QUALITY%"
echo "#FFFFFF"
echo "$ICON $QUALITY%"
echo "$ICON $QUALITY%"
echo "$COLOR15"
fi
notify() {

Loading…
Cancel
Save