Compare commits

..
4 Commits
4 changed files with 51 additions and 5 deletions

No files matched your search

+28
View File
@@ -14,6 +14,34 @@ compact = false
show_icons = true show_icons = true
sort_by_usage = true sort_by_usage = true
[[shell.session.actions]]
action = "lock"
shortcut = "1"
[[shell.session.actions]]
action = "logout"
shortcut = "2"
[[shell.session.actions]]
action = "lock_and_suspend"
shortcut = "3"
[[shell.session.actions]]
action = "command"
label = "Hibernate"
glyph = "moon-off"
command = "systemctl hibernate"
shortcut = "4"
[[shell.session.actions]]
action = "reboot"
shortcut = "5"
[[shell.session.actions]]
action = "shutdown"
shortcut = "6"
variant = "destructive"
[shell.launcher.providers.session] [shell.launcher.providers.session]
global = true global = true
+15
View File
@@ -30,6 +30,21 @@ alias dl-yt="bash $HOME/.local/scripts/yt-dlp/download.sh"
alias compress-video="bash $HOME/.local/scripts/ffmpeg/compress-video.sh" alias compress-video="bash $HOME/.local/scripts/ffmpeg/compress-video.sh"
alias convert-gif="bash $HOME/.local/scripts/ffmpeg/convert-gif-to-mp4.sh" alias convert-gif="bash $HOME/.local/scripts/ffmpeg/convert-gif-to-mp4.sh"
# chezetc fix for root shell
chezetc() {
if [[ $1 == cd ]]; then
local dir
if [[ -z $2 ]]; then
dir=${HOME}/.local/share/chezetc
else
dir=$(command chezetc source-path "$2") || return
fi
cd -- "$dir" || return
return
fi
command chezetc "$@"
}
# lazy # lazy
lg() { lg() {
lazygit "$@" lazygit "$@"
@@ -1,7 +1,6 @@
#!/bin/sh #!/bin/sh
set -eu set -eu
APP_NAME="discord-canary"
KEY="${1:-${KEY:-}}" KEY="${1:-${KEY:-}}"
if [ -z "$KEY" ]; then if [ -z "$KEY" ]; then
@@ -13,11 +12,15 @@ fi
PREV_FOCUS=$(niri msg -j focused-window | jq -r '.id // empty') PREV_FOCUS=$(niri msg -j focused-window | jq -r '.id // empty')
WINS=$(niri msg -j windows) WINS=$(niri msg -j windows)
WSS=$(niri msg -j workspaces) WSS=$(niri msg -j workspaces)
DISCORD_ID=$(printf '%s' "$WINS" | jq -r --arg a "$APP_NAME" \ DISCORD_ID=$(printf '%s' "$WINS" | jq -r --arg focus "$PREV_FOCUS" '
'.[] | select(.app_id == $a) | .id' | head -n1) [ .[] | select(.app_id == "discord" or .app_id == "discord-canary") ]
| (map(select(.id == ($focus | tonumber? // -1))) | .[0].id) //
(map(select(.app_id == "discord-canary")) | .[0].id) //
(.[0].id // empty)
')
if [ -z "$DISCORD_ID" ]; then if [ -z "$DISCORD_ID" ]; then
notify-send "Discord not found" "Could not find $APP_NAME window" notify-send "Discord not found" "No discord or discord-canary window"
exit 1 exit 1
fi fi
+1 -1
View File
@@ -3,7 +3,7 @@ Name=Discord
StartupWMClass=discord StartupWMClass=discord
Comment=All-in-one voice and text chat for gamers that's free, secure, and works on both your desktop and phone. Comment=All-in-one voice and text chat for gamers that's free, secure, and works on both your desktop and phone.
GenericName=Internet Messenger GenericName=Internet Messenger
Exec=/usr/bin/discord --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto --url -- %u Exec=env LIBVA_DRIVER_NAME=nvidia NVD_BACKEND=direct /usr/bin/discord --ignore-gpu-blocklist --use-gl=angle --use-angle=gl --enable-features=WaylandWindowDecorations,AcceleratedVideoDecodeLinuxGL,VaapiOnNvidiaGPUs --ozone-platform-hint=auto --url -- %u
Icon=discord Icon=discord
Type=Application Type=Application
Categories=Network;InstantMessaging; Categories=Network;InstantMessaging;