summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2023-06-25 12:53:26 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2023-06-25 12:53:26 +0530
commitab60bbbf1b19bae28f7302d2299ca14dd64a7bc5 (patch)
tree9ff52105f5309a1120ae06c7dff8114f0532bf83
parent2a08b80ecdedea6b198d777ecea5db1a1b8e42f2 (diff)
hypr+script: togglecaps sh to avoid emacspinky
-rw-r--r--.config/hypr/hyprland.conf16
-rwxr-xr-x.scripts/togglecaps16
2 files changed, 26 insertions, 6 deletions
diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf
index 706ec8a..a148f03 100644
--- a/.config/hypr/hyprland.conf
+++ b/.config/hypr/hyprland.conf
@@ -6,13 +6,14 @@ monitor=eDP-1,1920x1080@60,0x0,1.00,transform,0
# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
exec-once = waybar & dunst & wpaperd & suspend.sh
-exec-once = exec-once=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY
+#exec-once = exec-once=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY
+exec-once = systemctl --user import-environment DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
# Some default env vars.
-#env = XCURSOR_SIZE,24
+env = XCURSOR_SIZE,24
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
general {
@@ -65,7 +66,8 @@ animations {
input {
kb_layout = us
- kb_options=caps:escape
+kb_options=caps:escape
+# kb_options=ctrl:nocaps
follow_mouse = 1
touchpad {
disable_while_typing = no
@@ -92,6 +94,8 @@ Misc {
binds {
workspace_back_and_forth = true
allow_workspace_cycles = true
+ # trigger when the switch is toggled
+ bindl=,switch:Lid Switch,exec,swaylock
}
# Example per-device config
@@ -117,7 +121,7 @@ $MOD = SUPER
# Imp Utils #
###############
#Terminal
-bind = $MOD SHIFT, Return, exec, foot
+bind = $MOD SHIFT, Return, exec, foot -t meh
bind = $MOD, W, killactive
bind = $MOD CTRL SHIFT, Q, exit
bind = $MOD, F, togglefloating
@@ -150,7 +154,7 @@ bind = $MOD SHIFT, T, exec, qutebrowser https://teams.microsoft.com
# Launch spotify
bind = $MOD SHIFT, M, exec, sp
# Launch discord
-bind = $MOD SHIFT, D, exec, discord
+#bind = $MOD SHIFT, D, exec, discord
# Launch telegram
bind = $MOD CTRL, E, exec, telegram-desktop
@@ -161,7 +165,7 @@ bind = $MOD, R, exec, kitty -e ranger
# Launch pulsemixer
bind = $MOD, P, exec, foot -e pulsemixer
#Launch <go,h,b>top
-bind = $MOD SHIFT, G, exec, foot -e gotop
+bind = $MOD SHIFT, G, exec, kitty -e gotop
bind = $MOD SHIFT, H, exec, foot -e htop
bind = $MOD SHIFT, B, exec, foot -e btop
diff --git a/.scripts/togglecaps b/.scripts/togglecaps
new file mode 100755
index 0000000..09dd90c
--- /dev/null
+++ b/.scripts/togglecaps
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+hyprland_cfg="$HOME/.config/hypr/hyprland.conf"
+
+line1=$(grep "kb_options" "$hyprland_cfg" | head -n 1)
+line2=$(grep "kb_options" "$hyprland_cfg" | tail -n 1)
+
+if [ "${line1:0:1}" = "#" ]; then
+ # If first line is commented, uncomment it and comment the second line
+ sed -i 's/^#\s*kb_options=caps:escape/kb_options=caps:escape/' "$hyprland_cfg"
+ sed -i 's/^kb_options=ctrl:nocaps/# kb_options=ctrl:nocaps/' "$hyprland_cfg"
+elif [ "${line2:0:1}" = "#" ]; then
+ # If second line is commented, uncomment it and comment the first line
+ sed -i 's/^#\s*kb_options=ctrl:nocaps/kb_options=ctrl:nocaps/' "$hyprland_cfg"
+ sed -i 's/^kb_options=caps:escape/# kb_options=caps:escape/' "$hyprland_cfg"
+fi