added hypr and waybar dots

This commit is contained in:
Louis Hollingworth 2024-06-01 11:21:28 +01:00
parent 98eb35725e
commit a3f74e386d
Signed by: lucxjo
GPG key ID: A11415CB3DC7809B
39 changed files with 4212 additions and 26 deletions

View file

@ -0,0 +1,34 @@
general {
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
before_sleep_cmd = loginctl lock-session # lock before suspend.
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
}
listener {
timeout = 150 # 2.5min.
on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor.
on-resume = brightnessctl -r # monitor backlight restore.
}
# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight.
listener {
timeout = 150 # 2.5min.
on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 # turn off keyboard backlight.
on-resume = brightnessctl -rd rgb:kbd_backlight # turn on keyboard backlight.
}
listener {
timeout = 300 # 5min
on-timeout = loginctl lock-session # lock screen when timeout has passed
}
listener {
timeout = 330 # 5.5min
on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed
on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired.
}
listener {
timeout = 1800 # 30min
on-timeout = systemctl suspend # suspend pc
}

View file

@ -0,0 +1,337 @@
# #######################################################################################
# AUTOGENERATED HYPR CONFIG.
# PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT,
# OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS.
# #######################################################################################
# autogenerated = 1 # remove this line to remove the warning
# This is an example Hyprland config file.
# Refer to the wiki for more information.
# https://wiki.hyprland.org/Configuring/Configuring-Hyprland/
# Please note not all available settings / options are set here.
# For a full list, see the wiki
# You can split this configuration into multiple files
# Create your files separately and then link them to this file like this:
# source = ~/.config/hypr/myColors.conf
################
### MONITORS ###
################
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,1.25
###################
### MY PROGRAMS ###
###################
# See https://wiki.hyprland.org/Configuring/Keywords/
# Set programs that you use
$terminal = kitty
$fileManager = dolphin
$menu = rofi -show run
#################
### AUTOSTART ###
#################
# Autostart necessary processes (like notifications daemons, status bars, etc.)
# Or execute your favorite apps at launch like this:
# exec-once = $terminal
# exec-once = nm-applet &
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = $HOME/.config/hypr/scripts/polkit.sh
exec-once = nm-applet --indicator
exec-once = waybar & hyprpaper & dunst & swaync & hypridle
#############################
### ENVIRONMENT VARIABLES ###
#############################
# See https://wiki.hyprland.org/Configuring/Environment-variables/
env = XCURSOR_SIZE,24
env = HYPRCURSOR_THEME,Bibata-Modern-Ice
env = HYPRCURSOR_SIZE,24
env = SDL_VIDEODRIVER,wayland
env = CLUTTER_BACKEND,wayland
env = ELECTRON_OZONE_PLATFORM_HINT,wayland
#####################
### LOOK AND FEEL ###
#####################
# Refer to https://wiki.hyprland.org/Configuring/Variables/
# https://wiki.hyprland.org/Configuring/Variables/#general
general {
gaps_in = 5
gaps_out = 5
border_size = 2
# https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors
col.active_border = rgb(81a1c1) rgb(a3be8c) 45deg
col.inactive_border = rgb(4c566a)
# Set to true enable resizing windows by clicking and dragging on borders and gaps
resize_on_border = false
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
layout = dwindle
}
# https://wiki.hyprland.org/Configuring/Variables/#decoration
decoration {
rounding = 5
# Change transparency of focused and unfocused windows
active_opacity = 0.9
inactive_opacity = 0.8
drop_shadow = true
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(2e3440aa)
# https://wiki.hyprland.org/Configuring/Variables/#blur
blur {
enabled = true
size = 3
passes = 1
vibrancy = 0.1696
}
}
# https://wiki.hyprland.org/Configuring/Variables/#animations
animations {
enabled = true
# Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
dwindle {
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true # You probably want this
}
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
master {
new_is_master = false
}
# https://wiki.hyprland.org/Configuring/Variables/#misc
misc {
force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers
disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :(
}
#############
### INPUT ###
#############
# https://wiki.hyprland.org/Configuring/Variables/#input
input {
kb_layout = gb
kb_variant =
kb_model =
kb_options =
kb_rules =
follow_mouse = 0
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
touchpad {
natural_scroll = true
}
}
# https://wiki.hyprland.org/Configuring/Variables/#gestures
gestures {
workspace_swipe = true
}
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
device {
name = epic-mouse-v1
sensitivity = -0.5
}
####################
### KEYBINDINGSS ###
####################
# See https://wiki.hyprland.org/Configuring/Keywords/
$mainMod = SUPER # Sets "Windows" key as main modifier
$scriptsDir = $HOME/.config/hypr/scripts
bind = CTRL ALT, Delete, exec, hyprctl dispatch exit 0
bind = $mainMod, Q, killactive,
bind = $mainMod, F, fullscreen
bind = $mainMod SHIFT, Q, closewindow,
bind = $mainMod SHIFT, F, togglefloating,
bind = $mainMod ALT, F, exec, hyprctl dispatch workspaceopt allfloat
# Master Layout
bind = $mainMod CTRL, D, layoutmsg, removemaster
bind = $mainMod, I, layoutmsg, addmaster
bind = $mainMod, J, layoutmsg, cyclenext
bind = $mainMod, K, layoutmsg, cycleprev
bind = $mainMod, M, exec, hyprctl dispatch splitratio 0.3
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod CTRL, Return, layoutmsg, swapwithmaster
bind = $mainMod, Space, exec, $menu
bind = $mainMod, Return, exec, $terminal
# group
bind = $mainMod, G, togglegroup
bind = ALT, tab, changegroupactive #change focus to another window
# Special Keys / Hot Keys
bind = , xf86audioraisevolume, exec, $scriptsDir/Volume.sh --inc #volume up
bind = , xf86audiolowervolume, exec, $scriptsDir/Volume.sh --dec #volume down
bind = , xf86AudioMicMute, exec, $scriptsDir/Volume.sh --toggle-mic #mute mic
bind = , xf86audiomute, exec, $scriptsDir/Volume.sh --toggle
bind = , xf86Sleep, exec, systemctl suspend # sleep button
bind = , xf86Rfkill, exec, $scriptsDir/AirplaneMode.sh #Airplane mode
binde = , xf86MonBrightnessDown, exec, $scriptsDir/Brightness.sh --dec
binde = , xf86MonBrightnessUp, exec, $scriptsDir/Brightness.sh --inc
# media controls using keyboards
bind = , xf86AudioPlayPause, exec, $scriptsDir/MediaCtrl.sh --pause
bind = , xf86AudioPause, exec, $scriptsDir/MediaCtrl.sh --pause
bind = , xf86AudioPlay, exec, $scriptsDir/MediaCtrl.sh --pause
bind = , xf86AudioNext, exec, $scriptsDir/MediaCtrl.sh --nxt
bind = , xf86AudioPrev, exec, $scriptsDir/MediaCtrl.sh --prv
bind = , xf86audiostop, exec, $scriptsDir/MediaCtrl.sh --stop
# Screenshot keybindings NOTE: You may need to press Fn key as well
bind = $mainMod, Print, exec, $scriptsDir/ScreenShot.sh --now
bind = $mainMod SHIFT, Print, exec, $scriptsDir/ScreenShot.sh --area
bind = $mainMod CTRL, Print, exec, $scriptsDir/ScreenShot.sh --in5 #screenshot in 5 secs
bind = $mainMod CTRL SHIFT, Print, exec, $scriptsDir/ScreenShot.sh --in10 #screenshot in 10 secs
bind = ALT, Print, exec, $scriptsDir/ScreenShot.sh --active #take screenshot of active window
# screenshot with swappy (another screenshot tool)
bind = $mainMod SHIFT, S, exec, $scriptsDir/ScreenShot.sh --swappy
# Resize windows
binde = $mainMod SHIFT, left, resizeactive,-50 0
binde = $mainMod SHIFT, right, resizeactive,50 0
binde = $mainMod SHIFT, up, resizeactive,0 -50
binde = $mainMod SHIFT, down, resizeactive,0 50
# Move windows
bind = $mainMod CTRL, left, movewindow, l
bind = $mainMod CTRL, right, movewindow, r
bind = $mainMod CTRL, up, movewindow, u
bind = $mainMod CTRL, down, movewindow, d
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Workspaces related
bind = $mainMod, tab, workspace, m+1
bind = $mainMod SHIFT, tab, workspace, m-1
# Special workspace
bind = $mainMod SHIFT, U, movetoworkspace, special
bind = $mainMod, U, togglespecialworkspace,
# The following mappings use the key codes to better support various keyboard layouts
# 1 is code:10, 2 is code 11, etc
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, code:10, workspace, 1
bind = $mainMod, code:11, workspace, 2
bind = $mainMod, code:12, workspace, 3
bind = $mainMod, code:13, workspace, 4
bind = $mainMod, code:14, workspace, 5
bind = $mainMod, code:15, workspace, 6
bind = $mainMod, code:16, workspace, 7
bind = $mainMod, code:17, workspace, 8
bind = $mainMod, code:18, workspace, 9
bind = $mainMod, code:19, workspace, 10
# Move active window and follow to workspace mainMod + SHIFT [0-9]
bind = $mainMod SHIFT, code:10, movetoworkspace, 1
bind = $mainMod SHIFT, code:11, movetoworkspace, 2
bind = $mainMod SHIFT, code:12, movetoworkspace, 3
bind = $mainMod SHIFT, code:13, movetoworkspace, 4
bind = $mainMod SHIFT, code:14, movetoworkspace, 5
bind = $mainMod SHIFT, code:15, movetoworkspace, 6
bind = $mainMod SHIFT, code:16, movetoworkspace, 7
bind = $mainMod SHIFT, code:17, movetoworkspace, 8
bind = $mainMod SHIFT, code:18, movetoworkspace, 9
bind = $mainMod SHIFT, code:19, movetoworkspace, 10
bind = $mainMod SHIFT, bracketleft, movetoworkspace, -1 # brackets [ or ]
bind = $mainMod SHIFT, bracketright, movetoworkspace, +1
# Move active window to a workspace silently mainMod + CTRL [0-9]
bind = $mainMod CTRL, code:10, movetoworkspacesilent, 1
bind = $mainMod CTRL, code:11, movetoworkspacesilent, 2
bind = $mainMod CTRL, code:12, movetoworkspacesilent, 3
bind = $mainMod CTRL, code:13, movetoworkspacesilent, 4
bind = $mainMod CTRL, code:14, movetoworkspacesilent, 5
bind = $mainMod CTRL, code:15, movetoworkspacesilent, 6
bind = $mainMod CTRL, code:16, movetoworkspacesilent, 7
bind = $mainMod CTRL, code:17, movetoworkspacesilent, 8
bind = $mainMod CTRL, code:18, movetoworkspacesilent, 9
bind = $mainMod CTRL, code:19, movetoworkspacesilent, 10
bind = $mainMod CTRL, bracketleft, movetoworkspacesilent, -1 # brackets [ or ]
bind = $mainMod CTRL, bracketright, movetoworkspacesilent, +1
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
bind = $mainMod, period, workspace, e+1
bind = $mainMod, comma, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
##############################
### WINDOWS AND WORKSPACES ###
##############################
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
windowrulev2 = suppressevent maximize, class:.* # You'll probably like this.

View file

@ -0,0 +1,28 @@
background {
monitor =
path = /home/lucxjo/Pictures/Wallpapers/nord-arch.png # supports png, jpg, webp (no animations, though)
color = rgba(25, 20, 20, 1.0)
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
blur_passes = 0 # 0 disables blurring
blur_size = 7
noise = 0.0117
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
label {
monitor =
text = Hi there, $USER
text_align = center # center/right or any value for default left. multi-line text alignment inside label container
color = rgba(200, 200, 200, 1.0)
font_size = 25
font_family = Noto Sans
rotate = 0 # degrees, counter-clockwise
position = 0, 80
halign = center
valign = center
}

View file

@ -0,0 +1,3 @@
preload = $HOME/Pictures/Wallpapers/nord-arch.png
wallpaper = , $HOME/Pictures/Wallpapers/nord-arch.png

View file

@ -0,0 +1,16 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Airplane Mode. Turning on or off all wifi using rfkill.
notif="$HOME/.config/swaync/images/bell.png"
# Check if any wireless device is blocked
wifi_blocked=$(rfkill list wifi | grep -o "Soft blocked: yes")
if [ -n "$wifi_blocked" ]; then
rfkill unblock wifi
notify-send -u low -i "$notif" 'Airplane mode: OFF'
else
rfkill block wifi
notify-send -u low -i "$notif" 'Airplane mode: ON'
fi

View file

@ -0,0 +1,53 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Script for Monitor backlights (if supported) using brightnessctl
iDIR="$HOME/.config/swaync/icons"
notification_timeout=1000
# Get brightness
get_backlight() {
echo $(brightnessctl -m | cut -d, -f4)
}
# Get icons
get_icon() {
current=$(get_backlight | sed 's/%//')
if [ "$current" -le "20" ]; then
icon="$iDIR/brightness-20.png"
elif [ "$current" -le "40" ]; then
icon="$iDIR/brightness-40.png"
elif [ "$current" -le "60" ]; then
icon="$iDIR/brightness-60.png"
elif [ "$current" -le "80" ]; then
icon="$iDIR/brightness-80.png"
else
icon="$iDIR/brightness-100.png"
fi
}
# Notify
notify_user() {
notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Brightness : $current%"
}
# Change brightness
change_backlight() {
brightnessctl set "$1" && get_icon && notify_user
}
# Execute accordingly
case "$1" in
"--get")
get_backlight
;;
"--inc")
change_backlight "+10%"
;;
"--dec")
change_backlight "10%-"
;;
*)
get_backlight
;;
esac

View file

@ -0,0 +1,51 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Script for keyboard backlights (if supported) using brightnessctl
iDIR="$HOME/.config/swaync/icons"
# Get keyboard brightness
get_kbd_backlight() {
echo $(brightnessctl -d '*::kbd_backlight' -m | cut -d, -f4)
}
# Get icons
get_icon() {
current=$(get_kbd_backlight | sed 's/%//')
if [ "$current" -le "20" ]; then
icon="$iDIR/brightness-20.png"
elif [ "$current" -le "40" ]; then
icon="$iDIR/brightness-40.png"
elif [ "$current" -le "60" ]; then
icon="$iDIR/brightness-60.png"
elif [ "$current" -le "80" ]; then
icon="$iDIR/brightness-80.png"
else
icon="$iDIR/brightness-100.png"
fi
}
# Notify
notify_user() {
notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Keyboard Brightness : $current%"
}
# Change brightness
change_kbd_backlight() {
brightnessctl -d *::kbd_backlight set "$1" && get_icon && notify_user
}
# Execute accordingly
case "$1" in
"--get")
get_kbd_backlight
;;
"--inc")
change_kbd_backlight "+30%"
;;
"--dec")
change_kbd_backlight "30%-"
;;
*)
get_kbd_backlight
;;
esac

View file

@ -0,0 +1,17 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Script for changing blurs on the fly
notif="$HOME/.config/swaync/images/bell.png"
STATE=$(hyprctl -j getoption decoration:blur:passes | jq ".int")
if [ "${STATE}" == "2" ]; then
hyprctl keyword decoration:blur:size 2
hyprctl keyword decoration:blur:passes 1
notify-send -e -u low -i "$notif" "Less blur"
else
hyprctl keyword decoration:blur:size 5
hyprctl keyword decoration:blur:passes 2
notify-send -e -u low -i "$notif" "Normal blur"
fi

View file

@ -0,0 +1,30 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# for changing Hyprland Layouts (Master or Dwindle) on the fly
notif="$HOME/.config/swaync/images/bell.png"
LAYOUT=$(hyprctl -j getoption general:layout | jq '.str' | sed 's/"//g')
case $LAYOUT in
"master")
hyprctl keyword general:layout dwindle
hyprctl keyword unbind SUPER,J
hyprctl keyword unbind SUPER,K
hyprctl keyword bind SUPER,J,cyclenext
hyprctl keyword bind SUPER,K,cyclenext,prev
hyprctl keyword bind SUPER,O,togglesplit
notify-send -e -u low -i "$notif" "Dwindle Layout"
;;
"dwindle")
hyprctl keyword general:layout master
hyprctl keyword unbind SUPER,J
hyprctl keyword unbind SUPER,K
hyprctl keyword unbind SUPER,O
hyprctl keyword bind SUPER,J,layoutmsg,cyclenext
hyprctl keyword bind SUPER,K,layoutmsg,cycleprev
notify-send -e -u low -i "$notif" "Master Layout"
;;
*) ;;
esac

View file

@ -0,0 +1,40 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Clipboard Manager. This script uses cliphist, rofi, and wl-copy.
# Actions:
# CTRL Del to delete an entry
# ALT Del to wipe clipboard contents
while true; do
result=$(
rofi -i -dmenu \
-kb-custom-1 "Control-Delete" \
-kb-custom-2 "Alt-Delete" \
-config ~/.config/rofi/config-clipboard.rasi < <(cliphist list)
)
case "$?" in
1)
exit
;;
0)
case "$result" in
"")
continue
;;
*)
cliphist decode <<<"$result" | wl-copy
exit
;;
esac
;;
10)
cliphist delete <<<"$result"
;;
11)
cliphist wipe
;;
esac
done

View file

@ -0,0 +1,226 @@
#!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# For Dark and Light switching
# Note: Scripts are looking for keywords Light or Dark except for wallpapers as the are in a separate folders
# Paths
wallpaper_base_path="$HOME/Pictures/wallpapers/Dynamic-Wallpapers"
dark_wallpapers="$wallpaper_base_path/Dark"
light_wallpapers="$wallpaper_base_path/Light"
hypr_config_path="$HOME/.config/hypr"
swaync_style="$HOME/.config/swaync/style.css"
ags_style="$HOME/.config/ags/user/style.css"
SCRIPTSDIR="$HOME/.config/hypr/scripts"
notif="$HOME/.config/swaync/images/bell.png"
wallust_rofi="$HOME/.config/wallust/templates/colors-rofi.rasi"
wallust_config="$HOME/.config/wallust/wallust.toml"
pallete_dark="dark16"
pallete_light="light16"
# kill swaybg if running
pkill swaybg
# Initialize swww if needed
swww query || swww-daemon
# Set swww options
swww="swww img"
effect="--transition-bezier .43,1.19,1,.4 --transition-fps 60 --transition-type grow --transition-pos 0.925,0.977 --transition-duration 2"
# Determine current theme mode
if [ "$(cat $HOME/.cache/.theme_mode)" = "Light" ]; then
next_mode="Dark"
# Logic for Dark mode
wallpaper_path="$dark_wallpapers"
else
next_mode="Light"
# Logic for Light mode
wallpaper_path="$light_wallpapers"
fi
# Function to update theme mode for the next cycle
update_theme_mode() {
echo "$next_mode" > ~/.cache/.theme_mode
}
# Function to notify user
notify_user() {
notify-send -u low -i "$notif" "Switching to $1 mode"
}
# Use sed to replace the palette setting in the wallust config file
if [ "$next_mode" = "Dark" ]; then
sed -i 's/^palette = .*/palette = "'"$pallete_dark"'"/' "$wallust_config"
else
sed -i 's/^palette = .*/palette = "'"$pallete_light"'"/' "$wallust_config"
fi
# Function to set Waybar style
set_waybar_style() {
theme="$1"
waybar_styles="$HOME/.config/waybar/style"
waybar_style_link="$HOME/.config/waybar/style.css"
style_prefix="\\[${theme}\\].*\\.css$"
style_file=$(find "$waybar_styles" -maxdepth 1 -type f -regex ".*$style_prefix" | shuf -n 1)
if [ -n "$style_file" ]; then
ln -sf "$style_file" "$waybar_style_link"
else
echo "Style file not found for $theme theme."
fi
}
# Call the function after determining the mode
set_waybar_style "$next_mode"
notify_user "$next_mode"
# swaync color change
if [ "$next_mode" = "Dark" ]; then
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.8);/' "${swaync_style}"
sed -i '/@define-color noti-bg-alt/s/#.*;/#111111;/' "${swaync_style}"
else
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.9);/' "${swaync_style}"
sed -i '/@define-color noti-bg-alt/s/#.*;/#F0F0F0;/' "${swaync_style}"
fi
# ags color change
if [ "$next_mode" = "Dark" ]; then
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.4);/' "${ags_style}"
sed -i '/@define-color text-color/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.7);/' "${ags_style}"
sed -i '/@define-color noti-bg-alt/s/#.*;/#111111;/' "${ags_style}"
else
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.4);/' "${ags_style}"
sed -i '/@define-color text-color/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.7);/' "${ags_style}"
sed -i '/@define-color noti-bg-alt/s/#.*;/#F0F0F0;/' "${ags_style}"
fi
# Set Dynamic Wallpaper for Dark or Light Mode
if [ "$next_mode" = "Dark" ]; then
next_wallpaper="$(find "${dark_wallpapers}" -type f \( -iname "*.jpg" -o -iname "*.png" \) -print0 | shuf -n1 -z | xargs -0)"
else
next_wallpaper="$(find "${light_wallpapers}" -type f \( -iname "*.jpg" -o -iname "*.png" \) -print0 | shuf -n1 -z | xargs -0)"
fi
# Update wallpaper using swww command
$swww "${next_wallpaper}" $effect
# Set Kvantum Manager theme & QT5/QT6 settings
if [ "$next_mode" = "Dark" ]; then
kvantum_theme="Catppuccin-Mocha"
qt5ct_color_scheme="$HOME/.config/qt5ct/colors/Catppuccin-Mocha.conf"
qt6ct_color_scheme="$HOME/.config/qt6ct/colors/Catppuccin-Mocha.conf"
else
kvantum_theme="Catppuccin-Latte"
qt5ct_color_scheme="$HOME/.config/qt5ct/colors/Catppuccin-Latte.conf"
qt6ct_color_scheme="$HOME/.config/qt6ct/colors/Catppuccin-Latte.conf"
fi
sed -i "s|^color_scheme_path=.*$|color_scheme_path=$qt5ct_color_scheme|" "$HOME/.config/qt5ct/qt5ct.conf"
sed -i "s|^color_scheme_path=.*$|color_scheme_path=$qt6ct_color_scheme|" "$HOME/.config/qt6ct/qt6ct.conf"
kvantummanager --set "$kvantum_theme"
# set the rofi color for background
if [ "$next_mode" = "Dark" ]; then
sed -i '24s/.*/background: rgba(0,0,0,0.7);/' $wallust_rofi
else
sed -i '24s/.*/background: rgba(255,255,255,0.9);/' $wallust_rofi
fi
# GTK themes and icons switching
set_custom_gtk_theme() {
mode=$1
gtk_themes_directory="$HOME/.themes"
icon_directory="$HOME/.icons"
color_setting="org.gnome.desktop.interface color-scheme"
theme_setting="org.gnome.desktop.interface gtk-theme"
icon_setting="org.gnome.desktop.interface icon-theme"
if [ "$mode" == "Light" ]; then
search_keywords="*Light*"
gsettings set $color_setting 'prefer-light'
elif [ "$mode" == "Dark" ]; then
search_keywords="*Dark*"
gsettings set $color_setting 'prefer-dark'
else
echo "Invalid mode provided."
return 1
fi
themes=()
icons=()
while IFS= read -r -d '' theme_search; do
themes+=("$(basename "$theme_search")")
done < <(find "$gtk_themes_directory" -maxdepth 1 -type d -iname "$search_keywords" -print0)
while IFS= read -r -d '' icon_search; do
icons+=("$(basename "$icon_search")")
done < <(find "$icon_directory" -maxdepth 1 -type d -iname "$search_keywords" -print0)
if [ ${#themes[@]} -gt 0 ]; then
if [ "$mode" == "Dark" ]; then
selected_theme=${themes[RANDOM % ${#themes[@]}]}
else
selected_theme=${themes[$RANDOM % ${#themes[@]}]}
fi
echo "Selected GTK theme for $mode mode: $selected_theme"
gsettings set $theme_setting "$selected_theme"
# Flatpak GTK apps (themes)
if command -v flatpak &> /dev/null; then
flatpak --user override --filesystem=$HOME/.themes
sleep 0.5
flatpak --user override --env=GTK_THEME="$selected_theme"
fi
else
echo "No $mode GTK theme found"
fi
if [ ${#icons[@]} -gt 0 ]; then
if [ "$mode" == "Dark" ]; then
selected_icon=${icons[RANDOM % ${#icons[@]}]}
else
selected_icon=${icons[$RANDOM % ${#icons[@]}]}
fi
echo "Selected icon theme for $mode mode: $selected_icon"
gsettings set $icon_setting "$selected_icon"
## QT5ct icon_theme
sed -i "s|^icon_theme=.*$|icon_theme=$selected_icon|" "$HOME/.config/qt5ct/qt5ct.conf"
sed -i "s|^icon_theme=.*$|icon_theme=$selected_icon|" "$HOME/.config/qt6ct/qt6ct.conf"
# Flatpak GTK apps (icons)
if command -v flatpak &> /dev/null; then
flatpak --user override --filesystem=$HOME/.icons
sleep 0.5
flatpak --user override --env=ICON_THEME="$selected_icon"
fi
else
echo "No $mode icon theme found"
fi
}
# Call the function to set GTK theme and icon theme based on mode
set_custom_gtk_theme "$next_mode"
# Update theme mode for the next cycle
update_theme_mode
sleep 0.5
# Run remaining scripts
${SCRIPTSDIR}/WallustSwww.sh
sleep 1
${SCRIPTSDIR}/Refresh.sh
sleep 0.3
# Display notifications for theme and icon changes
notify-send -u normal -i "$notif" "Themes in $next_mode Mode"
exit 0

View file

@ -0,0 +1,31 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Game Mode. Turning off all animations
notif="$HOME/.config/swaync/images/bell.png"
SCRIPTSDIR="$HOME/.config/hypr/scripts"
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
if [ "$HYPRGAMEMODE" = 1 ] ; then
hyprctl --batch "\
keyword animations:enabled 0;\
keyword decoration:drop_shadow 0;\
keyword decoration:blur:passes 0;\
keyword general:gaps_in 0;\
keyword general:gaps_out 0;\
keyword general:border_size 1;\
keyword decoration:rounding 0"
swww kill
notify-send -e -u low -i "$notif" "gamemode enabled. All animations off"
exit
else
swww-daemon && swww img "$HOME/.config/rofi/.current_wallpaper" &
sleep 0.1
${SCRIPTSDIR}/WallustSwww.sh
sleep 0.5
${SCRIPTSDIR}/Refresh.sh
notify-send -e -u normal -i "$notif" "gamemode disabled. All animations normal"
exit
fi
hyprctl reload

View file

@ -0,0 +1,78 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Keyhints. Idea got from Garuda Hyprland
# Detect monitor resolution and scale
x_mon=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .width')
y_mon=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .height')
hypr_scale=$(hyprctl -j monitors | jq '.[] | select (.focused == true) | .scale' | sed 's/\.//')
# Calculate width and height based on percentages and monitor resolution
width=$((x_mon * hypr_scale / 100))
height=$((y_mon * hypr_scale / 100))
# Set maximum width and height
max_width=1200
max_height=1000
# Set percentage of screen size for dynamic adjustment
percentage_width=70
percentage_height=70
# Calculate dynamic width and height
dynamic_width=$((width * percentage_width / 100))
dynamic_height=$((height * percentage_height / 100))
# Limit width and height to maximum values
dynamic_width=$(($dynamic_width > $max_width ? $max_width : $dynamic_width))
dynamic_height=$(($dynamic_height > $max_height ? $max_height : $dynamic_height))
# Launch yad with calculated width and height
yad --width=$dynamic_width --height=$dynamic_height \
--center \
--title="Keybindings" \
--no-buttons \
--list \
--column=Key: \
--column=Description: \
--column=Command: \
--timeout-indicator=bottom \
"ESC" "close this app" "" "=" "SUPER KEY (Windows Key)" "(SUPER KEY)" \
" enter" "Terminal" "(kitty)" \
" SHIFT enter" "DropDown Terminal" "(kitty-pyprland)" \
" A" "Desktop Overview" "(AGS Overview)" \
" D" "App Launcher" "(rofi-wayland)" \
" T" "Open File Manager" "(Thunar)" \
" S" "Google Search" "(rofi)" \
" Q" "close active window" "(not kill)" \
" Shift Q " "closes a specified window" "(window)" \
" Z" "Desktop Zoom" "(pyprland)" \
" Alt V" "Clipboard Manager" "(cliphist)" \
" W" "Choose wallpaper" "(Wallpaper Menu)" \
"CTRL ALT W" "Random wallpaper" "(via swww)" \
" B" "Hide/UnHide Waybar" "waybar" \
" CTRL B" "Choose waybar styles" "(waybar styles)" \
" ALT B" "Choose waybar layout" "(waybar layout)" \
" ALT R" "Reload Waybar swaync Rofi" "CHECK NOTIFICATION FIRST!!!" \
" SHIFT N" "Launch Notification Panel" "swaync Notification Center" \
" 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)" \
"CTRL ALT Del" "Hyprland Exit" "(SAVE YOUR WORK!!!)" \
" F" "Fullscreen" "Toggles to full screen" \
" ALT L" "Toggle Dwindle | Master Layout" "Hyprland Layout" \
" Shift F" "Toggle float" "single window" \
" ALT F" "Toggle all windows to float" "all windows" \
" Shift B" "Toggle Blur" "normal or less blur" \
" SHIFT G" "Gamemode! All animations OFF or ON" "toggle" \
" ALT E" "Rofi Emoticons" "Emoticon" \
" ALT V" "Clipboard Manager" "cliphist" \
" H" "Launch this app" "" \
" E" "View or EDIT Keybinds, Settings, Monitor" "" \
"" "" "" \
"More tips:" "https://github.com/JaKooLit/Hyprland-Dots/wiki" ""\

View file

@ -0,0 +1,5 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# For Hyprlock
hyprlock -q --immediate

View file

@ -0,0 +1,61 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Playerctl
music_icon="$HOME/.config/swaync/icons/music.png"
# Play the next track
play_next() {
playerctl next
show_music_notification
}
# Play the previous track
play_previous() {
playerctl previous
show_music_notification
}
# Toggle play/pause
toggle_play_pause() {
playerctl play-pause
show_music_notification
}
# Stop playback
stop_playback() {
playerctl stop
notify-send -e -u low -i "$music_icon" "Playback Stopped"
}
# Display notification with song information
show_music_notification() {
status=$(playerctl status)
if [[ "$status" == "Playing" ]]; then
song_title=$(playerctl metadata title)
song_artist=$(playerctl metadata artist)
notify-send -e -u low -i "$music_icon" "Now Playing:" "$song_title\nby $song_artist"
elif [[ "$status" == "Paused" ]]; then
notify-send -e -u low -i "$music_icon" "Playback Paused"
fi
}
# Get media control action from command line argument
case "$1" in
"--nxt")
play_next
;;
"--prv")
play_previous
;;
"--pause")
toggle_play_pause
;;
"--stop")
stop_playback
;;
*)
echo "Usage: $0 [--nxt|--prv|--pause|--stop]"
exit 1
;;
esac

View file

@ -0,0 +1,21 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# For NixOS starting of polkit-gnome. Dec 2023, the settings stated in NixOS wiki does not work so have to manual start it
# Find all polkit-gnome executables in the Nix store
polkit_gnome_paths=$(find /nix/store -name 'polkit-gnome-authentication-agent-1' -type f 2>/dev/null)
for polkit_gnome_path in $polkit_gnome_paths; do
# Extract the directory containing the executable
polkit_gnome_dir=$(dirname "$polkit_gnome_path")
# Check if the executable is valid and exists
if [ -x "$polkit_gnome_dir/polkit-gnome-authentication-agent-1" ]; then
# Start the Polkit-GNOME Authentication Agent
"$polkit_gnome_dir/polkit-gnome-authentication-agent-1" &
exit 0
fi
done
# If no valid executable is found, report an error
echo "No valid Polkit-GNOME Authentication Agent executable found."

View file

@ -0,0 +1,30 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# This is for polkits, it will start from top and will stop if the top is executed
# Polkit possible paths files to check
polkit=(
"/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
"/usr/lib/polkit-kde-authentication-agent-1"
"/usr/lib/polkit-gnome-authentication-agent-1"
"/usr/libexec/polkit-gnome-authentication-agent-1"
"/usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1"
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"
)
executed=false # Flag to track if a file has been executed
# Loop through the list of files
for file in "${polkit[@]}"; do
if [ -e "$file" ]; then
echo "File $file found, executing command..."
exec "$file"
executed=true
break
fi
done
# If none of the files were found, you can add a fallback command here
if [ "$executed" == false ]; then
echo "None of the specified files were found. Install a Polkit"
fi

View file

@ -0,0 +1,16 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# For manually starting xdg-desktop-portal
sleep 1
killall xdg-desktop-portal-hyprland
killall xdg-desktop-portal-wlr
killall xdg-desktop-portal-gnome
killall xdg-desktop-portal
sleep 1
/usr/lib/xdg-desktop-portal-hyprland &
/usr/libexec/xdg-desktop-portal-hyprland &
sleep 2
/usr/lib/xdg-desktop-portal-hyprland &
/usr/libexec/xdg-desktop-portal &

View file

@ -0,0 +1,46 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Scripts for refreshing ags waybar, rofi, swaync, wallust
SCRIPTSDIR=$HOME/.config/hypr/scripts
UserScripts=$HOME/.config/hypr/UserScripts
# Define file_exists function
file_exists() {
if [ -e "$1" ]; then
return 0 # File exists
else
return 1 # File does not exist
fi
}
# Kill already running processes
_ps=(waybar rofi swaync ags)
for _prs in "${_ps[@]}"; do
if pidof "${_prs}" >/dev/null; then
pkill "${_prs}"
fi
done
# quit ags
ags -q
sleep 0.3
# Relaunch waybar
waybar &
# relaunch swaync
sleep 0.5
swaync > /dev/null 2>&1 &
# relaunch ags
ags &
# Relaunching rainbow borders if the script exists
sleep 1
if file_exists "${UserScripts}/RainbowBorders.sh"; then
${UserScripts}/RainbowBorders.sh &
fi
exit 0

View file

@ -0,0 +1,41 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Modified version of Refresh but no waybar refresh
# Used by automatic wallpaper change
# Modified inorder to refresh rofi background, Wallust, SwayNC
SCRIPTSDIR=$HOME/.config/hypr/scripts
UserScripts=$HOME/.config/hypr/UserScripts
# Define file_exists function
file_exists() {
if [ -e "$1" ]; then
return 0 # File exists
else
return 1 # File does not exist
fi
}
# Kill already running processes
_ps=(rofi)
for _prs in "${_ps[@]}"; do
if pidof "${_prs}" >/dev/null; then
pkill "${_prs}"
fi
done
# quit ags
ags -q
# Wallust refresh
${SCRIPTSDIR}/WallustSwww.sh &
# Relaunching rainbow borders if the script exists
sleep 1
if file_exists "${UserScripts}/RainbowBorders.sh"; then
${UserScripts}/RainbowBorders.sh &
fi
exit 0

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,17 @@
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Modified Script for Google Search
# Original Submitted by https://github.com/LeventKaanOguz
# Opens rofi in dmenu mod and waits for input. Then pushes the input to the query of the URL.
rofi_config="$HOME/.config/rofi/config-search.rasi"
# Kill Rofi if already running before execution
if pgrep -x "rofi" >/dev/null; then
pkill rofi
exit 0
fi
# Open rofi with a dmenu and pass the selected item to xdg-open for Google search
echo "" | rofi -dmenu -config "$rofi_config" -p "Search:" | xargs -I{} xdg-open "https://www.google.com/search?q={}"

View file

@ -0,0 +1,128 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Screenshots scripts
iDIR="$HOME/.config/swaync/icons"
sDIR="$HOME/.config/hypr/scripts"
notify_cmd_shot="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/picture.png"
time=$(date "+%d-%b_%H-%M-%S")
dir="$(xdg-user-dir)/Pictures/Screenshots"
file="Screenshot_${time}_${RANDOM}.png"
active_window_class=$(hyprctl -j activewindow | jq -r '(.class)')
active_window_file="Screenshot_${time}_${active_window_class}.png"
active_window_path="${dir}/${active_window_file}"
# notify and view screenshot
notify_view() {
if [[ "$1" == "active" ]]; then
if [[ -e "${active_window_path}" ]]; then
${notify_cmd_shot} "Screenshot of '${active_window_class}' Saved."
"${sDIR}/Sounds.sh" --screenshot
else
${notify_cmd_shot} "Screenshot of '${active_window_class}' not Saved"
fi
elif [[ "$1" == "swappy" ]]; then
${notify_cmd_shot} "Screenshot Captured."
else
local check_file="$dir/$file"
if [[ -e "$check_file" ]]; then
${notify_cmd_shot} "Screenshot Saved."
"${sDIR}/Sounds.sh" --screenshot
else
${notify_cmd_shot} "Screenshot NOT Saved."
fi
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() {
tmpfile=$(mktemp)
grim -g "$(slurp)" - >"$tmpfile"
if [[ -s "$tmpfile" ]]; then
wl-copy <"$tmpfile"
mv "$tmpfile" "$dir/$file"
fi
rm "$tmpfile"
notify_view
}
shotactive() {
active_window_class=$(hyprctl -j activewindow | jq -r '(.class)')
active_window_file="Screenshot_${time}_${active_window_class}.png"
active_window_path="${dir}/${active_window_file}"
hyprctl -j activewindow | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | grim -g - "${active_window_path}"
sleep 1
notify_view "active"
}
shotswappy() {
tmpfile=$(mktemp)
grim -g "$(slurp)" - >"$tmpfile" && "${sDIR}/Sounds.sh" --screenshot && notify_view "swappy"
swappy -f - <"$tmpfile"
rm "$tmpfile"
}
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
elif [[ "$1" == "--active" ]]; then
shotactive
elif [[ "$1" == "--swappy" ]]; then
shotswappy
else
echo -e "Available Options : --now --in5 --in10 --win --area --active --swappy"
fi
exit 0

View file

@ -0,0 +1,72 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# This script is used to play system sounds.
# Script is used by Volume.Sh and ScreenShots.sh
theme="freedesktop" # Set the theme for the system sounds.
mute=false # Set to true to mute the system sounds.
# Mute individual sounds here.
muteScreenshots=false
muteVolume=false
# Exit if the system sounds are muted.
if [[ "$mute" = true ]]; then
exit 0
fi
# Choose the sound to play.
if [[ "$1" == "--screenshot" ]]; then
if [[ "$muteScreenshots" = true ]]; then
exit 0
fi
soundoption="screen-capture.*"
elif [[ "$1" == "--volume" ]]; then
if [[ "$muteVolume" = true ]]; then
exit 0
fi
soundoption="audio-volume-change.*"
else
echo -e "Available sounds: --screenshot, --volume"
exit 0
fi
# Set the directory defaults for system sounds.
if [ -d "/run/current-system/sw/share/sounds" ]; then
systemDIR="/run/current-system/sw/share/sounds" # NixOS
else
systemDIR="/usr/share/sounds"
fi
userDIR="$HOME/.local/share/sounds"
defaultTheme="freedesktop"
# Prefer the user's theme, but use the system's if it doesn't exist.
sDIR="$systemDIR/$defaultTheme"
if [ -d "$userDIR/$theme" ]; then
sDIR="$userDIR/$theme"
elif [ -d "$systemDIR/$theme" ]; then
sDIR="$systemDIR/$theme"
fi
# Get the theme that it inherits.
iTheme=$(cat "$sDIR/index.theme" | grep -i "inherits" | cut -d "=" -f 2)
iDIR="$sDIR/../$iTheme"
# Find the sound file and play it.
sound_file=$(find $sDIR/stereo -name "$soundoption" -print -quit)
if ! test -f "$sound_file"; then
sound_file=$(find $iDIR/stereo -name "$soundoption" -print -quit)
if ! test -f "$sound_file"; then
sound_file=$(find $userDIR/$defaultTheme/stereo -name "$soundoption" -print -quit)
if ! test -f "$sound_file"; then
sound_file=$(find $systemDIR/$defaultTheme/stereo -name "$soundoption" -print -quit)
if ! test -f "$sound_file"; then
echo "Error: Sound file not found."
exit 1
fi
fi
fi
fi
# pipewire priority, fallback pulseaudio
pw-play "$sound_file" || pa-play "$sound_file"

View file

@ -0,0 +1,78 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# This is for changing kb_layouts. Set kb_layouts in $settings_file
layout_f="$HOME/.cache/kb_layout"
settings_file="$HOME/.config/hypr/UserConfigs/UserSettings.conf"
notif="$HOME/.config/swaync/images/bell.png"
# Check if ~/.cache/kb_layout exists and create it with a default layout from Settings.conf if not found
if [ ! -f "$layout_f" ]; then
default_layout=$(grep 'kb_layout=' "$settings_file" | cut -d '=' -f 2 | cut -d ',' -f 1 2>/dev/null)
if [ -z "$default_layout" ]; then
default_layout="us" # Default to 'us' layout if Settings.conf or 'kb_layout' is not found
fi
echo "$default_layout" > "$layout_f"
fi
current_layout=$(cat "$layout_f")
# Read keyboard layout settings from Settings.conf
if [ -f "$settings_file" ]; then
kb_layout_line=$(grep 'kb_layout=' "$settings_file" | cut -d '=' -f 2)
IFS=',' read -ra layout_mapping <<< "$kb_layout_line"
fi
layout_count=${#layout_mapping[@]}
# Find the index of the current layout in the mapping
for ((i = 0; i < layout_count; i++)); do
if [ "$current_layout" == "${layout_mapping[i]}" ]; then
current_index=$i
break
fi
done
# Calculate the index of the next layout
next_index=$(( (current_index + 1) % layout_count ))
new_layout="${layout_mapping[next_index]}"
# Update the keyboard layout
hyprctl switchxkblayout "at-translated-set-2-keyboard" "$new_layout"
echo "$new_layout" > "$layout_f"
# 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

View file

@ -0,0 +1,27 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# For disabling touchpad.
# Edit the Touchpad_Device according to your system
# use hyprctl devices to get your system touchpad device name
Touchpad_Device="asue1209:00-04f3:319f-touchpad"
notif="$HOME/.config/swaync/images/bell.png"
XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/$(id -u)}
STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status"
toggle_touchpad() {
if [ ! -f "$STATUS_FILE" ] || [ "$(cat "$STATUS_FILE")" = "false" ]; then
echo "true" > "$STATUS_FILE"
action="enabled"
else
echo "false" > "$STATUS_FILE"
action="disabled"
fi
notify-send -u low -i "$notif" "Touchpad $action"
hyprctl keyword "device[$Touchpad_Device]:enabled" "$(cat "$STATUS_FILE")"
}
toggle_touchpad

View file

@ -0,0 +1,33 @@
#!/usr/bin/env bash
# Script parses /proc/uptime to get the system uptime
# and prints it in a human-readable format
# This is a workaround for system where `uptime` command is taken from coreutils
# where `uptime -p` is not supported
if [[ -r /proc/uptime ]]; then
s=$(< /proc/uptime)
s=${s/.*}
else
echo "Error UptimeNixOS.sh: Uptime could not be determined." >&2
exit 1
fi
d="$((s / 60 / 60 / 24)) days"
h="$((s / 60 / 60 % 24)) hours"
m="$((s / 60 % 60)) minutes"
# Remove plural if < 2.
((${d/ *} == 1)) && d=${d/s}
((${h/ *} == 1)) && h=${h/s}
((${m/ *} == 1)) && m=${m/s}
# Hide empty fields.
((${d/ *} == 0)) && unset d
((${h/ *} == 0)) && unset h
((${m/ *} == 0)) && unset m
uptime=${d:+$d, }${h:+$h, }$m
uptime=${uptime%', '}
uptime=${uptime:-$s seconds}
echo "up $uptime"

View file

@ -0,0 +1,143 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Scripts for volume controls for audio and mic
iDIR="$HOME/.config/swaync/icons"
sDIR="$HOME/.config/hypr/scripts"
# Get Volume
get_volume() {
volume=$(pamixer --get-volume)
if [[ "$volume" -eq "0" ]]; then
echo "Muted"
else
echo "$volume%"
fi
}
# Get icons
get_icon() {
current=$(get_volume)
if [[ "$current" == "Muted" ]]; then
echo "$iDIR/volume-mute.png"
elif [[ "${current%\%}" -le 30 ]]; then
echo "$iDIR/volume-low.png"
elif [[ "${current%\%}" -le 60 ]]; then
echo "$iDIR/volume-mid.png"
else
echo "$iDIR/volume-high.png"
fi
}
# Notify
notify_user() {
if [[ "$(get_volume)" == "Muted" ]]; then
notify-send -e -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" "Volume: Muted"
else
notify-send -e -h int:value:"$(get_volume | sed 's/%//')" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" "Volume: $(get_volume)"
"$sDIR/Sounds.sh" --volume
fi
}
# Increase Volume
inc_volume() {
if [ "$(pamixer --get-mute)" == "true" ]; then
toggle_mute
else
pamixer -i 5 --allow-boost --set-limit 150 && notify_user
fi
}
# Decrease Volume
dec_volume() {
if [ "$(pamixer --get-mute)" == "true" ]; then
toggle_mute
else
pamixer -d 5 && notify_user
fi
}
# Toggle Mute
toggle_mute() {
if [ "$(pamixer --get-mute)" == "false" ]; then
pamixer -m && notify-send -e -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF"
elif [ "$(pamixer --get-mute)" == "true" ]; then
pamixer -u && notify-send -e -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 -e -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 -e -u low -i "$iDIR/microphone.png" "Microphone Switched ON"
fi
}
# Get Mic Icon
get_mic_icon() {
current=$(pamixer --default-source --get-volume)
if [[ "$current" -eq "0" ]]; then
echo "$iDIR/microphone-mute.png"
else
echo "$iDIR/microphone.png"
fi
}
# Get Microphone Volume
get_mic_volume() {
volume=$(pamixer --default-source --get-volume)
if [[ "$volume" -eq "0" ]]; then
echo "Muted"
else
echo "$volume%"
fi
}
# Notify for Microphone
notify_mic_user() {
volume=$(get_mic_volume)
icon=$(get_mic_icon)
notify-send -e -h int:value:"$volume" -h "string:x-canonical-private-synchronous:volume_notif" -u low -i "$icon" "Mic-Level: $volume"
}
# Increase MIC Volume
inc_mic_volume() {
if [ "$(pamixer --default-source --get-mute)" == "true" ]; then
toggle_mic
else
pamixer --default-source -i 5 && notify_mic_user
fi
}
# Decrease MIC Volume
dec_mic_volume() {
if [ "$(pamixer --default-source --get-mute)" == "true" ]; then
toggle-mic
else
pamixer --default-source -d 5 && notify_mic_user
fi
}
# 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

View file

@ -0,0 +1,37 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Wallust Colors for current wallpaper
# Define the path to the swww cache directory
cache_dir="$HOME/.cache/swww/"
# Get a list of monitor outputs
monitor_outputs=($(ls "$cache_dir"))
# Initialize a flag to determine if the ln command was executed
ln_success=false
# Get current focused monitor
current_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}')
echo $current_monitor
# Construct the full path to the cache file
cache_file="$cache_dir$current_monitor"
echo $cache_file
# Check if the cache file exists for the current monitor output
if [ -f "$cache_file" ]; then
# Get the wallpaper path from the cache file
wallpaper_path=$(cat "$cache_file")
echo $wallpaper_path
# Copy the wallpaper to the location Rofi can access
if ln -sf "$wallpaper_path" "$HOME/.config/rofi/.current_wallpaper"; then
ln_success=true # Set the flag to true upon successful execution
fi
fi
# Check the flag before executing further commands
if [ "$ln_success" = true ]; then
# execute wallust
echo 'about to execute wallust'
# execute wallust skipping tty and terminal changes
wallust run "$wallpaper_path" -s &
fi

View file

@ -0,0 +1,39 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Not my own work. This was added through Github PR. Credit to original author
#----- Optimized bars animation without much CPU usage increase --------
bar="▁▂▃▄▅▆▇█"
dict="s/;//g"
# Calculate the length of the bar outside the loop
bar_length=${#bar}
# Create dictionary to replace char with bar
for ((i = 0; i < bar_length; i++)); do
dict+=";s/$i/${bar:$i:1}/g"
done
# Create cava config
config_file="/tmp/bar_cava_config"
cat >"$config_file" <<EOF
[general]
bars = 10
[input]
method = pulse
source = auto
[output]
method = raw
raw_target = /dev/stdout
data_format = ascii
ascii_max_range = 7
EOF
# Kill cava if it's already running
pkill -f "cava -p $config_file"
# Read stdout from cava and perform substitution in a single sed command
cava -p "$config_file" | sed -u "$dict"

View file

@ -0,0 +1,64 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Script for waybar layout or configs
set -euo pipefail
IFS=$'\n\t'
# Define directories
waybar_layouts="$HOME/.config/waybar/configs"
waybar_config="$HOME/.config/waybar/config"
SCRIPTSDIR="$HOME/.config/hypr/scripts"
rofi_config="$HOME/.config/rofi/config-waybar-layout.rasi"
# Function to display menu options
menu() {
options=()
while IFS= read -r file; do
options+=("$(basename "$file")")
done < <(find "$waybar_layouts" -maxdepth 1 -type f -exec basename {} \; | sort)
printf '%s\n' "${options[@]}"
}
# Apply selected configuration
apply_config() {
ln -sf "$waybar_layouts/$1" "$waybar_config"
restart_waybar_if_needed
}
# Restart Waybar
restart_waybar_if_needed() {
if pgrep -x "waybar" >/dev/null; then
pkill waybar
sleep 0.1 # Delay for Waybar to completely terminate
fi
"${SCRIPTSDIR}/Refresh.sh" &
}
# Main function
main() {
choice=$(menu | rofi -i -dmenu -config "$rofi_config")
if [[ -z "$choice" ]]; then
echo "No option selected. Exiting."
exit 0
fi
case $choice in
"no panel")
pgrep -x "waybar" && pkill waybar || true
;;
*)
apply_config "$choice"
;;
esac
}
# Kill Rofi if already running before execution
if pgrep -x "rofi" >/dev/null; then
pkill rofi
exit 0
fi
main

View file

@ -0,0 +1,59 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Script for waybar styles
set -euo pipefail
IFS=$'\n\t'
# Define directories
waybar_styles="$HOME/.config/waybar/style"
waybar_style="$HOME/.config/waybar/style.css"
SCRIPTSDIR="$HOME/.config/hypr/scripts"
rofi_config="$HOME/.config/rofi/config-waybar-style.rasi"
# Function to display menu options
menu() {
options=()
while IFS= read -r file; do
if [ -f "$waybar_styles/$file" ]; then
options+=("$(basename "$file" .css)")
fi
done < <(find "$waybar_styles" -maxdepth 1 -type f -name '*.css' -exec basename {} \; | sort)
printf '%s\n' "${options[@]}"
}
# Apply selected style
apply_style() {
ln -sf "$waybar_styles/$1.css" "$waybar_style"
restart_waybar_if_needed
}
# Restart Waybar if it's running
restart_waybar_if_needed() {
if pgrep -x "waybar" >/dev/null; then
pkill waybar
sleep 0.1 # Delay for Waybar to completely terminate
fi
"${SCRIPTSDIR}/Refresh.sh" &
}
# Main function
main() {
choice=$(menu | rofi -i -dmenu -config "$rofi_config")
if [[ -z "$choice" ]]; then
echo "No option selected. Exiting."
exit 0
fi
apply_style "$choice"
}
# Kill Rofi if already running before execution
if pgrep -x "rofi" >/dev/null; then
pkill rofi
exit 0
fi
main

View file

@ -0,0 +1,57 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# wlogout (Power, Screen Lock, Suspend, etc)
# Set variables for parameters
A_2160=450
B_2160=450
A_1600=400
B_1600=400
A_1440=350
B_1440=350
A_1080=350
B_1080=350
A_720=50
B_720=50
# Check if wlogout is already running
if pgrep -x "wlogout" > /dev/null; then
pkill -x "wlogout"
exit 0
fi
# Detect monitor resolution and scaling factor
resolution=$(hyprctl -j monitors | jq -r '.[] | select(.focused==true) | .height / .scale' | awk -F'.' '{print $1}')
hypr_scale=$(hyprctl -j monitors | jq -r '.[] | select(.focused==true) | .scale')
# Set parameters based on screen resolution and scaling factor
if ((resolution >= 2160)); then
T_val=$(awk "BEGIN {printf \"%.0f\", $A_2160 * 2160 * $hypr_scale / $resolution}")
B_val=$(awk "BEGIN {printf \"%.0f\", $B_2160 * 2160 * $hypr_scale / $resolution}")
echo "Setting parameters for resolution >= 4k"
wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val &
elif ((resolution >= 1600 && resolution < 2160)); then
T_val=$(awk "BEGIN {printf \"%.0f\", $A_1600 * 1600 * $hypr_scale / $resolution}")
B_val=$(awk "BEGIN {printf \"%.0f\", $B_1600 * 1600 * $hypr_scale / $resolution}")
echo "Setting parameters for resolution >= 2.5k and < 4k"
wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val &
elif ((resolution >= 1440 && resolution < 1600)); then
T_val=$(awk "BEGIN {printf \"%.0f\", $A_1440 * 1440 * $hypr_scale / $resolution}")
B_val=$(awk "BEGIN {printf \"%.0f\", $B_1440 * 1440 * $hypr_scale / $resolution}")
echo "Setting parameters for resolution >= 2k and < 2.5k"
wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val &
elif ((resolution >= 1080 && resolution < 1440)); then
T_val=$(awk "BEGIN {printf \"%.0f\", $A_1080 * 1080 * $hypr_scale / $resolution}")
B_val=$(awk "BEGIN {printf \"%.0f\", $B_1080 * 1080 * $hypr_scale / $resolution}")
echo "Setting parameters for resolution >= 1080p and < 2k"
wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val &
elif ((resolution >= 720 && resolution < 1080)); then
T_val=$(awk "BEGIN {printf \"%.0f\", $A_720 * 720 * $hypr_scale / $resolution}")
B_val=$(awk "BEGIN {printf \"%.0f\", $B_720 * 720 * $hypr_scale / $resolution}")
echo "Setting parameters for resolution >= 720p and < 1080p"
wlogout --protocol layer-shell -b 3 -T $T_val -B $B_val &
else
echo "Setting default parameters"
wlogout &
fi

View file

@ -0,0 +1,16 @@
polkit=(
"/usr/lib/polkit-kde-authentication-agent-1"
"/usr/lib/x86_64-linux-gnu/libexec/polkit-authentication-agent-1"
)
executed=false
for file in "${polkit[@]}"; do
if [ -e "$file" ]; then
echo "File $file found"
exec "$file"
executed=true
break
fi
done