mirror of
https://github.com/nboughton/dotfiles
synced 2024-11-26 04:28:43 +01:00
minor overhaul
This commit is contained in:
parent
6b68edd15a
commit
5f306f6d56
@ -15,5 +15,5 @@ background-color=#4c566add
|
||||
text-color=#d8dee9
|
||||
border-color=#434c5e
|
||||
|
||||
default-timeout=30000
|
||||
default-timeout=10000
|
||||
ignore-timeout=1
|
||||
|
@ -20,7 +20,9 @@ set $term alacritty
|
||||
set $menu wofi -c ~/.config/wofi/config -s ~/.config/wofi/style.css -I
|
||||
|
||||
### Output configuration
|
||||
output * bg /home/nick/Pictures/Wallpapers/tu6cqny3ffu31.jpg fill
|
||||
#output * bg /home/nick/Pictures/Wallpapers/tu6cqny3ffu31.jpg fill
|
||||
#output * bg /home/nick/Pictures/Wallpapers/cf863cb7189443c5782ae6b0519d863f.jpg fill
|
||||
output * bg /home/nick/Pictures/Wallpapers/wl0fdl62lik41.jpg fill
|
||||
|
||||
### Gnome settings
|
||||
set $gnome-schema org.gnome.desktop.interface
|
||||
|
@ -1,4 +1,4 @@
|
||||
image=/home/nick/Pictures/oluit9ej7iu51.png
|
||||
image=/home/nick/Pictures/Wallpapers/wl0fdl62lik41.jpg
|
||||
font=Roboto
|
||||
indicator-radius=100
|
||||
indicator-thickness=20
|
||||
|
@ -8,27 +8,26 @@
|
||||
"margin-left": 5,
|
||||
"modules-left": [
|
||||
"sway/workspaces",
|
||||
"idle_inhibitor",
|
||||
"sway/mode",
|
||||
"sway/mode"
|
||||
],
|
||||
"modules-center": [
|
||||
"clock"
|
||||
],
|
||||
"modules-right": [
|
||||
"cpu",
|
||||
"custom/separator",
|
||||
"memory",
|
||||
"custom/swap",
|
||||
"custom/separator",
|
||||
"clock",
|
||||
"custom/separator",
|
||||
"disk#1",
|
||||
"disk#2",
|
||||
"custom/separator",
|
||||
"battery"
|
||||
],
|
||||
"modules-right": [
|
||||
"idle_inhibitor",
|
||||
"backlight",
|
||||
"custom/separator",
|
||||
"battery",
|
||||
"custom/separator",
|
||||
"pulseaudio",
|
||||
"custom/pacman",
|
||||
"custom/updates",
|
||||
"custom/auroch",
|
||||
"tray"
|
||||
],
|
||||
@ -125,13 +124,13 @@
|
||||
"format": " {percentage_used:2}%",
|
||||
"path": "/home"
|
||||
},
|
||||
"custom/pacman": {
|
||||
"custom/updates": {
|
||||
"format": " {}",
|
||||
"return-type": "json",
|
||||
"interval": 5,
|
||||
"exec": "cat ~/tmp/updates.json",
|
||||
"exec-if": "exit 0",
|
||||
"on-click": "alacritty --class aptus-upgrade -e ~/.config/waybar/modules/updates/update-system.sh; systemctl --user start updates.service",
|
||||
"on-click": "alacritty --class aptus-upgrade -e ~/.config/waybar/modules/updates/updates.sh; systemctl --user start updates.service",
|
||||
"tooltip": true
|
||||
},
|
||||
"custom/auroch": {
|
||||
|
@ -25,6 +25,119 @@ const (
|
||||
|
||||
var outfile = fmt.Sprintf("%s/tmp/auroch.json", os.Getenv("HOME"))
|
||||
|
||||
var packages = []*pkg{
|
||||
{
|
||||
AurName: "vue-cli",
|
||||
UpstreamName: "@vue/cli",
|
||||
UpstreamType: npm,
|
||||
},
|
||||
{
|
||||
AurName: "vue-cli-service-global",
|
||||
UpstreamName: "@vue/cli-service-global",
|
||||
UpstreamType: npm,
|
||||
},
|
||||
{
|
||||
AurName: "quasar-cli",
|
||||
UpstreamName: "@quasar/cli",
|
||||
UpstreamType: npm,
|
||||
},
|
||||
{
|
||||
AurName: "quasar-icongenie",
|
||||
UpstreamName: "@quasar/icongenie",
|
||||
UpstreamType: npm,
|
||||
},
|
||||
{
|
||||
AurName: "swnt",
|
||||
UpstreamName: "nboughton/swnt",
|
||||
UpstreamType: ghub,
|
||||
},
|
||||
{
|
||||
AurName: "myzt",
|
||||
UpstreamName: "nboughton/myzt",
|
||||
UpstreamType: ghub,
|
||||
},
|
||||
{
|
||||
AurName: "plymouth-theme-arch-charge-gdm",
|
||||
UpstreamName: "nboughton/plymouth-theme-arch-charge-gdm",
|
||||
UpstreamType: ghub,
|
||||
},
|
||||
{
|
||||
AurName: "devd",
|
||||
UpstreamName: "cortesi/devd",
|
||||
UpstreamType: ghub,
|
||||
},
|
||||
}
|
||||
|
||||
func main() {
|
||||
var (
|
||||
out []string
|
||||
class string
|
||||
err error
|
||||
)
|
||||
|
||||
class = "no-updates"
|
||||
for _, p := range packages {
|
||||
if err = p.getAurVer(); err != nil {
|
||||
class = errClass
|
||||
break
|
||||
|
||||
}
|
||||
|
||||
if p.UpstreamType == npm {
|
||||
if err = p.getNpmVer(); err != nil {
|
||||
class = errClass
|
||||
break
|
||||
}
|
||||
} else if p.UpstreamType == ghub {
|
||||
if err = p.getGithubVer(); err != nil {
|
||||
class = errClass
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("%s %s -> %s\n", p.AurName, p.AurVer, p.UpstreamVer)
|
||||
if p.AurVer != p.UpstreamVer {
|
||||
out = append(out, fmt.Sprintf("%s %s -> %s", p.AurName, p.AurVer, p.UpstreamVer))
|
||||
}
|
||||
}
|
||||
|
||||
n := len(out)
|
||||
|
||||
txt := fmt.Sprintf("%d", n)
|
||||
if class == errClass {
|
||||
txt = "!"
|
||||
}
|
||||
|
||||
if n > 0 {
|
||||
class = "updates"
|
||||
}
|
||||
|
||||
m := gobar.Module{
|
||||
Name: "AUROCH",
|
||||
Summary: "Outdated AUR Packages",
|
||||
JSON: gobar.JSONOutput{
|
||||
Text: txt,
|
||||
Alt: txt,
|
||||
Class: class,
|
||||
Tooltip: strings.Join(out, "\n"),
|
||||
Percentage: n,
|
||||
},
|
||||
}
|
||||
|
||||
if n > 0 {
|
||||
log.Println("Sending DBUS Notification")
|
||||
m.Notify(m.JSON.Tooltip, 10000)
|
||||
}
|
||||
|
||||
log.Println("Writing JSON data")
|
||||
f, err := os.Create(outfile)
|
||||
if err != nil {
|
||||
log.Fatalf("could not open %s for writing", outfile)
|
||||
}
|
||||
defer f.Close()
|
||||
m.JSON.Write(f)
|
||||
}
|
||||
|
||||
// Define relevant package data
|
||||
type pkg struct {
|
||||
AurName string `json:"aur_name,omitempty"` // Name on the AUR (i.e vue-cli)
|
||||
@ -98,116 +211,3 @@ func (p *pkg) getGithubVer() error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
packages := []*pkg{
|
||||
{
|
||||
AurName: "vue-cli",
|
||||
UpstreamName: "@vue/cli",
|
||||
UpstreamType: npm,
|
||||
},
|
||||
{
|
||||
AurName: "vue-cli-service-global",
|
||||
UpstreamName: "@vue/cli-service-global",
|
||||
UpstreamType: npm,
|
||||
},
|
||||
{
|
||||
AurName: "quasar-cli",
|
||||
UpstreamName: "@quasar/cli",
|
||||
UpstreamType: npm,
|
||||
},
|
||||
{
|
||||
AurName: "quasar-icongenie",
|
||||
UpstreamName: "@quasar/icongenie",
|
||||
UpstreamType: npm,
|
||||
},
|
||||
{
|
||||
AurName: "swnt",
|
||||
UpstreamName: "nboughton/swnt",
|
||||
UpstreamType: ghub,
|
||||
},
|
||||
{
|
||||
AurName: "myzt",
|
||||
UpstreamName: "nboughton/myzt",
|
||||
UpstreamType: ghub,
|
||||
},
|
||||
{
|
||||
AurName: "plymouth-theme-arch-charge-gdm",
|
||||
UpstreamName: "nboughton/plymouth-theme-arch-charge-gdm",
|
||||
UpstreamType: ghub,
|
||||
},
|
||||
{
|
||||
AurName: "devd",
|
||||
UpstreamName: "cortesi/devd",
|
||||
UpstreamType: ghub,
|
||||
},
|
||||
}
|
||||
|
||||
var (
|
||||
out []string
|
||||
class string
|
||||
err error
|
||||
)
|
||||
|
||||
class = "no-updates"
|
||||
for _, p := range packages {
|
||||
if err = p.getAurVer(); err != nil {
|
||||
class = errClass
|
||||
break
|
||||
|
||||
}
|
||||
|
||||
if p.UpstreamType == npm {
|
||||
if err = p.getNpmVer(); err != nil {
|
||||
class = errClass
|
||||
break
|
||||
}
|
||||
} else if p.UpstreamType == ghub {
|
||||
if err = p.getGithubVer(); err != nil {
|
||||
class = errClass
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("%s %s -> %s\n", p.AurName, p.AurVer, p.UpstreamVer)
|
||||
if p.AurVer != p.UpstreamVer {
|
||||
out = append(out, fmt.Sprintf("%s %s -> %s", p.AurName, p.AurVer, p.UpstreamVer))
|
||||
}
|
||||
}
|
||||
|
||||
n := len(out)
|
||||
|
||||
txt := fmt.Sprintf("%d", n)
|
||||
if class == errClass {
|
||||
txt = "!"
|
||||
}
|
||||
|
||||
if n > 0 {
|
||||
class = "updates"
|
||||
}
|
||||
|
||||
m := gobar.Module{
|
||||
Name: "AUROCH",
|
||||
Summary: "Outdated AUR Packages",
|
||||
JSON: gobar.JSONOutput{
|
||||
Text: txt,
|
||||
Alt: txt,
|
||||
Class: class,
|
||||
Tooltip: strings.Join(out, "\n"),
|
||||
Percentage: n,
|
||||
},
|
||||
}
|
||||
|
||||
if n > 0 {
|
||||
log.Println("Sending DBUS Notification")
|
||||
m.Notify(m.JSON.Tooltip, 10000)
|
||||
}
|
||||
|
||||
log.Println("Writing JSON data")
|
||||
f, err := os.Create(outfile)
|
||||
if err != nil {
|
||||
log.Fatalf("could not open %s for writing", outfile)
|
||||
}
|
||||
defer f.Close()
|
||||
m.JSON.Write(f)
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ Description=Check for new upstream AUR versions of NPM packages
|
||||
|
||||
[Timer]
|
||||
OnStartupSec=5min
|
||||
OnUnitActiveSec=1h
|
||||
OnUnitActiveSec=2h
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
WantedBy=timers.target
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
"github.com/nboughton/dotfiles/waybar/modules/gobar"
|
||||
)
|
||||
|
||||
var outfile = fmt.Sprintf("%s/tmp/updates.json", os.Getenv(("HOME")))
|
||||
var outfile = fmt.Sprintf("%s/tmp/updates.json", os.Getenv("HOME"))
|
||||
|
||||
func main() {
|
||||
m := gobar.Module{
|
@ -4,4 +4,4 @@ Description=Check for Pacman and AUR/git package updates
|
||||
[Service]
|
||||
Type=oneshot
|
||||
WorkingDirectory=%h/.config/waybar/modules/updates
|
||||
ExecStart=go run %h/.config/waybar/modules/updates/update-check.go
|
||||
ExecStart=go run %h/.config/waybar/modules/updates/updates.go
|
||||
|
@ -5,11 +5,11 @@
|
||||
|
||||
window#waybar {
|
||||
color: #d8dee9;
|
||||
background: rgba(76, 86, 106, 0.75);
|
||||
background: linear-gradient(90deg, rgba(180, 142, 173, 0.5) 0%, rgba(94,129,172, 0.5) 50%, rgba(163, 190, 140, 0.5) 100%);
|
||||
border-radius: 7px;
|
||||
}
|
||||
|
||||
#custom-pacman {
|
||||
#custom-updates {
|
||||
font-family: "Symbols Nerd Font";
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ window#waybar {
|
||||
#battery,
|
||||
#backlight,
|
||||
#disk,
|
||||
#custom-pacman,
|
||||
#custom-updates,
|
||||
#custom-auroch,
|
||||
#custom-swap,
|
||||
#custom-spotify,
|
||||
@ -59,24 +59,18 @@ window#waybar {
|
||||
border-bottom-left-radius: 7px;
|
||||
}
|
||||
#workspaces button.focused {
|
||||
background: rgba(94,129,172, 0.7);
|
||||
background: rgba(180, 142, 173, 0.5);
|
||||
}
|
||||
|
||||
#idle_inhibitor {
|
||||
margin: 0px;
|
||||
}
|
||||
#idle_inhibitor.activated {
|
||||
background: rgba(163, 190, 140, 0.6);
|
||||
}
|
||||
#idle_inhibitor.deactivated {
|
||||
background: rgba(208, 135, 112, 0.6);
|
||||
}
|
||||
|
||||
#mode {
|
||||
background: rgba(191, 97, 106, 0.7);
|
||||
background: rgba(191, 97, 106, 0.5);
|
||||
}
|
||||
|
||||
/* TOP BAR (right) */
|
||||
/* TOP BAR (right/center) */
|
||||
#disk.1,
|
||||
#memory {
|
||||
padding-right: 3px;
|
||||
@ -86,27 +80,30 @@ window#waybar {
|
||||
padding-left: 3px;
|
||||
}
|
||||
|
||||
#custom-pacman.no-updates,
|
||||
/*
|
||||
#custom-updates.no-updates,
|
||||
#custom-auroch.no-updates {
|
||||
background: rgba(163, 190, 140, 0.7);
|
||||
}
|
||||
#custom-pacman.updates,
|
||||
*/
|
||||
#custom-updates.updates,
|
||||
#custom-auroch.updates {
|
||||
background: rgba(180, 142, 173, 0.7);
|
||||
background: rgba(180, 142, 173, 0.5);
|
||||
}
|
||||
#custom-pacman.error {
|
||||
background: rgba(191, 97, 106, 0.7);
|
||||
#custom-updates.error,
|
||||
#custom-auroch.error {
|
||||
background: rgba(191, 97, 106, 0.5);
|
||||
}
|
||||
|
||||
#tray {
|
||||
background: rgba(94,129,172, 0.7);
|
||||
border-top-right-radius: 7px;
|
||||
border-bottom-right-radius: 7px;
|
||||
}
|
||||
|
||||
/* BOTTOM BAR (left to right)*/
|
||||
#custom-weather {
|
||||
background: rgba(94,129,172, 0.7);
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
border-top-left-radius: 7px;
|
||||
border-bottom-left-radius: 7px;
|
||||
}
|
||||
@ -122,11 +119,10 @@ window#waybar {
|
||||
text-shadow: 1px 1px 1px #2e3440;
|
||||
}
|
||||
#taskbar button.active {
|
||||
background: rgba(180, 142, 173, 0.7);
|
||||
background: rgba(180, 142, 173, 0.5);
|
||||
}
|
||||
|
||||
#custom-spotify {
|
||||
background: rgba(94,129,172, 0.7);
|
||||
border-top-right-radius: 7px;
|
||||
border-bottom-right-radius: 7px;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user