Skip to content

Commit 56a827e

Browse files
authored
Merge pull request #102 from Samillion/repo_docs_update
docs: update previous, adjust font reference, add credit mention about fluent font
2 parents eddce1c + 99b2b23 commit 56a827e

File tree

3 files changed

+47
-84
lines changed

3 files changed

+47
-84
lines changed

Material-Design-Iconic-Round.ttf

-47.3 KB
Binary file not shown.

README.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A sleek and modern OSC for [mpv](https://mpv.io/), this project is a fork of ModernX designed to enhance functionality by adding more features, all while preserving the core standards of mpv's OSC.
44

5-
![ModernZ OSC Screenshot](https://github.com/user-attachments/assets/57dc6e88-c222-4a62-b650-5ae6c88b4fc0)
5+
![ModernZ OSC Screenshot](https://github.com/user-attachments/assets/236f0035-e2b1-401f-8650-f5a49d44a6e0)
66

77
<p align="center">
88
<a href="#installation"><strong>Installation »</strong></a>
@@ -31,8 +31,9 @@ A sleek and modern OSC for [mpv](https://mpv.io/), this project is a fork of Mod
3131

3232
Don't like the default white buttons and text? ModernZ is fully customizable! Change colors and button layouts to match your style:
3333

34-
![Custom Titlebar Example](https://github.com/user-attachments/assets/7968b6f0-df16-44fd-8306-01e581b4e1a7)
35-
![Custom Colors Example](https://github.com/user-attachments/assets/637f0c50-16ac-4d8c-a341-187e3d71d2d3)
34+
![modernz_ui_top](https://github.com/user-attachments/assets/7765900e-93a0-46fa-9f9a-0e7c696ab3a0)
35+
36+
![modernz_ui_bottom](https://github.com/user-attachments/assets/16921c25-b040-4e52-899f-ba4513954be2)
3637

3738
See the [Color Customization](docs/USER_OPTS.md#colors) section in the configuration guide for details on how to customize colors and buttons.
3839

@@ -44,7 +45,7 @@ See the [Color Customization](docs/USER_OPTS.md#colors) section in the configura
4445
2. **Copy Files**
4546

4647
- Place `modernz.lua` in your mpv scripts directory
47-
- Place `Material-Design-Iconic-Round.ttf` in your mpv fonts directory
48+
- Place `fluent-system-icons.ttf` in your mpv fonts directory
4849
- (OPTIONAL) Place `thumbfast.lua` in your mpv scripts directory
4950

5051
3. **Locations**
@@ -59,7 +60,7 @@ See the [Color Customization](docs/USER_OPTS.md#colors) section in the configura
5960
```
6061
mpv/
6162
├── fonts/
62-
│ └── Material-Design-Iconic-Round.ttf
63+
│ └── fluent-system-icons.ttf
6364
├── script-opts/
6465
│ └── modernz.conf
6566
└── scripts/
@@ -118,7 +119,7 @@ z script-message-to modernz osc-idlescreen # Toggle idle screen
118119

119120
ModernZ supports mpv's built-in select.lua ([v0.39+](https://github.com/mpv-player/mpv/discussions/14903)) for playlist and chapter navigation.
120121

121-
https://github.com/user-attachments/assets/188992ba-1ad8-4d71-a96c-44c3c99df4e0
122+
https://github.com/user-attachments/assets/f47a2eb6-d926-4f3b-8a5d-19301c70c7a5
122123

123124
> [!TIP]
124125
> If the font size for the interactive playlist is too small, you can add the following in your `mpv.conf`
@@ -196,3 +197,6 @@ For even more useful scripts, check out the [mpv User Scripts Wiki](https://gith
196197
In essence, to modernize and revive the `Modern` origin.
197198

198199
Having said that, ModernZ still uses parts of the old code, and every previous and current fork author and contributor deserve credit (including mpv's stock osc), that is why they're mentioned in detail.
200+
201+
#### Credits:
202+
Fluent System Icons font was modified by [Xurdejl](https://github.com/Xurdejl) for use on ModernZ, they also contributed with code, reports and tests. 😻

modernz.lua

+37-78
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ local user_opts = {
2020
showwindowed = true, -- show OSC when windowed?
2121
showfullscreen = true, -- show OSC when fullscreen?
2222
greenandgrumpy = false, -- disable santa hat in December
23-
icon_style = "fluent", -- choose icon style. fluent, material
24-
-- Requires font files provided in repo in /fonts
2523

2624
-- Colors
2725
osc_color = "#000000", -- accent of the OSC and the title bar
@@ -172,80 +170,42 @@ local osc_param = { -- calculated by osc_init()
172170
areas = {},
173171
}
174172

173+
175174
local icons = {
176-
fluent = {
177-
play = "\238\166\143",
178-
pause = "\238\163\140",
179-
replay = "\238\189\191",
180-
previous = "\239\152\167",
181-
next = "\239\149\168",
182-
rewind = "\238\168\158",
183-
forward = "\238\152\135",
184-
185-
audio = '\238\175\139',
186-
subtitle = '\238\175\141',
187-
playlist = "\238\161\159",
188-
volume_mute = '\238\173\138',
189-
volume_quiet = '\238\172\184',
190-
volume_low = '\238\172\189',
191-
volume_high = '\238\173\130',
192-
193-
download = "\239\133\144",
194-
downloading = "\239\140\174",
195-
screenshot = "\238\169\183",
196-
ontop_on = "\238\165\190",
197-
ontop_off = "\238\166\129",
198-
loop_off = "\239\133\178",
199-
loop_on = "\239\133\181",
200-
info = "\239\146\164",
201-
fullscreen = "\239\133\160",
202-
fullscreen_exit = "\239\133\166",
203-
204-
jumpicons = {
205-
[5] = {"\238\171\186", "\238\171\187"},
206-
[10] = {"\238\171\188", "\238\172\129"},
207-
[30] = {"\238\172\133", "\238\172\134"},
208-
default = {"\238\172\138", "\238\172\138"}, -- second icon is mirrored in layout()
209-
}
210-
},
211-
material = {
212-
play = "\239\142\170",
213-
pause = "\239\142\167",
214-
replay = "\239\142\178",
215-
previous = "\239\142\181",
216-
next = "\239\142\180",
217-
rewind = "\239\142\160",
218-
forward = "\239\142\159",
219-
220-
audio = "\239\142\183",
221-
subtitle = "\239\140\164",
222-
playlist = "\239\137\135",
223-
volume_mute = "\239\142\187",
224-
volume_quiet = "\239\142\185",
225-
volume_low = "\239\142\185",
226-
volume_high = "\239\142\188",
227-
228-
download = "\239\136\160",
229-
downloading = "\239\134\185",
230-
screenshot = "\239\135\168",
231-
ontop_on = "\239\142\150",
232-
ontop_off = "\239\142\149",
233-
loop_off = "\239\134\181",
234-
loop_on = "\239\134\183",
235-
info = "\239\135\183",
236-
fullscreen = "\239\133\173",
237-
fullscreen_exit = "\239\133\172",
238-
239-
jumpicons = {
240-
[5] = {"\239\142\177", "\239\142\163"},
241-
[10] = {"\239\142\175", "\239\142\161"},
242-
[30] = {"\239\142\176", "\239\142\162"},
243-
default = {"\239\142\178", "\239\142\178"}, -- second icon is mirrored in layout()
244-
}
175+
play = "\238\166\143",
176+
pause = "\238\163\140",
177+
replay = "\238\189\191",
178+
previous = "\239\152\167",
179+
next = "\239\149\168",
180+
rewind = "\238\168\158",
181+
forward = "\238\152\135",
182+
183+
audio = '\238\175\139',
184+
subtitle = '\238\175\141',
185+
playlist = "\238\161\159",
186+
volume_mute = '\238\173\138',
187+
volume_quiet = '\238\172\184',
188+
volume_low = '\238\172\189',
189+
volume_high = '\238\173\130',
190+
191+
download = "\239\133\144",
192+
downloading = "\239\140\174",
193+
screenshot = "\238\156\153",
194+
ontop_on = "\238\165\190",
195+
ontop_off = "\238\166\129",
196+
loop_off = "\239\133\178",
197+
loop_on = "\239\133\181",
198+
info = "\239\146\164",
199+
fullscreen = "\239\133\160",
200+
fullscreen_exit = "\239\133\166",
201+
202+
jumpicons = {
203+
[5] = {"\238\171\186", "\238\171\187"},
204+
[10] = {"\238\171\188", "\238\172\129"},
205+
[30] = {"\238\172\133", "\238\172\134"},
206+
default = {"\238\172\138", "\238\172\138"}, -- second icon is mirrored in layout()
245207
}
246-
247208
}
248-
icons = user_opts.icon_style == "fluent" and icons.fluent or icons.material
249209

250210
--- Localization
251211
local language = {
@@ -315,8 +275,7 @@ local sub_track_count = 0
315275
local window_control_box_width = 138
316276
local is_december = os.date("*t").month == 12
317277
local UNICODE_MINUS = string.char(0xe2, 0x88, 0x92) -- UTF-8 for U+2212 MINUS SIGN
318-
local iconfont = user_opts.icon_style == "fluent" and "fluent-system-icons" or "Material-Design-Iconic-Round"
319-
local iconfont_size = user_opts.icon_style == "fluent" and 30 or 36
278+
local iconfont = "fluent-system-icons"
320279

321280
local function osc_color_convert(color)
322281
return color:sub(6,7) .. color:sub(4,5) .. color:sub(2,3)
@@ -331,7 +290,7 @@ local function set_osc_styles()
331290
SeekbarFg = "{\\blur1\\bord1\\1c&H" .. osc_color_convert(user_opts.seekbarfg_color) .. "&}",
332291
VolumebarBg = "{\\blur0\\bord0\\1c&H999999&}",
333292
VolumebarFg = "{\\blur1\\bord1\\1c&H" .. osc_color_convert(user_opts.side_buttons_color) .. "&}",
334-
Ctrl1 = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.playpause_color) .. "&\\3c&HFFFFFF&\\fs" .. iconfont_size .. "\\fn" .. iconfont .. "}",
293+
Ctrl1 = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.playpause_color) .. "&\\3c&HFFFFFF&\\fs30\\fn" .. iconfont .. "}",
335294
Ctrl2 = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.middle_buttons_color) .. "&\\3c&HFFFFFF&\\fs24\\fn" .. iconfont .. "}",
336295
Ctrl2Flip = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.middle_buttons_color) .. "&\\3c&HFFFFFF&\\fs24\\fn" .. iconfont .. "\\fry180}",
337296
Ctrl3 = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.side_buttons_color) .. "&\\3c&HFFFFFF&\\fs24\\fn" .. iconfont .. "}",
@@ -1551,7 +1510,7 @@ layouts = function ()
15511510
if showjump then
15521511
lo = add_layout("jump_backward")
15531512
lo.geometry = {x = refX - 60, y = refY - 40 , an = 5, w = 30, h = 24}
1554-
lo.style = user_opts.icon_style == "fluent" and ((user_opts.jumpiconnumber and icons.jumpicons[user_opts.jumpamount] ~= nil) and osc_styles.Ctrl2 or osc_styles.Ctrl2Flip) or osc_styles.Ctrl2
1513+
lo.style = (user_opts.jumpiconnumber and icons.jumpicons[user_opts.jumpamount] ~= nil) and osc_styles.Ctrl2 or osc_styles.Ctrl2Flip
15551514
end
15561515

15571516
lo = add_layout("play_pause")
@@ -1561,7 +1520,7 @@ layouts = function ()
15611520
if showjump then
15621521
lo = add_layout("jump_forward")
15631522
lo.geometry = {x = refX + 60, y = refY - 40 , an = 5, w = 30, h = 24}
1564-
lo.style = user_opts.icon_style == "fluent" and osc_styles.Ctrl2 or ((user_opts.jumpiconnumber and icons.jumpicons[user_opts.jumpamount] ~= nil) and osc_styles.Ctrl2 or osc_styles.Ctrl2Flip)
1523+
lo.style = osc_styles.Ctrl2
15651524
end
15661525

15671526
if showskip then

0 commit comments

Comments
 (0)