diff options
| author | subh <subh@example.com> | 2026-01-31 10:35:36 +0530 |
|---|---|---|
| committer | subh <subh@example.com> | 2026-01-31 10:35:36 +0530 |
| commit | bd7ffca7774ac96abb496d86810b20dc20736178 (patch) | |
| tree | c19ac74d55485d88f396e7bf5ad46d4542880160 | |
| parent | 667f7d3561272b460163c26d7893dfc0e01ac1cb (diff) | |
Added a script with a hotkey to lookup word meanings and a url decoder in python for the CLI
| -rw-r--r-- | hyprland/hyprland.conf | 2 | ||||
| -rw-r--r-- | hyprland/keybinds.conf | 12 | ||||
| -rwxr-xr-x | scripts/decoder | 17 | ||||
| -rwxr-xr-x | scripts/define.sh | 22 |
4 files changed, 47 insertions, 6 deletions
diff --git a/hyprland/hyprland.conf b/hyprland/hyprland.conf index 49fd67e..3668bd8 100644 --- a/hyprland/hyprland.conf +++ b/hyprland/hyprland.conf @@ -191,5 +191,5 @@ windowrule { # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ #windowrulev2 = suppressevent maximize, class:^(firefox|code|jetbrains-.*|electron)$ -windowrule = border_color rgb(f38ba8) rgb(313244), match:class (firefox|librewolf|discord|sublime_text|com.mitchellh.ghostty|org.keepassxc.KeePassXC) +windowrule = border_color rgb(f38ba8) rgb(313244), match:class (firefox|librewolf|discord|sublime_text|com.mitchellh.ghostty|org.keepassxc.KeePassXC|burp-StartBurp) windowrule = suppress_event maximize, match:class .* # You'll probably like this. diff --git a/hyprland/keybinds.conf b/hyprland/keybinds.conf index 397f35d..3abfa95 100644 --- a/hyprland/keybinds.conf +++ b/hyprland/keybinds.conf @@ -4,7 +4,8 @@ bind = $mainMod, Return, exec, $terminal bind = $mainMod, Q, killactive, bind = $mainMod|Shift, Q, exit, bind = $mainMod, F, exec, $fileManager -bind = $mainMod, V, togglefloating, + +#bind = $mainMod, V, togglefloating, bind = $mainMod, R, exec, $menu bind = $mainMod|Shift, R, exec, $reload_qs bind = $mainMod|Ctrl, R, exec, $reload_hypr @@ -13,19 +14,21 @@ bind = $mainMod|Ctrl,F,fullscreen, 1 bind = $mainMod, W, exec, $browser bind = $mainMod, D, exec, discord bind = $mainMod|Shift, D, exec, kill -9 `pidof discord` -bind = $mainMod|Shift, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy +bind = $mainMod|Shift, A, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy bind = $mainMod|Shift, L, exec, /opt/scripts/power.sh bind = $mainMod, B, exec, /opt/scripts/wallpaper-picker.sh bind = $mainMod, N, exec, /opt/scripts/wifi-connect.sh bind = $mainMod|Shift, N, exec, /opt/scripts/wifi-disconnect.sh bind = $mainMod, M, exec, spotify +bind = $mainMod|Shift, M, exec, kill -9 `pidof spotify` bind = $mainMod|Shift, K, exec, keepassxc bind = $mainMod, S, exec, subl -bind = $mainMod, P, exec, /opt/scripts/vpn_connect.sh -bind = $mainMod|Shift, P, exec, /opt/scripts/vpn_disconnect.sh +bind = $mainMod, V, exec, /opt/scripts/vpn_connect.sh +bind = $mainMod|Shift, V, exec, /opt/scripts/vpn_disconnect.sh bind = $mainMod, X, exec, /opt/scripts/screen-record.sh bind = $mainMod|Shift, X, exec, /opt/scripts/screen-record-stop.sh bind = $mainMod, Y, exec, hyprctl workspaces -j | jq '.[].lastwindowtitle' | rofi -show window +bind = $mainMod, P, exec, /opt/scripts/power-profiles.sh # Move focus with mainMod + arrow keys @@ -69,4 +72,3 @@ bind = $mainMod, mouse_up, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow - diff --git a/scripts/decoder b/scripts/decoder new file mode 100755 index 0000000..1b19fce --- /dev/null +++ b/scripts/decoder @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 + +import urllib.parse +import sys + +if len(sys.argv) < 2: + print(f"[*] Usage: python3 {sys.argv[0]} <url-encoded-data>") + sys.exit() + +enc = sys.argv[1] + +def decode(e): + dec = urllib.parse.unquote(e) + print(dec) + +decode(enc) + diff --git a/scripts/define.sh b/scripts/define.sh new file mode 100755 index 0000000..041f0a1 --- /dev/null +++ b/scripts/define.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "[!] Provide a word" + exit 1 +fi + +RESP=$(curl -s -q https://api.dictionaryapi.dev/api/v2/entries/en/$1 | jq -r ' + [.[0].meanings[] + | select(.partOfSpeech=="noun") + | .definitions[].definition][0:2] + | to_entries + | map("\(.key + 1). \(.value)") + | join("\n") +' 2>/dev/null) + +if [ -z "$RESP" ]; then + notify-send -t 10000 -u normal -i accessories-dictionary "Meaning Not Found!" +else + notify-send -t 10000 -u normal -i accessories-dictionary "$1" "$RESP" +fi + |
