Skip to content

Commit c73fc81

Browse files
committed
Add KDE fixes
1 parent 2693b04 commit c73fc81

File tree

4 files changed

+43
-7
lines changed

4 files changed

+43
-7
lines changed

startup/suspend/agx-resume-user.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env sh
2+
set -eu
3+
4+
# This does not seem to fix the Plasma crash on Kubuntu 24.10
5+
if pgrep -x "plasmashell" > /dev/null; then
6+
sleep 1
7+
killall plasmashell -9
8+
sleep 1
9+
kstart plasmashell
10+
fi
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
5+
CONF_DIR="/usr/lib/systemd/system-sleep"
6+
7+
if [ "${EUID}" -ne 0 ]; then
8+
echo "This script should be run as root."
9+
exit 1
10+
fi
11+
12+
if ! [ -d "${CONF_DIR}" ]; then
13+
echo "Config directory \"${CONF_DIR}\" was not found."
14+
fi
15+
16+
echo "Enabling agx-suspend script."
17+
cp "${SCRIPT_DIR}/agx-suspend-enabler.sh" "${CONF_DIR}"
18+
chmod 755 "${CONF_DIR}/agx-suspend-enabler.sh"
19+
echo "agx-suspend script enabled."

startup/suspend/agx-suspend.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
USERNAME="$(id -nu 1000)"
5+
# After resume
6+
if [[ "${1}" == "post" ]]; then
7+
sudo -u "${USERNAME}" -i "/home/${USERNAME}/Git/linux-scripts/startup/suspend/agx-resume-user.sh"
8+
fi

zsh/custom/utils.zsh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@ findit() {
5151
fi
5252
}
5353

54-
# This does not work, since zsh functions are not available in the KDE Alt+F2 prompt
55-
# fix-kde() {
56-
# killall plasmashell
57-
# sleep 1
58-
# kstart plasmashell
59-
# }
54+
fix-kde() {
55+
killall plasmashell -9
56+
sleep 1
57+
kstart plasmashell
58+
}
6059

6160
pdfsearch() {
6261
# https://stackoverflow.com/questions/4643438/how-to-search-contents-of-multiple-pdf-files
@@ -246,7 +245,7 @@ alias eti="grep -rnI -B 1 -A 1"
246245

247246
# Scan wifi networks. This also refreshes the wifi-list, so if device was not connected,
248247
# it makes auto-connection quicker
249-
alias fixwifi="sudo iwlist scan | grep 'Cell\|ESSID:\|Quality='"
248+
alias fix-wifi="sudo iwlist scan | grep 'Cell\|ESSID:\|Quality='"
250249

251250
# shellcheck disable=SC2139
252251
alias modem="sudo ${HOME}/Git/linux-scripts/modem.py"

0 commit comments

Comments
 (0)