summaryrefslogtreecommitdiff
path: root/ar
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-02-25 10:52:36 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-02-25 10:52:36 +0900
commit2be125ce9360905699c08daac3f4888eef6075fc (patch)
tree15c6c5ba1a2fabf9e0a14fe08edee66d5f248fe6 /ar
parent72a1195c7a2d1466f9d76e8da56a76374cc12974 (diff)
modified lf/lfrc, created bin/yt-music
Diffstat (limited to 'ar')
-rw-r--r--ar/.config/lf/lfrc10
-rwxr-xr-xar/.local/bin/yt-music23
2 files changed, 31 insertions, 2 deletions
diff --git a/ar/.config/lf/lfrc b/ar/.config/lf/lfrc
index 99150ee..a1ac309 100644
--- a/ar/.config/lf/lfrc
+++ b/ar/.config/lf/lfrc
@@ -316,7 +316,9 @@ cmd open ${{
case $(file --mime-type "$(readlink -f $f)" -b) in
application/octet-stream)
case ${f##*.} in
- doc|docx|xls|xlsx|odt|ppt|pptx) setsid -f libreoffice $fx >/dev/null 2>&1 ;;
+ ppt|pptx) setsid -f libreoffice --impress $fx >/dev/null 2>&1 ;;
+ doc|docx|odt) setsid -f libreoffice --writer $fx >/dev/null 2>&1 ;;
+ xls|xlsx) setsid -f libreoffice --calc $fx >/dev/null 2>&1 ;;
ghw) setsid -f gtkwave $f >/dev/null 2>&1 ;;
ts) setsid -f mpv --x11-name=video --really-quiet -- "$f" </dev/null >/dev/null 2>&1 ;;
*) setsid -f zathura $fx >/dev/null 2>&1 ;;
@@ -324,7 +326,11 @@ cmd open ${{
;;
application/epub*|application/pdf|application/postscript|application/vnd.djvu|image/vnd.djvu) setsid -f zathura $fx >/dev/null 2>&1 ;;
application/pgp-encrypted) $EDITOR $fx ;;
- application/vnd.oasis.opendocument.text|application/vnd.oasis.opendocument.spreadsheet|application/vnd.oasis.opendocument.spreadsheet-template|application/vnd.oasis.opendocument.presentation-template|application/vnd.oasis.opendocument.presentation|application/vnd.ms-powerpoint|application/vnd.oasis.opendocument.graphics|application/vnd.oasis.opendocument.graphics-template|application/vnd.oasis.opendocument.formula|application/vnd.oasis.opendocument.database|application/x-hwp|application/vnd.openxmlformats-officedocument.presentationml.presentation|application/vnd.openxmlformats-officedocument.wordprocessingml.document) setsid -f libreoffice $fx >/dev/null 2>&1 ;;
+ application/vnd.oasis.opendocument.presentation|application/vnd.oasis.opendocument.presentation-template|application/vnd.ms-powerpoint|application/vnd.openxmlformats-officedocument.presentationml.presentation) setsid -f libreoffice --impress $fx >/dev/null 2>&1 ;;
+ application/vnd.oasis.opendocument.text|application/x-hwp|application/vnd.openxmlformats-officedocument.wordprocessingml.document) setsid -f libreoffice --writer $fx >/dev/null 2>&1 ;;
+ application/vnd.oasis.opendocument.spreadsheet|application/vnd.oasis.opendocument.spreadsheet-template) setsid -f libreoffice --calc $fx >/dev/null 2>&1 ;;
+ application/vnd.oasis.opendocument.graphics|application/vnd.oasis.opendocument.graphics-template) setsid -f libreoffice --draw $fx >/dev/null 2>&1 ;;
+ application/vnd.oasis.opendocument.formula|application/vnd.oasis.opendocument.database) setsid -f libreoffice $fx >/dev/null 2>&1 ;;
audio/*|video/x-ms-asf) setsid -f mpv --volume=50 --x11-name=music --force-window=yes --audio-display=embedded-first --really-quiet -- "$f" </dev/null >/dev/null 2>&1 ; lf -remote "send $id redraw" ;;
image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;;
image/svg+xml) display -- $f ;;
diff --git a/ar/.local/bin/yt-music b/ar/.local/bin/yt-music
new file mode 100755
index 0000000..795403f
--- /dev/null
+++ b/ar/.local/bin/yt-music
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
+
+if [ -f "$XDG_CONFIG_HOME/youtube-music-flags.conf" ]; then
+ YOUTUBE_MUSIC_USER_FLAGS="$(grep -v '^#' "$XDG_CONFIG_HOME/youtube-music-flags.conf")"
+fi
+
+export ELECTRON_IS_DEV=0
+"/opt/YouTube Music/youtube-music" $YOUTUBE_MUSIC_USER_FLAGS "$@" &
+APP_PID=$!
+
+# Wait for the main window, then override WM_CLASS set by Electron
+i=0
+while [ "$i" -lt 50 ]; do
+ WID=$(xdotool search --classname "com.github.th_ch.youtube_music" 2>/dev/null | tail -1)
+ if [ -n "$WID" ]; then
+ xdotool set_window --classname "yt-music" --class "yt-music" "$WID"
+ break
+ fi
+ sleep 0.2
+ i=$((i + 1))
+done