minor
This commit is contained in:
5
.scripts/rofi-cliphist
Executable file
5
.scripts/rofi-cliphist
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
cliphist list | rofi -dmenu -config ~/.config/rofi/dmenu.rasi -display-columns 2 -i | \
|
||||
cliphist decode | wl-copy
|
||||
@@ -273,7 +273,7 @@ binds {
|
||||
Mod+E { spawn "dolphin"; }
|
||||
Mod+W { spawn "zen"; }
|
||||
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+Return { spawn "kitty"; }
|
||||
Mod+Shift+T { spawn "ghostty"; }
|
||||
@@ -285,17 +285,17 @@ binds {
|
||||
Mod+Shift+L { spawn-sh "qs ipc call lyrics toggleBarLyrics"; }
|
||||
|
||||
// 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"; }
|
||||
|
||||
// Rofi
|
||||
Mod+D { spawn-sh "pkill rofi || rofi -show run"; }
|
||||
Alt+Space { spawn-sh "pkill rofi || rofi -show drun"; }
|
||||
Mod+D { spawn-sh "pkill -x rofi || rofi -show run"; }
|
||||
Alt+Space { spawn-sh "pkill -x rofi || rofi -show drun"; }
|
||||
|
||||
// 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+Period { spawn-sh "pkill rofi || rofi-emoji"; }
|
||||
Ctrl+Alt+Delete { spawn-sh "pkill wlogout || wlogout -p layer-shell"; }
|
||||
Mod+V { spawn-sh "pkill -x rofi || rofi-cliphist"; }
|
||||
Mod+Period { spawn-sh "pkill -x rofi || rofi-emoji"; }
|
||||
Ctrl+Alt+Delete { spawn-sh "pkill -x wlogout || wlogout -p layer-shell"; }
|
||||
Print { spawn-sh "screenshot full"; }
|
||||
Mod+Shift+S { spawn-sh "screenshot area"; }
|
||||
Mod+Ctrl+Shift+S { spawn-sh "screenshot window"; }
|
||||
|
||||
@@ -273,7 +273,7 @@ binds {
|
||||
Mod+E { spawn "dolphin"; }
|
||||
Mod+W { spawn "zen"; }
|
||||
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+Return { spawn "kitty"; }
|
||||
Mod+Shift+T { spawn "ghostty"; }
|
||||
@@ -285,17 +285,17 @@ binds {
|
||||
Mod+Shift+L { spawn-sh "qs ipc call lyrics toggleBarLyrics"; }
|
||||
|
||||
// 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"; }
|
||||
|
||||
// Rofi
|
||||
Mod+D { spawn-sh "pkill rofi || rofi -show run"; }
|
||||
Alt+Space { spawn-sh "pkill rofi || rofi -show drun"; }
|
||||
Mod+D { spawn-sh "pkill -x rofi || rofi -show run"; }
|
||||
Alt+Space { spawn-sh "pkill -x rofi || rofi -show drun"; }
|
||||
|
||||
// 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+Period { spawn-sh "pkill rofi || rofi-emoji"; }
|
||||
Ctrl+Alt+Delete { spawn-sh "pkill wlogout || wlogout -p layer-shell"; }
|
||||
Mod+V { spawn-sh "pkill -x rofi || rofi-cliphist"; }
|
||||
Mod+Period { spawn-sh "pkill -x rofi || rofi-emoji"; }
|
||||
Ctrl+Alt+Delete { spawn-sh "pkill -x wlogout || wlogout -p layer-shell"; }
|
||||
Print { spawn-sh "screenshot full"; }
|
||||
Mod+Shift+S { spawn-sh "screenshot area"; }
|
||||
Mod+Ctrl+Shift+S { spawn-sh "screenshot window"; }
|
||||
|
||||
4
quickshell/Assets/Config/.gitignore
vendored
4
quickshell/Assets/Config/.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
|
||||
# some sensitive files
|
||||
Location.json
|
||||
|
||||
GeoInfoToken.txt
|
||||
IpCache.json
|
||||
@@ -54,7 +54,7 @@ Singleton {
|
||||
property int animationFast: 150
|
||||
property int animationNormal: 300
|
||||
property int animationSlow: 450
|
||||
property int animationSlowest: 750
|
||||
property int animationSlowest: 1000
|
||||
// Delays
|
||||
property int tooltipDelay: 300
|
||||
property int tooltipDelayLong: 1200
|
||||
|
||||
@@ -54,7 +54,7 @@ Scope {
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 1000
|
||||
duration: Style.animationSlowest
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ Scope {
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 1000
|
||||
duration: Style.animationSlowest
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
|
||||
@@ -234,14 +234,6 @@ Scope {
|
||||
Caffeine.manualToggle();
|
||||
}
|
||||
|
||||
Behavior on buttonColor {
|
||||
ColorAnimation {
|
||||
duration: 500
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SymbolButton {
|
||||
|
||||
@@ -5,7 +5,7 @@ import qs.Utils
|
||||
pragma Singleton
|
||||
|
||||
Singleton {
|
||||
property string ip: "N/A"
|
||||
property alias ip: cacheFileAdapter.ip
|
||||
property string countryCode: "N/A"
|
||||
property real fetchInterval: 30 // in s
|
||||
property real fetchTimeout: 10 // in s
|
||||
@@ -66,7 +66,7 @@ Singleton {
|
||||
if (xhr.status === 200) {
|
||||
try {
|
||||
const response = JSON.parse(xhr.responseText);
|
||||
if (response && response.country) {
|
||||
if (response && response.country_code) {
|
||||
let newCountryCode = response.country_code;
|
||||
Logger.log("IpService", "Fetched country code: " + newCountryCode);
|
||||
if (newCountryCode !== countryCode) {
|
||||
@@ -77,6 +77,9 @@ Singleton {
|
||||
countryCode = "N/A";
|
||||
Logger.error("IpService", "Geo response does not contain 'country' field");
|
||||
}
|
||||
cacheFileAdapter.ip = ip;
|
||||
cacheFileAdapter.geoInfo = response;
|
||||
cacheFile.writeAdapter();
|
||||
} catch (e) {
|
||||
countryCode = "N/A";
|
||||
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 {
|
||||
id: fetchTimer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user