Skip to content

Commit

Permalink
✨ Add toggle waybar script
Browse files Browse the repository at this point in the history
  • Loading branch information
mekb-turtle committed Jan 28, 2025
1 parent 5e26097 commit debd20d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
~/.bin/ctp-rofi: scripts/ctp-rofi
~/.bin/lock: scripts/lock
~/.bin/toggle-autolock: scripts/toggle-autolock
~/.bin/toggle-waybar: scripts/toggle-waybar
~/.bin/hypr-search-proc.pl: scripts/hypr-search-proc.pl
~/.bin/keybinds: keybinds
~/.bin/kill-window: scripts/kill-window
~/.bin/power: scripts/power
~/.bin/rewallpaper: scripts/rewallpaper
~/.bin/rewaybar: scripts/rewaybar
~/.bin/screenshot: submodules/hyprland-screenshot/screenshot.sh
~/.bin/screenshot-ocr: scripts/screenshot-ocr
~/.bin/screenshot-preview: scripts/screenshot-preview
Expand Down
16 changes: 9 additions & 7 deletions hyprland.conf.d/autostart.conf
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Autostart

$proc = ~/.bin/hypr-search-proc.pl -s -q --

# Touchscreen keyboard (hidden by default)
exec-once = wvkbd-mobintl --hidden --fn Ubuntu --bg 1e1e2e --fg 45475a --fg-sp 585b70 --press 313244 --press-sp 313244 --swipe 313244 --swipe-sp 313244 --text cdd6f4 --text-sp f5c2e7 --landscape-layers simple,special -H 300 -L 200

# User service manager
exec-once = if ! pgrep -x -u "$(id -u)" dinit; then sleep 3; dinit; fi

# Start notification daemon
exec = pidof -sq dunst || dunst
exec = $proc dunst

# Enable automatic screen-lock
exec-once = hypridle
exec-once = $proc hypridle

# KDE Connect
exec-once = /usr/lib/polkit-kde-authentication-agent-1
Expand All @@ -33,19 +35,19 @@ exec-once = wl-paste --type image --watch cliphist store
exec-once = $HOME/.bin/hyprstart

# Special script to start keepassxc with ssh-agent environment variables
exec-once = pidof -sq keepassxc || ~/.bin/start-keepassxc
exec-once = ~/.bin/hypr-search-proc.pl -q keepassxc || ~/.bin/start-keepassxc

# Volume/brightness control with a pop-up
exec-once = swayosd-server
exec = $proc swayosd-server

# Waybar
exec-once = if ! pidof -sq waybar; then sleep 1 && ~/.bin/rewaybar; fi
exec = $proc waybar

# Calender
exec-once = if ! pidof -sq orage; then sleep 1 && orage; fi
exec = $proc orage

# Audio mixer
exec-once = if ! pidof -sq jamesdsp; then sleep 1 && jamesdsp --tray; fi
exec = $proc jamesdsp --tray

# Apply wallpaper
exec-once = ~/.bin/rewallpaper
Expand Down
8 changes: 4 additions & 4 deletions keybinds
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ IFS=$'\n'
keybinds=(
"$MOD CTRL, Space, exec, true | wl-copy" # Clear clipboard
"$MOD CTRL, C, exec, true | wl-copy" # Clear clipboard
"$MOD, A, exec, \$HOME/.bin/emojiclip rofi" # Emoji menu
"$MOD, B, exec, if pidof -sq waybar; then killall -SIGUSR1 waybar; else ~/.bin/rewaybar; fi" # Toggle waybar
"$MOD, A, exec, ~/.bin/emojiclip rofi" # Emoji menu
"$MOD, B, exec, ~/.bin/toggle-waybar" # Toggle waybar
"$MOD, C, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" # Clipboard history
"$MOD, X, exec, \$HOME/.bin/ctp-rofi" # Rofi Catppuccin color picker
"$MOD, X, exec, ~/.bin/ctp-rofi" # Rofi Catppuccin color picker
"$MOD SHIFT, C, exec, true | wl-copy; cliphist wipe && notify-send 'cleared clipboard history' -a ''" # Clear clipboard history
"$MOD, Z, exec, dunstctl history-pop" # Show last notification
"$MOD, L, exec, ~/.bin/lock" # Lock screen
"$MOD SHIFT, L, exec, ~/.bin/toggle-autolock" # Toggle automatic locking
"$MOD SHIFT, I, exec, pkill -RTMIN -x wvkbd-mobintl" # Toggle software keyboard
"$MOD, K, exec, ~/.bin/start-keepassxc" # Password manager
"CTRL ALT SUPER, Delete, exec, \$HOME/.bin/power" # Power menu
"CTRL ALT SUPER, Delete, exec, ~/.bin/power" # Power menu
"$MOD, R, exec, rofi -show drun" # Application menu
"$MOD SHIFT, R, exec, rofi -show run"
"$MOD, N, exec, nemo" # File manager
Expand Down
4 changes: 0 additions & 4 deletions scripts/rewaybar

This file was deleted.

10 changes: 10 additions & 0 deletions scripts/toggle-waybar
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -euo pipefail
set -f
IFS=$'\n'
if PIDS="$(~/.bin/hypr-search-proc.pl waybar)"; then
kill -SIGUSR1 -- $PIDS
else
waybar &
disown
fi

0 comments on commit debd20d

Please sign in to comment.