mirror of
https://github.com/CoolnsX/hyprdots.git
synced 2025-12-20 07:15:23 +05:30
Pro Tip: Double check XNAMEX's PRs
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
menu() {
|
||||
bemenu --fn 'Cascadia Mono 15' -i -c -W "0.${2:-4}" -B 3 -l 20 -p "$1" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT"
|
||||
bemenu --fn 'IBM Plex Sans 15' -i -c -W "0.${2:-4}" -B 3 -l 20 -p "$1" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT"
|
||||
}
|
||||
|
||||
notify() {
|
||||
|
||||
@@ -8,7 +8,7 @@ file="$HOME/.cache/bookmarks"
|
||||
oshi_file="$HOME/.cache/oshi-urls"
|
||||
|
||||
menu() {
|
||||
bemenu --fn 'Roboto 15' -i -c -W 0.6 -B 3 -l 30 -p "$1" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT"
|
||||
bemenu --fn 'IBM Plex Sans 15' -i -c -W 0.6 -B 3 -l 30 -p "$1" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT"
|
||||
}
|
||||
|
||||
case $1 in
|
||||
|
||||
@@ -257,7 +257,7 @@ show_menu() {
|
||||
|
||||
# Human-readable names of devices, one per line
|
||||
# If scan is off, will only list paired devices
|
||||
devices=$(bluetoothctl devices | grep -F Device | cut -d ' ' -f 3-)
|
||||
devices=$(bluetoothctl devices | sed -nE 's|^Device ([A-Z0-9:]*) (.*)|\2|p')
|
||||
|
||||
# Get controller flags
|
||||
scan=$(scan_on)
|
||||
@@ -304,7 +304,7 @@ original_args=("$@")
|
||||
# dmenu command to pipe into. Extra arguments to dmenu-bluetooth are passed through to dmenu. This
|
||||
# allows the user to set fonts, sizes, colours, etc.
|
||||
run_dmenu() {
|
||||
bemenu "${original_args[@]}" --fn 'Roboto 16' -i -l 10 -c -W 0.4 -B 3 -p "$1" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT"
|
||||
bemenu "${original_args[@]}" --fn 'IBM Plex Sans 15' -i -l 10 -c -W 0.4 -B 3 -p "$1" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
|
||||
@@ -6,7 +6,7 @@ historyfile=$cachedir/dmenu_history
|
||||
|
||||
ls /bin >"$cache"
|
||||
|
||||
cut -f2 "$historyfile" "$cache" | bemenu -R 20 --fixed-height --fn 'JetBrainsMono Nerd Font 15' -i -c -W 0.5 -B 3 -p "RUN: " -l 15 -P ">>" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT" |
|
||||
cut -f2 "$historyfile" "$cache" | bemenu -R 20 --fixed-height --fn 'IBM Plex Sans 15' -i -c -W 0.5 -B 3 -p "RUN: " -l 15 -P ">>" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT" |
|
||||
awk -v histfile="$historyfile" '
|
||||
BEGIN {
|
||||
FS=OFS="\t"
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||
monitor=eDP-1,highres,auto,1.5,bitdepth,10,vrr,1
|
||||
#monitor=HDMI-A-1,highres,auto,1
|
||||
monitor=eDP-1,highres,auto,1.5,vrr,0,bitdepth,10
|
||||
|
||||
$hypr_dir="$HOME/.config/hypr"
|
||||
$accent=6FAAFF
|
||||
$browser=google-chrome-stable
|
||||
#$browser=firefox
|
||||
#$browser=google-chrome-stable
|
||||
$browser=firefox
|
||||
|
||||
#envs
|
||||
env = BROWSER,$browser
|
||||
@@ -112,7 +111,7 @@ misc {
|
||||
force_default_wallpaper = 0
|
||||
vfr = 1
|
||||
#vrr = 1
|
||||
no_direct_scanout = false
|
||||
#no_direct_scanout = false
|
||||
}
|
||||
|
||||
xwayland {
|
||||
@@ -226,7 +225,7 @@ exec-once = dbus-update-activation-environment --systemd --all
|
||||
exec-once = hypridle
|
||||
exec-once = ssh-agent
|
||||
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||
exec-once = swaybg -i $HOME/.config/wall/1.png -m fill
|
||||
exec-once = swaybg -i $HOME/.config/wall/4.jpg -m fill
|
||||
exec-once = xrdb -merge $HOME/.config/.Xresource
|
||||
exec-once = $hypr_dir/workspace 'focus'
|
||||
exec-once = $hypr_dir/battery
|
||||
|
||||
@@ -35,7 +35,7 @@ input-field {
|
||||
outer_color = $foreground
|
||||
inner_color = rgb(0,0,0)
|
||||
font_color = $foreground
|
||||
fade_on_empty = false
|
||||
fade_on_empty = true
|
||||
fade_timeout = 1000
|
||||
placeholder_text = <i><span foreground="##$GLOBAL_ACCENT">Input Password...</span></i> # Text rendered in the input box when it's empty.
|
||||
hide_input = false
|
||||
|
||||
@@ -5,7 +5,7 @@ gamedir="$HOME/games"
|
||||
games=$(find "$gamedir" -maxdepth 2 -type f -name '*.exe' -executable | sed "s|$gamedir/||g;/[U|u]nin.*/d")
|
||||
|
||||
[ -z "$games" ] && notify-send -e -u critical "No games installed" && exit 1
|
||||
game=$(printf '%s\n' "$games" | bemenu --fn 'JetBrainsMono Nerd Font 15' -i -c -W 0.5 -B 3 -p "PLAY GAME: " -l 15 -P ">> " --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT")
|
||||
game=$(printf '%s\n' "$games" | bemenu --fn 'IBM Plex Sans 15' -i -c -W 0.5 -B 3 -p "PLAY GAME: " -l 15 -P ">> " --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT")
|
||||
|
||||
[ -z "$game" ] && notify-send -e -h "string:x-canonical-private-synchronous:${0##*/}" -u critical "No game selected" && exit 1
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ case "$1" in
|
||||
fullsave)
|
||||
tmp_file="$HOME/Pictures/$(date -u "+%Y-%m-%d_%H-%M-%S").png"
|
||||
message="Screenshot saved."
|
||||
[ -d "$HOME/Pictures" ] || mkdir -p "$HOME/Pictures"
|
||||
grim "$tmp_file"
|
||||
;;
|
||||
selclip)
|
||||
|
||||
100
hypr/wifi
100
hypr/wifi
@@ -1,9 +1,93 @@
|
||||
#!/bin/bash
|
||||
if nmcli radio wifi | grep -q 'enabled'; then
|
||||
nmcli radio wifi off
|
||||
wifi_icon="offline"
|
||||
else
|
||||
nmcli radio wifi on
|
||||
wifi_icon="acquiring"
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
# Wifi wrapper using iwctl
|
||||
|
||||
# config
|
||||
adapter="wlan0"
|
||||
divider="--------------------"
|
||||
|
||||
#menu
|
||||
menu () {
|
||||
bemenu -R 20 --fn 'IBM Plex Sans 15' -i -c -W 0.5 -B 3 -p "$1" -l 26 -I "${2:-0}" -P ">>" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT" -x "$3"
|
||||
}
|
||||
|
||||
#notify
|
||||
notify() {
|
||||
notify-send -e -h "string:x-canonical-private-synchronous:${0##*/}" "$1" -i "$2" -t "${3:-1200}"
|
||||
}
|
||||
|
||||
# show list of networks and also the connected one
|
||||
show_networks() {
|
||||
iwctl station $adapter get-networks | sed -nE 's|^[[:space:]]*(.*)[[:space:]]*psk.*|\1|p' | tr -cd '[:print:]\n' | sed 's/\[0m[[:space:]]*//g;s/\[1\;90m>[[:space:]]*/(connected) /g' | sed 's/[[:space:]]*$//g'
|
||||
}
|
||||
|
||||
connect() {
|
||||
temp=$(printf '%s' "$1" | sed -nE 's|\(connected\) (.*)|\1|p')
|
||||
wifi_name=${temp:-$1}
|
||||
output=0
|
||||
if iwctl known-networks "$wifi_name" show | grep -q "$wifi_name"; then
|
||||
iwctl station $adapter connect "$wifi_name"
|
||||
else
|
||||
password=$(: | menu "Enter Password:" "" "indicator")
|
||||
[ -z "$password" ] && notify "No credentials Provided" && return 1
|
||||
notify "Authenticating to $wifi_name" "" "10000"
|
||||
iwctl --passphrase "$password" station $adapter connect "$wifi_name"
|
||||
output=$?
|
||||
fi
|
||||
|
||||
while iwctl station $adapter show | grep -q connecting;do
|
||||
notify "Connecting to $wifi_name"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
if [ "$output" -ne 0 ]; then
|
||||
notify "Unable to connect to $wifi_name, try again later."
|
||||
return 0
|
||||
fi
|
||||
notify "Connected: $wifi_name"
|
||||
}
|
||||
|
||||
if iwctl device $adapter show | grep -q 'Powered.*off';then
|
||||
option=$(printf 'Turn On' | menu '[iwd]')
|
||||
[ -z "$option" ] && exit 0
|
||||
iwctl device $adapter set-property Powered on
|
||||
while iwctl device $adapter show | grep -q 'Powered.*off'; do
|
||||
notify "Turning On Wifi"
|
||||
sleep 1
|
||||
done
|
||||
notify "Wifi On"
|
||||
fi
|
||||
notify-send -e -i "/usr/share/icons/Papirus/16x16/panel/network-wireless-$wifi_icon.svg" "wifi $(nmcli radio wifi)" -h "string:x-canonical-private-synchronous:${0##*/}"
|
||||
|
||||
while option=$(printf 'Scan\nDisconnect\nTurn Off\nExit\n%s\n%s' "$divider" "$(show_networks)" | menu "[iwd]"); do
|
||||
case $option in
|
||||
"" | "$divider")
|
||||
notify "Bye.."
|
||||
break
|
||||
;;
|
||||
Scan)
|
||||
iwctl station $adapter scan
|
||||
while iwctl station wlan0 show | grep -q 'Scanning.*yes';do
|
||||
notify "Scanning For Networks"
|
||||
sleep 1
|
||||
done
|
||||
;;
|
||||
Exit)
|
||||
notify "Bye.."
|
||||
break
|
||||
;;
|
||||
Disconnect)
|
||||
iwctl station $adapter disconnect
|
||||
;;
|
||||
"Turn Off")
|
||||
notify "Turning Off Wifi..."
|
||||
iwctl device $adapter set-property Powered off
|
||||
notify "Wifi Off"
|
||||
break
|
||||
;;
|
||||
*)
|
||||
connect "$option"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
setup_dual_monitor() {
|
||||
sed -i "s/monitor=,1920x1080,0x0,1,mirror,eDP-1/monitor=,highrr,auto,1/g" "$HOME/.config/hypr/hyprland.conf"
|
||||
sleep 2
|
||||
if hyprctl monitors | grep -q "HDMI-A-1"; then
|
||||
monitor=$(hyprctl monitors | sed -nE 's|.*(HDMI-A-[0-9]).*|\1|p')
|
||||
if [ -n "$monitor" ]; then
|
||||
notify-send -e "Setting up dual monitor workflow"
|
||||
hyprctl keyword monitor "$(hyprctl monitors | sed -nE 's|.*(HDMI-A-[0-9]).*|\1|p')",highres,auto,1
|
||||
hyprctl dispatch moveworkspacetomonitor "1 0"
|
||||
hyprctl dispatch moveworkspacetomonitor "2 0"
|
||||
hyprctl dispatch moveworkspacetomonitor "3 0"
|
||||
hyprctl dispatch moveworkspacetomonitor "3 1"
|
||||
hyprctl dispatch moveworkspacetomonitor "4 1"
|
||||
eww kill
|
||||
eww open-many time_1 music_1
|
||||
@@ -16,13 +16,13 @@ setup_dual_monitor() {
|
||||
|
||||
handle_it() {
|
||||
[ -z "$1" ] || notify-send -e "$1"
|
||||
choice=$(printf "Mirror\nExtend" | bemenu --fn 'Roboto 15' -i -c -W 0.2 -B 3 -l 20 -p "what to do??: " -m 1 --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT")
|
||||
choice=$(printf "Mirror\nExtend" | bemenu --fn 'IBM Plex Sans 15' -i -c -W 0.2 -B 3 -l 20 -p "what to do??: " -m 1 --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT")
|
||||
[ -z "$choice" ] && return 0
|
||||
notify-send -e "${choice}ing screen"
|
||||
if [ "$choice" = "Extend" ]; then
|
||||
setup_dual_monitor
|
||||
setup_dual_monitor
|
||||
else
|
||||
sed -i "s/monitor=,highrr,auto,1/monitor=,1920x1080,0x0,1,mirror,eDP-1/g" "$HOME/.config/hypr/hyprland.conf"
|
||||
hyprctl keyword monitor "$(hyprctl monitors | sed -nE 's|.*(HDMI-A-[0-9]).*|\1|p')",preferred, auto, 1, mirror, eDP-1
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -41,13 +41,8 @@ case $1 in
|
||||
socat - "UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | while read -r line; do
|
||||
printf "%s" "$line" | grep -qE "monitoraddedv2.*HEADLESS" && continue
|
||||
printf "%s" "$line" | grep -q "monitoraddedv2" && handle_it "$line"
|
||||
printf "%s" "$line" | grep -q "monitorremoved" && sed -i "s/monitor=,1920x1080,0x0,1,mirror,eDP-1/monitor=,highrr,auto,1/g" "$HOME/.config/hypr/hyprland.conf" && eww kill && eww open_many time_0 music_0
|
||||
#recent workspace switcher
|
||||
current=$(printf "%s" "$line" | sed -nE 's_^(workspace)v2>>([^,]*),.*_\1 \2_p')
|
||||
if [ -n "$current" ]; then
|
||||
cat /tmp/workcurr >/tmp/workprev
|
||||
printf "%s" "$current" >/tmp/workcurr
|
||||
fi
|
||||
notify-send -e -i "lol" "$current" -h "string:x-canonical-private-synchronous:monitor" -t 700 2>/dev/null
|
||||
done
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user