This commit is contained in:
2025-10-13 02:20:40 +02:00
parent 8b2cb792ff
commit 6c46193cf2
7 changed files with 52 additions and 30 deletions

5
.scripts/rofi-cliphist Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
cliphist list | rofi -dmenu -config ~/.config/rofi/dmenu.rasi -display-columns 2 -i | \
cliphist decode | wl-copy

View File

@@ -273,7 +273,7 @@ binds {
Mod+E { spawn "dolphin"; } Mod+E { spawn "dolphin"; }
Mod+W { spawn "zen"; } Mod+W { spawn "zen"; }
Mod+X { spawn "gnome-text-editor" "--new-window"; } Mod+X { spawn "gnome-text-editor" "--new-window"; }
Mod+B { spawn-sh "killall btop || ghostty -e btop"; } Mod+B { spawn-sh "pkill -x -n btop || ghostty -e btop"; }
Mod+T { spawn "kitty"; } Mod+T { spawn "kitty"; }
Mod+Return { spawn "kitty"; } Mod+Return { spawn "kitty"; }
Mod+Shift+T { spawn "ghostty"; } Mod+Shift+T { spawn "ghostty"; }
@@ -285,17 +285,17 @@ binds {
Mod+Shift+L { spawn-sh "qs ipc call lyrics toggleBarLyrics"; } Mod+Shift+L { spawn-sh "qs ipc call lyrics toggleBarLyrics"; }
// Quickshell // Quickshell
Mod+Shift+K { spawn-sh "pkill quickshell || quickshell"; } Mod+Shift+K { spawn-sh "pkill -x quickshell || quickshell"; }
Mod+I { spawn-sh "qs ipc call idleInhibitor toggleInhibitor"; } Mod+I { spawn-sh "qs ipc call idleInhibitor toggleInhibitor"; }
// Rofi // Rofi
Mod+D { spawn-sh "pkill rofi || rofi -show run"; } Mod+D { spawn-sh "pkill -x rofi || rofi -show run"; }
Alt+Space { spawn-sh "pkill rofi || rofi -show drun"; } Alt+Space { spawn-sh "pkill -x rofi || rofi -show drun"; }
// Actions // Actions
Mod+V { spawn-sh "pkill rofi || cliphist list | rofi -dmenu -config ~/.config/rofi/dmenu.rasi -display-columns 2 -i | cliphist decode | wl-copy"; } Mod+V { spawn-sh "pkill -x rofi || rofi-cliphist"; }
Mod+Period { spawn-sh "pkill rofi || rofi-emoji"; } Mod+Period { spawn-sh "pkill -x rofi || rofi-emoji"; }
Ctrl+Alt+Delete { spawn-sh "pkill wlogout || wlogout -p layer-shell"; } Ctrl+Alt+Delete { spawn-sh "pkill -x wlogout || wlogout -p layer-shell"; }
Print { spawn-sh "screenshot full"; } Print { spawn-sh "screenshot full"; }
Mod+Shift+S { spawn-sh "screenshot area"; } Mod+Shift+S { spawn-sh "screenshot area"; }
Mod+Ctrl+Shift+S { spawn-sh "screenshot window"; } Mod+Ctrl+Shift+S { spawn-sh "screenshot window"; }

View File

@@ -273,7 +273,7 @@ binds {
Mod+E { spawn "dolphin"; } Mod+E { spawn "dolphin"; }
Mod+W { spawn "zen"; } Mod+W { spawn "zen"; }
Mod+X { spawn "gnome-text-editor" "--new-window"; } Mod+X { spawn "gnome-text-editor" "--new-window"; }
Mod+B { spawn-sh "killall btop || ghostty -e btop"; } Mod+B { spawn-sh "pkill -x -n btop || ghostty -e btop"; }
Mod+T { spawn "kitty"; } Mod+T { spawn "kitty"; }
Mod+Return { spawn "kitty"; } Mod+Return { spawn "kitty"; }
Mod+Shift+T { spawn "ghostty"; } Mod+Shift+T { spawn "ghostty"; }
@@ -285,17 +285,17 @@ binds {
Mod+Shift+L { spawn-sh "qs ipc call lyrics toggleBarLyrics"; } Mod+Shift+L { spawn-sh "qs ipc call lyrics toggleBarLyrics"; }
// Quickshell // Quickshell
Mod+Shift+K { spawn-sh "pkill quickshell || quickshell"; } Mod+Shift+K { spawn-sh "pkill -x quickshell || quickshell"; }
Mod+I { spawn-sh "qs ipc call idleInhibitor toggleInhibitor"; } Mod+I { spawn-sh "qs ipc call idleInhibitor toggleInhibitor"; }
// Rofi // Rofi
Mod+D { spawn-sh "pkill rofi || rofi -show run"; } Mod+D { spawn-sh "pkill -x rofi || rofi -show run"; }
Alt+Space { spawn-sh "pkill rofi || rofi -show drun"; } Alt+Space { spawn-sh "pkill -x rofi || rofi -show drun"; }
// Actions // Actions
Mod+V { spawn-sh "pkill rofi || cliphist list | rofi -dmenu -config ~/.config/rofi/dmenu.rasi -display-columns 2 -i | cliphist decode | wl-copy"; } Mod+V { spawn-sh "pkill -x rofi || rofi-cliphist"; }
Mod+Period { spawn-sh "pkill rofi || rofi-emoji"; } Mod+Period { spawn-sh "pkill -x rofi || rofi-emoji"; }
Ctrl+Alt+Delete { spawn-sh "pkill wlogout || wlogout -p layer-shell"; } Ctrl+Alt+Delete { spawn-sh "pkill -x wlogout || wlogout -p layer-shell"; }
Print { spawn-sh "screenshot full"; } Print { spawn-sh "screenshot full"; }
Mod+Shift+S { spawn-sh "screenshot area"; } Mod+Shift+S { spawn-sh "screenshot area"; }
Mod+Ctrl+Shift+S { spawn-sh "screenshot window"; } Mod+Ctrl+Shift+S { spawn-sh "screenshot window"; }

View File

@@ -1,4 +1,4 @@
# some sensitive files
Location.json Location.json
GeoInfoToken.txt GeoInfoToken.txt
IpCache.json

View File

@@ -54,7 +54,7 @@ Singleton {
property int animationFast: 150 property int animationFast: 150
property int animationNormal: 300 property int animationNormal: 300
property int animationSlow: 450 property int animationSlow: 450
property int animationSlowest: 750 property int animationSlowest: 1000
// Delays // Delays
property int tooltipDelay: 300 property int tooltipDelay: 300
property int tooltipDelayLong: 1200 property int tooltipDelayLong: 1200

View File

@@ -54,7 +54,7 @@ Scope {
Behavior on color { Behavior on color {
ColorAnimation { ColorAnimation {
duration: 1000 duration: Style.animationSlowest
easing.type: Easing.InOutCubic easing.type: Easing.InOutCubic
} }
@@ -68,7 +68,7 @@ Scope {
Behavior on color { Behavior on color {
ColorAnimation { ColorAnimation {
duration: 1000 duration: Style.animationSlowest
easing.type: Easing.InOutCubic easing.type: Easing.InOutCubic
} }
@@ -234,14 +234,6 @@ Scope {
Caffeine.manualToggle(); Caffeine.manualToggle();
} }
Behavior on buttonColor {
ColorAnimation {
duration: 500
easing.type: Easing.InOutCubic
}
}
} }
SymbolButton { SymbolButton {

View File

@@ -5,7 +5,7 @@ import qs.Utils
pragma Singleton pragma Singleton
Singleton { Singleton {
property string ip: "N/A" property alias ip: cacheFileAdapter.ip
property string countryCode: "N/A" property string countryCode: "N/A"
property real fetchInterval: 30 // in s property real fetchInterval: 30 // in s
property real fetchTimeout: 10 // in s property real fetchTimeout: 10 // in s
@@ -66,7 +66,7 @@ Singleton {
if (xhr.status === 200) { if (xhr.status === 200) {
try { try {
const response = JSON.parse(xhr.responseText); const response = JSON.parse(xhr.responseText);
if (response && response.country) { if (response && response.country_code) {
let newCountryCode = response.country_code; let newCountryCode = response.country_code;
Logger.log("IpService", "Fetched country code: " + newCountryCode); Logger.log("IpService", "Fetched country code: " + newCountryCode);
if (newCountryCode !== countryCode) { if (newCountryCode !== countryCode) {
@@ -77,6 +77,9 @@ Singleton {
countryCode = "N/A"; countryCode = "N/A";
Logger.error("IpService", "Geo response does not contain 'country' field"); Logger.error("IpService", "Geo response does not contain 'country' field");
} }
cacheFileAdapter.ip = ip;
cacheFileAdapter.geoInfo = response;
cacheFile.writeAdapter();
} catch (e) { } catch (e) {
countryCode = "N/A"; countryCode = "N/A";
Logger.error("IpService", "Failed to parse geo response: " + e); Logger.error("IpService", "Failed to parse geo response: " + e);
@@ -123,6 +126,28 @@ Singleton {
} }
} }
FileView {
id: cacheFile
path: Qt.resolvedUrl("../Assets/Config/IpCache.json")
watchChanges: false
onLoaded: {
Logger.log("IpService", "Loaded IP from cache file: " + cacheFileAdapter.ip);
if (cacheFileAdapter.geoInfo) {
countryCode = cacheFileAdapter.geoInfo.country_code || cacheFileAdapter.country || "N/A";
Logger.log("IpService", "Loaded country code from cache file: " + countryCode);
}
}
JsonAdapter {
id: cacheFileAdapter
property string ip: "N/A"
property var geoInfo: null
}
}
Timer { Timer {
id: fetchTimer id: fetchTimer