hyprland config
This commit is contained in:
13
hyprland/hypr/scripts/ClipManager.sh
Executable file
13
hyprland/hypr/scripts/ClipManager.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# WOFI STYLES
|
||||
CONFIG="$HOME/.config/wofi/WofiBig/config"
|
||||
STYLE="$HOME/.config/wofi/style.css"
|
||||
|
||||
if [[ ! $(pidof wofi) ]]; then
|
||||
cliphist list | wofi --show dmenu --prompt 'Search...' \
|
||||
--conf ${CONFIG} --style ${STYLE} \
|
||||
--width=600 --height=400 | cliphist decode | wl-copy
|
||||
else
|
||||
pkill wofi
|
||||
fi
|
||||
5
hyprland/hypr/scripts/LockScreen.sh
Executable file
5
hyprland/hypr/scripts/LockScreen.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
CONFIG="$HOME/.config/swaylock/config"
|
||||
|
||||
sleep 0.5s; swaylock --config ${CONFIG} & disown
|
||||
7
hyprland/hypr/scripts/Mako.sh
Executable file
7
hyprland/hypr/scripts/Mako.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CONFIG="$HOME/.config/mako/config"
|
||||
|
||||
if [[ ! $(pidof mako) ]]; then
|
||||
mako --config ${CONFIG}
|
||||
fi
|
||||
8
hyprland/hypr/scripts/PortalHyprlandArch.sh
Executable file
8
hyprland/hypr/scripts/PortalHyprlandArch.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
sleep 1
|
||||
killall xdg-desktop-portal-hyprland
|
||||
killall xdg-desktop-portal-wlr
|
||||
killall xdg-desktop-portal
|
||||
/usr/lib/xdg-desktop-portal-hyprland &
|
||||
sleep 2
|
||||
/usr/lib/xdg-desktop-portal &
|
||||
80
hyprland/hypr/scripts/ScreenShot.sh
Executable file
80
hyprland/hypr/scripts/ScreenShot.sh
Executable file
@@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
|
||||
iDIR="$HOME/.config/mako/icons"
|
||||
|
||||
time=$(date +%Y-%m-%d-%H-%M-%S)
|
||||
dir="$(xdg-user-dir)/Pictures/Screenshots"
|
||||
file="Screenshot_${time}_${RANDOM}.png"
|
||||
|
||||
# notify and view screenshot
|
||||
notify_cmd_shot="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/picture.png"
|
||||
notify_view() {
|
||||
${notify_cmd_shot} "Copied to clipboard."
|
||||
## viewnior ${dir}/"$file"
|
||||
if [[ -e "$dir/$file" ]]; then
|
||||
${notify_cmd_shot} "Screenshot Saved."
|
||||
else
|
||||
${notify_cmd_shot} "Screenshot Deleted."
|
||||
fi
|
||||
}
|
||||
|
||||
# countdown
|
||||
countdown() {
|
||||
for sec in $(seq $1 -1 1); do
|
||||
notify-send -h string:x-canonical-private-synchronous:shot-notify -t 1000 -i "$iDIR"/timer.png "Taking shot in : $sec"
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
# take shots
|
||||
shotnow() {
|
||||
cd ${dir} && grim - | tee "$file" | wl-copy
|
||||
sleep 2
|
||||
notify_view
|
||||
}
|
||||
|
||||
shot5() {
|
||||
countdown '5'
|
||||
sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy
|
||||
sleep 1
|
||||
notify_view
|
||||
|
||||
}
|
||||
|
||||
shot10() {
|
||||
countdown '10'
|
||||
sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
shotwin() {
|
||||
w_pos=$(hyprctl activewindow | grep 'at:' | cut -d':' -f2 | tr -d ' ' | tail -n1)
|
||||
w_size=$(hyprctl activewindow | grep 'size:' | cut -d':' -f2 | tr -d ' ' | tail -n1 | sed s/,/x/g)
|
||||
cd ${dir} && grim -g "$w_pos $w_size" - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
shotarea() {
|
||||
cd ${dir} && grim -g "$(slurp -b 1B1F28CC -c E06B74ff -s C778DD0D -w 2)" - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
if [[ ! -d "$dir" ]]; then
|
||||
mkdir -p "$dir"
|
||||
fi
|
||||
|
||||
if [[ "$1" == "--now" ]]; then
|
||||
shotnow
|
||||
elif [[ "$1" == "--in5" ]]; then
|
||||
shot5
|
||||
elif [[ "$1" == "--in10" ]]; then
|
||||
shot10
|
||||
elif [[ "$1" == "--win" ]]; then
|
||||
shotwin
|
||||
elif [[ "$1" == "--area" ]]; then
|
||||
shotarea
|
||||
else
|
||||
echo -e "Available Options : --now --in5 --in10 --win --area"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
20
hyprland/hypr/scripts/Startup.sh
Executable file
20
hyprland/hypr/scripts/Startup.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPTSDIR=$HOME/.config/hypr/scripts
|
||||
|
||||
# Kill already running process
|
||||
_ps=(waybar mako)
|
||||
for _prs in "${_ps[@]}"; do
|
||||
if [[ $(pidof ${_prs}) ]]; then
|
||||
killall -9 ${_prs}
|
||||
fi
|
||||
done
|
||||
|
||||
# Lauch notification daemon (mako)
|
||||
${SCRIPTSDIR}/Mako.sh &
|
||||
|
||||
# Lauch statusbar (waybar)
|
||||
${SCRIPTSDIR}/Waybar.sh &
|
||||
|
||||
# Lauch syncthing
|
||||
${SCRIPTSDIR}/syncthing.sh &
|
||||
106
hyprland/hypr/scripts/Volume.sh
Executable file
106
hyprland/hypr/scripts/Volume.sh
Executable file
@@ -0,0 +1,106 @@
|
||||
#!/bin/bash
|
||||
|
||||
iDIR="$HOME/.config/hypr/mako/icons"
|
||||
|
||||
# Get Volume
|
||||
get_volume() {
|
||||
volume=$(pamixer --get-volume)
|
||||
echo "$volume"
|
||||
}
|
||||
|
||||
# Get icons
|
||||
get_icon() {
|
||||
current=$(get_volume)
|
||||
if [[ "$current" -eq "0" ]]; then
|
||||
echo "$iDIR/volume-mute.png"
|
||||
elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then
|
||||
echo "$iDIR/volume-low.png"
|
||||
elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then
|
||||
echo "$iDIR/volume-mid.png"
|
||||
elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then
|
||||
echo "$iDIR/volume-high.png"
|
||||
fi
|
||||
}
|
||||
|
||||
# Notify
|
||||
notify_user() {
|
||||
notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_icon)" "Volume : $(get_volume) %"
|
||||
}
|
||||
|
||||
# Increase Volume
|
||||
inc_volume() {
|
||||
pamixer -i 5 && notify_user
|
||||
}
|
||||
|
||||
# Decrease Volume
|
||||
dec_volume() {
|
||||
pamixer -d 5 && notify_user
|
||||
}
|
||||
|
||||
# Toggle Mute
|
||||
toggle_mute() {
|
||||
if [ "$(pamixer --get-mute)" == "false" ]; then
|
||||
pamixer -m && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF"
|
||||
elif [ "$(pamixer --get-mute)" == "true" ]; then
|
||||
pamixer -u && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_icon)" "Volume Switched ON"
|
||||
fi
|
||||
}
|
||||
|
||||
# Toggle Mic
|
||||
toggle_mic() {
|
||||
if [ "$(pamixer --default-source --get-mute)" == "false" ]; then
|
||||
pamixer --default-source -m && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF"
|
||||
elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then
|
||||
pamixer -u --default-source u && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone.png" "Microphone Switched ON"
|
||||
fi
|
||||
}
|
||||
# Get icons
|
||||
get_mic_icon() {
|
||||
current=$(pamixer --default-source --get-volume)
|
||||
if [[ "$current" -eq "0" ]]; then
|
||||
echo "$iDIR/microphone.png"
|
||||
elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then
|
||||
echo "$iDIR/microphone.png"
|
||||
elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then
|
||||
echo "$iDIR/microphone.png"
|
||||
elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then
|
||||
echo "$iDIR/microphone.png"
|
||||
fi
|
||||
}
|
||||
# Notify
|
||||
notify_mic_user() {
|
||||
notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_mic_icon)" "Mic-Level : $(pamixer --default-source --get-volume) %"
|
||||
}
|
||||
|
||||
# Increase MIC Volume
|
||||
inc_mic_volume() {
|
||||
pamixer --default-source -i 5 && notify_mic_user
|
||||
}
|
||||
|
||||
# Decrease MIC Volume
|
||||
dec_mic_volume() {
|
||||
pamixer --default-source -d 5 && notify_mic_user
|
||||
}
|
||||
|
||||
# Execute accordingly
|
||||
if [[ "$1" == "--get" ]]; then
|
||||
get_volume
|
||||
elif [[ "$1" == "--inc" ]]; then
|
||||
inc_volume
|
||||
elif [[ "$1" == "--dec" ]]; then
|
||||
dec_volume
|
||||
elif [[ "$1" == "--toggle" ]]; then
|
||||
toggle_mute
|
||||
elif [[ "$1" == "--toggle-mic" ]]; then
|
||||
toggle_mic
|
||||
elif [[ "$1" == "--get-icon" ]]; then
|
||||
get_icon
|
||||
elif [[ "$1" == "--get-mic-icon" ]]; then
|
||||
get_mic_icon
|
||||
elif [[ "$1" == "--mic-inc" ]]; then
|
||||
inc_mic_volume
|
||||
elif [[ "$1" == "--mic-dec" ]]; then
|
||||
dec_mic_volume
|
||||
else
|
||||
get_volume
|
||||
fi
|
||||
8
hyprland/hypr/scripts/Waybar.sh
Executable file
8
hyprland/hypr/scripts/Waybar.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
CONFIG="$HOME/.config/waybar/config"
|
||||
STYLE="$HOME/.config/waybar/style.css"
|
||||
|
||||
if [[ ! $(pidof waybar) ]]; then
|
||||
waybar --bar main-bar --log-level error --config ${CONFIG} --style ${STYLE}
|
||||
fi
|
||||
10
hyprland/hypr/scripts/Wofi.sh
Executable file
10
hyprland/hypr/scripts/Wofi.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
CONFIG="$HOME/.config/wofi/config"
|
||||
STYLE="$HOME/.config/wofi/style.css"
|
||||
|
||||
if [[ ! $(pidof wofi) ]]; then
|
||||
wofi --show drun --prompt 'Search...' --conf ${CONFIG} --style ${STYLE}
|
||||
elses
|
||||
pkill wofi
|
||||
fi
|
||||
5
hyprland/hypr/scripts/syncthing.sh
Executable file
5
hyprland/hypr/scripts/syncthing.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
sleep 10
|
||||
sudo systemctl start syncthing@$HOST.service
|
||||
syncthing
|
||||
Reference in New Issue
Block a user