Gemini, LeoAI 이용 스크립트 생성 WM 꾸미기
JUQ123

Lv.1 JUQ123 (146.♡.205.134)

2025년 7월 13일 PM 08:54 · 수정됨(07. 18. 01:11)

조회 700 공감 0

Gemini, LeoAI 이용 스크립트 생성 WM 꾸미기


1. 시스템 환경




2. Leo AI 이용 toggle_compositor.sh 스크리비트 만들기 :  XMonad GUI

[동영상] :  https://drive.google.com/file/d/1RWUpirbc0bwcSto1dzRvENbeMxVeLhT5/view?usp=drive_link

- XMonad GUI  : Brave-nightly 브라우저 (Leo AI 가 내장 되어 있씁니다)

  오늘 쪼맨 많이  돌렸더니 할당량 다 썻는지. 프리미엄 돈주고 가입하라고 하더라구요. 삭제하고 재설치 하니깐 어랏 그냥 또 되는데요???

  물음 문장 : "xmonad wm 에서 fastcompmgr을 사용하여 'mod4 + shift + `' 키를 누를 때마다 해당 compositor를 of/off 하는 토글 쉘 스크립트와 xmonad config 파일을 만들어 주세요"

 -- $HOME/.local/bin/toggle_compositor.sh

#!/bin/bash
# fastcompmgr 프로세스가 실행 중인지 확인합니다.
if pgrep -x "fastcompmgr" > /dev/null
then
# 실행 중이면, 모든 fastcompmgr 프로세스를 종료합니다.
killall fastcompmgr
# 알림을 보냅니다.
notify-send "Compositor Disabled"
else
# 실행 중이 아니면, fastcompmgr을 백그라운드에서 시작합니다.
fastcompmgr &
# 알림을 보냅니다.
notify-send "Compositor Enabled"
fi

--복사/붙여넣기 하고 해당 파일 실행 권한 지정

$ touch $HOME/.local/bin/toggle_compositor.sh$ chmod +x $HOME/.local/bin/toggle_compositor.sh


-- $HOME/.xmonad/onad.hs : 단축키 추가하는 방법이 여러가지 방식이 있어요. 동일 질문 실행 할때마다 결과 코드가 달라져요

A. 방식

import XMonad
main = xmonad $ defaultConfig
{ modMask = mod4Mask
, keys = c -> myKeys c `mappend` defaultTDEBindings
}
myKeys (XConfig { XMonad.modMask = modMask }) = [
((modMask, xK_grave), composeToggle)
]
composeToggle :: X ()
composeToggle = spawn "$HOME/.local/bin/ toggle_compositor.sh"


- 실행 : mod4mask = window 키,   ' 키 = esc 바로 밑에 키

토글 단축키 : "mod4 + ctrl + shift +`"




3. Gemeni 이용 toggle_wallpapers.sh 스크립트 만들기 : XMonad CLI

[동영상] :  https://drive.google.com/file/d/1lhl6ina3B-zfp8ZyagI2MBlZHJQWv8xN/view?usp=drive_link

- XMonad CLI : urxvt -> tmux -> gemini -> vim : 터미널 하나로 다 됩니다. 이제 웹브라우저 켜서 검색 안해도 되겠어요.  터미럴 하나만 켜도 다 되네요.

- 물음 문장 "toggle [Solid Color | 랜덤 이미지] 상호 전환하는 바탕화면 쉘 스크립트 주삼. 웰페이퍼 폴더에 있는 랜덤 이미지 파일을 바탕화면으로 설정하는 bash 쉘 스크립틀 작성해 주삼. xmonad wm에서 "mo4 + `" 키를 누를 때마다 바탕화면을 solid color 로 지정하고, 웰페이퍼 폴더 아래에 있는 랜덤 이미지를 바탕화면으로 지정하는 toggle bash 쉘 스크립트를 작성해. 위 소스에서 solid color 색상 바탕화면 설정은 랜덤이 아닌 스크립트 변수에 기재된 색상값을 hsetroot 커맨드를 사용하여 지정하는 로직으로 수정해"


-- $HOME/.local/bin/toggle_wallpaper.sh

#!/bin/bash
# --- 설정 ---
# 월페이퍼 이미지가 저장된 디렉토리 경로
WALLPAPER_DIR="$HOME/Wallpapers"
# 사용할 Solid Color 색상값
SOLID_COLOR="#312e39"
# 스크립트의 현재 상태를 저장할 파일 경로 (이미지 또는 단색)
STATE_FILE="/tmp/wallpaper_toggle_state"
# --- 스크립트 시작 ---
# 월페이퍼 디렉토리 존재 여부 확인 (이미지 모드에 필요)
function check_wallpaper_dir() {
if [ ! -d "$WALLPAPER_DIR" ]; then
echo "오류: 월페이퍼 디렉토리를 찾을 수 없습니다: $WALLPAPER_DIR"
echo "스크립트 상단의 WALLPAPER_DIR 변수를 올바른 경로로 수정해주세요."
exit 1
fi
}
# 랜덤 이미지 배경화면 설정
function set_random_image_wallpaper() {
check_wallpaper_dir
PIC=$(find "$WALLPAPER_DIR" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | shuf -n 1)
if [ -z "$PIC" ]; then
echo "오류: '$WALLPAPER_DIR' 디렉토리에서 이미지 파일을 찾을 수 없습니다."
exit 1
fi
echo "배경화면 설정 (이미지): $PIC"
case "$XDG_CURRENT_DESKTOP" in
GNOME|Unity|Cinnamon)
gsettings set org.gnome.desktop.background picture-options 'zoomed'
gsettings set org.gnome.desktop.background picture-uri "file://$PIC"
;;
MATE)
gsettings set org.mate.background picture-filename "$PIC"
;;
XFCE)
xfconf-query -c xfce4-desktop -p /backdrop -l | grep "last-image" | while read -r path; do
xfconf-query -c xfce4-desktop -p "$path" -s "$PIC"
done
;;
KDE)
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript "
var allDesktops = desktops();
for (i=0;i<allDesktops.length;i++) {
d = allDesktops[i];
d.wallpaperPlugin = 'org.kde.image';
d.currentConfigGroup = Array('Wallpaper', 'org.kde.image', 'General');
d.writeConfig('Image', 'file://$PIC');
}"
;;
LXDE)
pcmanfm --set-wallpaper="$PIC" --wallpaper-mode=fit
;;
*)
if command -v feh &> /dev/null; then feh --bg-scale "$PIC" && notify-send --icon="$PIC" "배경화면 설정 (랜덤 이미지)" "$PIC";
else echo "feh가 설치되지 않았습니다."; fi
;;
esac
}
# 단색 배경화면 설정
function set_solid_color_wallpaper() {
echo "배경화면 설정 (단색): $SOLID_COLOR"
if command -v hsetroot &> /dev/null; then
hsetroot -solid "$SOLID_COLOR"; notify-send "배경화면 설정 (단색): $SOLID_COLOR"
else
echo "오류: hsetroot가 설치되어 있지 않습니다. 단색 배경화면을 설정할 수 없습니다."
echo "hsetroot를 설치하거나 다른 방법을 사용하도록 스크립트를 수정해주세요."
exit 1
fi
}
# 현재 상태를 읽어와서 다음 상태 결정
CURRENT_STATE=$(cat "$STATE_FILE" 2>/dev/null)
if [ "$CURRENT_STATE" == "image" ]; then
# 현재가 이미지이므로, 다음은 단색으로 변경
set_solid_color_wallpaper
echo "color" > "$STATE_FILE"
else
# 현재가 단색이거나 상태 파일이 없으면, 다음은 이미지로 변경
set_random_image_wallpaper
echo "image" > "$STATE_FILE"
fi

- gemini 는 내 컴퓨터 쓰기/읽기 권한을 가진다. 경로까지 지정하면, 알아서 "$HOME/.local/bin/toggle_wallpapers.sh" 파일을 해당 경로에 생성해서 만들어 주고, 실행권한도 추가해준다.

(약간 내가 생각했던 로직 그대로 스크립트를 만들어 준다. 와아 신기하네요. 수동으로 약간 다듬고 논리 에러 몇개 수정했어요)

 제미니는 내  컴터의 참조할 소스가 많거나, 참조할 폴더/파일들이 많으면,  시간이 아주 많이 걸린다. (야구 보면서 해야해요 !!)


-- $HOME/.xmonad/xmonad.hs : 단축키 추가하는 다른 방식

B. 방식

import XMonad
import XMonad.Util.EZConfig (additionalKeys)
main = xmonad $ def
{ terminal = "urxvt"
, modMask = mod4Mask
}
`additionalKeys`
[ ((mod4Mask, xK_grave), spawn "$HOME/.local/bin/xmonad/ toggle-wallpapers.sh") ]


- 실행

토글 단축키 : "mod4 + `' 키




3. 먼가 찜찜 할때 음소거와 영상플레이어 unvisibel 또는 닫아 버리기

--$HOME/.xmonad/scripts/volume (실행권한 추가 필요)

#!/bin/bash
VOL=$(amixer sget Master | tail -1 | awk -F"[][%]" '{ print $2 }')
ISMUTED=$(amixer sget Master | tail -1 | awk -F"[][]" '{ print $4 }')
if [ "$1" == "low" ]
then
#amixer -q set Master 3%- unmute
amixer -q -D pulse set Master 2%- unmute
#ICON="/usr/share/icons/Adwaita/16x16/status/audio-volume-low.png"
ICON="/home/nietz/.local/share/icons/Snowy/symbolic/actions/scalable/zoom-out-symbolic.png"
TEXT=$(amixer sget Master | tail -1 | cut -d' ' -f7 | sed 's/([|])//g')
TEXT="⬇ Level : ""$TEXT"
volnoti-show $VOL
elif [ "$1" == "high" ]
then
#amixer -q set Master 3%+ unmute
amixer -q -D pulse set Master 2%+ unmute
#ICON="/usr/share/icons/Adwaita/16x16/status/audio-volume-high.png"
ICON="/home/nietz/.local/share/icons/Snowy/symbolic/actions/scalable/zoom-in-symbolic.png"
TEXT=$(amixer sget Master | tail -1 | cut -d' ' -f7 | sed 's/([|])//g')
TEXT="⬆ Level : ""$TEXT"
volnoti-show $VOL
elif [ "$1" == "mute" ]
then
MUTESTATE=$(amixer sget Master | tail -1 | awk -F"[][]" '{ print $4 }')
#amixer -q set Master toggle
amixer -q -D pulse set Master toggle
if [ "$MUTESTATE" = "on" ]; then
#ICON="/usr/share/icons/Adwaita/16x16/status/audio-volume-muted.png"
ICON="/home/nietz/.local/share/icons/Snowy/actions/scalable/player-volume-muted.png"
TEXT=$(amixer sget Master | tail -1 | cut -d' ' -f8 | sed 's/([|])//g')
TEXT="💀 muted : ""$TEXT"
volnoti-show -m
fi
if
[ "$MUTESTATE" = "off" ]; then
#ICON="/usr/share/icons/Adwaita/16x16/status/audio-volume-muted.png"
ICON="/home/nietz/.local/share/icons/Snowy/actions/scalable/player-volume.png"
TEXT=$(amixer sget Master | tail -1 | cut -d' ' -f8 | sed 's/([|])//g')
TEXT="😀 muted : ""$TEXT"
volnoti-show $VOL
fi
else
echo "Usage volume [low | high | mute]n"
fi
ID=$(cat /home/nietz/.xmonad/.dunst_volume)
if [ $ID -gt "0" ]
then
notify-send -p -r $ID -i $ICON " Volume" "$TEXT" --app-name=Volume >/home/nietz/.xmonad/.dunst_volume
else
notify-send -p -i $ICON " Volume" "$TEXT" >/home/nietz/.xmonad/.dunst_volume
fi


- $HOME/.xmonad/xmonad.hs 파일에 단축키로 추가한다.

- 실행 : 누르면 소리가 꺼지고, 영상플레이러를 가리거나/ 영상 플레이어를 kill 해버린다.

토글 단축키 : "mod4 + <esc>" 키


- 위 스크립트를 10년 전에 처음 만들었을땐 문법을 몰라서 작성하는데 일주일 걸렸었는데요.

잼민희에게  물어봤더니 1분만에 스크립트 풀 코드가 나옵니다. ㄷㄷㄷ

갑자기  "VOL"  볼륨 추출 커맨드 설명이 갑자기 궁금해졌습니다

 * 질문 : "amixer 이용 Master 볼륨 추출 커맨드를 알려주세요"
    (와아 설명히 자세합니다. 웹 검색이 필요가 없네요. 자세히 몰랐던 문법 이해에 도움이 되었습니다.)

✦ 다음은 amixer를 사용하여 현재 마스터 볼륨을 추출하는 몇 가지 방법입니다. 가장 간단하고 일반적으로 사용되는 방법부터 설명해 드립니다.

1. awk 사용 (가장 추천)
이 방법은 amixer 출력에서 볼륨 값이 있는 줄을 찾아 [ 와 ] 사이의 값을 정확히 추출합니다.


1 amixer get Master | awk -F'[][]' '/%/{print $2}'



* amixer get Master: 'Master' 컨트롤의 정보를 가져옵니다.
* |: 앞 명령어의 출력을 다음 명령어로 전달합니다.
* awk -F'[][]': 필드 구분자를 [ 또는 ] 문자로 설정합니다.
* /%/{print $2}: % 문자가 포함된 줄을 찾아서, 구분자로 나뉜 두 번째 필드(예: 87%)를 출력합니다.


만약 좌우 채널이 모두 출력되는 경우, 첫 번째 값만 가져오려면 head -n 1을 추가할 수 있습니다.


1 amixer get Master | awk -F'[][]' '/%/{print $2}' | head -n 1



2. grep과 cut 사용
grep으로 필요한 줄을 찾고 cut으로 원하는 부분을 잘라내는 고전적인 방식입니다.


1 amixer get Master | grep '%' | head -n 1 | cut -d '[' -f 2 | cut -d '%' -f 1



* grep '%': '%' 기호가 포함된 줄을 필터링합니다.
* head -n 1: 여러 줄이 나올 경우 첫 번째 줄만 선택합니다.
* cut -d '[' -f 2: [ 문자를 기준으로 문자열을 나누고 두 번째 조각을 가져옵니다. (예: 87%] [on])
* cut -d '%' -f 1: 이전 결과물을 다시 % 문자를 기준으로 나누고 첫 번째 조각을 가져옵니다. (예: 87)


3. % 기호 없이 숫자만 추출하고 싶을 경우

awk를 사용하는 첫 번째 방법에서 % 기호만 제거하면 됩니다.



1 amixer get Master | awk -F'[][]' '/%/{print $2}' | tr -d '%' | head -n 1


* tr -d '%': % 문자를 삭제합니다.

이 명령어들을 셸 스크립트에서 변수에 저장하여 활용할 수 있습니다.



1 #!/bin/bash
2 volume=$(amixer get Master | awk -F'[][]' '/%/{print $2}' | head -n 1)
3 echo "현재 볼륨: $volume"



위,  2.  3   4 단축키

         `additionalKeysP`
[
-- Toggle [Solid|Random Image] Background
("M-`" , spawn "$HOME/.local/bin/ toggle_wallpaper.sh;mpc volume +1; sleep 0.5;mpc volume -1")
-- Toggle Compositor
, ("M-C-S-`" , spawn "$HOME/.local/bin/ toggle_compositor.sh")
-- Toggle Compositor and Master Volume toggle
, ("M-<Esc>" , spawn "$HOME/.xmonad/scripts/volume mute; $HOME/.local/bin/ toggle_compositor.sh")
-- Kill mpv and Master Volume toggle
, ("M-<Brake>", spawn "$HOME/.xmonad/scripts/volume mute; pkill mpv")
----- Key code 다른 방식 -----
--- PulseAudio Mixer control
-- Volume up 1%
--, ((modMask x, xK_KP_Add ), spawn "amixer -D pulse set Master 2%+ unmute")
, ((modMask x, xK_KP_Add ), spawn "~/.xmonad/scripts/volume high")
-- Volume down -1%
--, ((modMask x, xK_KP_Subtract), spawn "amixer -D pulse set Master 2%- unmute")
, ((modMask x, xK_KP_Subtract), spawn "~/.xmonad/scripts/volume low" )

-- Volume toggle
--, ((modMask x, xK_KP_Multiply), spawn "amixer -D pulse set Master toggle" )
, ((modMask x, xK_KP_Multiply), spawn "~/.xmonad/scripts/volume mute")
]


다른 WM 이나 다른 DE 를 쓴다면, 단축키를 xbindkey 를 이용하여, 단축키 맵핑하면 된다.

바로 위 라인들 복사해서 제미니에 붙여넣고, 위 코드를 "$HOME/.xbindkeysrc" 파일에 전환해서 반영해 주세요 하면 될것 같다.


-----------------------------------------------------------------

긴 글 읽어 주셔서 감사합니다. AI 잼있네요.

질문만 잘하면 원하는 대로 스크립트를 자동을 다 만들어 주는 거 같아요. 에러 원인/분석도 다 해주고요. 신기방기하였습니다.

-------------------------------------------------------------------


(추가)


- 위 볼륭 노티파이 스크립트는 아주 오래된 구형방식입니다.

  아래 범용 신형 방식이 더 좋은 거 같습니다. 요즘 dunst 는 볼륨 프로그래시바도 그려주네요. "-h [~~~]" 옵션이 언제 새로 생겼죠?

  위 스크립트와 달리 시스템 디폴트 아이콘을 출력하며, 범용입니다.  libnotify 또는, dunst 만 설치하면 됩니다. pactl , notify-send 명령어는 아마 디폴트로 다 깔려져 있을 것 같아요.

- 윗 부분 알림 : 구형방식   |    아랫 부분 알림 : 신형방식   ---->  더 신형이자 엄청 이쁜거 :  알림 전용 이쁜,  최신형 어플릿 앱이 있는 거 같아요.



-- $HOME/.local/bin/volume.sh

[code=bash]#!/bin/bash


# 이 스크립트는 PulseAudio 볼륨을 제어하고, libnotify를 통해 데스크톱 알림을 표시합니다.

# 사용법:

# ./volume.sh up # 볼륨 5% 증가

# ./volume.sh down # 볼륨 5% 감소

# ./volume.sh toggle # 음소거 켜기/끄기


# 현재 볼륨 상태를 가져와서 알림을 보내는 함수

function send_notification() {

# @DEFAULT_SINK@는 현재 기본 출력 장치를 의미합니다.

local volume=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -o '[0-9]*%' | head -n1 | sed 's/%//')

local mute=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}')


local icon=""

local text=""


if [ "$mute" == "yes" ]; then

icon="audio-volume-muted"

text="음소거됨"

else

if [ "$volume" -gt 70 ]; then

icon="audio-volume-high"

elif [ "$volume" -gt 30 ]; then

icon="audio-volume-medium"

else

icon="audio-volume-low"

fi

text="볼륨: ${volume}%"

fi


# notify-send를 사용하여 알림을 보냅니다.

# -h int:value:$volume : 많은 데스크톱 환경에서 볼륨 바를 표시해줍니다.

# -h string:x-canonical-private-synchronous:my-notification : 알림이 쌓이지 않고 교체되도록 합니다.

# -h byte:urgency:2 : 알림의 긴급도를 'critical'로 설정하여 일부 데스크톱 환경에서 빨간색으로 표시될 수 있습니다.

notify-send -i "$icon" -h int:value:"$volume" -h string:x-canonical-private-synchronous:my-notification -h byte:urgency:2 "$text"

}


# 스크립트에 전달된 인자에 따라 동작을 결정합니다.

case $1 in

up)

# 기본 싱크의 볼륨을 5% 올립니다.

pactl set-sink-volume @DEFAULT_SINK@ +5%

send_notification

;;

down)

# 기본 싱크의 볼륨을 5% 내립니다.

pactl set-sink-volume @DEFAULT_SINK@ -5%

send_notification

;;

toggle)

# 기본 싱크의 음소거 상태를 토글합니다.

pactl set-sink-mute @DEFAULT_SINK@ toggle

send_notification

;;

*)

echo "사용법: $0 {up|down|toggle}"

exit 1

;;

esac[/code]


[mpv 를 이미지 뷰어 용도로 사용하기]

0.먼저 mpv 의 영상 재생 기본 단축키 설명입니다.(~/.config/mpv//input.conf )

   mpv 의 기본 단축키는 아래 링크에서 다운로드 가능합니다.

https://raw.githubusercontent.com/kba/mpv-config/refs/heads/master/input.conf


[code=bash]✦ mpv의 모든 단축키는 매우 방대하며, 기본적인 기능부터 고급 기능까지 다양하게 설정되어 있습니다. 아래에 주요 기능별로 모든

단축키를 정리했습니다.


참고: input.conf 파일을 통해 이 모든 단축키를 사용자가 원하는 대로 변경할 수 있습니다. (~/.config/mpv/input.conf

경로에 파일을 생성하여 설정)


재생 제어



┌───────────┬─────────────────────────────────────────┐

│ 키 │ 기능 │

├───────────┼─────────────────────────────────────────┤

│ p, SPACE │ 재생/일시정지 전환 │

│ . │ 한 프레임 앞으로 이동 (그리고 일시정지) │

│ , │ 한 프레임 뒤로 이동 (그리고 일시정지) │

│ q │ 재생을 멈추고 종료 │

│ Q │ 현재 재생 위치를 저장하고 종료 │

│ [ │ 재생 속도 10% 감소 │

│ ] │ 재생 속도 10% 증가 │

│ { │ 재생 속도 절반으로 감소 │

│ } │ 재생 속도 두 배로 증가 │

│ BACKSPACE │ 재생 속도 초기화 │

└───────────┴─────────────────────────────────────────┘


탐색 (시간 이동)



┌──────────────────────┬───────────────────────────────┐

│ 키 │ 기능 │

├──────────────────────┼───────────────────────────────┤

│ ←, → │ 5초 뒤로/앞으로 이동 │

│ ↑, ↓ │ 1분 앞으로/뒤로 이동 │

│ Shift + ←, Shift + → │ 1초 뒤로/앞으로 정확하게 이동 │

│ Shift + ↑, Shift + ↓ │ 5초 앞으로/뒤로 정확하게 이동 │

│ Ctrl + ←, Ctrl + → │ 이전/다음 자막으로 이동 │

│ Shift + BACKSPACE │ 마지막 탐색 취소 │

└──────────────────────┴───────────────────────────────┘


볼륨 및 오디오



┌────────────────────┬─────────────────────────┐

│ 키 │ 기능 │

├────────────────────┼─────────────────────────┤

│ 9, 0 │ 볼륨 감소/증가 │

│ /, * │ 볼륨 감소/증가 │

│ m │ 음소거/음소거 해제 │

│ # │ 오디오 트랙 전환 │

│ Ctrl + +, Ctrl + - │ 오디오 딜레이 증가/감소 │

└────────────────────┴─────────────────────────┘


자막



┌────────────────────────────────────┬────────────────────────────────┐

│ 키 │ 기능 │

├────────────────────────────────────┼────────────────────────────────┤

│ v │ 자막 보이기/숨기기 │

│ j, Shift + j │ 사용 가능한 자막 트랙 전환 │

│ z, x │ 자막 딜레이 -/+ 0.1초 조절 │

│ r, t │ 자막 위/아래로 이동 │

│ Ctrl + Shift + ←, Ctrl + Shift + → │ 이전/다음 자막에 타이밍 맞추기 │

└────────────────────────────────────┴────────────────────────────────┘


비디오 및 창



┌──────────────────┬─────────────────────────────────────────┐

│ 키 │ 기능 │

├──────────────────┼─────────────────────────────────────────┤

│ f │ 전체 화면 전환 │

│ T │ 항상 위에 표시 전환 │

│ w, e │ 팬 앤 스캔(Pan-and-scan) 범위 감소/증가 │

│ Alt + +, Alt + - │ 확대/축소 │

│ Alt + 화살표 키 │ 비디오 화면 이동 │

│ Alt + BACKSPACE │ 화면 이동/확대 초기화 │

│ s │ 스크린샷 찍기 │

│ Shift + s │ 자막 없이 스크린샷 찍기 │

│ Ctrl + h │ 하드웨어 비디오 디코딩 전환 │

└──────────────────┴─────────────────────────────────────────┘


재생 목록



┌───────┬─────────────────────────────────────┐

│ 키 │ 기능 │

├───────┼─────────────────────────────────────┤

│ <, > │ 재생 목록의 이전/다음 항목으로 이동 │

│ ENTER │ 재생 목록의 다음 항목으로 이동 │

└───────┴─────────────────────────────────────┘


기타



┌────┬─────────────────────────────────────────────┐

│ 키 │ 기능 │

├────┼─────────────────────────────────────────────┤

│ o │ 진행률 표시줄, 경과 시간, 총 재생 시간 표시 │

│ l │ A-B 구간 반복 설정/해제 │

│ i │ 통계 정보 표시 │

│ ? │ 현재 설정된 단축키 목록 표시 │

└────┴─────────────────────────────────────────────┘

[/code]


전체 mpv 단축키 ~/.input.conf 파일 예시입니다.일반적으로 이 파일에서 단축키 설정을 변경하고 커스텀 단축키 등을 추가해서 사용합니다.


[code=bash]# mpv default key bindings

#


# Location of user-defined bindings: ~/.config/mpv/input.conf

#

# You can list all commands and properties with --input-test

# You can list all key names with --input-keylist

#

# Use 'ignore' to unbind a key, e.g. 'g ignore'.

#

# Strings starting with ` or ´ are expanded as properties (see Property

# Expansion).

#

# For a list of useful commands, see the "USER INPUT" section of the man page.

#

# Note: this file is not supposed to be used directly. Instead, you should

# create your own input.conf, and add whatever bindings you want to have.


# Developer note:

# This file is not supposed to be parsable. It's a reference for the default

# bindings, which are hardcoded in input_default.c. It's all in one file,

# because this is the most convenient way to handle it.

# After changing this file, run ./TOOLS/gen-input-conf to update input_default.c.

# A misformatted file will lead to errors during generation, or mpv runtime

# errors.

#

# Lines starting with a single # are comments. Lines starting with ## are

# comments, but are removed by the generator script. The latter is used for

# comments that are not useful for the user, but may be of interest to people

# reading this file.

# A # character after a binding is not a comment, but part of a key name.

# (e.g. Shift+# is a valid key name).


# Keys are specified like this:

# [Shift+][Ctrl+][Alt+][Meta+]<key>

# The key is either a single character, or a name like 'UP', 'LEFT', 'ENTER' etc.

# The order of modifiers is Shift > Ctrl > Alt > Meta.

# It's also possible to bind mouse buttons, e.g. 'MBTN_LEFT'.

# The 'WHEEL_UP' and 'WHEEL_DOWN' keys are special.

#

# Commands are specified like this:

# <command> <arg1> <arg2> ...

# There are some special commands, like 'ignore' (disables a key), or 'seek 10'

# (seeks 10 seconds forward).

#

# It's also possible to cycle through values, e.g.

# <key> cycle <property> <value1> <value2> ...

#

# You can also bind a key to a sequence of commands:

# <key> script-binding <script_name>/<binding_name>

#

# See the man page for details.



# --- MOUSE ---

# (the default bindings are hard-coded into the source code and are not

# configurable with the input.conf mechanism)

#

# MBTN_LEFT cycle pause

# MBTN_LEFT_DBL cycle fullscreen

# MBTN_RIGHT cycle pause

# MBTN_BACK playlist-prev

# MBTN_FORWARD playlist-next

# WHEEL_UP seek 10

# WHEEL_DOWN seek -10

# WHEEL_LEFT add volume -2

# WHEEL_RIGHT add volume 2



# --- KEYS ---


# Seek

# Note: these are also used for OSD seeking (bar with percentage).

RIGHT seek 5

LEFT seek -5

UP seek 60

DOWN seek -60

# Do smaller, always exact (non-keyframe-aligned), seeks

Shift+RIGHT no-osd seek 1 exact

Shift+LEFT no-osd seek -1 exact

Shift+UP no-osd seek 5 exact

Shift+DOWN no-osd seek -5 exact

# Seek to previous/next subtitle (subject to some restrictions)

Ctrl+LEFT no-osd sub-seek -1

Ctrl+RIGHT no-osd sub-seek 1

# Seek to previous/next chapter.

Ctrl+UP add chapter 1

Ctrl+DOWN add chapter -1

# Much finer seeking

Alt+LEFT script-binding fast-forward

Alt+RIGHT script-binding fast-rewind

# Seek to the beginning of the previous/next chapter.

PGUP add chapter 1

PGDWN add chapter -1

# Seek to the beginning of the file.

HOME seek 0 absolute

# Seek to the end of the file.

END seek 100 absolute-percent

# Seek to a given percentage.

1 seek 10 absolute-percent

2 seek 20 absolute-percent

3 seek 30 absolute-percent

4 seek 40 absolute-percent

5 seek 50 absolute-percent

6 seek 60 absolute-percent

7 seek 70 absolute-percent

8 seek 80 absolute-percent

9 seek 90 absolute-percent

0 seek 0 absolute


# Volume

/ add volume -2

* add volume 2

9 add volume -2

0 add volume 2

m cycle mute


# Speed

[ multiply speed 0.9091

] multiply speed 1.1

{ multiply speed 0.5

} multiply speed 2.0

BS set speed 1.0


# OSD

# The OSD is visible as long as the player is paused.

# With the following two bindings, you can make the OSD always visible,

# or hide it completely.

# o cycle-values osd-level 3 1

# O show-progress

# The following key bindings are for the OSD.

# They are only active if the OSD is visible.

# OSD_LEFT osd-bar-seek -5

# OSD_RIGHT osd-bar-seek 5

# OSD_HOME osd-bar-seek -100

# OSD_END osd-bar-seek 100

# OSD_SUB_LEFT osd-bar-seek -1

# OSD_SUB_RIGHT osd-bar-seek 1

# OSD_ENTER osd-bar-seek 0 absolute


# Screenshot

s screenshot

S screenshot video

Ctrl+s screenshot window

Alt+s screenshot-to-file sub.png


# Playlist

> playlist-next

< playlist-prev

ENTER playlist-next

# You can also use the following, but they are not bound by default.

# They are useful if you want to have a key for "play next file",

# without having to think about whether it's in a playlist or not.

# They will either go to the next playlist entry, or quit if there is none.

# > playlist-next ; quit

# < playlist-prev ; quit


# Fullscreen

f cycle fullscreen

ESC set fullscreen no

# You can also use the following, but they are not bound by default.

# ESC quit

# This is useful if you want to have a key for "exit fullscreen or quit".

# ESC cycle fullscreen ; quit


# A-B loop

l ab-loop

L cycle-values loop-file "inf" "no"


# Audio

# Cycle through audio tracks

# a cycle audio

# Change audio delay

# Alt++ add audio-delay 0.100

# Alt+- add audio-delay -0.100

# + add audio-delay 0.100

# - add audio-delay -0.100

# You can also use the following, but they are not bound by default.

# They are useful if you want to have a key for "cycle audio tracks",

# without having to think about whether there are any audio tracks.

# a cycle audio ; show-text "No audio tracks"

# You can also use the following, but they are not bound by default.

# They are useful if you want to have a key for "cycle audio tracks",

# and you want to see the track title in the OSD.

# a cycle audio ; show-text "${track-list/${track-id}/title}"


# Subtitles

# Cycle through subtitle tracks

j cycle sub

# Change subtitle delay

# z add sub-delay -0.1

# x add sub-delay +0.1

# You can also use the following, but they are not bound by default.

# They are useful if you want to have a key for "cycle subtitle tracks",

# without having to think about whether there are any subtitle tracks.

# j cycle sub ; show-text "No subtitle tracks"

# You can also use the a/A keys to cycle through audio/subtitle tracks.

# a cycle audio

# A cycle sub

# You can also use the following, but they are not bound by default.

# They are useful if you want to have a key for "cycle subtitle tracks",

# and you want to see the track title in the OSD.

# j cycle sub ; show-text "${track-list/${track-id}/title}"

# You can also use the following, but they are not bound by default.

# They are useful if you want to have a key for "cycle subtitle tracks",

# and you want to see the track title in the OSD, and you want to

# see the track language in the OSD.

# j cycle sub ; show-text "${track-list/${track-id}/title} (${track-list/${track-id}/lang})"

# You can also use the following, but they are not bound by default.

# They are useful if you want to have a key for "cycle subtitle tracks",

# and you want to see the track title in the OSD, and you want to

# see the track language in the OSD, and you want to see the track

# codec in the OSD.

# j cycle sub ; show-text "${track-list/${track-id}/title} (${track-list/${track-id}/lang}) [${track-list/${track-id}/codec}]"


# Video

# Cycle through video tracks

# _ cycle video

# You can also use the following, but they are not bound by default.

# They are useful if you want to have a key for "cycle video tracks",

# without having to think about whether there are any video tracks.

# _ cycle video ; show-text "No video tracks"

# You can also use the following, but they are not bound by default.

# They are useful if you want to have a key for "cycle video tracks",

# and you want to see the track title in the OSD.

# _ cycle video ; show-text "${track-list/${track-id}/title}"


# Quit

q quit

Q quit-watch-later


# Pause

p cycle pause

. frame-step

, frame-back-step

SPACE cycle pause


# Misc

# i show-text "${media-title}"

# I show-text "${filename}"

# P show-progress

# T cycle ontop

# v cycle sub-visibility

# V cycle sub-ass-vsfilter-blur-compat

# r add sub-pos -1

# t add sub-pos +1

# u add sub-scale -0.1

# U add sub-scale +0.1

# DEL script-binding console/enable

# ` script-binding console/enable

# ~ script-binding console/enable

# Alt+v script-binding cycle-dump-video

# Alt+a script-binding cycle-dump-audio

# Alt+s script-binding cycle-dump-sub

# Alt+c script-binding cycle-dump-container

# Alt+x script-binding cycle-dump-format

# Alt+p script-binding cycle-dump-path

# Alt+d script-binding cycle-dump-decoder

# Alt+e script-binding cycle-dump-encoder

# Alt+f script-binding cycle-dump-filter

# Alt+l script-binding cycle-dump-log

# Alt+m script-binding cycle-dump-metadata

# Alt+o script-binding cycle-dump-osd

# Alt+r script-binding cycle-dump-renderer

# Alt+t script-binding cycle-dump-track

# Alt+w script-binding cycle-dump-window

# Alt+z script-binding cycle-dump-zone

# Alt+0 script-binding cycle-dump-all

# Alt+1 script-binding cycle-dump-user

# Alt+2 script-binding cycle-dump-user2

# Alt+3 script-binding cycle-dump-user3

# Alt+4 script-binding cycle-dump-user4

# Alt+5 script-binding cycle-dump-user5

# Alt+6 script-binding cycle-dump-user6

# Alt+7 script-binding cycle-dump-user7

# Alt+8 script-binding cycle-dump-user8

# Alt+9 script-binding cycle-dump-user9

# Ctrl+c quit 4

# Ctrl+z quit 5

# Ctrl+x quit 6

# Ctrl+d quit 7

# Ctrl+h script-binding history

# Ctrl+r script-binding search

# Ctrl+t script-binding top

# Ctrl+w script-binding web

# Ctrl+p script-binding playlist

# Ctrl+f script-binding file

# Ctrl+b script-binding bookmark

# Ctrl+e script-binding edit

# Ctrl+s script-binding save

# Ctrl+o script-binding open

# Ctrl+n script-binding new

# Ctrl+q script-binding quit

# Ctrl+a script-binding about

# Ctrl+l script-binding log

# Ctrl+m script-binding mute

# Ctrl+v script-binding volume

# Ctrl+j script-binding sub

# Ctrl+k script-binding audio

# Ctrl+i script-binding video

# Ctrl+u script-binding url

# Ctrl+y script-binding youtube

# Ctrl+g script-binding search-google

# Ctrl+d script-binding search-duckduckgo

# Ctrl+b script-binding search-bing

# Ctrl+y script-binding search-yandex

# Ctrl+w script-binding search-wikipedia

# Ctrl+a script-binding search-amazon

# Ctrl+e script-binding search-ebay

# Ctrl+i script-binding search-imdb

# Ctrl+r script-binding search-rottentomatoes

# Ctrl+m script-binding search-metacritic

# Ctrl+t script-binding search-themoviedb

# Ctrl+f script-binding search-thetvdb

# Ctrl+s script-binding search-soundcloud

# Ctrl+v script-binding search-vimeo

# Ctrl+d script-binding search-dailymotion

# Ctrl+y script-binding search-youtube

# Ctrl+p script-binding search-pornhub

# Ctrl+x script-binding search-xvideos

# Ctrl+r script-binding search-redtube

# Ctrl+t script-binding search-tube8

# Ctrl+y script-binding search-youporn

# Ctrl+p script-binding search-porntube

# Ctrl+h script-binding search-hentaigasm

# Ctrl+e script-binding search-e-hentai

# Ctrl+x script-binding search-exhentai

# Ctrl+n script-binding search-nhentai

# Ctrl+t script-binding search-tsumino

# Ctrl+p script-binding search-pururin

# Ctrl+f script-binding search-fakku

# Ctrl+s script-binding search-sadpanda

# Ctrl+h script-binding search-hitomi

# Ctrl+a script-binding search-asmr-online

# Ctrl+d script-binding search-doujins

# Ctrl+m script-binding search-mangadex

# Ctrl+b script-binding search-bato

# Ctrl+k script-binding search-kissmanga

# Ctrl+r script-binding search-readmanga

# Ctrl+f script-binding search-fanfox

# Ctrl+m script-binding search-mangahere

# Ctrl+n script-binding search-manganelo

# Ctrl+t script-binding search-mangatown

# Ctrl+o script-binding search-mangapark

# Ctrl+z script-binding search-zingbox

# Ctrl+c script-binding search-comicastle

# Ctrl+v script-binding search-viewcomics

# Ctrl+r script-binding search-readcomiconline

# Ctrl+x script-binding search-xoxocomics

# Ctrl+g script-binding search-getcomics

# Ctrl+w script-binding search-worldofwarcraft

# Ctrl+d script-binding search-diablo

# Ctrl+s script-binding search-starcraft

# Ctrl+h script-binding search-hearthstone

# Ctrl+o script-binding search-overwatch

# Ctrl+f script-binding search-finalfantasy

# Ctrl+d script-binding search-dragonquest

# Ctrl+p script-binding search-pokemon

# Ctrl+m script-binding search-monsterhunter

# Ctrl+z script-binding search-zelda

# Ctrl+s script-binding search-supermario

# Ctrl+k script-binding search-kirby

# Ctrl+d script-binding search-donkeykong

# Ctrl+m script-binding search-metroid

# Ctrl+f script-binding search-fireemblem

# Ctrl+x script-binding search-xenoblade

# Ctrl+p script-binding search-persona

# Ctrl+s script-binding search-shinmegamitensei

# Ctrl+t script-binding search-talesof

# Ctrl+y script-binding search-ys

# Ctrl+k script-binding search-kiseki

# Ctrl+n script-binding search-nier

# Ctrl+d script-binding search-drakengard

# Ctrl+b script-binding search-bayonetta

# Ctrl+d script-binding search-devilmaycry

# Ctrl+r script-binding search-residentevil

# Ctrl+s script-binding search-silenthill

# Ctrl+f script-binding search-fatalframe

# Ctrl+c script-binding search-clocktower

# Ctrl+h script-binding search-hauntingground

# Ctrl+d script-binding search-dino-crisis

# Ctrl+p script-binding search-parasiteeve

# Ctrl+v script-binding search-vagrantstory

# Ctrl+f script-binding search-finalfantasytactics

# Ctrl+o script-binding search-ogrebattle

# Ctrl+t script-binding search-tacticsogre

# Ctrl+d script-binding search-disgaea

# Ctrl+f script-binding search-frontmission

# Ctrl+a script-binding search-armoredcore

# Ctrl+z script-binding search-zoneoftheenders

# Ctrl+g script-binding search-gundam

# Ctrl+m script-binding search-macross

# Ctrl+e script-binding search-evangelion

# Ctrl+c script-binding search-codegeass

# Ctrl+g script-binding search-gurrenlagann

# Ctrl+k script-binding search-killlakill

# Ctrl+o script-binding search-onepunchman

# Ctrl+m script-binding search-myheroacademia

# Ctrl+n script-binding search-naruto

# Ctrl+b script-binding search-bleach

# Ctrl+o script-binding search-onepiece

# Ctrl+d script-binding search-dragonball

# Ctrl+s script-binding search-sailormoon

# Ctrl+c script-binding search-cardcaptorsakura

# Ctrl+m script-binding search-magicaldoremi

# Ctrl+p script-binding search-precure

# Ctrl+i script-binding search-idolmaster

# Ctrl+l script-binding search-lovelive

# Ctrl+b script-binding search-bangdream

# Ctrl+p script-binding search-proseka

# Ctrl+u script-binding search-uma-musume

# Ctrl+t script-binding search-touhou

# Ctrl+k script-binding search-kancolle

# Ctrl+a script-binding search-azurlane

# Ctrl+g script-binding search-girlsfrontline

# Ctrl+p script-binding search-princessconnect

# Ctrl+b script-binding search-granbluefantasy

# Ctrl+f script-binding search-fategrandorder

# Ctrl+c script-binding search-arknights

# Ctrl+g script-binding search-genshinimpact

# Ctrl+h script-binding search-honkaiimpact

# Ctrl+s script-binding search-starrail

# Ctrl+z script-binding search-zenlesszonezero[/code]



1.image 뷰어용도의 단축키 파일 재정의/생성

  CLI 이미지 뷰어의 최강자는 "feh" 입니다.최고로 가볍고 빠릅니다.다만 gif, webp,, 등 ainimation 이미지를 볼수 없습니다.이에 따른 추가 gif view 용도로 mpv를 사용가능합니다.

  키바인딩은 feh 의 키바인딩과 동일하게 맞춰어 주겠습니다.

  일반적으로 mpv "화살표 좌/우" 키는 재생속도입니다. image view 에서 "화살표 좌/우" 키는 prev / next playlist 이미지 전환 용도입니다. 이런 키들은 전부 재정의 해주어야 합니다.

  영상 파일에서는 화살표가 기본 재생 단축키로 동작하고, 이미지 뷰어에서는 이전/다음 이미지 전환으로 동작하도록 설정을 해 주어야 합니다.



(작성중)

댓글 (4)

  • 신사아님당

    신사아님당 Lv.1

    25.07.16 · 125.♡.243.26

    [code=sh]PIC=$(find "$WALLPAPER_DIR" -type f \\( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \\) | shuf -n 1)[/code]
    월페이퍼 쉘스크립터 복붙해 쓸려니까 에러가 나서 gpt에 물어봤더니, 중간에 들어간 소괄호 앞에 \를 넣어줘야 한다고 하네요. 수정했더니 잘 됩니다. 아마 원문에는 있던 역슬래시가 다모앙 에디터에 붙여넣을 때 날아간 것 같습니다. :)

    +
    이런 식으로 스크립트를 만들어 두고 단축키로 연결해서 쓰는거군요. 오호~ {emo:onion-012.gif:50}

    +
    방금도 코드에 \(라고 넣으니 역슬래시가 날아가 버려서 \\( 라고 역슬래시 두 개를 입력했더니 한 개는 살아남았습니다.
    인용이나 코드에 \를 넣으면 날아가는데, 본문에 넣은건 또 안 날라가네요. @_@>

    +
    월페이퍼 표시 명령이 feh --bg-scale 로 되어있는데 사진 비율이 자꾸 깨지더군요. --bg-fill로 바꾸니 사진 일부가 잘리지만 비율은 깨지지 않길래 이걸로 바꿨습니다.
  • JUQ123

    JUQ123 Lv.1 → 신사아님당 작성자

    25.07.16 · 193.♡.16.54

    [혹 이댓글은 삭제의 필요성이 있을 수도 있으니. 이 댓글의 댓댓글은 아니되옵니다. 그냥 게시글의 댓글을 요망합니다]

    와아 틀린거 찾아서 고쳐 쓰시는 군요 저게 chatgpt 인가요? 신사아임당님 덕에 제미니도 처음 경험 해보고, gpt 사용 화면도 처음 봅니다.
    말씀하신대로 본문 게시글에서 "\" 역슬래쉬가 날아 가는 군요.

    왔! 어랏 feh 바탕화면 설정하는 옵션이 예전보다 한개 더 늘었네요 "--bg-max" 바로 제 ranger 설정 파일에 반여했어요.
    $ feh -h
    --bg-center FILE Set FILE as centered desktop background
    --bg-fill FILE Like --bg-scale, but preserves aspect ratio by
    zooming the image until it fits. May cut off
    corners
    --bg-max FILE Like --bg-fill, but scale the image to the maximum
    size that fits the screen with black borders on one
    side
    --bg-scale FILE Set FILE as scaled desktop background. This will
    fill the whole background, but the images' aspect
    ratio may not be preserved
    --bg-tile FILE Set FILE as tiled desktop background
    --no-fehbg Do not write a ~/.fehbg file

    혹시 ranger 쓰시나요? 수동으로 배경화면 지정할려면 ranger 가 가장 빠릅니다.
    1. ~/.config/ranger/rc.conf 파일

    # ===================================================================
    # == Custom Keybinding
    # ===================================================================

    # Reload rc.conf
    map xx chain shell vim -p ~/.config/ranger/rc.conf; eval fm.source(fm.confpath('rc.conf'))
    # Reload scope.sh
    map xs chain shell vim -p ~/.config/ranger/scope.sh; eval fm.source(fm.confpath('scope.sh'))
    # Reload rifle.conf
    map xr chain shell vim ~/.config/ranger/rifle.conf; eval fm.rifle.reload_config()
    # Smart "cw", redefine map cw
    map cw eval fm.execute_console("bulkrename") if fm.thisdir.marked_items else fm.open_console("rename ")

    --> rnager 종료 후 재시작

    2. ranger 실행 : "xr" 단축키 --> "rifle.conf" 파일을 vim 으로 엽니다.
    아래와 같이 수정하고 저장하면 단축키 작동합니다. "xx" "xs" "xr" 단축키는 reload 하므로 ranger 재시작 필요 없어요.jj
    #-------------------------------------------
    # Misc
    #-------------------------------------------
    label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1"
    label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1"
    label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1"
    label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"
    label wallpaper, number 15, mime ^image, has feh, X = feh --bg-max "$1"
    label imagevierer, number 22, mime ^image, has mpv, X = mpv --profile=jjal "$1"

    3. "Wallpaper" 폴더를 북마크 한다. 대소문자 구분합니다.
    "Wallpaper" 폴더로 이동 후, "mw" ---> Marking w
    북마크 실행 : "'w" ---> 작은 따옴표 누룬 뒤 w 키 누르면 바로 Wallpaper 폴더로 이동합니다.


    [수동 배경화면 지정] 3초면 끝납니다.
    터미널서 : ranger 'w [hjkl] 키로 이미지 이동하다가 찾으면 바로 r11
    "ranger " 은 타이핑 7번해야 하잖아요. 사용하는 쉘(bash or zsh)의 keybind 설정에서 ranger 실행 단축키도 지정해서 사용하면 합이 2초 이니더

    - 훌덤에서 세븐 포커면 무적입니다.. 777 잭팟 터졋랍 !!!!
    cde80e8cb6a40d.png]

    질문 1.) 다모앙 게시글이나 댓글에 신사아님당 님의 첫 문자처럼 "소스코드 테이블" 나오게 할려면 어케 해야 하나요?
  • 신사아님당

    신사아님당 Lv.1

    25.07.17 · 125.♡.243.26

    ranger 설정, 말씀하신 대로 따라 하니 잘 됩니다. 감사합니다. :D
    ( 설정파일에 대한 자세한 설명입니다. 혹 저처럼 기본 지식이 없으신 분이 보신다면 참고하세용 )
    https://chatgpt.com/share/6877d7b1-7a08-8002-9407-8ca761f17407

    오호~ 위 아래 바 양쪽 모두 투명이군요. 월페이퍼가 좋으면(?) 약간은 가독성을 희생하더라도 투명도를 높이는 것도 괜찮겠다는 생각이 들었습니다. ( ")>

    [https://damoang.net/data/editor/2507/comment_2108814106_VAPBpCh9_69a0d9c0a1ac41dcbc794b23fc7959e6ca871636.webp]
    코드 버튼을 누르면 창 하나가 아래서 올라오는데, 윗쪽 코드 종류 입력하라는 곳에는 아무거나 넣어도 되는 것 같습니다. 저는 sh라고 넣었습니다. 아래 칸에 코드를 입력하고 [코드 생성] 버튼을 누르면 됩니당.
  • JUQ123

    JUQ123 Lv.1 → 신사아님당 작성자

    25.07.18 · 154.♡.23.51

    [ 작성중.. 댓댓글 아니되옵니다]
    와아 Chatgpt 대단한데요. 링크 읽어 봣습니다. 설명되 자세하고, 제가 사용하고 있는 방법 유추해서 그대로 적어주네요. 신기 방기..

    위. gpt 마지막 부분에 언급된... custom [Profile]과, image-input(이미지 뷰어용 키맵 재설정), mpv + lua 와 연동 가장 빠르게 바탕화면을 지정하는 법입니다.
    (중략) 내용 길어줘서 이건 낸중에 본문으로 고고.

    1. mpv 이미지/짤 전용 profile 설정

    2. mpv 이미지 뷰어용도로 image-input.conf 파일 새로 생성/정의
    (1. 2. 본문 하단 참조.. 작성중 낸중에 추가욤. )

    3. 영상(유투브/tv/로컬 영상파일)의 현재 재생중인 프레임을 바로 바탕화면으로 지정하는 lua 설정
    --- $HOME/.config/mpv/scripts/set-wallpaper.lua
    [code=lua]--[[
    mpv에서 'b'를 누르면 현재 프레임을 feh를 이용해 바탕화면으로 설정합니다.
    HTTP 스트림을 포함한 모든 영상, 이미지에서 작동합니다.

    요구사항:
    - feh: 이 스크립트가 작동하려면 시스템에 'feh'가 설치되어 있어야 합니다.
    ]]

    function set_wallpaper()
    -- 1. 스크린샷을 저장할 고정된 임시 파일 경로를 지정합니다.
    local screenshot_path = "/tmp/mpv_wallpaper.png"

    -- 2. 지정된 경로에 현재 영상 프레임을 스크린샷으로 저장합니다.
    -- 'video' 옵션은 OSD나 자막 없이 순수한 영상 프레임만 캡처합니다.
    mp.commandv("screenshot-to-file", screenshot_path, "video")

    -- 3. feh 명령어를 실행하여 바탕화면을 설정합니다.
    -- '--bg-scale' 옵션은 이미지를 화면에 맞게 확대/축소하여 채웁니다.
    local command = "feh --bg-scale \"" .. screenshot_path .. "\""
    os.execute(command)

    -- 4. 사용자에게 작업 완료를 알리는 메시지를 화면에 표시합니다.
    mp.osd_message("Wallpaper set!")
    end

    -- 'b' 키에 위에서 정의한 set_wallpaper 함수를 바인딩합니다.
    mp.add_key_binding("b", "set_wallpaper", set_wallpaper)[/code]

    3-1. 유투브를 보다가 "mpv 터미널" 도는 "mpv 재생화면" 에서 단축키 "b" 키를 누르면, 해당 프레임이 바탕화면으로 지정된다.
    ( $ feh --bg-scale "이미지파일" : 해당 명령어는 바탕화면을 지정하면서, "이미지파일 경로" 명을 담고 있는 $HOME/.fehbg 파일을 생성한다. 단축키"Mod4 + Shift + `" 키에 "$HOME/.fehbg" 커맨드를 등록하거나. [hsetroot -solid 솔리드컬러 | $HOME/.fehbg] 토글하는 스크립트를 해당 단축키로 등록한다.
    [https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7iz7GEW0SFfpJbWy76mBmvEEIKDA6y9iWV2doyazkflpnDgeTOZp_ytsVDX6Hp6pHXIKcYk1z4rOZOCjS0APxqWqjsdXibeKUWzSBmYGAo0rErxHR5Xnwn_SOIw4zxfA89lR60zX18o4VPpVTfFjz_2xdldhq_wNKpzYB39bxNk3JikQpKUc4MRL0uZjp/s16000/xmonad_custom_01.png]

    3-2. ~/.zshrc
    [code=bash]alias mw='mpv --profile=jjal $HOME/Wallpapers/ --script=~/.config/mpv/scripts/set-wallpaper.lua'[/code]
    A. 터미널서 : $ mw
    B. mpv 로 이미지 하나 뜨면 : 'g' 키
    gallery-view.lua: https://github.com/occivink/mpv-gallery-view?tab=readme-ov-file
    가. 위 폴더 구조 그대로 $HOME/.config/mpv 폴더에 복사/붙여넣기 하고
    나. $HOME/.config/mpv/input.conf 파일에 아래 라인 추가해서 사용
    [code=bash]g script-message contact-sheet-close; script-message playlist-view-toggle
    ctrl+alt+c script-message playlist-view-close; script-message contact-sheet-toggle[/code]
    C. 화살표키나 'hjlk' 키로 이동하다가.. 선택= 키, ---> 플레이 리스트 이동
    D. 'b' 키 : 현재 프레임(이미지 하나짜리)을 mpu lua 스크립트를 통해 바탕화면으로 지정
    ----> 이 방법이 바탕화면 지정하기에 젤 빠른거 같아요. mpv cpu/memory도 적게 먹고 속도도 빠르고요
    [https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrIC_y5RGuY4IVohqu6vjyxD6hKq4LS-2utdsYdpr_UJBUcCrhu25WwGp_yWqPhmYbvPkrY-HtuBB9jJ8SOxKyeRbJRnnZnha-dG-INv31cW02yUnj9NPKOpNjoTrDB6q-QwN7B-43Q9dkErlsSFxl7p20Bo6H-2KHVLea5_JF1xRPeR1uuYBu6_0wIWLP/s16000/xmonad_custom_02.png]

댓글을 작성하려면 이 필요합니다.