Browse Source

Export Xresources colors, use these in i3blocks

master
Riyyi 6 years ago
parent
commit
9269c10c04
  1. 2
      .config/i3/blocks
  2. 31
      .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 command=$HOME/.scripts/wm/$BLOCK_NAME
separator_block_width=20 separator_block_width=20
markup=none markup=none
# separator=false separator=false
align=center align=center
[volume.sh] [volume.sh]

31
.config/i3/config

@ -21,11 +21,11 @@ exec --no-startup-id thunar
exec --no-startup-id xss-lock -- $HOME/.scripts/wm/lock.sh & exec --no-startup-id xss-lock -- $HOME/.scripts/wm/lock.sh &
# Colors # Colors
set $bg-color #404552 set $bgcolor #404552
set $bg-color-inactive #2B2E39 set $bgcolor-inactive #2b2e39
set $bg-color-urgent #DC7A43 set $bgcolor-urgent #dc7a43
set $text-color #FFFFFF set $text-color #ffffff
set $text-color-inactive #676E7D set $textcolor-inactive #676e7d
# Xresources colors # Xresources colors
set_from_resource $darkblack color0 #000000 set_from_resource $darkblack color0 #000000
@ -48,21 +48,22 @@ set $transparent #00000000
# Window colors # Window colors
# border background text indicator # border background text indicator
client.focused $text-color-inactive $text-color-inactive $text-color $darkgreen client.focused $textcolor-inactive $textcolor-inactive $white $darkgreen
client.unfocused $bg-color-inactive $bg-color-inactive $text-color-inactive $darkgreen client.unfocused $bgcolor-inactive $bgcolor-inactive $darkwhite $darkgreen
client.focused_inactive $bg-color-inactive $bg-color-inactive $text-color-inactive $darkgreen client.focused_inactive $bgcolor-inactive $bgcolor-inactive $darkwhite $darkgreen
client.urgent $bg-color-urgent $bg-color-urgent $text-color $darkgreen client.urgent $bgcolor-urgent $bgcolor-urgent $white $darkgreen
bar { bar {
colors { colors {
background $bg-color-inactive background $bgcolor-inactive
separator #757575 separator $darkwhite
statusline $white
# border background text # border background text
focused_workspace $bg-color $bg-color $text-color focused_workspace $bgcolor $bgcolor $white
inactive_workspace $bg-color-inactive $bg-color-inactive $text-color-inactive inactive_workspace $bgcolor-inactive $bgcolor-inactive $darkwhite
urgent_workspace $bg-color-urgent $bg-color-urgent $text-color 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 status_command i3blocks -c $HOME/.config/i3/blocks
#strip_workspace_numbers yes #strip_workspace_numbers yes
tray_output primary tray_output primary

5
.config/xorg/xinitrc

@ -2,6 +2,7 @@
xrdb "$XDG_CONFIG_HOME/xorg/Xresources" 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 --newmode "3000x2000_48.00" 405.25 3000 3232 3552 4104 2000 2003 2013 2058 -hsync +vsync
xrandr --addmode eDP-1 3000x2000_48.00 xrandr --addmode eDP-1 3000x2000_48.00
xrandr --output eDP-1 --mode 3000x2000_48.00 --primary xrandr --output eDP-1 --mode 3000x2000_48.00 --primary
@ -30,4 +31,8 @@ setxkbmap -option ''
# Swap capslock with escape # Swap capslock with escape
setxkbmap -option caps:swapescape 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 exec i3

4
.scripts/wm/battery.sh

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

5
.scripts/wm/brightness.sh

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

6
.scripts/wm/volume.sh

@ -11,11 +11,11 @@ case $BLOCK_BUTTON in
esac esac
if [ "$($MEDIACONTROL getmute)" == "0" ]; then if [ "$($MEDIACONTROL getmute)" == "0" ]; then
COLOR="#676E7D" COLOR="$COLOR7"
VOLUME="MUTE" VOLUME="MUTE"
SYMBOL="" SYMBOL=""
else else
COLOR="#FFF" COLOR="$COLOR15"
VOLUME="$($MEDIACONTROL getvolume)%" VOLUME="$($MEDIACONTROL getvolume)%"
if [ "${VOLUME%?}" -ge "50" ]; then if [ "${VOLUME%?}" -ge "50" ]; then
@ -27,4 +27,4 @@ else
fi fi
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}" WIRELESS="${BLOCK_INSTANCE:-wlan0}"
ICON=""
if [ ! -d /sys/class/net/${WIRELESS}/wireless ] || if [ ! -d /sys/class/net/${WIRELESS}/wireless ] ||
[ "$(cat /sys/class/net/$WIRELESS/operstate)" = 'down' ]; then [ "$(cat /sys/class/net/$WIRELESS/operstate)" = 'down' ]; then
echo ""
echo "" echo "$ICON"
echo "#676E7D" echo "$ICON"
echo "$COLOR7"
else else
SSID="$(iw dev $WIRELESS link | awk '/SSID/ { print $2 }')" SSID="$(iw dev $WIRELESS link | awk '/SSID/ { print $2 }')"
QUALITY=$(grep $WIRELESS /proc/net/wireless | \ QUALITY=$(grep $WIRELESS /proc/net/wireless | \
awk '{ print int($3 * 100 / 70) }') awk '{ print int($3 * 100 / 70) }')
echo " $QUALITY%" echo "$ICON $QUALITY%"
echo " $QUALITY%" echo "$ICON $QUALITY%"
echo "#FFFFFF" echo "$COLOR15"
fi fi
notify() { notify() {

Loading…
Cancel
Save