mirror of
https://github.com/ksyasuda/dotfiles.git
synced 2026-02-04 06:36:35 -08:00
Compare commits
25 Commits
fb7b605e55
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 3218ceada1 | |||
| dca8f0df32 | |||
|
da80481d63
|
|||
|
e6c89cf38b
|
|||
|
35357f1674
|
|||
|
bd6eefe084
|
|||
| 4eda790932 | |||
| d57275597d | |||
| 75a9cc360c | |||
| 5b9cbbba99 | |||
|
c867434c8d
|
|||
|
63cd7242b6
|
|||
|
7f28515e8d
|
|||
|
|
88f0d9938c | ||
|
|
7957d0b57c | ||
|
7d47044e5c
|
|||
|
baa897573e
|
|||
|
6ce0155364
|
|||
|
d32f79f406
|
|||
|
f301f16949
|
|||
|
cf14d30091
|
|||
|
b238daee8c
|
|||
|
61c4425c6e
|
|||
|
15d55786f3
|
|||
|
e9e6dfa2d3
|
@@ -16,7 +16,7 @@
|
|||||||
"hooks": [
|
"hooks": [
|
||||||
{
|
{
|
||||||
"type": "command",
|
"type": "command",
|
||||||
"command": "powershell.exe -WindowStyle Hidden -Command \"& { Add-Type -AssemblyName System.Windows.Forms; $balloon = New-Object System.Windows.Forms.NotifyIcon; $balloon.Icon = [System.Drawing.SystemIcons]::Information; $balloon.BalloonTipIcon = 'Info'; $balloon.BalloonTipTitle = 'Claude Code'; $balloon.BalloonTipText = 'Awaiting your input'; $balloon.Visible = $true; $balloon.ShowBalloonTip(5000); Start-Sleep -Seconds 5; $balloon.Dispose() }\""
|
"command": "notify-send 'Claude Code' 'Claude Code needs your attention'"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
"clangd-lsp@claude-plugins-official": true
|
"clangd-lsp@claude-plugins-official": true
|
||||||
},
|
},
|
||||||
"sandbox": {
|
"sandbox": {
|
||||||
"enabled": true,
|
"enabled": false,
|
||||||
"autoAllowBashIfSandboxed": true,
|
"autoAllowBashIfSandboxed": true,
|
||||||
"network": {
|
"network": {
|
||||||
"allowUnixSockets": [
|
"allowUnixSockets": [
|
||||||
43
.claude/settings.json##os.Linux
Normal file
43
.claude/settings.json##os.Linux
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"attribution": {
|
||||||
|
"commit": "",
|
||||||
|
"pr": ""
|
||||||
|
},
|
||||||
|
"permissions": {
|
||||||
|
"deny": [
|
||||||
|
"Read(.env)",
|
||||||
|
"Read(~/.aws/**)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hooks": {
|
||||||
|
"Notification": [
|
||||||
|
{
|
||||||
|
"matcher": "",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "notify-send 'Claude Code' 'Claude Code needs your attention'"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"enabledPlugins": {
|
||||||
|
"pyright-lsp@claude-plugins-official": true,
|
||||||
|
"typescript-lsp@claude-plugins-official": true,
|
||||||
|
"clangd-lsp@claude-plugins-official": true
|
||||||
|
},
|
||||||
|
"sandbox": {
|
||||||
|
"enabled": false,
|
||||||
|
"autoAllowBashIfSandboxed": true,
|
||||||
|
"network": {
|
||||||
|
"allowUnixSockets": [
|
||||||
|
"/var/run/docker.sock"
|
||||||
|
],
|
||||||
|
"allowLocalBinding": true
|
||||||
|
},
|
||||||
|
"excludedCommands": [
|
||||||
|
"docker"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
44
.claude/settings.json##os.WSL
Normal file
44
.claude/settings.json##os.WSL
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"attribution": {
|
||||||
|
"commit": "",
|
||||||
|
"pr": ""
|
||||||
|
},
|
||||||
|
"permissions": {
|
||||||
|
"deny": [
|
||||||
|
"Read(.env)",
|
||||||
|
"Read(~/.aws/**)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hooks": {
|
||||||
|
"Notification": [
|
||||||
|
{
|
||||||
|
"matcher": "",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "powershell.exe -Command \"[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('Claude Code needs your attention', 'Claude Code')\""
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"enabledPlugins": {
|
||||||
|
"pyright-lsp@claude-plugins-official": true,
|
||||||
|
"typescript-lsp@claude-plugins-official": true,
|
||||||
|
"clangd-lsp@claude-plugins-official": true
|
||||||
|
},
|
||||||
|
"sandbox": {
|
||||||
|
"enabled": false,
|
||||||
|
"autoAllowBashIfSandboxed": true,
|
||||||
|
"network": {
|
||||||
|
"allowUnixSockets": [
|
||||||
|
"/var/run/docker.sock"
|
||||||
|
],
|
||||||
|
"allowLocalBinding": true
|
||||||
|
},
|
||||||
|
"excludedCommands": [
|
||||||
|
"docker"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"model": "haiku"
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
|
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
|
||||||
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
|
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
|
||||||
color_theme = "/home/kyasuda/.config/btop/themes/catppuccin_macchiato.theme"
|
color_theme = "TTY"
|
||||||
|
|
||||||
#* If the theme set background should be shown, set to False if you want terminal background transparency.
|
#* If the theme set background should be shown, set to False if you want terminal background transparency.
|
||||||
theme_background = true
|
theme_background = true
|
||||||
|
|||||||
@@ -17,7 +17,10 @@ app-notifications = no-clipboard-copy
|
|||||||
shell-integration = zsh
|
shell-integration = zsh
|
||||||
shell-integration-features = title,sudo
|
shell-integration-features = title,sudo
|
||||||
desktop-notifications = true
|
desktop-notifications = true
|
||||||
term=ghostty
|
term=xterm-ghostty
|
||||||
|
link-url = true
|
||||||
|
link-previews = true
|
||||||
|
bell-features=system,attention,no-audio
|
||||||
keybind = all:ctrl+enter=unbind
|
keybind = all:ctrl+enter=unbind
|
||||||
keybind = all:ctrl+shift+j=next_tab
|
keybind = all:ctrl+shift+j=next_tab
|
||||||
keybind = all:ctrl+shift+k=last_tab
|
keybind = all:ctrl+shift+k=last_tab
|
||||||
|
|||||||
@@ -191,13 +191,15 @@ animations {
|
|||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
|
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
|
||||||
dwindle {
|
dwindle {
|
||||||
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
|
pseudotile = false # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
|
||||||
preserve_split = true # You probably want this
|
preserve_split = true
|
||||||
|
split_width_multiplier = 1.69
|
||||||
}
|
}
|
||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
|
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
|
||||||
master {
|
master {
|
||||||
new_status = master
|
new_status = slave
|
||||||
|
allow_small_split = false
|
||||||
}
|
}
|
||||||
|
|
||||||
# https://wiki.hyprland.org/Configuring/Variables/#misc
|
# https://wiki.hyprland.org/Configuring/Variables/#misc
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ bind = $mainMod SHIFT, j, movewindow, d
|
|||||||
bind = $mainMod SHIFT, k, movewindow, u
|
bind = $mainMod SHIFT, k, movewindow, u
|
||||||
bind = $mainMod SHIFT, h, movewindow, l
|
bind = $mainMod SHIFT, h, movewindow, l
|
||||||
bind = $mainMod SHIFT, l, movewindow, r
|
bind = $mainMod SHIFT, l, movewindow, r
|
||||||
bind = CTRL+SHIFT, c, centerwindow
|
bind = $mainMod+SHIFT, c, centerwindow
|
||||||
|
|
||||||
|
|
||||||
# Move focus to next monitor
|
# Move focus to next monitor
|
||||||
@@ -92,7 +92,7 @@ bindl = , XF86AudioPrev, exec, mpc prev
|
|||||||
|
|
||||||
# rofi
|
# rofi
|
||||||
bind = $mainMod SHIFT, v, exec, uwsm app -sb -- rofi-rbw
|
bind = $mainMod SHIFT, v, exec, uwsm app -sb -- rofi-rbw
|
||||||
bind = $mainMod, w, exec, rofi -show window -theme $HOME/.config/rofi/launchers/type-2/style-2.rasi -dpi 96 -theme-str 'window {width: 35%;}'
|
# bind = $mainMod, w, exec, rofi -show window -theme $HOME/.config/rofi/launchers/type-2/style-2.rasi -dpi 96 -theme-str 'window {width: 35%;}'
|
||||||
bind = $mainMod SHIFT, w, exec, "$HOME/.config/rofi/scripts/rofi-wallpaper.sh"
|
bind = $mainMod SHIFT, w, exec, "$HOME/.config/rofi/scripts/rofi-wallpaper.sh"
|
||||||
bind = $mainMod SHIFT, d, exec, "$HOME/.config/rofi/scripts/rofi-docs.sh"
|
bind = $mainMod SHIFT, d, exec, "$HOME/.config/rofi/scripts/rofi-docs.sh"
|
||||||
bind = SUPER, j, exec, "$HOME/.config/rofi/scripts/rofi-jellyfin-dir.sh"
|
bind = SUPER, j, exec, "$HOME/.config/rofi/scripts/rofi-jellyfin-dir.sh"
|
||||||
@@ -146,4 +146,10 @@ bind = SUPER, l, exec, hyprlock
|
|||||||
|
|
||||||
# ANKI
|
# ANKI
|
||||||
bind = $mainMod, a, exec, ~/.config/rofi/scripts/rofi-anki-script.sh
|
bind = $mainMod, a, exec, ~/.config/rofi/scripts/rofi-anki-script.sh
|
||||||
bind = $mainMod SHIFT, a, exec, ~/projects/scripts/screenshot-anki.sh -cdMinecraft
|
# bind = $mainMod SHIFT, a, exec, ~/projects/scripts/screenshot-anki.sh -cdMinecraft
|
||||||
|
|
||||||
|
# GSM
|
||||||
|
bindl = , mouse:275, exec, xdotool key alt+w # top mouse to texthooker
|
||||||
|
bindl = , mouse:276, exec, xdotool key alt+grave # bottom mouse to overlay
|
||||||
|
bind = ALT, g, exec, /opt/mpv-yomitan/mpv-yomitan.AppImage --toggle
|
||||||
|
# bind = ALT SHIFT, Y, exec, "$HOME/.config/rofi/scripts/rofi-mpv-yomitan.sh"
|
||||||
|
|||||||
Submodule .config/mpv-modules/ModernZ updated: f66905acff...fadaf74b08
Submodule .config/mpv-modules/animecards updated: ae0020060e...c5950c2660
Submodule .config/mpv-modules/immersion-tracker deleted from f4a2c6012f
Submodule .config/mpv-modules/mpvacious updated: 9f9e9df06d...2629602b90
@@ -225,7 +225,8 @@ ctrl+B ignore # script-binding mpvacious-overwrite-selected-note
|
|||||||
ctrl+m ignore # script-binding mpvacious-update-last-note
|
ctrl+m ignore # script-binding mpvacious-update-last-note
|
||||||
ctrl+M ignore # script-binding mpvacious-overwrite-last-note
|
ctrl+M ignore # script-binding mpvacious-overwrite-last-note
|
||||||
G script-binding mpvacious-quick-card-menu-open
|
G script-binding mpvacious-quick-card-menu-open
|
||||||
alt+g script-binding mpvacious-quick-card-sel-menu-open
|
alt+g ignore
|
||||||
|
alt+G script-binding mpvacious-quick-card-sel-menu-open
|
||||||
ctrl+c script-binding mpvacious-copy-primary-sub-to-clipboard
|
ctrl+c script-binding mpvacious-copy-primary-sub-to-clipboard
|
||||||
ctrl+C script-binding mpvacious-copy-secondary-sub-to-clipboard
|
ctrl+C script-binding mpvacious-copy-secondary-sub-to-clipboard
|
||||||
ctrl+= script-binding mpvacious-autocopy-toggle
|
ctrl+= script-binding mpvacious-autocopy-toggle
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ sub-fix-timing=yes
|
|||||||
sub-ass-override=scale
|
sub-ass-override=scale
|
||||||
sub-gauss=1.0
|
sub-gauss=1.0
|
||||||
sub-gray=yes
|
sub-gray=yes
|
||||||
sub-pos=100
|
sub-pos=95
|
||||||
|
|
||||||
# --- Audio chain ---
|
# --- Audio chain ---
|
||||||
volume=75
|
volume=75
|
||||||
@@ -111,6 +111,8 @@ demuxer-max-back-bytes=200MiB # Keep recent data handy for quick reverse seeks
|
|||||||
cache-secs=30
|
cache-secs=30
|
||||||
demuxer-readahead-secs=30
|
demuxer-readahead-secs=30
|
||||||
|
|
||||||
|
msg-level=subs2srs,animecards,mpvacious=error
|
||||||
|
|
||||||
[anime]
|
[anime]
|
||||||
profile-desc="Anime upscaling with ArtCNN"
|
profile-desc="Anime upscaling with ArtCNN"
|
||||||
glsl-shaders="~~/shaders/ArtCNN_C4F32.glsl"
|
glsl-shaders="~~/shaders/ArtCNN_C4F32.glsl"
|
||||||
@@ -163,6 +165,7 @@ glsl-shaders="~~/shaders/ArtCNN_C4F32.glsl"
|
|||||||
scale=ewa_lanczossharp
|
scale=ewa_lanczossharp
|
||||||
dither=error-diffusion
|
dither=error-diffusion
|
||||||
deband=yes # Crucial for anime gradients
|
deband=yes # Crucial for anime gradients
|
||||||
|
input-ipc-server=/tmp/mpv-yomitan-socket
|
||||||
|
|
||||||
[anime-subs]
|
[anime-subs]
|
||||||
profile-cond=p["slang"] == "ja" or p["slang"] == "ja.hi"
|
profile-cond=p["slang"] == "ja" or p["slang"] == "ja.hi"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ dither=fruit # Lightweight dithering
|
|||||||
ontop=yes
|
ontop=yes
|
||||||
border=no
|
border=no
|
||||||
no-border
|
no-border
|
||||||
autofit=50% # Reasonable default size
|
autofit=69% # Reasonable default size
|
||||||
|
|
||||||
# Audio (macOS-specific)
|
# Audio (macOS-specific)
|
||||||
volume=75
|
volume=75
|
||||||
@@ -129,6 +129,9 @@ cache-pause=no
|
|||||||
cache-secs=30
|
cache-secs=30
|
||||||
demuxer-readahead-secs=30
|
demuxer-readahead-secs=30
|
||||||
|
|
||||||
|
msg-level=subs2srs,animecards,mpvacious=error
|
||||||
|
|
||||||
|
|
||||||
############
|
############
|
||||||
# Profiles #
|
# Profiles #
|
||||||
############
|
############
|
||||||
@@ -152,7 +155,7 @@ profile-cond=width >= 1920 and filename:match("mkv$|mp4$")
|
|||||||
glsl-shaders=""
|
glsl-shaders=""
|
||||||
scale=ewa_lanczos
|
scale=ewa_lanczos
|
||||||
target-peak=800
|
target-peak=800
|
||||||
hdr-tone-mapping=bt.2390
|
# hdr-tone-mapping=bt.2390
|
||||||
|
|
||||||
# HDR profile
|
# HDR profile
|
||||||
[hdr]
|
[hdr]
|
||||||
@@ -195,6 +198,7 @@ glsl-shaders="~~/shaders/ArtCNN_C4F32.glsl"
|
|||||||
scale=ewa_lanczossharp
|
scale=ewa_lanczossharp
|
||||||
dither=error-diffusion
|
dither=error-diffusion
|
||||||
deband=yes # Crucial for anime gradients
|
deband=yes # Crucial for anime gradients
|
||||||
|
input-ipc-server=/tmp/mpv-yomitan-socket
|
||||||
|
|
||||||
# Anime subtitles profile
|
# Anime subtitles profile
|
||||||
[anime-subs]
|
[anime-subs]
|
||||||
|
|||||||
Binary file not shown.
@@ -8,6 +8,7 @@
|
|||||||
# Anki Field Names
|
# Anki Field Names
|
||||||
# These must match the field names in your Anki note type
|
# These must match the field names in your Anki note type
|
||||||
# =================================================
|
# =================================================
|
||||||
|
DEBUG_MODE=no
|
||||||
FRONT_FIELD=Expression
|
FRONT_FIELD=Expression
|
||||||
SENTENCE_FIELD=Sentence
|
SENTENCE_FIELD=Sentence
|
||||||
IMAGE_FIELD=Picture
|
IMAGE_FIELD=Picture
|
||||||
@@ -28,12 +29,12 @@ ASK_TO_OVERWRITE=yes
|
|||||||
OVERWRITE_LIMIT=8
|
OVERWRITE_LIMIT=8
|
||||||
|
|
||||||
# Keep bold formatting added by yomitan? (yes/no)
|
# Keep bold formatting added by yomitan? (yes/no)
|
||||||
HIGHLIGHT_WORD=no
|
HIGHLIGHT_WORD=yes
|
||||||
|
|
||||||
# Use MPV's built-in clipboard API (requires v0.40+)? (yes/no)
|
# Use MPV's built-in clipboard API (requires v0.40+)? (yes/no)
|
||||||
# Alternative clipboard method that may reduce latency on Windows.
|
# Alternative clipboard method that may reduce latency on Windows.
|
||||||
# Supported on macOS and Wayland as well. Not supported on X11.
|
# Supported on macOS and Wayland as well. Not supported on X11.
|
||||||
USE_MPV_CLIPBOARD_API=no
|
USE_MPV_CLIPBOARD_API=yes
|
||||||
|
|
||||||
# ==========================================================
|
# ==========================================================
|
||||||
# Audio Settings
|
# Audio Settings
|
||||||
|
|||||||
@@ -30,6 +30,6 @@ menu_timeout=5
|
|||||||
show_errors=yes
|
show_errors=yes
|
||||||
ytdlp_file_format=mp4
|
ytdlp_file_format=mp4
|
||||||
ytdlp_output_template=%(uploader)s/%(title)s.%(ext)s
|
ytdlp_output_template=%(uploader)s/%(title)s.%(ext)s
|
||||||
use_history_db=yes
|
use_history_db=no
|
||||||
backend_host=http://localhost
|
backend_host=http://localhost
|
||||||
backend_port=42069
|
backend_port=42069
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ menu_font_name=Noto Serif CJK JP
|
|||||||
# Change this if you have changed webBindAddress in AnkiConnect's settings.
|
# Change this if you have changed webBindAddress in AnkiConnect's settings.
|
||||||
ankiconnect_url=127.0.0.1:8765
|
ankiconnect_url=127.0.0.1:8765
|
||||||
|
|
||||||
|
# AnkiConnect server api key (optional)
|
||||||
|
#ankiconnect_api_key=
|
||||||
|
|
||||||
##
|
##
|
||||||
## Toggleables.
|
## Toggleables.
|
||||||
## Possible values: `yes` or `no`.
|
## Possible values: `yes` or `no`.
|
||||||
@@ -330,3 +333,40 @@ ffmpeg_audio_args=-af loudnorm=I=-16:TP=-1.5:LRA=11:dual_mono=true
|
|||||||
mpv_audio_args=--af-append=loudnorm=I=-16:TP=-1.5:LRA=11:dual_mono=true
|
mpv_audio_args=--af-append=loudnorm=I=-16:TP=-1.5:LRA=11:dual_mono=true
|
||||||
#mpv_audio_args=
|
#mpv_audio_args=
|
||||||
#mpv_audio_args=--af-append=silenceremove=1:0:-50dB
|
#mpv_audio_args=--af-append=silenceremove=1:0:-50dB
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
## Custom Sub Filter
|
||||||
|
## Place a `subs2srs_sub_filter.lua` file
|
||||||
|
## in the `~/.config/mpv/subs2srs_sub_filter` directory.
|
||||||
|
## The custom script must return a table
|
||||||
|
## that includes either of a `preprocess` or a `trim` function (or both).
|
||||||
|
##
|
||||||
|
## - `preprocess(text)`: Executes before trimming/cleaning.
|
||||||
|
## - `trim(text)`: Replaces the built-in trimming logic.
|
||||||
|
##
|
||||||
|
|
||||||
|
# Enable custom sub preprocessing by default (yes, no)
|
||||||
|
custom_sub_filter_enabled=no
|
||||||
|
|
||||||
|
# Notification prefix for toggle
|
||||||
|
custom_sub_filter_notification=Custom Sub Filter
|
||||||
|
|
||||||
|
# Use a custom trim instead of the built in one (yes, no)
|
||||||
|
use_custom_trim=no
|
||||||
|
|
||||||
|
##
|
||||||
|
## New note check timer
|
||||||
|
##
|
||||||
|
|
||||||
|
# Enable the check note timer feature.
|
||||||
|
# If set to `yes`, mpvacious will periodically check for new notes in Anki
|
||||||
|
# and automatically update them with media if they match the configured note type
|
||||||
|
# I.e., you create a note with GoldenDict, Rikaitan, etc.,
|
||||||
|
# then mpvacious updates the note and adds audio and image automatically.
|
||||||
|
enable_new_note_timer=no
|
||||||
|
|
||||||
|
# Interval in seconds for checking for new notes.
|
||||||
|
# This setting controls how often mpvacious checks for new notes in Anki.
|
||||||
|
# Only used when enable_new_note_timer is set to `yes`
|
||||||
|
new_note_timer_interval_seconds=5
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
../../submodules/mpv-anilist-updater/anilistUpdater/anilistUpdater.py
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../../submodules/mpv-anilist-updater/anilistUpdater/main.lua
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../submodules/immersion-tracker
|
|
||||||
@@ -1 +1 @@
|
|||||||
../submodules/mpv-youtube-queue/mpv-youtube-queue.lua
|
../../mpv-modules/mpv-youtube-queue/mpv-youtube-queue.lua
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
-- mpv_websocket
|
-- mpv_websocket
|
||||||
-- https://github.com/kuroahna/mpv_websocket
|
-- https://github.com/kuroahna/mpv_websocket
|
||||||
|
|
||||||
|
local use_secondary_subs = false
|
||||||
|
|
||||||
local utils = require("mp.utils")
|
local utils = require("mp.utils")
|
||||||
|
|
||||||
local platform = mp.get_property_native("platform")
|
local platform = mp.get_property_native("platform")
|
||||||
@@ -8,76 +10,101 @@ local platform = mp.get_property_native("platform")
|
|||||||
local config_file_path = mp.find_config_file("mpv.conf")
|
local config_file_path = mp.find_config_file("mpv.conf")
|
||||||
local config_folder_path, config_file = utils.split_path(config_file_path)
|
local config_folder_path, config_file = utils.split_path(config_file_path)
|
||||||
local mpv_websocket_path =
|
local mpv_websocket_path =
|
||||||
utils.join_path(config_folder_path, platform == "windows" and "mpv_websocket.exe" or "mpv_websocket")
|
utils.join_path(config_folder_path, platform == "windows" and "mpv_websocket.exe" or "mpv_websocket")
|
||||||
local initialised_websocket
|
local initialised_websocket
|
||||||
|
|
||||||
local _, err = utils.file_info(config_file_path)
|
local _, err = utils.file_info(config_file_path)
|
||||||
if err then
|
if err then
|
||||||
error("failed to open mpv config file `" .. config_file_path .. "`")
|
error("failed to open mpv config file `" .. config_file_path .. "`")
|
||||||
end
|
end
|
||||||
|
|
||||||
local _, err = utils.file_info(mpv_websocket_path)
|
local _, err = utils.file_info(mpv_websocket_path)
|
||||||
if err then
|
if err then
|
||||||
error("failed to open mpv_websocket")
|
error("failed to open mpv_websocket")
|
||||||
end
|
end
|
||||||
|
|
||||||
local function find_mpv_socket(config_file_path)
|
local function find_mpv_socket(config_file_path)
|
||||||
local file = io.open(config_file_path, "r")
|
-- First, try to get from mpv properties (includes command-line options)
|
||||||
if file == nil then
|
local mpv_socket = mp.get_property("input-ipc-server")
|
||||||
error("failed to read mpv config file `" .. config_file_path .. "`")
|
if mpv_socket and mpv_socket ~= "" then
|
||||||
end
|
return mpv_socket
|
||||||
|
end
|
||||||
|
|
||||||
local mpv_socket
|
-- Fall back to reading config file
|
||||||
for line in file:lines() do
|
local file = io.open(config_file_path, "r")
|
||||||
mpv_socket = line:match("^input%-ipc%-server%s*=%s*(%g+)%s*")
|
if file == nil then
|
||||||
if mpv_socket then
|
error("failed to read mpv config file `" .. config_file_path .. "`")
|
||||||
break
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
file:close()
|
for line in file:lines() do
|
||||||
|
mpv_socket = line:match("^input%-ipc%-server%s*=%s*(%g+)%s*")
|
||||||
|
if mpv_socket then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if not mpv_socket then
|
file:close()
|
||||||
error("input-ipc-server option does not exist in `" .. config_file_path .. "`")
|
|
||||||
end
|
|
||||||
|
|
||||||
return mpv_socket
|
if not mpv_socket then
|
||||||
|
error("input-ipc-server option does not exist in `" .. config_file_path .. "`")
|
||||||
|
end
|
||||||
|
|
||||||
|
return mpv_socket
|
||||||
end
|
end
|
||||||
|
|
||||||
local mpv_socket = find_mpv_socket(config_file_path)
|
local mpv_socket = find_mpv_socket(config_file_path)
|
||||||
if platform == "windows" then
|
if platform == "windows" then
|
||||||
mpv_socket = "\\\\.\\pipe" .. mpv_socket:gsub("/", "\\")
|
mpv_socket = "\\\\.\\pipe" .. mpv_socket:gsub("/", "\\")
|
||||||
end
|
end
|
||||||
|
|
||||||
local function start_websocket()
|
local function start_websocket()
|
||||||
initialised_websocket = mp.command_native_async({
|
local args = {
|
||||||
name = "subprocess",
|
mpv_websocket_path,
|
||||||
playback_only = false,
|
"-m",
|
||||||
capture_stdout = true,
|
mpv_socket,
|
||||||
capture_stderr = true,
|
"-w",
|
||||||
args = {
|
"6677",
|
||||||
mpv_websocket_path,
|
}
|
||||||
"-m",
|
|
||||||
mpv_socket,
|
if use_secondary_subs then
|
||||||
"-w",
|
table.insert(args, "-s")
|
||||||
"6677",
|
end
|
||||||
},
|
|
||||||
})
|
initialised_websocket = mp.command_native_async({
|
||||||
|
name = "subprocess",
|
||||||
|
playback_only = false,
|
||||||
|
capture_stdout = true,
|
||||||
|
capture_stderr = true,
|
||||||
|
args = args,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local function end_websocket()
|
local function end_websocket()
|
||||||
mp.abort_async_command(initialised_websocket)
|
mp.abort_async_command(initialised_websocket)
|
||||||
initialised_websocket = nil
|
initialised_websocket = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local function toggle_websocket()
|
local function toggle_websocket()
|
||||||
local paused = mp.get_property_bool("pause")
|
local paused = mp.get_property_bool("pause")
|
||||||
if initialised_websocket and paused then
|
if initialised_websocket and paused then
|
||||||
end_websocket()
|
end_websocket()
|
||||||
elseif not initialised_websocket and not paused then
|
elseif not initialised_websocket and not paused then
|
||||||
start_websocket()
|
start_websocket()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function toggle_subs_type()
|
||||||
|
if use_secondary_subs then
|
||||||
|
use_secondary_subs = false
|
||||||
|
else
|
||||||
|
use_secondary_subs = true
|
||||||
|
end
|
||||||
|
if initialised_websocket then
|
||||||
|
end_websocket()
|
||||||
|
start_websocket()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
mp.register_script_message("togglewebsocket", toggle_websocket)
|
mp.register_script_message("togglewebsocket", toggle_websocket)
|
||||||
|
mp.register_script_message("togglesubstype", toggle_subs_type)
|
||||||
start_websocket()
|
start_websocket()
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
-- Bootstrap lazy.nvim
|
-- Bootstrap lazy.nvim
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
vim.api.nvim_echo({
|
vim.api.nvim_echo({
|
||||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
{ out, "WarningMsg" },
|
{ out, "WarningMsg" },
|
||||||
{ "\nPress any key to exit..." },
|
{ "\nPress any key to exit..." },
|
||||||
}, true, {})
|
}, true, {})
|
||||||
vim.fn.getchar()
|
vim.fn.getchar()
|
||||||
os.exit(1)
|
os.exit(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,35 @@
|
|||||||
@import "catppuccin-macchiato.rasi"
|
// @import "catppuccin-latte"
|
||||||
|
// @import "catppuccin-frappe"
|
||||||
configuration {
|
// @import "catppuccin-macchiato"
|
||||||
show-icons: true;
|
// @import "catppuccin-mocha"
|
||||||
icon-theme: "Dracula";
|
|
||||||
dpi: 144;
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
* {
|
||||||
|
rosewater: #f4dbd6;
|
||||||
|
flamingo: #f0c6c6;
|
||||||
|
pink: #f5bde6;
|
||||||
|
mauve: #c6a0f6;
|
||||||
|
red: #ed8796;
|
||||||
|
maroon: #ee99a0;
|
||||||
|
peach: #f5a97f;
|
||||||
|
yellow: #eed49f;
|
||||||
|
green: #a6da95;
|
||||||
|
teal: #8bd5ca;
|
||||||
|
sky: #91d7e3;
|
||||||
|
sapphire: #7dc4e4;
|
||||||
|
blue: #8aadf4;
|
||||||
|
lavender: #b7bdf8;
|
||||||
|
text: #cad3f5;
|
||||||
|
subtext1: #b8c0e0;
|
||||||
|
subtext0: #a5adcb;
|
||||||
|
overlay2: #939ab7;
|
||||||
|
overlay1: #8087a2;
|
||||||
|
overlay0: #6e738d;
|
||||||
|
surface2: #5b6078;
|
||||||
|
surface1: #494d64;
|
||||||
|
surface0: #363a4f;
|
||||||
|
base: #24273a;
|
||||||
|
mantle: #1e2030;
|
||||||
|
crust: #181926;
|
||||||
selected-active-foreground: @background;
|
selected-active-foreground: @background;
|
||||||
lightfg: @text;
|
lightfg: @text;
|
||||||
separatorcolor: @foreground;
|
separatorcolor: @foreground;
|
||||||
@@ -35,6 +58,11 @@ configuration {
|
|||||||
alternate-active-foreground: @blue;
|
alternate-active-foreground: @blue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
configuration {
|
||||||
|
show-icons: true;
|
||||||
|
icon-theme: "Dracula";
|
||||||
|
dpi: 144;
|
||||||
|
}
|
||||||
element {
|
element {
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -90,12 +118,6 @@ element-icon {
|
|||||||
text-color: inherit;
|
text-color: inherit;
|
||||||
}
|
}
|
||||||
window {
|
window {
|
||||||
border: 4;
|
|
||||||
padding: 12px;
|
|
||||||
border-radius: 12px;
|
|
||||||
anchor: center;
|
|
||||||
location: center;
|
|
||||||
|
|
||||||
padding: 5;
|
padding: 5;
|
||||||
background-color: @background;
|
background-color: @background;
|
||||||
border: 1;
|
border: 1;
|
||||||
@@ -180,4 +202,3 @@ textbox-prompt-colon {
|
|||||||
str: ":";
|
str: ":";
|
||||||
text-color: inherit;
|
text-color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ configuration {
|
|||||||
show-icons: true;
|
show-icons: true;
|
||||||
icon-theme: "Dracula";
|
icon-theme: "Dracula";
|
||||||
dpi: 144;
|
dpi: 144;
|
||||||
|
modes: "window,run,ssh,drun,filebrowser";
|
||||||
}
|
}
|
||||||
|
|
||||||
#window {
|
#window {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
*
|
*
|
||||||
* Author : Aditya Shakya (adi1090x)
|
* Author : Aditya Shakya (adi1090x)
|
||||||
* Github : @adi1090x
|
* Github : @adi1090x
|
||||||
*
|
*
|
||||||
* Rofi Theme File
|
* Rofi Theme File
|
||||||
* Rofi Version: 1.7.3
|
* Rofi Version: 1.7.3
|
||||||
**/
|
**/
|
||||||
@@ -49,7 +49,7 @@ mainbox {
|
|||||||
border-radius: 0px 0px 0px 0px;
|
border-radius: 0px 0px 0px 0px;
|
||||||
border-color: @selected;
|
border-color: @selected;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
children: [ "inputbar", "listview" ];
|
children: [ "inputbar", "listview-split" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****----- Inputbar -----*****/
|
/*****----- Inputbar -----*****/
|
||||||
@@ -99,7 +99,7 @@ listview {
|
|||||||
reverse: false;
|
reverse: false;
|
||||||
fixed-height: true;
|
fixed-height: true;
|
||||||
fixed-columns: true;
|
fixed-columns: true;
|
||||||
|
|
||||||
spacing: 0px;
|
spacing: 0px;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
@@ -110,6 +110,18 @@ listview {
|
|||||||
text-color: @foreground;
|
text-color: @foreground;
|
||||||
cursor: "default";
|
cursor: "default";
|
||||||
}
|
}
|
||||||
|
listview-split {
|
||||||
|
orientation: horizontal;
|
||||||
|
children: [listview, icon-current-entry];
|
||||||
|
spacing: 1em;
|
||||||
|
background-color: @background;
|
||||||
|
}
|
||||||
|
icon-current-entry {
|
||||||
|
expand: true;
|
||||||
|
size: 40%;
|
||||||
|
background-color: transparent;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
scrollbar {
|
scrollbar {
|
||||||
handle-width: 5px ;
|
handle-width: 5px ;
|
||||||
handle-color: @selected;
|
handle-color: @selected;
|
||||||
@@ -173,3 +185,10 @@ textbox {
|
|||||||
horizontal-align: 0.0;
|
horizontal-align: 0.0;
|
||||||
highlight: none;
|
highlight: none;
|
||||||
}
|
}
|
||||||
|
scrollbar {
|
||||||
|
width: 4px;
|
||||||
|
handle-color: @surface2;
|
||||||
|
handle-width: 4px;
|
||||||
|
background-color: @surface0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ set -Eeuo pipefail
|
|||||||
|
|
||||||
THEME="$HOME/.config/rofi/launchers/type-3/style-4.rasi"
|
THEME="$HOME/.config/rofi/launchers/type-3/style-4.rasi"
|
||||||
DIR="$HOME/Pictures/wallpapers/favorites"
|
DIR="$HOME/Pictures/wallpapers/favorites"
|
||||||
SELECTED_WALL=$(cd "$DIR" && for a in *.jpg *.png; do echo -en "$a\0icon\x1f$a\n"; done | rofi -dmenu -i -no-custom -theme "$THEME" -p "Select a wallpaper" -theme-str 'configuration {icon-size: 128; dpi: 96;} window {width: 45%; height: 45%;}')
|
SELECTED_WALL=$(cd "$DIR" && for a in *.jpg *.png; do echo -en "$a\0icon\x1f$a\n"; done | rofi -dmenu -i -no-custom -theme "$THEME" -p "Select a wallpaper" -theme-str 'configuration {icon-size: 256; dpi: 96;} window {width: 75%; height: 69%;} listview {rows: 5; lines: 7;}')
|
||||||
PTH="$(printf "%s" "$DIR/$SELECTED_WALL" | tr -s '/')"
|
PTH="$(printf "%s" "$DIR/$SELECTED_WALL" | tr -s '/')"
|
||||||
hyprctl hyprpaper wallpaper "DP-1, $PTH"
|
hyprctl hyprpaper wallpaper "DP-1, $PTH"
|
||||||
notify-send -a "rofi-wallpaper" "Wallpaper set to" -i "$PTH" "$PTH"
|
notify-send -a "rofi-wallpaper" "Wallpaper set to" -i "$PTH" "$PTH"
|
||||||
|
|||||||
129
.config/subminer/config.jsonc
Normal file
129
.config/subminer/config.jsonc
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
{
|
||||||
|
"subtitlePosition": {
|
||||||
|
"yPercent": 17.38459152016546
|
||||||
|
},
|
||||||
|
"keybindings": [
|
||||||
|
{
|
||||||
|
"key": "Space",
|
||||||
|
"command": [
|
||||||
|
"cycle",
|
||||||
|
"pause"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ArrowRight",
|
||||||
|
"command": [
|
||||||
|
"seek",
|
||||||
|
5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ArrowLeft",
|
||||||
|
"command": [
|
||||||
|
"seek",
|
||||||
|
-5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ArrowRight",
|
||||||
|
"command": [
|
||||||
|
"seek",
|
||||||
|
5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ArrowUp",
|
||||||
|
"command": [
|
||||||
|
"seek",
|
||||||
|
60
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ArrowDown",
|
||||||
|
"command": [
|
||||||
|
"seek",
|
||||||
|
-60
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "KeyQ",
|
||||||
|
"command": [
|
||||||
|
"quit"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Ctrl+KeyW",
|
||||||
|
"command": [
|
||||||
|
"quit"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"texthooker": {
|
||||||
|
"openBrowser": false
|
||||||
|
},
|
||||||
|
"websocket": {
|
||||||
|
"enabled": "auto",
|
||||||
|
"port": 6677
|
||||||
|
},
|
||||||
|
"ankiConnect": {
|
||||||
|
"enabled": true,
|
||||||
|
"url": "http://127.0.0.1:8765",
|
||||||
|
"deck": "Minecraft",
|
||||||
|
"pollingRate": 200,
|
||||||
|
"audioField": "ExpressionAudio",
|
||||||
|
"imageField": "Picture",
|
||||||
|
"sentenceField": "Sentence",
|
||||||
|
"generateAudio": true,
|
||||||
|
"generateImage": true,
|
||||||
|
"imageType": "avif",
|
||||||
|
"imageFormat": "webp",
|
||||||
|
"miscInfoPattern": "[mpv-yomitan] %f (%t)",
|
||||||
|
"overwriteAudio": false,
|
||||||
|
"overwriteImage": true,
|
||||||
|
"highlightWord": true,
|
||||||
|
"showNotificationOnUpdate": true,
|
||||||
|
"notificationType": "system",
|
||||||
|
"audioPadding": 0.5,
|
||||||
|
"fallbackDuration": 3,
|
||||||
|
"animatedFps": 24,
|
||||||
|
"animatedMaxWidth": 640,
|
||||||
|
"animatedMaxHeight": null,
|
||||||
|
"animatedCrf": 35,
|
||||||
|
"autoUpdateNewCards": false,
|
||||||
|
"sentenceCardModel": "Lapis Morph",
|
||||||
|
"sentenceCardSentenceField": "Sentence",
|
||||||
|
"sentenceCardAudioField": "SentenceAudio",
|
||||||
|
"isLapis": true,
|
||||||
|
"mediaInsertMode": "append",
|
||||||
|
"auto_start_overlay": false,
|
||||||
|
"secondarySub": {
|
||||||
|
"autoLoadSecondarySub": true,
|
||||||
|
"secondarySubLanguages": [
|
||||||
|
"en",
|
||||||
|
"eng"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"subtitleStyle": {
|
||||||
|
"ontFamily": "Noto Sans CJK JP Regular, Noto Sans CJK JP, Arial Unicode MS, Arial, sans-serif",
|
||||||
|
"fontSize": 35,
|
||||||
|
"fontColor": "#cad3f5",
|
||||||
|
"fontWeight": "normal",
|
||||||
|
"fontStyle": "normal",
|
||||||
|
"backgroundColor": "rgb(30, 32, 48, 0.88)",
|
||||||
|
"secondary": {
|
||||||
|
"fontSize": 24,
|
||||||
|
"fontColor": "#cad3f5",
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"shortcuts": {
|
||||||
|
"copySubtitle": "CommandOrControl+C",
|
||||||
|
"copySubtitleMultiple": "CommandOrControl+Shift+C",
|
||||||
|
"updateLastCardFromClipboard": "CommandOrControl+V",
|
||||||
|
"mineSentence": "CommandOrControl+S",
|
||||||
|
"mineSentenceMultiple": "CommandOrControl+Shift+S",
|
||||||
|
"toggleSecondarySub": "CommandOrControl+Shift+V",
|
||||||
|
"multiCopyTimeoutMs": 3000
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -157,7 +157,6 @@ set -gq @catppuccin_window_flags_icon_format "##{?window_activity_flag,#{E:@catp
|
|||||||
set -gq allow-passthrough on
|
set -gq allow-passthrough on
|
||||||
set -g visual-activity off
|
set -g visual-activity off
|
||||||
|
|
||||||
|
|
||||||
set -g @catppuccin_window_status_style "rounded" # basic, rounded, slanted, custom, or none
|
set -g @catppuccin_window_status_style "rounded" # basic, rounded, slanted, custom, or none
|
||||||
|
|
||||||
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
|
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export GTK_THEME=Dracula
|
|||||||
export XDG_CONFIG_HOME=$HOME/.config
|
export XDG_CONFIG_HOME=$HOME/.config
|
||||||
export COMPOSE_BAKE=true
|
export COMPOSE_BAKE=true
|
||||||
export ANKI_WAYLAND=1
|
export ANKI_WAYLAND=1
|
||||||
|
export SUDO_PROMPT=$'\a[sudo] password for %u: '
|
||||||
|
|
||||||
# nvidia
|
# nvidia
|
||||||
export NVD_BACKEND=direct
|
export NVD_BACKEND=direct
|
||||||
|
|||||||
22
.gitconfig##os.Darwin
Normal file
22
.gitconfig##os.Darwin
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
[user]
|
||||||
|
name = sudacode
|
||||||
|
email = suda@sudacode.com
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
|
[push]
|
||||||
|
default = simple
|
||||||
|
autoSetupRemote = true
|
||||||
|
[pull]
|
||||||
|
rebase = true
|
||||||
|
[rebase]
|
||||||
|
autoStash = true
|
||||||
|
[fetch]
|
||||||
|
prune = true
|
||||||
|
[diff]
|
||||||
|
algorithm = histogram
|
||||||
|
[merge]
|
||||||
|
conflictstyle = zdiff3
|
||||||
|
[color]
|
||||||
|
ui = auto
|
||||||
|
[core]
|
||||||
|
pager = less -FRX
|
||||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -19,9 +19,6 @@
|
|||||||
[submodule ".config/mpv-modules/autosubsync-mpv"]
|
[submodule ".config/mpv-modules/autosubsync-mpv"]
|
||||||
path = .config/mpv-modules/autosubsync-mpv
|
path = .config/mpv-modules/autosubsync-mpv
|
||||||
url = git@github.com:joaquintorres/autosubsync-mpv.git
|
url = git@github.com:joaquintorres/autosubsync-mpv.git
|
||||||
[submodule ".config/mpv-modules/immersion-tracker"]
|
|
||||||
path = .config/mpv-modules/immersion-tracker
|
|
||||||
url = git@gitea.suda.codes:sudacode/immersion-tracker.git
|
|
||||||
[submodule ".config/mpv-modules/mpvacious"]
|
[submodule ".config/mpv-modules/mpvacious"]
|
||||||
path = .config/mpv-modules/mpvacious
|
path = .config/mpv-modules/mpvacious
|
||||||
url = git@github.com:ksyasuda/mpvacious.git
|
url = git@github.com:ksyasuda/mpvacious.git
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import sys
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
# Configuration
|
|
||||||
OPENROUTER_API_KEY = os.environ.get("OPENROUTER_API_KEY", "")
|
OPENROUTER_API_KEY = os.environ.get("OPENROUTER_API_KEY", "")
|
||||||
MODEL = os.environ.get("OPENROUTER_MODEL", "google/gemini-2.0-flash-001")
|
# MODEL = os.environ.get("OPENROUTER_MODEL", "google/gemini-2.0-flash-001")
|
||||||
|
MODEL = os.environ.get("OPENROUTER_MODEL", "openai/gpt-oss-120b:free")
|
||||||
API_URL = "https://openrouter.ai/api/v1/chat/completions"
|
API_URL = "https://openrouter.ai/api/v1/chat/completions"
|
||||||
|
|
||||||
# Try to load API key from file if not in environment
|
# Try to load API key from file if not in environment
|
||||||
|
|||||||
@@ -1,106 +1,81 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
THEME="${THEME:-$HOME/.config/rofi/launchers/type-2/style-2.rasi}"
|
THEME="${THEME:-/opt/mpv-yomitan/catppuccin-macchiato.rasi}"
|
||||||
THUMBNAIL_PATH="/tmp/rmpv-thumbnail.jpg"
|
|
||||||
FONTCONFIG_FILE=$HOME/.config/mpv/mpv-fonts.conf
|
FONTCONFIG_FILE=$HOME/.config/mpv/mpv-fonts.conf
|
||||||
COMMAND=mpv
|
COMMAND=mpv
|
||||||
|
VIDEO_EXTENSIONS="mkv|mp4|avi|webm|mov|flv|wmv|m4v|ts|m2ts"
|
||||||
|
|
||||||
# Parse command-line options first
|
# Parse command-line options first
|
||||||
while getopts ":it:" opt; do
|
while getopts ":it:" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
i)
|
i)
|
||||||
COMMAND="$COMMAND --profile=immersion"
|
COMMAND="$COMMAND --profile=immersion"
|
||||||
;;
|
;;
|
||||||
t)
|
t)
|
||||||
THEME="$OPTARG"
|
THEME="$OPTARG"
|
||||||
;;
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
:)
|
:)
|
||||||
echo "Option -$OPTARG requires an argument." >&2
|
echo "Option -$OPTARG requires an argument." >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
shift $((OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
|
|
||||||
generate_thumbnail() {
|
find_videos() {
|
||||||
local video_file="$1"
|
find "$PWD" -maxdepth 1 -type f -regextype posix-extended \
|
||||||
local temp_thumb="/tmp/rmpv-thumbnail-$$.jpg"
|
-iregex ".*\.($VIDEO_EXTENSIONS)$" 2> /dev/null | sort -V
|
||||||
local thumbnail_file="${video_file%.*}.jpg"
|
|
||||||
|
|
||||||
# Clean up previous thumbnail
|
|
||||||
rm -f "$THUMBNAIL_PATH"
|
|
||||||
|
|
||||||
# Validate input
|
|
||||||
if [[ -z "$video_file" ]]; then
|
|
||||||
echo "Error: No video file specified" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -f "$video_file" ]]; then
|
|
||||||
echo "Error: Video file '$video_file' not found" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if it's a video file
|
|
||||||
if ! file "$video_file" | grep -qE "(video|Video)"; then
|
|
||||||
echo "Error: '$video_file' doesn't appear to be a video file" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Generate thumbnail if it doesn't exist
|
|
||||||
if [[ ! -f "$thumbnail_file" ]]; then
|
|
||||||
echo "Generating thumbnail for $(basename "$video_file")..."
|
|
||||||
# Try generating thumbnail side-by-side
|
|
||||||
if ! ffmpeg -ss 00:00:01 -i "$video_file" \
|
|
||||||
-vf "scale=320:240:force_original_aspect_ratio=decrease,pad=320:240:(ow-iw)/2:(oh-ih)/2" \
|
|
||||||
-frames:v 1 \
|
|
||||||
-q:v 4 \
|
|
||||||
"$thumbnail_file" \
|
|
||||||
-loglevel error -y 2>/dev/null; then
|
|
||||||
|
|
||||||
# Fallback to temp file if side-by-side fails (e.g. read-only fs)
|
|
||||||
echo "Warning: Failed to write to $thumbnail_file, trying temp location" >&2
|
|
||||||
thumbnail_file="$temp_thumb"
|
|
||||||
|
|
||||||
if ! ffmpeg -ss 00:00:01 -i "$video_file" \
|
|
||||||
-vf "scale=320:240:force_original_aspect_ratio=decrease,pad=320:240:(ow-iw)/2:(oh-ih)/2" \
|
|
||||||
-frames:v 1 \
|
|
||||||
-q:v 4 \
|
|
||||||
"$thumbnail_file" \
|
|
||||||
-loglevel error -y 2>/dev/null; then
|
|
||||||
echo "Error: Failed to generate thumbnail" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Copy to consistent location for notify-send
|
|
||||||
# We use a fixed path so notify-send always finds it
|
|
||||||
if cp "$thumbnail_file" "$THUMBNAIL_PATH" 2>/dev/null; then
|
|
||||||
echo "Thumbnail ready at: $THUMBNAIL_PATH"
|
|
||||||
ls -l "$THUMBNAIL_PATH"
|
|
||||||
file "$THUMBNAIL_PATH"
|
|
||||||
else
|
|
||||||
echo "Error: Failed to copy thumbnail to $THUMBNAIL_PATH" >&2
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
choice="$(find . -iname "*[.mkv|.mp4]" | sort -h | rofi -dmenu -i -theme "$THEME" -theme-str 'listview {columns: 1; lines: 15;} window {width: 88%;}' -p "Choose Video")"
|
build_rofi_menu() {
|
||||||
if [[ -z "$choice" ]]; then
|
while IFS= read -r video; do
|
||||||
echo "No video selected."
|
[ -z "$video" ] && continue
|
||||||
exit 1
|
local display_name
|
||||||
|
display_name=$(basename "$video")
|
||||||
|
printf '%s\0icon\x1fthumbnail://%s\n' "$display_name" "$video"
|
||||||
|
done < <(find_videos)
|
||||||
|
}
|
||||||
|
|
||||||
|
get_video_thumbnail() {
|
||||||
|
local video="$1"
|
||||||
|
local thumb_dir="$HOME/.cache/thumbnails/large"
|
||||||
|
local video_uri="file://$(realpath "$video")"
|
||||||
|
local thumb_hash=$(echo -n "$video_uri" | md5sum | cut -d' ' -f1)
|
||||||
|
local thumb_path="$thumb_dir/$thumb_hash.png"
|
||||||
|
|
||||||
|
if [[ -f "$thumb_path" ]]; then
|
||||||
|
echo "$thumb_path"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
local tmp_thumb="/tmp/rmpv-thumb-$$.jpg"
|
||||||
|
if command -v ffmpegthumbnailer &> /dev/null; then
|
||||||
|
ffmpegthumbnailer -i "$video" -o "$tmp_thumb" -s 512 -q 5 2> /dev/null && echo "$tmp_thumb"
|
||||||
|
elif command -v ffmpeg &> /dev/null; then
|
||||||
|
ffmpeg -i "$video" -ss 00:00:30 -vframes 1 -vf "scale=512:-1" "$tmp_thumb" 2> /dev/null && echo "$tmp_thumb"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
selection=$(build_rofi_menu | rofi -dmenu -i -show-icons -theme "$THEME" \
|
||||||
|
-theme-str 'configuration {font: "JetBrainsMono Nerd Font 10";} listview {columns: 1; lines: 15;} window {width: 88%;}' -p "Choose Video ")
|
||||||
|
|
||||||
|
if [[ -z "$selection" ]]; then
|
||||||
|
echo "No video selected."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
generate_thumbnail "$choice"
|
choice="./$selection"
|
||||||
if [[ ! -f "$THUMBNAIL_PATH" ]]; then
|
|
||||||
echo "Warning: Thumbnail not created, notification will have no icon" >&2
|
THUMBNAIL_PATH=$(get_video_thumbnail "$choice")
|
||||||
|
if [[ -n "$THUMBNAIL_PATH" && -f "$THUMBNAIL_PATH" ]]; then
|
||||||
|
notify-send -i "$THUMBNAIL_PATH" "Playing Video" "$(basename "$choice")"
|
||||||
|
else
|
||||||
|
notify-send "Playing Video" "$(basename "$choice")"
|
||||||
fi
|
fi
|
||||||
notify-send -i "$THUMBNAIL_PATH" "Playing Video" "$(basename "$choice")"
|
|
||||||
$COMMAND "$choice" &
|
$COMMAND "$choice" &
|
||||||
|
|
||||||
# vim: ft=sh
|
# vim: ft=sh
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user