Push dots

This commit is contained in:
Marco Thomas
2020-08-21 17:09:27 +02:00
committed by Marc
commit 246e1fb1fc
330 changed files with 16534 additions and 0 deletions

View File

@@ -0,0 +1,331 @@
; vim: ft=dosini
[colors]
transparent = #00000000
red = #BF616A
orange = #D08770
yellow = #EBCB8B
green = #A3BE8C
purple = #B48EAD
blue0 = #8FBCBB
blue1 = #88C0D0
blue2 = #81A1C1
blue3 = #5E81AC
nord0 = #2E3440
nord1 = #3b4252
nord2 = #434c5e
nord3 = #4C566A
frost0 = #d8dee9
frost1 = #e5e9f0
frost2 = #ECEFF4
accent = ${colors.green}
foreground = ${colors.frost2}
background = ${colors.nord0}
tray = ${colors.nord0}
################################################################################
[bar/global]
monitor = ${env:MONITOR}
font-0 = "FiraCode Nerd Font Mono:pixelsize=9;3"
font-1 = "IPAGothic:fontformat=truetype:antialias=false:pixelsize=11;2"
font-2 = "Siji:size=7;2"
bottom = false
radius = 12
height = 27px
foreground = ${colors.foreground}
background = ${colors.nord0}
module-margin= 0
wm-name = i3
wm-restack = i3
################################################################################
[bar/workspaces]
inherit = bar/global
width = 10%
override-redirect = true
offset-x = 8px
offset-y = 8px
modules-center = i3
################################################################################
[bar/middle]
inherit = bar/global
width = 25%
override-redirect = true
fixed-center = true
offset-x = 37.25%
offset-y = 8px
modules-center = spotify
################################################################################
[bar/status]
inherit = bar/global
width = 25%
override-redirect = true
fixed-center = true
offset-x = 75%:-8px
offset-y = 8px
modules-center = backlight volume battery date
###############################################################################
[module/i3]
type = internal/i3
pin-workspaces = true
wrapping-scroll = false
format = <label-state> <label-mode>
foreground = ${colors.foreground}
background = ${colors.nord0}
label-focused = ""
label-focused-padding = 1
label-unfocused = ""
label-unfocused-padding = 1
label-urgent = ""
label-urgent-foreground = ${colors.red}
label-urgent-padding = 1
###############################################################################
[module/date]
type = internal/date
format-padding = 1
format-background = ${colors.background}
interval = 1.0
time =  %I:%M %p - %A, %d %B %Y
time-alt =  %I:%M %p
format = <label>
label = %time%
###############################################################################
[module/title]
type = internal/xwindow
label = %title%
format = <label>
label-maxlen = 80
label-empty = "Yoroshiku!"
format-padding = 1
###############################################################################
[module/cpu]
type = internal/cpu
interval = 5
format-background = ${colors.frost1}
format-foreground = ${colors.nord0}
format = <label>
format-prefix = 
format-padding = 1
label = " %percentage%%"
###############################################################################
[module/memory]
type = internal/memory
interval = 3
format = <label>
format-prefix = 
label = " %mb_used%"
###############################################################################
[module/battery]
type = internal/battery
full-at = 99
battery = BAT0
apdapter = ADP1
bg = ${colors.background}
format-charging = <animation-charging> <label-charging>
format-charging-background = ${self.bg}
format-charging-padding = 1
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-background = ${self.bg}
format-discharging-padding = 1
format-full = <ramp-capacity> <label-full>
format-full-background = ${self.bg}
format-full-padding = 1
label-charging = %percentage%%
label-discharging = %percentage%%
label-full = 100%
; Only applies if <ramp-capacity> is used
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-5 = 
ramp-capacity-6 = 
ramp-capacity-7 = 
ramp-capacity-8 = 
ramp-capacity-9 = 
; Only applies if <animation-charging> is used
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
; Framerate in milliseconds
animation-charging-framerate = 750
###############################################################################
[module/volume]
type = internal/pulseaudio
format-volume-background = ${colors.background}
format-volume-padding = 1
format-volume = <ramp-volume> <label-volume>
label-volume = %percentage%%
format-muted-prefix = " "
format-muted-padding = 1
label-muted = "Muted"
ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 
ramp-volume-3 = 
ramp-volume-4 = 
ramp-headphones-0 = 
ramp-headphones-1 = 
###############################################################################
[module/network]
type = internal/network
interface = wlo1
interval = 1.0
accumulate-stats = true
unknown-as-up = true
format-connected = <ramp-signal> <label-connected>
format-connected-background = ${colors.nord1}
format-connected-padding = 1
format-disconnected = <label-disconnected>
format-disconnected-background = ${colors.nord1}
format-disconnected-padding = 1
label-connected = %essid%
label-disconnected =  Disconnected
; Only applies if <ramp-signal> is used
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
###############################################################################
[module/backlight]
type = internal/backlight
format-padding = 1
format-background = ${colors.background}
format-foreground = ${colors.foreground}
# ls -1 /sys/class/backlight
card = amdgpu_bl0
format = <label>
format-prefix = ""
label = " %percentage%%"
bar-width = 10
bar-indicator = |
bar-fill = ─
bar-empty= ─
###############################################################################
[module/load]
type = custom/script
exec = ~/.config/polybar/scripts/load.sh
interval = 5.0
###############################################################################
[module/spotify]
type = custom/script
format-prefix = " "
exec = ~/.config/polybar/scripts/song.sh 2>/dev/null || echo "No song is playing"
tail = true
interval = 2
###############################################################################
[module/hostname]
type = custom/script
format-padding = 1
format-background = ${colors.green}
format-foreground = ${colors.nord0}
exec = ~/.config/polybar/scripts/hostname.sh
tail = true
interval = 60
###############################################################################
[module/ip]
type = custom/script
format-padding = 1
format-background = ${colors.nord0}
format-foreground = ${colors.foreground}
format-prefix = "直 "
exec = ~/.config/polybar/scripts/ip.sh
tail = true
interval = 20
###############################################################################
[module/powerbutton]
type = custom/text
content-padding = 1
content-background = ${colors.nord1}
content-foreground = ${colors.frost2}
content = "襤"
click-left = ~/scripts/powermenu

View File

@@ -0,0 +1,12 @@
killall -q polybar
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
if type "xrandr"; then
for mon in $(xrandr --query | grep " connected" | cut -d" " -f1); do
MONITOR=$mon polybar --reload workspaces &
MONITOR=$mon polybar --reload middle &
MONITOR=$mon polybar --reload status &
done
else
echo "No Bars loaded."
fi

View File

@@ -0,0 +1,3 @@
#!/bin/bash
echo "$USER@$HOSTNAME"

View File

@@ -0,0 +1,8 @@
#!/bin/bash
PUBLIC_IP=`wget http://ipecho.net/plain -O - -q ; echo`
WLO1=`hostname -I | awk '{print $1}'`
SSID=`iwgetid -r`
echo "$PUBLIC_IP - $WLO1 - $SSID"

View File

@@ -0,0 +1,7 @@
#!/bin/sh
function load() {
echo -n "$(cat /proc/loadavg | awk -F ' ' '{print $1,$2,$3}')"
}
load

View File

@@ -0,0 +1,37 @@
#!/bin/sh
function scroll () {
prefix="$1"
scrolling="$2"
temp="$(echo "$scrolling"| sed "s/^\(.\{20\}\)\(.*\)$/\1[\2]/"| sed "s/\[ *\]$//"| sed "s/\[.*\]$//")"
suffix="$3"
if [ "$(echo -n $scrolling |wc -c)" -gt 20 ]; then
echo "$prefix%{T7}$temp%{T-}$suffix"
sleep 0.5
zscroll -l 20 \
--delay 0.2 \
--before-text "$prefix%{T7}" \
--after-text "%{T-}$suffix" \
--scroll-padding " " \
--update-check true "echo '$(get_title)'" &
wait
else
echo "$prefix%{T8} $temp %{T-}$suffix"
fi
} #
function get_artist () {
echo "$(playerctl -p spotify metadata --format "{{ artist }}"| sed -e "s/[[(]....*[])]*//g" | sed "s/ *$//"| sed "s/^\(.\{20\}[^ ]*\)\(.*\)$/\1[\2]/"| sed "s/\[ *\]$//"| sed "s/\[.*\]$/.../")"
} #
function get_title () {
echo "$(playerctl -p spotify metadata --format "{{title}}" | sed 's/'\''/\\'\''/g')"
} #
[ ! -z "$(playerctl -p spotify status 2>/dev/null)" ] \
&& artist=$(get_artist) \
&& title=$(get_title) \
&& ([ -z "$artist$title" ] && scroll "" "Spotify is not connected on this pc" "" || scroll "%{F#79e6f3}$artist%{F#FFF} [" "$title" "]%{F-}" ) \
|| exit 1

View File

@@ -0,0 +1,23 @@
#!/bin/sh
main() {
if ! pgrep -x spotify >/dev/null; then
echo ""; exit
fi
cmd="org.freedesktop.DBus.Properties.Get"
domain="org.mpris.MediaPlayer2"
path="/org/mpris/MediaPlayer2"
meta=$(dbus-send --print-reply --dest=${domain}.spotify \
/org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:${domain}.Player string:Metadata)
artist=$(echo "$meta" | sed -nr '/xesam:artist"/,+2s/^ +string "(.*)"$/\1/p' | tail -1 | sed 's/\&/\\&/g' | sed 's#\/#\\/#g')
album=$(echo "$meta" | sed -nr '/xesam:album"/,+2s/^ +variant +string "(.*)"$/\1/p' | tail -1| sed 's/\&/\\&/g'| sed 's#\/#\\/#g')
title=$(echo "$meta" | sed -nr '/xesam:title"/,+2s/^ +variant +string "(.*)"$/\1/p' | tail -1 | sed 's/\&/\\&/g'| sed 's#\/#\\/#g')
echo "${*:-%artist% - %title%}" | sed "s/%artist%/$artist/g;s/%title%/$title/g;s/%album%/$album/g"i | sed "s/\&/\&/g" | sed "s#\/#\/#g"
}
main "$@"