1
1
mirror of https://github.com/rywng/dotfiles.git synced 2024-11-22 02:41:50 +08:00

feat: mpv, waybar, zathura

This commit is contained in:
Ryan 2024-01-14 17:53:01 +08:00
parent ee4f05860c
commit d9b78e8b0b
6 changed files with 105 additions and 183 deletions

View File

@ -30,7 +30,7 @@ layer = overlay
[colors] [colors]
background=282828ff background=282828ff
text=665c54ff text=665c54ff
match=bdae93ff match=928374ff
selection=3c3836ff selection=3c3836ff
selection-text=ebdbb2ff selection-text=ebdbb2ff
selection-match=ebdbb2ff selection-match=ebdbb2ff

View File

@ -1,87 +0,0 @@
import argparse
import collections
import json
import pathlib
class Profile:
def __init__(self, object, json, groups_key="setting-groups"):
self.json = json
self.groups_key = groups_key
self._settings = []
self._shaders = []
self._collect(object)
def _collect(self, object):
self._settings.extend(object.get("settings", []))
self._shaders.extend(object.get("shaders", []))
for key in object.get(self.groups_key, []):
self._collect(self.json["setting-groups"][key])
parser = argparse.ArgumentParser()
parser.add_argument("--profile", default=None)
parser.add_argument(
"--path", default=f"{pathlib.Path.home()}/.config/mpv/default-shader-pack")
parser.add_argument("--config", default=False, action="store_true")
arguments = parser.parse_args()
arguments.path = str(pathlib.Path(arguments.path))
# with open(pathlib.Path(arguments.path, "pack.json"), "rb") as file:
with open(pathlib.Path(arguments.path, "pack-hq.json"), "rb") as file:
json_ = json.load(file)
if arguments.profile is None:
for profile in json_["profiles"].values():
print(profile["displayname"])
else:
if arguments.config:
prefix = ""
end = None
else:
prefix = "--"
end = " "
default_profile = Profile(
json_, json_, groups_key="default-setting-groups")
(_,) = (
profile
for profile in json_["profiles"].values()
if profile["displayname"] == arguments.profile
)
profile = Profile(_, json_)
for key, value in collections.OrderedDict(
default_profile._settings + profile._settings
).items():
key = key.replace("_", "-")
if value is True:
print(prefix, key, sep="", end=end)
continue
print(prefix, key, "=", value, sep="", end=end)
print(
prefix,
"glsl-shaders=",
":".join(
str(pathlib.Path(arguments.path, "shaders", shader))
for shader in collections.OrderedDict(
(_, None) for _ in default_profile._shaders + profile._shaders
).keys()
),
sep="",
end=end,
)
print()

@ -1 +0,0 @@
Subproject commit ca506a6bf3937881ebd1ab35bfbaf3d9b0221e0d

View File

@ -1,3 +1,3 @@
volume=70 volume=70
sub-auto=fuzzy sub-auto=fuzzy
# hwdec=auto-safe hwdec=auto-safe

View File

@ -1,95 +1,102 @@
{ {
"layer": "top", "layer": "top",
"modules-left": [ "modules-left": [
"sway/workspaces" "sway/workspaces"
], ],
"fixed-center": false, "fixed-center": false,
"modules-center": [ "modules-center": [
"sway/window" "sway/window"
], ],
"modules-right": [ "modules-right": [
"tray", "tray",
"custom/notification", "custom/notification",
"custom/player", "custom/player",
"cpu", "cpu",
"memory", "memory",
"network", "network",
"battery", "battery",
"clock" "clock"
], ],
"sway/workspaces": { "sway/workspaces": {
"show_special": true, "show_special": true,
"on-click": "activate", "on-click": "activate",
"persistent_workspaces": { "persistent_workspaces": {
"9": ["HDMI-A-1"] "9": [
} "HDMI-A-1"
}, ]
"sway/window": { }
"max-length": 50, },
"separate-outputs": true "sway/window": {
}, "max-length": 50,
"tray": { "separate-outputs": true
"spacing": 10 },
}, "tray": {
"cpu": { "spacing": 10
"format": " {load}", },
"format-alt": " {usage}% @ {avg_frequency}GHz" "cpu": {
}, "format": " {load}",
"memory": { "format-alt": " {usage}% @ {avg_frequency}GHz"
"format": "󰍛 {used:0.1f}G / {total:0.1f}G", },
"format-alt": "󰓡 Swap: {swapUsed:0.1f}G / {swapTotal:0.1f}G" "memory": {
}, "format": "󰍛 {used:0.1f}G / {total:0.1f}G",
"network": { "format-alt": "󰓡 Swap: {swapUsed:0.1f}G / {swapTotal:0.1f}G"
"format-wifi": " {essid} ({signalStrength}%)", },
"format-ethernet": "󰈀 {ifname}", "network": {
"format-linked": " {ifname}", "format-wifi": " {essid} ({signalStrength}%)",
"format-disconnected": "󰌙 Disconnected", "format-ethernet": "󰈀 {ifname}",
"format-alt": "󰩟 {ifname}: {ipaddr}/{cidr}", "format-linked": " {ifname}",
"tooltip-format": "{ifname} via {gwaddr}" "format-disconnected": "󰌙 Disconnected",
}, "format-alt": "󰩟 {ifname}: {ipaddr}/{cidr}",
"battery": { "tooltip-format": "{ifname} via {gwaddr}"
"states": { },
"good": 75, "battery": {
"warning": 15, "states": {
"critical": 5 "good": 75,
}, "warning": 15,
"format": "{icon} {capacity}%", "critical": 5
"format-charging": "󰉁 {capacity}%", },
"format-plugged": " {capacity}%", "format": "{icon} {capacity}%",
"format-alt": "{icon} ETA: {time}", "format-charging": "󰉁 {capacity}%",
"format-icons": [ "format-plugged": " {capacity}%",
"", "format-alt": "{icon} ETA: {time}",
"", "format-icons": [
"", "",
"", "",
"" "",
] "",
}, ""
"clock": { ]
"format": "{:󰅐 %H:%M\t %m-%d}", },
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>" "clock": {
}, "format": "{:󰅐 %H:%M\t %m-%d}",
"custom/notification": { "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
"tooltip": true, },
"format": "{icon}", "custom/notification": {
"format-icons": { "tooltip": true,
"notification": " <span foreground='red'><sup></sup></span> New notifications", "format": "{icon}",
"none": " No notifications", "format-icons": {
"dnd-notification": " DND on", "notification": " <span foreground='red'><sup></sup></span> New notifications",
"dnd-none": " DND on" "none": " No notifications",
}, "dnd-notification": " DND on",
"return-type": "json", "dnd-none": " DND on"
"exec-if": "which swaync-client", },
"exec": "swaync-client -swb", "return-type": "json",
"on-click": "swaync-client -t -sw", "exec-if": "which swaync-client",
"on-click-right": "swaync-client -d -sw", "exec": "swaync-client -swb",
"escape": true "on-click": "swaync-client -t -sw",
}, "on-click-right": "swaync-client -d -sw",
"custom/player": { "escape": true
"format": "󰎈 {}", },
"return-type": "json", "custom/player": {
"exec": "playerctl -a metadata --format '{\"text\": \"{{uc(playerName)}}: {{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"class\": \"{{status}}\"}' -F", "format": "{icon} {}",
"max-length": 35, "format-icons": {
"on-click": "playerctl play-pause" "Playing": "󰎈 ",
} "Paused": "󰏤 "
},
"return-type": "json",
"exec": "playerctl -a metadata --format '{\"text\": \"{{playerName}}: {{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{markup_escape(title)}} - {{markup_escape(album)}}\", \"class\": \"{{status}}\", \"alt\": \"{{status}}\" }' -F",
"max-length": 40,
"on-click": "playerctl play-pause",
"on-click-right": "pavucontrol"
}
} }

View File

@ -38,3 +38,6 @@ set recolor-lightcolor "#282828" # bg
set recolor-darkcolor "#ebdbb2" # fg set recolor-darkcolor "#ebdbb2" # fg
set recolor "true" set recolor "true"
# set recolor-keephue true # keep original color # set recolor-keephue true # keep original color
# selection clipboard
set selection-clipboard clipboard