Added devenv and moved config files
This commit is contained in:
54
config/polybar/bars/bars.ini
Normal file
54
config/polybar/bars/bars.ini
Normal file
@@ -0,0 +1,54 @@
|
||||
include-file = colours.ini
|
||||
include-directory = modules
|
||||
|
||||
[bar/base]
|
||||
dpi = 96
|
||||
width = 100%
|
||||
height = 32
|
||||
offset-x = 0
|
||||
offset-y = 0
|
||||
|
||||
font-0 = "Iosevka:size=10;2"
|
||||
font-1 = "Iosevka:size=16;2"
|
||||
font-2 = "Iosevka:size=22;4"
|
||||
|
||||
background = ${colours/bar.bg}
|
||||
foreground = ${colours/bar.fg}
|
||||
|
||||
border-bottom-size = 5
|
||||
border-top-size = 5
|
||||
border-left-size = 10
|
||||
border-right-size = 10
|
||||
|
||||
border-bottom-color = ${colours/bar.bg}
|
||||
border-top-color = ${colours/bar.bg}
|
||||
border-left-color = ${colours/bar.bg}
|
||||
border-right-color = ${colours/bar.bg}
|
||||
|
||||
spacing = 0
|
||||
padding-left = 0
|
||||
padding-right = 0
|
||||
module-margin-left = 0
|
||||
|
||||
separator = |
|
||||
separator-padding = .5
|
||||
separator-foreground = ${colours/bar.bg}
|
||||
separator-background = ${colours/bar.bg}
|
||||
|
||||
[bar/bottom]
|
||||
inherit = bar/base
|
||||
bottom = true
|
||||
|
||||
modules-left = workspaces
|
||||
modules-right = wireless bluetooth volume battery
|
||||
|
||||
tray-position = center
|
||||
tray-maxsize = 28
|
||||
|
||||
[bar/top]
|
||||
inherit = bar/base
|
||||
bottom = false
|
||||
|
||||
modules-left = spotify
|
||||
modules-center = date
|
||||
modules-right = i3-mode
|
||||
57
config/polybar/bars/colours.ini
Normal file
57
config/polybar/bars/colours.ini
Normal file
@@ -0,0 +1,57 @@
|
||||
[colours]
|
||||
trans = #0000
|
||||
white = #fff
|
||||
black = #000
|
||||
gray = #555
|
||||
|
||||
[colours/bar]
|
||||
bg = ${colours.trans}
|
||||
fg = ${colour-scheme.base05}
|
||||
|
||||
[colours/date]
|
||||
bg = ${colour-scheme.base01}
|
||||
fg = ${colour-scheme.base05}
|
||||
|
||||
[colours/battery]
|
||||
full-bg = ${colour-scheme.base0C}
|
||||
full-fg = ${colour-scheme.base01}
|
||||
charging-bg = ${colour-scheme.base0C}
|
||||
charging-fg = ${colour-scheme.base01}
|
||||
discharging-bg = ${colour-scheme.base01}
|
||||
discharging-fg = ${colour-scheme.base05}
|
||||
low-bg = ${colour-scheme.base0E}
|
||||
low-fg = ${colour-scheme.base01}
|
||||
|
||||
[colours/workspaces]
|
||||
focused-bg = ${colour-scheme.base02}
|
||||
focused-fg = ${colour-scheme.base04}
|
||||
unfocused-bg = ${colour-scheme.base01}
|
||||
unfocused-fg = ${colour-scheme.base05}
|
||||
urgent-bg = ${colour-scheme.base0E}
|
||||
urgent-fg = ${colour-scheme.base01}
|
||||
|
||||
[colours/i3-mode]
|
||||
bg = ${colour-scheme.base0E}
|
||||
fg = ${colour-scheme.base01}
|
||||
|
||||
[colours/volume]
|
||||
volume-bg = ${colour-scheme.base0C}
|
||||
volume-fg = ${colour-scheme.base01}
|
||||
muted-bg = ${colour-scheme.base01}
|
||||
muted-fg = ${colour-scheme.base05}
|
||||
|
||||
[colours/wireless]
|
||||
connected-bg = ${colour-scheme.base0C}
|
||||
connected-fg = ${colour-scheme.base01}
|
||||
disconnected-bg = ${colour-scheme.base01}
|
||||
disconnected-fg = ${colour-scheme.base05}
|
||||
packetloss-bg = ${colour-scheme.base0E}
|
||||
packetloss-fg = ${colour-scheme.base01}
|
||||
|
||||
[colours/bluetooth]
|
||||
bg = ${colour-scheme.base0C}
|
||||
fg = ${colour-scheme.base01}
|
||||
|
||||
[colours/spotify]
|
||||
bg = ${colour-scheme.base0A}
|
||||
fg = ${colour-scheme.base01}
|
||||
31
config/polybar/bars/modules/battery.ini
Normal file
31
config/polybar/bars/modules/battery.ini
Normal file
@@ -0,0 +1,31 @@
|
||||
[module/battery]
|
||||
type = internal/battery
|
||||
full-at = 100
|
||||
low-at = 20
|
||||
battery = BAT0
|
||||
adapter = ADP0
|
||||
poll-interval = 1
|
||||
|
||||
format-full = <label-full>
|
||||
label-full = "%{T2}%{T-} %percentage%%"
|
||||
label-full-background = ${colours/battery.full-bg}
|
||||
label-full-foreground = ${colours/battery.full-fg}
|
||||
label-full-padding = 1
|
||||
|
||||
format-charging = <label-charging>
|
||||
label-charging = "%{T2}%{T-} %percentage%%"
|
||||
label-charging-background = ${colours/battery.charging-bg}
|
||||
label-charging-foreground = ${colours/battery.charging-fg}
|
||||
label-charging-padding = 1
|
||||
|
||||
format-discharging = <label-discharging>
|
||||
label-discharging = "%{T2}%{T-} %percentage%%"
|
||||
label-discharging-background = ${colours/battery.discharging-bg}
|
||||
label-discharging-foreground = ${colours/battery.discharging-fg}
|
||||
label-discharging-padding = 1
|
||||
|
||||
format-low = <label-low>
|
||||
label-low = "%{T2}%{T-} %percentage%%"
|
||||
label-low-background = ${colours/battery.low-bg}
|
||||
label-low-foreground = ${colours/battery.low-fg}
|
||||
label-low-padding = 1
|
||||
9
config/polybar/bars/modules/bluetooth.ini
Normal file
9
config/polybar/bars/modules/bluetooth.ini
Normal file
@@ -0,0 +1,9 @@
|
||||
[module/bluetooth]
|
||||
type = custom/script
|
||||
exec = ~/.config/rofi/menus/bluetooth/bluetooth.sh --status
|
||||
interval = 5
|
||||
click-left = ~/.config/rofi/menus/bluetooth/bluetooth.sh
|
||||
|
||||
format-background = ${colours/bluetooth.bg}
|
||||
format-foreground = ${colours/bluetooth.fg}
|
||||
format-padding = 1
|
||||
13
config/polybar/bars/modules/date.ini
Normal file
13
config/polybar/bars/modules/date.ini
Normal file
@@ -0,0 +1,13 @@
|
||||
[module/date]
|
||||
type = internal/date
|
||||
interval = 1.0
|
||||
date = %A, %d %B %Y
|
||||
time = %H:%M:%S
|
||||
label = %date% · %time%
|
||||
|
||||
format = <label>
|
||||
format-padding = 0
|
||||
|
||||
label-background = ${colours/date.bg}
|
||||
label-foreground = ${colours/date.fg}
|
||||
label-padding = 1
|
||||
7
config/polybar/bars/modules/i3-mode.ini
Normal file
7
config/polybar/bars/modules/i3-mode.ini
Normal file
@@ -0,0 +1,7 @@
|
||||
[module/i3-mode]
|
||||
type = internal/i3
|
||||
format = <label-mode>
|
||||
|
||||
label-mode-background = ${colours/i3-mode.bg}
|
||||
label-mode-foreground = ${colours/i3-mode.fg}
|
||||
label-mode-padding = 2
|
||||
8
config/polybar/bars/modules/spotify.ini
Normal file
8
config/polybar/bars/modules/spotify.ini
Normal file
@@ -0,0 +1,8 @@
|
||||
[module/spotify]
|
||||
type = custom/script
|
||||
exec = ~/.config/polybar/scripts/spotify.sh
|
||||
interval = 5
|
||||
|
||||
format-background = ${colours/spotify.bg}
|
||||
format-foreground = ${colours/spotify.fg}
|
||||
format-padding = 1
|
||||
15
config/polybar/bars/modules/volume.ini
Normal file
15
config/polybar/bars/modules/volume.ini
Normal file
@@ -0,0 +1,15 @@
|
||||
[module/volume]
|
||||
type = internal/pulseaudio
|
||||
interval = 5
|
||||
|
||||
format-volume = <label-volume>
|
||||
label-volume = %{T2}墳%{T-} %percentage%%
|
||||
label-volume-padding = 1
|
||||
label-volume-foreground = ${colours/volume.volume-fg}
|
||||
label-volume-background = ${colours/volume.volume-bg}
|
||||
|
||||
format-muted = <label-muted>
|
||||
label-muted = %{T2}ﱝ%{T-} muted
|
||||
label-muted-padding = 1
|
||||
label-muted-foreground = ${colours/volume.muted-fg}
|
||||
label-muted-background = ${colours/volume.muted-bg}
|
||||
28
config/polybar/bars/modules/wireless.ini
Normal file
28
config/polybar/bars/modules/wireless.ini
Normal file
@@ -0,0 +1,28 @@
|
||||
[module/wireless]
|
||||
type = internal/network
|
||||
interface-type = wireless
|
||||
interval = 3.0
|
||||
|
||||
accumulate-stats = true
|
||||
;unknown-as-up = true
|
||||
|
||||
; The unit used for displaying network speeds
|
||||
; For example if set to the empty string, a speed of 5 KB/s is displayed as 5 K
|
||||
speed-unit = ''
|
||||
|
||||
format-connected = <label-connected>
|
||||
label-connected = %{T2}直%{T-} %essid% (%local_ip%)
|
||||
label-connected-background = ${colours/wireless.connected-bg}
|
||||
label-connected-foreground = ${colours/wireless.connected-fg}
|
||||
label-connected-padding = 1
|
||||
|
||||
format-disconnected = <label-disconnected>
|
||||
label-disconnected = %{T2}睊
|
||||
label-disconnected-background = ${colours/wireless.disconnected-bg}
|
||||
label-disconnected-foreground = ${colours/wireless.disconnected-fg}
|
||||
label-disconnected-padding = 1
|
||||
|
||||
format-packetloss = <label-connected>*
|
||||
label-packetloss-background = ${colours/wireless.packetloss-bg}
|
||||
label-packetloss-foreground = ${colours/wireless.packetloss-fg}
|
||||
label-packetloss-padding = 1
|
||||
22
config/polybar/bars/modules/workspaces.ini
Normal file
22
config/polybar/bars/modules/workspaces.ini
Normal file
@@ -0,0 +1,22 @@
|
||||
[module/workspaces]
|
||||
type = internal/i3
|
||||
format = <label-state>
|
||||
index-sort = true
|
||||
wrapping-scroll = false
|
||||
strip-wsnumbers = true
|
||||
pin-workspaces = true
|
||||
|
||||
label-focused = %index%
|
||||
label-focused-background = ${colours/workspaces.focused-bg}
|
||||
label-focused-foreground = ${colours/workspaces.focused-fg}
|
||||
label-focused-padding = 2
|
||||
|
||||
label-unfocused = %index%
|
||||
label-unfocused-background = ${colours/workspaces.unfocused-bg}
|
||||
label-unfocused-foreground = ${colours/workspaces.unfocused-fg}
|
||||
label-unfocused-padding = 2
|
||||
|
||||
label-urgent = %index%
|
||||
label-urgent-background = ${colours/workspaces.urgent-bg}
|
||||
label-urgent-foreground = ${colours/workspaces.urgent-fg}
|
||||
label-urgent-padding = 2
|
||||
3
config/polybar/config.ini
Normal file
3
config/polybar/config.ini
Normal file
@@ -0,0 +1,3 @@
|
||||
# This file is generated by nixos-rebuild
|
||||
include-file = colour-scheme.ini
|
||||
include-file = bars/bars.ini
|
||||
20
config/polybar/scripts/spotify.sh
Executable file
20
config/polybar/scripts/spotify.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
main() {
|
||||
pgrep spotify -l | grep -v spotify.sh > /dev/null || return
|
||||
|
||||
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 ${cmd} string:${domain}.Player string:Metadata)
|
||||
|
||||
# Normal track
|
||||
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 "$@"
|
||||
Reference in New Issue
Block a user