터미널에서 바탕화면 배경화면 변경

터미널에서 바탕화면 배경화면 변경

저는 Mint 13과 Cinnamon 1.6을 실행하고 있습니다. 시간에 따라 데스크탑 배경화면이 자동으로 변경되도록 하고 싶습니다. 그래서 제가 처음 생각한 것은 이 작업을 수행할 크론 작업을 설정하는 것이었습니다. 문제는 스크립트/터미널에서 배경 화면을 변경하는 방법을 모른다는 것입니다.

내가 알고 싶은 것은:
1) 터미널에서 배경을 변경하는 방법은 무엇입니까?
2) 이를 수행하는 기본 제공 방법이 이미 있습니까?

답변1

이것이 질문에 대한 정답입니다. 다른 건 그냥 해킹일 뿐이야

 gsettings set org.cinnamon.desktop.background picture-uri  "file:///filename"

답변2

Linux Mint 16(다른 버전은 확실하지 않음)을 사용하면 gsettings두 가지를 모두 사용할 수 있습니다얻다현재 배경 화면에 대한 정보 및놓다그것.

man gsettings약간 얇기는 하지만 TAB 완성은 다음 명령의 대부분 단계에서 작동합니다.

정보 얻기:

gsettings get org.cinnamon.desktop.background picture-uri
gsettings get org.cinnamon.desktop.background picture-opacity
gsettings get org.cinnamon.desktop.background picture-options

옵션을 변경하려면 "get"을 "set"으로 변경하고 끝에 새 값을 추가하면 됩니다.

다음은 알려진 배경화면 목록을 반복하는 빠른 스크립트입니다.

#!/bin/sh
#
# Set the wallpaper from a list
#
# The list, all can be found in $BASE
BASE="file:///home/tigger/.wallpapers/"
LIST="shot1.png another.png just_no_space_in_name.png keep_adding.png"

# The current wallpaper
current=`gsettings get org.cinnamon.desktop.background picture-uri`
opacity=`gsettings get org.cinnamon.desktop.background picture-opacity`
options=`gsettings get org.cinnamon.desktop.background picture-options`

# loop over the list until we find a match
matched=0
new=""
for wp in $LIST
do
    if [ $matched -eq 1 ]
    then
        new="${BASE}${wp}"
        break
    elif [ "'${BASE}${wp}'" = "${current}" ]
    then
        matched=1
    fi
done

# if "$new" is blank, then we show the first shot
if [ "$new" = "" ]
then
    new=${BASE}${LIST%% *}
fi

# set the wallpaper
gsettings set org.cinnamon.desktop.background picture-uri \'${new}\'
gsettings set org.cinnamon.desktop.background picture-opacity ${opacity}
gsettings set org.cinnamon.desktop.background picture-options ${options}

답변3

x 윈도우 시스템에 관한 한, 루트 윈도우의 배경을 변경하고 싶습니다. 이 창의 설정을 변경하기 위한 "내장" 도구는 입니다 xsetroot. 불행히도 약간 구식입니다. 예를 들어 배경 이미지에 대한 비트맵 선택만 지원합니다.

hsetroot이에 비해 나는 이 도구를 선호합니다 xsetroot. 두 도구 모두 명령줄에서 사용해야 합니다.

또한 x 리소스 데이터베이스를 통해 루트 창의 설정을 조정할 수 있다고 상상할 수 있지만 지금은 해당 정보를 찾을 수 없습니다.

답변4

이 시도:

xsetbg /path/to/wallpaper.jpg

관련 정보