diff options
Diffstat (limited to 'bspwm/.config')
| -rwxr-xr-x | bspwm/.config/bspwm/bspwmrc | 78 | ||||
| -rwxr-xr-x | bspwm/.config/bspwm/scripts/.fullscreen.bak | 47 | ||||
| -rwxr-xr-x | bspwm/.config/bspwm/scripts/.screenshot.bak | 13 | ||||
| -rwxr-xr-x | bspwm/.config/bspwm/scripts/.snip.bak | 13 | ||||
| -rwxr-xr-x | bspwm/.config/bspwm/scripts/.truefull | 26 | ||||
| -rwxr-xr-x | bspwm/.config/bspwm/scripts/blur-lock | 11 | ||||
| -rwxr-xr-x | bspwm/.config/bspwm/scripts/fullscreen | 80 | ||||
| -rwxr-xr-x | bspwm/.config/bspwm/scripts/keyboard | 5 | ||||
| -rwxr-xr-x | bspwm/.config/bspwm/scripts/keyboard-layouts | 1 | ||||
| -rwxr-xr-x | bspwm/.config/bspwm/scripts/mute | 14 | ||||
| -rwxr-xr-x | bspwm/.config/bspwm/scripts/screenshot | 16 | ||||
| -rwxr-xr-x | bspwm/.config/bspwm/scripts/snip | 16 |
12 files changed, 320 insertions, 0 deletions
diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc new file mode 100755 index 0000000..14e1036 --- /dev/null +++ b/bspwm/.config/bspwm/bspwmrc @@ -0,0 +1,78 @@ +#!/bin/sh +# ██████╗░██╗░░██╗░░░░░░██████╗░░██████╗██████╗░░██╗░░░░░░░██╗███╗░░░███╗ # +# ██╔══██╗██║░░██║░░░░░░██╔══██╗██╔════╝██╔══██╗░██║░░██╗░░██║████╗░████║ # +# ██████╦╝███████║█████╗██████╦╝╚█████╗░██████╔╝░╚██╗████╗██╔╝██╔████╔██║ # +# ██╔══██╗██╔══██║╚════╝██╔══██╗░╚═══██╗██╔═══╝░░░████╔═████║░██║╚██╔╝██║ # +# ██████╦╝██║░░██║░░░░░░██████╦╝██████╔╝██║░░░░░░░╚██╔╝░╚██╔╝░██║░╚═╝░██║ # +# ╚═════╝░╚═╝░░╚═╝░░░░░░╚═════╝░╚═════╝░╚═╝░░░░░░░░╚═╝░░░╚═╝░░╚═╝░░░░░╚═╝ # +# +# █▄▄ █░█ ▀ █▀ █▀▀ █▀█ █▄░█ █▀▀ █ █▀▀ █▀▀ █▀█ █▀█ █▄▄ █▀ █▀█ █░█░█ █▀▄▀█ # +# █▄█ █▀█ ░ ▄█ █▄▄ █▄█ █░▀█ █▀░ █ █▄█ █▀░ █▄█ █▀▄ █▄█ ▄█ █▀▀ ▀▄▀▄▀ █░▀░█ # + + +# Colours + +darkcyan="#007575" +lightcyan="#1ebaba" +lightercyan="#19e0e0" +red="#e55235" + + +# Keybindings + +# /home/bh/.config/bspwm/scripts/keyboard & # Capslock to Backspace +# setxkbmap -layout "us,us,cn,jp,ru" -variant "dvorak,,wubi,,," -option "grp:ctrl_shift_toggle" + +pgrep -x sxhkd > /dev/null || sxhkd -c /home/bh/.config/sxhkd/sxhkdrc & # Checks if sxhkd is running. If not, it is started. + +# Workspaces + +# bspc monitor -d 1 2 3 4 5 6 7 8 9 10 +# bspc monitor -d I II III IV V VI VII VIII IX X +# bspc monitor -d 壹 貳 參 肆 伍 陸 柒 捌 玖 拾 +bspc monitor -d 一 二 三 四 五 六 七 八 九 十 + +# Windows +bspc config border_width 1 +bspc config window_gap 6 + +bspc config split_ratio 0.50 +bspc config borderless_monocle true +bspc config gapless_monocle true + +bspc config focused_border_color "$lightercyan" +bspc config normal_border_color "$darkcyan" +bspc config urgent_border_color "$red" +bspc config presel_feedback_color "$lightercyan" + + +# Startup + +kitty & # Opens Two +kitty & # Terminal Emulators + +polybar & # Opens Status Bar + +# feh --bg-fill /home/bh/Pictures/Wallpapers/NightMountain.jpg & # Wallpaper +# feh --bg-fill /home/bh/Pictures/Wallpapers/BlueMountain.jpg & # Wallpaper +# feh --bg-fill /home/bh/Pictures/Wallpapers/CloudyBluishMountain.jpg & # Wallpaper +feh --bg-fill /home/bh/Pictures/Wallpapers/TealNebula.jpg & # Wallpaper + + + +# Application Rules + +# bspc rule -a "kitty" desktop=^1 follow=on # Only Opens Kitty in Desktop 1 +bspc rule -a "firefox" desktop=^2 follow=on # Only Opens Firefox in Desktop 2 +bspc rule -a "zen" desktop=^2 follow=on # Only Opens Zen-Browser in Desktop 2 +bspc rule -a "Emacs" desktop=^3 follow=on # Only Opens Emacs in Desktop 3 + + +# Floating Class +bspc rule -a floating state=floating + +# Compositor +# picom --config ~/.config/picom/picom.conf & # Compositor + +# Notifications +dunst & diff --git a/bspwm/.config/bspwm/scripts/.fullscreen.bak b/bspwm/.config/bspwm/scripts/.fullscreen.bak new file mode 100755 index 0000000..a3062dd --- /dev/null +++ b/bspwm/.config/bspwm/scripts/.fullscreen.bak @@ -0,0 +1,47 @@ +#!/bin/bash +# Toggle fullscreen mode: hide all other nodes and fullscreen current node + +STATE_FILE="/tmp/bspwm_fullscreen_state" + +# Check if we're already in fullscreen mode +if [ -f "$STATE_FILE" ]; then + # Restore mode: unhide all nodes and exit fullscreen + while IFS= read -r node_id; do + # First line is the fullscreen node, rest are hidden nodes + if [ -z "$fullscreen_node" ]; then + fullscreen_node="$node_id" + # Exit fullscreen on the current fullscreen node + bspc node "$fullscreen_node" -t tiled 2>/dev/null + else + # Unhide the hidden nodes + bspc node "$node_id" -g hidden=off 2>/dev/null + fi + done < "$STATE_FILE" + + # Remove state file + rm "$STATE_FILE" +else + # Enter fullscreen mode: hide all other nodes + focused_node=$(bspc query -N -n focused) + + if [ -z "$focused_node" ]; then + echo "No focused node found" + exit 1 + fi + + # Store the focused node ID first + echo "$focused_node" > "$STATE_FILE" + + # Get all visible windows on current desktop except the focused one + bspc query -N -d focused -n .window | while read -r node_id; do + if [ "$node_id" != "$focused_node" ]; then + # Hide the node + bspc node "$node_id" -g hidden=on + # Store the hidden node ID + echo "$node_id" >> "$STATE_FILE" + fi + done + + # Make the focused node fullscreen + bspc node "$focused_node" -t fullscreen +fi diff --git a/bspwm/.config/bspwm/scripts/.screenshot.bak b/bspwm/.config/bspwm/scripts/.screenshot.bak new file mode 100755 index 0000000..f15b6f1 --- /dev/null +++ b/bspwm/.config/bspwm/scripts/.screenshot.bak @@ -0,0 +1,13 @@ +#!/bin/bash + +# Ensure the folder exists +mkdir -p ~/Pictures/Screenshots + +# Create timestamped filename +FILE=~/Pictures/Screenshots/$(date '+%Y-%m-%d_%H-%M-%S').png + +# Take screenshot (full screen) using maim +maim "$FILE" | xclip -selection clipboard -t image/png + +# Notify via dunst +dunstify "Screenshot Taken!" -i "$FILE" diff --git a/bspwm/.config/bspwm/scripts/.snip.bak b/bspwm/.config/bspwm/scripts/.snip.bak new file mode 100755 index 0000000..02c8784 --- /dev/null +++ b/bspwm/.config/bspwm/scripts/.snip.bak @@ -0,0 +1,13 @@ +#!/bin/bash + +# Ensure folder exists +mkdir -p ~/Pictures/Screenshots + +# Timestamped filename +FILE=~/Pictures/Screenshots/$(date '+%Y-%m-%d_%H-%M-%S').png + +# Take screenshot (interactive selection) +maim -s "$FILE" | xclip -selection clipboard -t image/png + +# Notify with dunst, explicitly setting icon as the screenshot +dunstify -a "Screenshot Taken!" -i "$FILE" diff --git a/bspwm/.config/bspwm/scripts/.truefull b/bspwm/.config/bspwm/scripts/.truefull new file mode 100755 index 0000000..85ebeab --- /dev/null +++ b/bspwm/.config/bspwm/scripts/.truefull @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +# Get the focused window +FOCUSED=$(bspc query -N -n focused) +if [ -z "$FOCUSED" ]; then + exit 1 +fi + +# Check if the window is already on the temporary fullscreen desktop +TEMP_DESKTOP="fullscreen-$$" +CURRENT_DESKTOP=$(bspc query -D -d focused --names) + +# Toggle behavior +if bspc query -D -d "$TEMP_DESKTOP" &>/dev/null; then + # The temporary desktop exists → move back to original desktop + ORIGINAL=$(bspc query -D -d | grep -v "$TEMP_DESKTOP" | head -n1) + bspc node "$FOCUSED" -d "$ORIGINAL" + bspc desktop "$ORIGINAL" -f + bspc desktop "$TEMP_DESKTOP" --remove +else + # Create temporary desktop and move the window there + bspc monitor -d "$TEMP_DESKTOP" + bspc node "$FOCUSED" -d "$TEMP_DESKTOP" + bspc desktop "$TEMP_DESKTOP" -f + bspc node "$FOCUSED" -t fullscreen +fi diff --git a/bspwm/.config/bspwm/scripts/blur-lock b/bspwm/.config/bspwm/scripts/blur-lock new file mode 100755 index 0000000..4ff7ed6 --- /dev/null +++ b/bspwm/.config/bspwm/scripts/blur-lock @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +PICTURE=/tmp/i3lock.png +SCREENSHOT="scrot -z $PICTURE" + +BLUR="5x4" + +$SCREENSHOT +convert $PICTURE -blur $BLUR $PICTURE +i3lock -i $PICTURE +rm $PICTURE diff --git a/bspwm/.config/bspwm/scripts/fullscreen b/bspwm/.config/bspwm/scripts/fullscreen new file mode 100755 index 0000000..3214f5f --- /dev/null +++ b/bspwm/.config/bspwm/scripts/fullscreen @@ -0,0 +1,80 @@ +#!/bin/bash +# Toggle fullscreen mode: hide all other nodes and fullscreen current node + +STATE_FILE="/tmp/bspwm_fullscreen_state" +MONITOR_PID_FILE="/tmp/bspwm_fullscreen_monitor_pid" + +# Function to restore hidden windows +restore_windows() { + if [ -f "$STATE_FILE" ]; then + while IFS= read -r node_id; do + if [ -z "$fullscreen_node" ]; then + fullscreen_node="$node_id" + bspc node "$fullscreen_node" -t tiled 2>/dev/null + else + bspc node "$node_id" -g hidden=off 2>/dev/null + fi + done < "$STATE_FILE" + rm "$STATE_FILE" + fi + [ -f "$MONITOR_PID_FILE" ] && rm "$MONITOR_PID_FILE" +} + +# Function to monitor fullscreen window +monitor_fullscreen() { + local fullscreen_node="$1" + + bspc subscribe node_remove | while read -r _ _ _ removed_node; do + # Check if state file still exists (user might have toggled manually) + if [ ! -f "$STATE_FILE" ]; then + exit 0 + fi + + # Check if the removed node is our fullscreen node + if [ "$removed_node" = "$fullscreen_node" ]; then + restore_windows + exit 0 + fi + done +} + +# Kill any existing monitor process +if [ -f "$MONITOR_PID_FILE" ]; then + old_pid=$(cat "$MONITOR_PID_FILE") + kill "$old_pid" 2>/dev/null + rm "$MONITOR_PID_FILE" +fi + +# Check if we're already in fullscreen mode +if [ -f "$STATE_FILE" ]; then + # Restore mode: unhide all nodes and exit fullscreen + restore_windows +else + # Enter fullscreen mode: hide all other nodes + focused_node=$(bspc query -N -n focused) + + if [ -z "$focused_node" ]; then + echo "No focused node found" + exit 1 + fi + + # Store the focused node ID first + echo "$focused_node" > "$STATE_FILE" + + # Get all visible windows on current desktop except the focused one + bspc query -N -d focused -n .window | while read -r node_id; do + if [ "$node_id" != "$focused_node" ]; then + # Hide the node + bspc node "$node_id" -g hidden=on + # Store the hidden node ID + echo "$node_id" >> "$STATE_FILE" + fi + done + + # Make the focused node fullscreen + bspc node "$focused_node" -t fullscreen + + # Start background monitor to detect window close + monitor_fullscreen "$focused_node" & + echo $! > "$MONITOR_PID_FILE" +fi diff --git a/bspwm/.config/bspwm/scripts/keyboard b/bspwm/.config/bspwm/scripts/keyboard new file mode 100755 index 0000000..ee3083e --- /dev/null +++ b/bspwm/.config/bspwm/scripts/keyboard @@ -0,0 +1,5 @@ +#!/usr/bin/sh + +setxkbmap -option caps:backspace +# setxkbmap -option shift:both_capslock +xmodmap -e "clear Lock" diff --git a/bspwm/.config/bspwm/scripts/keyboard-layouts b/bspwm/.config/bspwm/scripts/keyboard-layouts new file mode 100755 index 0000000..f1f641a --- /dev/null +++ b/bspwm/.config/bspwm/scripts/keyboard-layouts @@ -0,0 +1 @@ +#!/usr/bin/env bash diff --git a/bspwm/.config/bspwm/scripts/mute b/bspwm/.config/bspwm/scripts/mute new file mode 100755 index 0000000..7d17b92 --- /dev/null +++ b/bspwm/.config/bspwm/scripts/mute @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Toggle mute +pactl set-sink-mute @DEFAULT_SINK@ toggle + +# Get mute status +MUTE=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') + +if [ "$MUTE" = "yes" ]; then + dunstify " Volume: Muted" -r 2593 -t 1000 +else + VOLUME=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po "\d+%" | head -1) + dunstify " Volume: $VOLUME" -h int:value:${VOLUME%\%} -r 2593 -t 1000 +fi diff --git a/bspwm/.config/bspwm/scripts/screenshot b/bspwm/.config/bspwm/scripts/screenshot new file mode 100755 index 0000000..d0b078c --- /dev/null +++ b/bspwm/.config/bspwm/scripts/screenshot @@ -0,0 +1,16 @@ +#!/bin/bash + +# Ensure the folder exists +mkdir -p ~/Pictures/Screenshots + +# Create timestamped filename +FILE=~/Pictures/Screenshots/$(date '+%Y-%m-%d_%H-%M-%S').png + +# Take screenshot (full screen) +maim "$FILE" + +# Copy to clipboard +xclip -selection clipboard -t image/png -i "$FILE" + +# Notify via dunst with the screenshot as icon +dunstify "Screenshot Taken!" -i "$FILE" "Saved to $FILE" diff --git a/bspwm/.config/bspwm/scripts/snip b/bspwm/.config/bspwm/scripts/snip new file mode 100755 index 0000000..4ddde54 --- /dev/null +++ b/bspwm/.config/bspwm/scripts/snip @@ -0,0 +1,16 @@ +#!/bin/bash + +# Ensure folder exists +mkdir -p ~/Pictures/Screenshots + +# Timestamped filename +FILE=~/Pictures/Screenshots/$(date '+%Y-%m-%d_%H-%M-%S').png + +# Take screenshot (interactive selection) +maim -s "$FILE" + +# Copy to clipboard +xclip -selection clipboard -t image/png -i "$FILE" + +# Notify with dunst +dunstify -a "Screenshot Taken!" -i "$FILE" "Saved to $FILE" |
