From 62d1d91792fe258147dbd9454fd19722aef10ea6 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Thu, 16 May 2024 12:14:24 +0900 Subject: updated prinscr + 10 secs timer. It is now super CTRL SHIFT PrintScr --- config/hypr/scripts/KeyHints.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/KeyHints.sh b/config/hypr/scripts/KeyHints.sh index d6dd4049..a6d13aa4 100755 --- a/config/hypr/scripts/KeyHints.sh +++ b/config/hypr/scripts/KeyHints.sh @@ -58,6 +58,8 @@ yad --width=$dynamic_width --height=$dynamic_height \ " Print" "screenshot" "(grim)" \ " Shift Print" "screenshot region" "(grim + slurp)" \ " Shift S" "screenshot region" "(swappy)" \ +" CTRL Print" "screenshot timer 5 secs " "(grim)" \ +" CTRL SHIFT Print" "screenshot timer 10 secs " "(grim)" \ "ALT Print" "Screenshot active window" "active window only" \ "CTRL ALT P" "power-menu" "(wlogout)" \ "CTRL ALT L" "screen lock" "(hyprlock)" \ -- cgit v1.2.3 From e66c4e6047da7d2b5edaad31439bceb6c4000cbc Mon Sep 17 00:00:00 2001 From: GrafMonteCarlo <53829166+vailrahmatulin@users.noreply.github.com> Date: Tue, 21 May 2024 18:41:20 +0700 Subject: Update SwitchKeyboardLayout.sh Changing the keyboard layout for all keyboards connected to the computer. --- config/hypr/scripts/SwitchKeyboardLayout.sh | 37 +++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/SwitchKeyboardLayout.sh b/config/hypr/scripts/SwitchKeyboardLayout.sh index 0145e262..cbacd74f 100755 --- a/config/hypr/scripts/SwitchKeyboardLayout.sh +++ b/config/hypr/scripts/SwitchKeyboardLayout.sh @@ -41,5 +41,38 @@ new_layout="${layout_mapping[next_index]}" hyprctl switchxkblayout "at-translated-set-2-keyboard" "$new_layout" echo "$new_layout" > "$layout_f" -# Notification for the new keyboard layout -notify-send -u low -i "$notif" "new KB_Layout: $new_layout" +# Created by T-Crypt + +get_keyboard_names() { + hyprctl devices -j | jq -r '.keyboards[].name' +} + +change_layout() { + local got_error=false + + while read -r name; do + hyprctl switchxkblayout "$name" next + if [[ $? -eq 0 ]]; then + echo "Switched the layout for $name." + else + >&2 echo "Error while switching the layout for $name." + got_error=true + fi + done <<< "$(get_keyboard_names)" + + if [ "$got_error" = true ]; then + >&2 echo "Some errors were found during the process..." + return 1 + fi + + return 0 # All layouts had been cycled successfully +} + +if ! change_layout; then + notify-send -u low -t 2000 'Keyboard layout' 'Error: Layout change failed' + >&2 echo "Layout change failed." + exit 1 +else + # Notification for the new keyboard layout + notify-send -u low -i "$notif" "new KB_Layout: $new_layout" +fi -- cgit v1.2.3 From 40fb30c13b3e0e80174066b7ccf2dd88fe2a9666 Mon Sep 17 00:00:00 2001 From: JosephArmas Date: Wed, 22 May 2024 13:41:48 -0700 Subject: feat: Add rofi calculator using qalc command. Result of expression is automatically saved to clipboard. Default keybinding set to mod + alt + c. --- config/hypr/configs/Keybinds.conf | 1 + config/hypr/scripts/RofiCalc.sh | 21 +++++++++++++++++++++ config/rofi/config-calc.rasi | 7 +++++++ 3 files changed, 29 insertions(+) create mode 100755 config/hypr/scripts/RofiCalc.sh create mode 100644 config/rofi/config-calc.rasi (limited to 'config/hypr/scripts') diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index 142de86a..bd6e0a9f 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -23,6 +23,7 @@ bind = CTRL ALT, P, exec, $scriptsDir/Wlogout.sh bind = $mainMod, H, exec, $scriptsDir/KeyHints.sh # Small help file bind = $mainMod ALT, R, exec, $scriptsDir/Refresh.sh # Refresh waybar, swaync, rofi bind = $mainMod ALT, E, exec, $scriptsDir/RofiEmoji.sh # emoji +bind = $mainMod ALT, C, exec, $scriptsDir/RofiEmoji.sh # calculator bind = $mainMod, S, exec, $scriptsDir/RofiSearch.sh # Google search from Rofi bind = $mainMod SHIFT, B, exec, $scriptsDir/ChangeBlur.sh # Toggle blur settings bind = $mainMod SHIFT, G, exec, $scriptsDir/GameMode.sh # animations ON/OFF diff --git a/config/hypr/scripts/RofiCalc.sh b/config/hypr/scripts/RofiCalc.sh new file mode 100755 index 00000000..3589525f --- /dev/null +++ b/config/hypr/scripts/RofiCalc.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +rofi_config="$HOME/.config/rofi/config-calc.rasi" + + +while true; do + result=$( + rofi -i -dmenu \ + -config "$rofi_config" \ + -mesg "$result = $calc_result" + ) + + if [ $? -ne 0 ]; then + exit + fi + + if [ -n "$result" ]; then + calc_result=$(qalc -t "$result") + echo "$calc_result" | wl-copy + fi +done diff --git a/config/rofi/config-calc.rasi b/config/rofi/config-calc.rasi new file mode 100644 index 00000000..4c7cad2e --- /dev/null +++ b/config/rofi/config-calc.rasi @@ -0,0 +1,7 @@ +@import "~/.config/rofi/config-long.rasi" + +/* ---- Entry ---- */ +entry { + width: 45%; + placeholder: "🧮 Calculate"; +} -- cgit v1.2.3 From a3bf20a92a091fe240d530c42b61437301571160 Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" <85185940+JaKooLit@users.noreply.github.com> Date: Thu, 23 May 2024 12:15:06 +0900 Subject: Update RofiCalc.sh --- config/hypr/scripts/RofiCalc.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/RofiCalc.sh b/config/hypr/scripts/RofiCalc.sh index 3589525f..d908e2b1 100755 --- a/config/hypr/scripts/RofiCalc.sh +++ b/config/hypr/scripts/RofiCalc.sh @@ -1,4 +1,7 @@ #!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ +# /* Calculator (using qualculate) and rofi */ +# /* Submitted by: https://github.com/JosephArmas */ rofi_config="$HOME/.config/rofi/config-calc.rasi" -- cgit v1.2.3 From f34a6bf1006bcd3b2584ec69c2ca7ab30b517bc0 Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" <85185940+JaKooLit@users.noreply.github.com> Date: Thu, 23 May 2024 12:16:02 +0900 Subject: Update RofiCalc.sh --- config/hypr/scripts/RofiCalc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/RofiCalc.sh b/config/hypr/scripts/RofiCalc.sh index d908e2b1..ff96b3a8 100755 --- a/config/hypr/scripts/RofiCalc.sh +++ b/config/hypr/scripts/RofiCalc.sh @@ -1,6 +1,6 @@ #!/bin/bash # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ -# /* Calculator (using qualculate) and rofi */ +# /* Calculator (using qalculate) and rofi */ # /* Submitted by: https://github.com/JosephArmas */ rofi_config="$HOME/.config/rofi/config-calc.rasi" -- cgit v1.2.3 From 6780cd29054a5293ba68f6716eacc0cf70c6f543 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Thu, 23 May 2024 12:25:03 +0900 Subject: editing rofi calc to kill rofi first --- config/hypr/scripts/RofiCalc.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/RofiCalc.sh b/config/hypr/scripts/RofiCalc.sh index ff96b3a8..355130de 100755 --- a/config/hypr/scripts/RofiCalc.sh +++ b/config/hypr/scripts/RofiCalc.sh @@ -5,6 +5,13 @@ rofi_config="$HOME/.config/rofi/config-calc.rasi" +# Kill Rofi if already running before execution +if pgrep -x "rofi" >/dev/null; then + pkill rofi + exit 0 +fi + +# main function while true; do result=$( -- cgit v1.2.3 From 57121a4bddf834545613b38dfa8510a1e7060d3c Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Thu, 23 May 2024 20:27:41 +0900 Subject: RofiCalc script moved to UserScripts --- config/hypr/UserConfigs/UserKeybinds.conf | 2 +- config/hypr/UserScripts/RofiCalc.sh | 31 +++++++++++++++++++++++++++++++ config/hypr/scripts/RofiCalc.sh | 31 ------------------------------- 3 files changed, 32 insertions(+), 32 deletions(-) create mode 100755 config/hypr/UserScripts/RofiCalc.sh delete mode 100755 config/hypr/scripts/RofiCalc.sh (limited to 'config/hypr/scripts') diff --git a/config/hypr/UserConfigs/UserKeybinds.conf b/config/hypr/UserConfigs/UserKeybinds.conf index f3d03df8..85f3c1c3 100644 --- a/config/hypr/UserConfigs/UserKeybinds.conf +++ b/config/hypr/UserConfigs/UserKeybinds.conf @@ -21,7 +21,7 @@ bind = $mainMod, A, exec, pkill rofi || true && ags -t 'overview' bind = $mainMod, Return, exec, $term # Launch terminal bind = $mainMod, T, exec, $files # Launch file manager -bind = $mainMod ALT, C, exec, $scriptsDir/RofiCalc.sh # calculator (qalculate) +bind = $mainMod ALT, C, exec, $UserScripts/RofiCalc.sh # calculator (qalculate) # pyprland bind = $mainMod SHIFT, Return, exec, pypr toggle term # Dropdown terminal diff --git a/config/hypr/UserScripts/RofiCalc.sh b/config/hypr/UserScripts/RofiCalc.sh new file mode 100755 index 00000000..355130de --- /dev/null +++ b/config/hypr/UserScripts/RofiCalc.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ +# /* Calculator (using qalculate) and rofi */ +# /* Submitted by: https://github.com/JosephArmas */ + +rofi_config="$HOME/.config/rofi/config-calc.rasi" + +# Kill Rofi if already running before execution +if pgrep -x "rofi" >/dev/null; then + pkill rofi + exit 0 +fi + +# main function + +while true; do + result=$( + rofi -i -dmenu \ + -config "$rofi_config" \ + -mesg "$result = $calc_result" + ) + + if [ $? -ne 0 ]; then + exit + fi + + if [ -n "$result" ]; then + calc_result=$(qalc -t "$result") + echo "$calc_result" | wl-copy + fi +done diff --git a/config/hypr/scripts/RofiCalc.sh b/config/hypr/scripts/RofiCalc.sh deleted file mode 100755 index 355130de..00000000 --- a/config/hypr/scripts/RofiCalc.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ -# /* Calculator (using qalculate) and rofi */ -# /* Submitted by: https://github.com/JosephArmas */ - -rofi_config="$HOME/.config/rofi/config-calc.rasi" - -# Kill Rofi if already running before execution -if pgrep -x "rofi" >/dev/null; then - pkill rofi - exit 0 -fi - -# main function - -while true; do - result=$( - rofi -i -dmenu \ - -config "$rofi_config" \ - -mesg "$result = $calc_result" - ) - - if [ $? -ne 0 ]; then - exit - fi - - if [ -n "$result" ]; then - calc_result=$(qalc -t "$result") - echo "$calc_result" | wl-copy - fi -done -- cgit v1.2.3