elsa in mac

mac:Fedora-Asahi Remix, Hyperland + KDE plasmashell을 함께 사용하기 본문

Mac(OS X)/Asahi Linux

mac:Fedora-Asahi Remix, Hyperland + KDE plasmashell을 함께 사용하기

elsa in mac 2024. 5. 1. 20:28

이번 포스트에서는 Hyprland 에서 KDE의 plasmashell을 함께 사용하는 방법을 간단히 알아 봅니다.  이 방법은 KDE DE가 설치되어 있는 시스템에서 Hyprland를 추가적으로 설치하여 사용 중인 사용자에게만 국한된 방법 입니다. 

우선, 아래는 결과물입니다. 

KDE DE(Desktop Environment)는 Kwin Window Manager를 사용하고 있고, Hyprland는 Window Manager일뿐 DE를 갖고 있지는 않습니다.  그래서 이 방법은 Hyprland로 login을 한 상태에서 plasmashell을 실행 시켜, DE를 사용할 수 있도록 하는 방법 입니다. 

이 방법의 장점은 KDE의 widget과 dekstop icon, wllpaper engine을 사용할 수 있는 반면, 기존 Hyprland 환경에서 보다 많은 RAM(1GB 정도)를 소모한다는 단점이 발생합니다. 

사용방법은 간단합니다. 

Hyprland로 로그인 후, 터미널에서 kstart plasmashell 을 실행시키면 됩니다. 반대로 실행된 plasmashell 환경을 종료 할 경우에는 kquitapp6 plasmashell 을 실행 시키면 됩니다. 

# plasmashell 실행
kstart plasmashell

# plasmashell 종료
kquitapp6 plasmashell

간단히 스크립트를 작성하고, Hyprland의 bind 기능으로 plasmashell을 켤 경우, waybar나 swww등을 종료 시키고, 반대로 plasmashell을 종료 할 경우는 swww와 waybar를 실행시키도록 하면 괜찮을 것 같습니다. 

#!/bin/bash

#---------------------------
# toggle-plasmashell.sh
#---------------------------

lock_file="/tmp/plasmashell.lock"

# Check if the lock file exists
if [ ! -f "$lock_file" ]; then
    # plasmashell 이 실행되지 않음
    # swww 종료.
    pids=$(ps aux | grep 'swww' | grep -v grep | awk '{print $2}' | tr '\n' ' ')
    if [ -n "$pids" ]; then
        kill $pids
    fi

    # waybar 종료
    pids=$(ps aux | grep 'waybar' | grep -v grep | awk '{print $2}' | tr '\n' ' ')
    if [ -n "$pids" ]; then
        kill $pids
    fi

    # plasmashell 실행
    kstart plasmashell

	# lock 파일 생성.
    touch "$lock_file"
else
    # /tmp/plasmashell.lock 파일을 삭제.
    rm -Rf "$lock_file"
    
    # waybar, swww, desktop_wdiget을 각각 실행.
    waybar &
    swww query || swww init &

    # plasmashell을 종료 시킨다.
    kquitapp6 plasmashell

	# kill process 
    pids=$(ps aux | grep 'plasma' | grep -v grep | awk '{print $2}' | tr '\n' ' ')
    if [ -n "$pids" ]; then
        kill $pids
    fi
fi

한가지, KDE widget이나 Panel 의 Font 섹상이 어둡게 보이는 경우에는 Hyprland의 environment 설정에서 아래와 같이 kde로 설정을 해 주면 개선이 됩니다. 

env = QT_QPA_PLATFORMTHEME,kde
공유하기 링크
Comments