diff options
51 files changed, 6615 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" diff --git a/dunst/.config/dunst/dunstrc b/dunst/.config/dunst/dunstrc new file mode 100644 index 0000000..a9cc8dc --- /dev/null +++ b/dunst/.config/dunst/dunstrc @@ -0,0 +1,124 @@ +# customized dunst setup fro EndeavourOS i3 +# https://github.com/endeavouros-team/endeavouros-i3wm-setup +# +# BH DUNSTRC +# +# See dunst(5) for all configuration options + +# Custom Dunst configuration for EndeavourOS i3 +# Author: ChatGPT +# Features: top-right, rounded, 75% opacity, custom colors, bigger text + +[global] + ### Display ### + monitor = 0 + follow = none + + ### Geometry ### + width = 300 + height = 100 + origin = top-right + offset = 30x40 + scale = 0 + notification_limit = 5 + + ### Progress bar ### + progress_bar = true + progress_bar_height = 10 + progress_bar_frame_width = 1 + progress_bar_min_width = 150 + progress_bar_max_width = 300 + + indicate_hidden = yes + + # Transparency (0 = opaque, 100 = fully transparent) + transparency = 35 + + separator_height = 2 + padding = 8 + horizontal_padding = 8 + text_icon_padding = 0 + # frame_width = 2 + frame_width = 1 + frame_color = "#8affff" # default frame color + separator_color = auto + sort = yes + idle_threshold = 0 + + ### Text ### + # font = Inconsolata 13 + font = JetBrainsMono Nerd Font 12 + line_height = 0 + markup = no + # format = "%s\n%b" + format = "<b>%s</b>\n%b" + alignment = left + vertical_alignment = center + show_age_threshold = 60 + ellipsize = middle + ignore_newline = no + stack_duplicates = true + hide_duplicate_count = true + show_indicators = no + + ### Icons ### + # icon_position = left + # min_icon_size = 0 + # max_icon_size = 32 + # icon_path = /usr/share/icons/Qogir/16/status:/usr/share/icons/Qogir/16/devices/:/usr/share/icons/Qogir/24/panel/:/usr/share/icons/Qogir/16/apps/:/usr/share/pixmaps/ + + min_icon_size = 32 + max_icon_size = 64 + + ### History ### + # sticky_history = false + history_length = 10000 + + ### Misc/Advanced ### + dmenu = /usr/bin/dmenu -p dunst: + browser = /usr/bin/xdg-open + always_run_script = true + title = Dunst + class = Dunst + # corner_radius = 10 + ignore_dbusclose = false + + ### Mouse ### + mouse_left_click = close_current + mouse_middle_click = do_action, close_current + mouse_right_click = close_all + +[experimental] + per_monitor_dpi = false + +[progress] + highlight = "#8affff" + +### Urgency Sections ### + +[urgency_low] + background = "#003636" + foreground = "#8affff" + frame_color = "#E0FFFF" # very light cyan + timeout = 5 + # icon = /usr/share/icons/Qogir/16/status/package-installed-outdated.svg + +[urgency_normal] + background = "#003636" + foreground = "#8affff" + frame_color = "#8affff" + timeout = 5 + # icon = /usr/share/icons/Qogir/16/emblems/emblem-question.svg + +[urgency_critical] + background = "#003636" + foreground = "#8affff" + frame_color = "#ff7f7f" # same red as your previous file + timeout = 120 + # icon = /usr/share/icons/Qogir/16/actions/dialog-warning.svg + +### Example Rules ### +# You can add rules below to customize per application if desired +#[stack-volumes] +# appname = "some_volume_notifiers" +# set_stack_tag = "volume" diff --git a/dunst/.config/dunst/dunstrc.bak b/dunst/.config/dunst/dunstrc.bak new file mode 100644 index 0000000..a9b183f --- /dev/null +++ b/dunst/.config/dunst/dunstrc.bak @@ -0,0 +1,442 @@ +# customized dunst setup fro EndeavourOS i3 +# https://github.com/endeavouros-team/endeavouros-i3wm-setup +# BH DUNSTRC +# See dunst(5) for all configuration options + +[global] + ### Display ### + + # Which monitor should the notifications be displayed on. + monitor = 0 + + # Display notification on focused monitor. Possible modes are: + # mouse: follow mouse pointer + # keyboard: follow window with keyboard focus + # none: don't follow anything + # + # "keyboard" needs a window manager that exports the + # _NET_ACTIVE_WINDOW property. + # This should be the case for almost all modern window managers. + # + # If this option is set to mouse or keyboard, the monitor option + # will be ignored. + follow = none + + ### Geometry ### + + # dynamic width from 0 to 300 + # width = (0, 300) + # constant width of 300 + width = 300 + + # The maximum height of a single notification, excluding the frame. + height = 300 + + # Position the notification in the top right corner + origin = bottom-right + + # Offset from the origin + offset = 30x40 + + # Scale factor. It is auto-detected if value is 0. + scale = 0 + + # Maximum number of notification (0 means no limit) + notification_limit = 5 + + ### Progress bar ### + + # Turn on the progress bar. It appears when a progress hint is passed with + # for example dunstify -h int:value:12 + progress_bar = true + + # Set the progress bar height. This includes the frame, so make sure + # it's at least twice as big as the frame width. + progress_bar_height = 10 + + # Set the frame width of the progress bar + progress_bar_frame_width = 1 + + # Set the minimum width for the progress bar + progress_bar_min_width = 150 + + # Set the maximum width for the progress bar + progress_bar_max_width = 300 + + + # Show how many messages are currently hidden (because of + # notification_limit). + indicate_hidden = yes + + # The transparency of the window. Range: [0; 100]. + # This option will only work if a compositing window manager is + # present (e.g. xcompmgr, compiz, etc.). (X11 only) + transparency = 0 + + # Draw a line of "separator_height" pixel height between two + # notifications. + # Set to 0 to disable. + separator_height = 2 + + # Padding between text and separator. + padding = 8 + + # Horizontal padding. + horizontal_padding = 8 + + # Padding between text and icon. + text_icon_padding = 0 + + # Defines width in pixels of frame around the notification window. + # Set to 0 to disable. + frame_width = 1 + + # Defines color of the frame around the notification window. + frame_color = "#7f3fbf" + + # Define a color for the separator. + # possible values are: + # * auto: dunst tries to find a color fitting to the background; + # * foreground: use the same color as the foreground; + # * frame: use the same color as the frame; + # * anything else will be interpreted as a X color. + separator_color = auto + + # Sort messages by urgency. + sort = yes + + # Don't remove messages, if the user is idle (no mouse or keyboard input) + # for longer than idle_threshold seconds. + # Set to 0 to disable. + # A client can set the 'transient' hint to bypass this. See the rules + # section for how to disable this if necessary + idle_threshold = 0 + + ### Text ### + + font = Noto Sans Regular 9 + + # The spacing between lines. If the height is smaller than the + # font height, it will get raised to the font height. + line_height = 0 + + # Possible values are: + # full: Allow a small subset of html markup in notifications: + # <b>bold</b> + # <i>italic</i> + # <s>strikethrough</s> + # <u>underline</u> + # + # For a complete reference see + # <https://docs.gtk.org/Pango/pango_markup.html>. + # + # strip: This setting is provided for compatibility with some broken + # clients that send markup even though it's not enabled on the + # server. Dunst will try to strip the markup but the parsing is + # simplistic so using this option outside of matching rules for + # specific applications *IS GREATLY DISCOURAGED*. + # + # no: Disable markup parsing, incoming notifications will be treated as + # plain text. Dunst will not advertise that it has the body-markup + # capability if this is set as a global setting. + # + # It's important to note that markup inside the format option will be parsed + # regardless of what this is set to. + markup = full + + # The format of the message. Possible variables are: + # %a appname + # %s summary + # %b body + # %i iconname (including its path) + # %I iconname (without its path) + # %p progress value if set ([ 0%] to [100%]) or nothing + # %n progress value if set without any extra characters + # %% Literal % + # Markup is allowed + format = "<b>%s</b>\n%b" + + # Alignment of message text. + # Possible values are "left", "center" and "right". + alignment = left + + # Vertical alignment of message text and icon. + # Possible values are "top", "center" and "bottom". + vertical_alignment = center + + # Show age of message if message is older than show_age_threshold + # seconds. + # Set to -1 to disable. + show_age_threshold = 60 + + # Specify where to make an ellipsis in long lines. + # Possible values are "start", "middle" and "end". + ellipsize = middle + + # Ignore newlines '\n' in notifications. + ignore_newline = no + + # Stack together notifications with the same content + stack_duplicates = true + + # Hide the count of stacked notifications with the same content + hide_duplicate_count = true + + # Display indicators for URLs (U) and actions (A). + show_indicators = no + + ### Icons ### + + # Align icons left/right/off + icon_position = left + + # Scale small icons up to this size, set to 0 to disable. Helpful + # for e.g. small files or high-dpi screens. In case of conflict, + # max_icon_size takes precedence over this. + min_icon_size = 0 + + # Scale larger icons down to this size, set to 0 to disable + max_icon_size = 32 + + # Paths to default icons. + #icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ + icon_path = /usr/share/icons/Qogir/16/status:/usr/share/icons/Qogir/16/devices/:/usr/share/icons/Qogir/24/panel/:/usr/share/icons/Qogir/16/apps/:/usr/share/pixmaps/ + + ### History ### + + # Should a notification popped up from history be sticky or timeout + # as if it would normally do. + sticky_history = false + + # Maximum amount of notifications kept in history + history_length = 0 + + ### Misc/Advanced ### + + # dmenu path. + dmenu = /usr/bin/dmenu -p dunst: + + # Browser for opening urls in context menu. + browser = /usr/bin/xdg-open + + # Always run rule-defined scripts, even if the notification is suppressed + always_run_script = true + + # Define the title of the windows spawned by dunst + title = Dunst + + # Define the class of the windows spawned by dunst + class = Dunst + + # Define the corner radius of the notification window + # in pixel size. If the radius is 0, you have no rounded + # corners. + # The radius will be automatically lowered if it exceeds half of the + # notification height to avoid clipping text and/or icons. + corner_radius = 7 + + # Ignore the dbus closeNotification message. + # Useful to enforce the timeout set by dunst configuration. Without this + # parameter, an application may close the notification sent before the + # user defined timeout. + ignore_dbusclose = false + + ### Wayland ### + # These settings are Wayland-specific. They have no effect when using X11 + + # Uncomment this if you want to let notications appear under fullscreen + # applications (default: overlay) + # layer = top + + # Set this to true to use X11 output on Wayland. + force_xwayland = false + + ### Legacy + + # Use the Xinerama extension instead of RandR for multi-monitor support. + # This setting is provided for compatibility with older nVidia drivers that + # do not support RandR and using it on systems that support RandR is highly + # discouraged. + # + # By enabling this setting dunst will not be able to detect when a monitor + # is connected or disconnected which might break follow mode if the screen + # layout changes. + force_xinerama = false + + ### mouse + + # Defines list of actions for each mouse event + # Possible values are: + # * none: Don't do anything. + # * do_action: Invoke the action determined by the action_name rule. If there is no + # such action, open the context menu. + # * open_url: If the notification has exactly one url, open it. If there are multiple + # ones, open the context menu. + # * close_current: Close current notification. + # * close_all: Close all notifications. + # * context: Open context menu for the notification. + # * context_all: Open context menu for all notifications. + # These values can be strung together for each mouse event, and + # will be executed in sequence. + mouse_left_click = close_current + mouse_middle_click = do_action, close_current + mouse_right_click = close_all + +# Experimental features that may or may not work correctly. Do not expect them +# to have a consistent behaviour across releases. +[experimental] + # Calculate the dpi to use on a per-monitor basis. + # If this setting is enabled the Xft.dpi value will be ignored and instead + # dunst will attempt to calculate an appropriate dpi value for each monitor + # using the resolution and physical size. This might be useful in setups + # where there are multiple screens with very different dpi values. + per_monitor_dpi = false + + +[urgency_low] + # IMPORTANT: colors have to be defined in quotation marks. + # Otherwise the "#" and following would be interpreted as a comment. + background = "#004D4F" + foreground = "#00FFFF" + frame_color = "#00FFFF" + timeout = 5 + # Icon for notifications with low urgency, uncomment to enable + icon = /usr/share/icons/Qogir/16/status/package-installed-outdated.svg + +[urgency_normal] + background = "#004D4F" + foreground = "#2df793" + frame_color = "#2df793" + timeout = 5 + # Icon for notifications with normal urgency, uncomment to enable + icon = /usr/share/icons/Qogir/16/emblems/emblem-question.svg + +[urgency_critical] + background = "#591812" + foreground = "#ffffff" + frame_color = "#ff7f7f" + timeout = 120 + # Icon for notifications with critical urgency, uncomment to enable + icon = /usr/share/icons/Qogir/16/actions/dialog-warning.svg + +# Every section that isn't one of the above is interpreted as a rules to +# override settings for certain messages. +# +# Messages can be matched by +# appname (discouraged, see desktop_entry) +# body +# category +# desktop_entry +# icon +# match_transient +# msg_urgency +# stack_tag +# summary +# +# and you can override the +# background +# foreground +# format +# frame_color +# fullscreen +# new_icon +# set_stack_tag +# set_transient +# set_category +# timeout +# urgency +# skip_display +# history_ignore +# action_name +# word_wrap +# ellipsize +# alignment +# +# Shell-like globing will get expanded. +# +# Instead of the appname filter, it's recommended to use the desktop_entry filter. +# GLib based applications export their desktop-entry name. In comparison to the appname, +# the desktop-entry won't get localized. +# +# SCRIPTING +# You can specify a script that gets run when the rule matches by +# setting the "script" option. +# The script will be called as follows: +# script appname summary body icon urgency +# where urgency can be "LOW", "NORMAL" or "CRITICAL". +# +# NOTE: It might be helpful to run dunst -print in a terminal in order +# to find fitting options for rules. + +# Disable the transient hint so that idle_threshold cannot be bypassed from the +# client +#[transient_disable] +# match_transient = yes +# set_transient = no +# +# Make the handling of transient notifications more strict by making them not +# be placed in history. +#[transient_history_ignore] +# match_transient = yes +# history_ignore = yes + +# fullscreen values +# show: show the notifications, regardless if there is a fullscreen window opened +# delay: displays the new notification, if there is no fullscreen window active +# If the notification is already drawn, it won't get undrawn. +# pushback: same as delay, but when switching into fullscreen, the notification will get +# withdrawn from screen again and will get delayed like a new notification +#[fullscreen_delay_everything] +# fullscreen = delay +#[fullscreen_show_critical] +# msg_urgency = critical +# fullscreen = show + +#[espeak] +# summary = "*" +# script = dunst_espeak.sh + +#[script-test] +# summary = "*script*" +# script = dunst_test.sh + +#[ignore] +# # This notification will not be displayed +# summary = "foobar" +# skip_display = true + +#[history-ignore] +# # This notification will not be saved in history +# summary = "foobar" +# history_ignore = yes + +#[skip-display] +# # This notification will not be displayed, but will be included in the history +# summary = "foobar" +# skip_display = yes + +#[signed_on] +# appname = Pidgin +# summary = "*signed on*" +# urgency = low +# +#[signed_off] +# appname = Pidgin +# summary = *signed off* +# urgency = low +# +#[says] +# appname = Pidgin +# summary = *says* +# urgency = critical +# +#[twitter] +# appname = Pidgin +# summary = *twitter.com* +# urgency = normal +# +[stack-volumes] + appname = "some_volume_notifiers" + set_stack_tag = "volume" +# +# vim: ft=cfg diff --git a/kitty/.config/kitty/kitty.conf b/kitty/.config/kitty/kitty.conf new file mode 100644 index 0000000..8db5d8d --- /dev/null +++ b/kitty/.config/kitty/kitty.conf @@ -0,0 +1,54 @@ +# ██████╗░██╗░░██╗░░░░░░██╗░░██╗██╗████████╗████████╗██╗░░░██╗ +# ██╔══██╗██║░░██║░░░░░░██║░██╔╝██║╚══██╔══╝╚══██╔══╝╚██╗░██╔╝ +# ██████╦╝███████║█████╗█████═╝░██║░░░██║░░░░░░██║░░░░╚████╔╝░ +# ██╔══██╗██╔══██║╚════╝██╔═██╗░██║░░░██║░░░░░░██║░░░░░╚██╔╝░░ +# ██████╦╝██║░░██║░░░░░░██║░╚██╗██║░░░██║░░░░░░██║░░░░░░██║░░░ +# ╚═════╝░╚═╝░░╚═╝░░░░░░╚═╝░░╚═╝╚═╝░░░╚═╝░░░░░░╚═╝░░░░░░╚═╝░░░ + + +# Theme +include ~/.config/kitty/themes/Cobalt2.conf + +# Font + +# font_family Source Code Pro +# font_family FiraCode Nerd Font +# font_family Fira Code +# font_family JetBrains Mono +# font_family JetBrains Mono Nerd +# font_family Consolas +# font_family Cascadia Code +# font_family Inconsolata +# font_family Hack +font_family JetBrainsMono Nerd Font + +bold_font auto +italic_font auto +bold_italic_font auto +font_size 10.5 + +# Terminal +foreground #8affff +background #003636 +# background_opacity 0.60 +background_opacity 0.75 +# background_opacity 0.00 +background_blur 1 + +window_padding_width 5 + +# Scrolling +scrollback_lines 10000 + +# Allows Remote Control +allow_remote_control yes + +# No Ligatures +# disable_ligatures always +# font_features none + + +# Tmux +# shell /bin/zsh -c 'tmux attach || tmux' +# shell tmux +# confirm_os_window_close -1 diff --git a/kitty/.config/kitty/kitty.conf.bak b/kitty/.config/kitty/kitty.conf.bak new file mode 100644 index 0000000..e9e1cd4 --- /dev/null +++ b/kitty/.config/kitty/kitty.conf.bak @@ -0,0 +1,22 @@ +# ██████╗░██╗░░██╗░░░░░░██╗░░██╗██╗████████╗████████╗██╗░░░██╗ +# ██╔══██╗██║░░██║░░░░░░██║░██╔╝██║╚══██╔══╝╚══██╔══╝╚██╗░██╔╝ +# ██████╦╝███████║█████╗█████═╝░██║░░░██║░░░░░░██║░░░░╚████╔╝░ +# ██╔══██╗██╔══██║╚════╝██╔═██╗░██║░░░██║░░░░░░██║░░░░░╚██╔╝░░ +# ██████╦╝██║░░██║░░░░░░██║░╚██╗██║░░░██║░░░░░░██║░░░░░░██║░░░ +# ╚═════╝░╚═╝░░╚═╝░░░░░░╚═╝░░╚═╝╚═╝░░░╚═╝░░░░░░╚═╝░░░░░░╚═╝░░░ + + +# Font +font_family Source Code Pro +bold_font auto +italic_font auto +bold_italic_font auto +font_size 10.5 + +# Terminal +foreground #8affff +background #003636 +background_opacity 0.75 +background_blur 1 + +window_padding_width 5 diff --git a/kitty/.config/kitty/themes/Cobalt2.conf b/kitty/.config/kitty/themes/Cobalt2.conf new file mode 100644 index 0000000..236ce42 --- /dev/null +++ b/kitty/.config/kitty/themes/Cobalt2.conf @@ -0,0 +1,76 @@ +## name: Cobalt2 +## author: Lalit Kumar(@laltimee) +## license: MIT +## upstream: https://github.com/lalitmee/kitty-cobalt2/blob/master/cobalt2.conf +## blurb: Don't stress your eyes now + +# The basic colors +foreground #FFFFFF +background #193549 +selection_foreground #FFFFFF +selection_background #185294 + +# Cursor colors +cursor #FFC600 +cursor_text_color #1C1C1C + +# URL underline color when hovering with mouse +url_color #00AAFF + +# Kitty window border colors +active_border_color #00AAFF +inactive_border_color #9E9E9E +bell_border_color #F2ED7F + +# OS Window titlebar colors +wayland_titlebar_color system +macos_titlebar_color system + +# Tab bar colors +active_tab_foreground #FFC600 +inactive_tab_background #185294 +inactive_tab_foreground #FFFFFF +active_tab_background #0050A4 +tab_bar_background #193549 + +# Colors for marks (marked text in the terminal) +mark1_foreground #FFC600 +mark1_background #3AD900 +mark2_foreground #967EFB +mark2_background #00AAFF +mark3_foreground #FF628C +mark3_background #FF9A00 + +# The 16 terminal #88FF88#88FF88colors + +# black +color0 #1C1C1C +color8 #9E9E9E + +# red +color1 #FF0000 +color9 #700009 + +# green +color2 #3AD900 +color10 #88FF88 + +# yellow +color3 #FFC600 +color11 #FF9A00 + +# cyan +color6 #80FCFF +color14 #8fbfdc + +# magenta +color5 #FF628C +color13 #EE80E1 + +# blue +color4 #00AAFF +color12 #0050A4 + +# white +color7 #FFFFFF +color15 #BCBCBC diff --git a/picom/.config/picom/picom.conf b/picom/.config/picom/picom.conf new file mode 100644 index 0000000..00bafad --- /dev/null +++ b/picom/.config/picom/picom.conf @@ -0,0 +1,491 @@ +################################# +# Shadows # +################################# + + +# Enabled client-side shadows on windows. Note desktop windows +# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, +# unless explicitly requested using the wintypes option. +# +# shadow = false +shadow = true; + +# The blur radius for shadows, in pixels. (defaults to 12) +# shadow-radius = 12 +shadow-radius = 7; + +# The opacity of shadows. (0.0 - 1.0, defaults to 0.75) +# shadow-opacity = .75 + +# The left offset for shadows, in pixels. (defaults to -15) +# shadow-offset-x = -15 +shadow-offset-x = -7; + +# The top offset for shadows, in pixels. (defaults to -15) +# shadow-offset-y = -15 +shadow-offset-y = -7; + +# Red color value of shadow (0.0 - 1.0, defaults to 0). +# shadow-red = 0 + +# Green color value of shadow (0.0 - 1.0, defaults to 0). +# shadow-green = 0 + +# Blue color value of shadow (0.0 - 1.0, defaults to 0). +# shadow-blue = 0 + +# Hex string color value of shadow (#000000 - #FFFFFF, defaults to #000000). This option will override options set shadow-(red/green/blue) +# shadow-color = "#000000" + +# Specify a list of conditions of windows that should have no shadow. +# +# examples: +# shadow-exclude = "n:e:Notification"; +# +# shadow-exclude = [] +shadow-exclude = [ + "name = 'Notification'", + "class_g = 'Conky'", + "class_g ?= 'Notify-osd'", + "class_g = 'Cairo-clock'", + "_GTK_FRAME_EXTENTS@:c" +]; + +# Specify a list of conditions of windows that should have no shadow painted over, such as a dock window. +# clip-shadow-above = [] + +# Specify a X geometry that describes the region in which shadow should not +# be painted in, such as a dock window region. Use +# shadow-exclude-reg = "x10+0+0" +# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on. +# +# shadow-exclude-reg = "" + +# Crop shadow of a window fully on a particular Xinerama screen to the screen. +# xinerama-shadow-crop = false + + +################################# +# Fading # +################################# + + +# Fade windows in/out when opening/closing and when opacity changes, +# unless no-fading-openclose is used. +# fading = false +fading = true; + +# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) +# fade-in-step = 0.028 +fade-in-step = 0.03; + +# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) +# fade-out-step = 0.03 +fade-out-step = 0.03; + +# The time between steps in fade step, in milliseconds. (> 0, defaults to 10) +# fade-delta = 10 +fade-delta = 10 + +# Specify a list of conditions of windows that should not be faded. +# fade-exclude = [] + +# Do not fade on window open/close. +# no-fading-openclose = false + +# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc. +# no-fading-destroyed-argb = false + + +################################# +# Transparency / Opacity # +################################# + + +# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) +inactive-opacity = 1 +# inactive-opacity = 0.8; + +# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) +# frame-opacity = 1.0 +frame-opacity = 0.7; + +# Let inactive opacity set by -i override the '_NET_WM_WINDOW_OPACITY' values of windows. +# inactive-opacity-override = true +inactive-opacity-override = false; + +# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) +# active-opacity = 1.0 + +# Dim inactive windows. (0.0 - 1.0, defaults to 0.0) +# inactive-dim = 0.0 + +# Specify a list of conditions of windows that should never be considered focused. +# focus-exclude = [] +focus-exclude = [ "class_g = 'Cairo-clock'" ]; + +# Use fixed inactive dim value, instead of adjusting according to window opacity. +# inactive-dim-fixed = 1.0 + +# Specify a list of opacity rules, in the format `PERCENT:PATTERN`, +# like `50:name *= "Firefox"`. picom-trans is recommended over this. +# Note we don't make any guarantee about possible conflicts with other +# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows. +# example: +# opacity-rule = [ "80:class_g = 'URxvt'" ]; +# +# opacity-rule = [] + + +################################# +# Corners # +################################# + +# Sets the radius of rounded window corners. When > 0, the compositor will +# round the corners of windows. Does not interact well with +# `transparent-clipping`. +corner-radius = 0 + +# Exclude conditions for rounded corners. +rounded-corners-exclude = [ + "window_type = 'dock'", + "window_type = 'desktop'" +]; + + +################################# +# Background-Blurring # +################################# + + +# Parameters for background blurring, see the *BLUR* section for more information. +blur-method = "dual_kawase" +# blur-size = 12 +# +# blur-deviation = false +# +blur-strength = 5 + +# Blur background of semi-transparent / ARGB windows. +# Bad in performance, with driver-dependent behavior. +# The name of the switch may change without prior notifications. +# +# blur-background = false + +# Blur background of windows when the window frame is not opaque. +# Implies: +# blur-background +# Bad in performance, with driver-dependent behavior. The name may change. +# +# blur-background-frame = false + + +# Use fixed blur strength rather than adjusting according to window opacity. +# blur-background-fixed = false + + +# Specify the blur convolution kernel, with the following format: +# example: +# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"; +# +# blur-kern = "" +blur-kern = "3x3box"; + + +# Exclude conditions for background blur. +# blur-background-exclude = [] +blur-background-exclude = [ + # "window_type = 'dock'", + "window_type = 'desktop'", + "_GTK_FRAME_EXTENTS@:c" +]; + +################################# +# General Settings # +################################# + +# Enable remote control via D-Bus. See the man page for more details. +# dbus = true + +# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers. +# daemon = false + +# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. +# `xrender` is the default one. +# + + +# fading = true; +# fade-in-step = 0.05; # smaller step → slower fade-in +# fade-out-step = 0.05; # smaller step → slower fade-out +# fade-delta = 20; # time in ms between steps +# +backend = "glx" +# backend = "xrender"; +# backend = "xr_glx_hybrid"; + +# Enable/disable VSync. +# vsync = false +vsync = true; + +# Enable remote control via D-Bus. See the *D-BUS API* section below for more details. +# dbus = false + +# Try to detect WM windows (a non-override-redirect window with no +# child that has 'WM_STATE') and mark them as active. +# +# mark-wmwin-focused = false +mark-wmwin-focused = true; + +# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused. +# mark-ovredir-focused = false +mark-ovredir-focused = true; + +# Try to detect windows with rounded corners and don't consider them +# shaped windows. The accuracy is not very high, unfortunately. +# +# detect-rounded-corners = false +detect-rounded-corners = true; + +# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers +# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows. +# +# detect-client-opacity = false +detect-client-opacity = true; + +# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, +# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy, +# provided that the WM supports it. +# +# use-ewmh-active-win = false + +# Unredirect all windows if a full-screen opaque window is detected, +# to maximize performance for full-screen windows. Known to cause flickering +# when redirecting/unredirecting windows. +# +# unredir-if-possible = false + +# Delay before unredirecting the window, in milliseconds. Defaults to 0. +# unredir-if-possible-delay = 0 + +# Conditions of windows that shouldn't be considered full-screen for unredirecting screen. +# unredir-if-possible-exclude = [] + +# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows +# in the same group focused at the same time. +# +# detect-transient = false +detect-transient = true; + +# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same +# group focused at the same time. This usually means windows from the same application +# will be considered focused or unfocused at the same time. +# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too. +# +# detect-client-leader = false + +# Resize damaged region by a specific number of pixels. +# A positive value enlarges it while a negative one shrinks it. +# If the value is positive, those additional pixels will not be actually painted +# to screen, only used in blur calculation, and such. (Due to technical limitations, +# with use-damage, those pixels will still be incorrectly painted to screen.) +# Primarily used to fix the line corruption issues of blur, +# in which case you should use the blur radius value here +# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`, +# with a 5x5 one you use `--resize-damage 2`, and so on). +# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly. +# +# resize-damage = 1 + +# Specify a list of conditions of windows that should be painted with inverted color. +# Resource-hogging, and is not well tested. +# +# invert-color-include = [] + +# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer. +# Might cause incorrect opacity when rendering transparent content (but never +# practically happened) and may not work with blur-background. +# My tests show a 15% performance boost. Recommended. +# +# glx-no-stencil = false + +# GLX backend: Avoid rebinding pixmap on window damage. +# Probably could improve performance on rapid window content changes, +# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.). +# Recommended if it works. +# +# glx-no-rebind-pixmap = false + +# Disable the use of damage information. +# This cause the whole screen to be redrawn everytime, instead of the part of the screen +# has actually changed. Potentially degrades the performance, but might fix some artifacts. +# The opposing option is use-damage +# +# no-use-damage = false +use-damage = true; + +# Use X Sync fence to sync clients' draw calls, to make sure all draw +# calls are finished before picom starts drawing. Needed on nvidia-drivers +# with GLX backend for some users. +# +# xrender-sync-fence = false + +# GLX backend: Use specified GLSL fragment shader for rendering window +# contents. Read the man page for a detailed explanation of the interface. +# +# window-shader-fg = "default" + +# Use rules to set per-window shaders. Syntax is SHADER_PATH:PATTERN, similar +# to opacity-rule. SHADER_PATH can be "default". This overrides window-shader-fg. +# +# window-shader-fg-rule = [ +# "my_shader.frag:window_type != 'dock'" +# ] + +# Force all windows to be painted with blending. Useful if you +# have a glx-fshader-win that could turn opaque pixels transparent. +# +# force-win-blend = false + +# Do not use EWMH to detect fullscreen windows. +# Reverts to checking if a window is fullscreen based only on its size and coordinates. +# +# no-ewmh-fullscreen = false + +# Dimming bright windows so their brightness doesn't exceed this set value. +# Brightness of a window is estimated by averaging all pixels in the window, +# so this could comes with a performance hit. +# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0) +# +# max-brightness = 1.0 + +# Make transparent windows clip other windows like non-transparent windows do, +# instead of blending on top of them. +# +# transparent-clipping = false + +# Specify a list of conditions of windows that should never have transparent +# clipping applied. Useful for screenshot tools, where you need to be able to +# see through transparent parts of the window. +# +# transparent-clipping-exclude = [] + +# Set the log level. Possible values are: +# "trace", "debug", "info", "warn", "error" +# in increasing level of importance. Case doesn't matter. +# If using the "TRACE" log level, it's better to log into a file +# using *--log-file*, since it can generate a huge stream of logs. +# +# log-level = "debug" +log-level = "warn"; + +# Set the log file. +# If *--log-file* is never specified, logs will be written to stderr. +# Otherwise, logs will to written to the given file, though some of the early +# logs might still be written to the stderr. +# When setting this option from the config file, it is recommended to use an absolute path. +# +# log-file = "/path/to/your/log/file" + +# Show all X errors (for debugging) +# show-all-xerrors = false + +# Write process ID to a file. +# write-pid-path = "/path/to/your/log/file" + +# Window type settings +# +# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard: +# "unknown", "desktop", "dock", "toolbar", "menu", "utility", +# "splash", "dialog", "normal", "dropdown_menu", "popup_menu", +# "tooltip", "notification", "combo", and "dnd". +# +# Following per window-type options are available: :: +# +# fade, shadow::: +# Controls window-type-specific shadow and fade settings. +# +# opacity::: +# Controls default opacity of the window type. +# +# focus::: +# Controls whether the window of this type is to be always considered focused. +# (By default, all window types except "normal" and "dialog" has this on.) +# +# full-shadow::: +# Controls whether shadow is drawn under the parts of the window that you +# normally won't be able to see. Useful when the window has parts of it +# transparent, and you want shadows in those areas. +# +# clip-shadow-above::: +# Controls wether shadows that would have been drawn above the window should +# be clipped. Useful for dock windows that should have no shadow painted on top. +# +# redir-ignore::: +# Controls whether this type of windows should cause screen to become +# redirected again after been unredirected. If you have unredir-if-possible +# set, and doesn't want certain window to cause unnecessary screen redirection, +# you can set this to `true`. +# + +animations = ({ + + # Animation for window open / show / close / hide -> slide + fade + # triggers = [ "open", "show", "close", "hide" ]; + triggers = [ "open" ]; + # You can pick a preset; here we use slide-in/slide-out + fade + preset = "appear"; + duration = 0.25; + +}, { + # Another script for when windows hide/close (optional, could skip if above covers) + triggers = [ "hide", "close" ]; + preset = "disappear"; + direction = "down"; + duration = 0.20; + +}, { + # Animation for geometry changes — resize or move windows + triggers = [ "geometry" ]; + preset = "geometry-change"; + duration = 0.20; + +}) + +wintypes: +{ + tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; + dock = { shadow = false; clip-shadow-above = true; } + dnd = { shadow = false; } + popup_menu = { opacity = 1; } + dropdown_menu = { opacity = 1; } +}; + +blur-background-exclude = [ + "class_g = 'slop'" +]; + + + +# blur: +# method = "dual_kawase"; +# strength = 7; +# blur-background = true; +# blur-background-frame = true; +# blur-background-fixed = false; + +# blur: +# { +# method = "gaussian"; +# size = 20; +# deviation = 15; +# }; + + +# For Zathura +# Example: picom.conf + # opacity-rule = [ + # "90:class_g = 'Zathura'" + # "100:class_g = 'maim'" + # ]; + diff --git a/polybar/.config/polybar/.config.ini.bak b/polybar/.config/polybar/.config.ini.bak new file mode 100644 index 0000000..a0adc17 --- /dev/null +++ b/polybar/.config/polybar/.config.ini.bak @@ -0,0 +1,275 @@ +;========================================================== +; +; +; ██████╗░██╗░░██╗░░░░░░██████╗░░█████╗░██████╗░ +; ██╔══██╗██║░░██║░░░░░░██╔══██╗██╔══██╗██╔══██╗ +; ██████╦╝███████║█████╗██████╦╝███████║██████╔╝ +; ██╔══██╗██╔══██║╚════╝██╔══██╗██╔══██║██╔══██╗ +; ██████╦╝██║░░██║░░░░░░██████╦╝██║░░██║██║░░██║ +; ╚═════╝░╚═╝░░╚═╝░░░░░░╚═════╝░╚═╝░░╚═╝╚═╝░░╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== + +[colors] +; background = #BF003636 +; background-alt = #CC0d6063 + +; High Transparency +; background = #33003636 +; background = #00003636 +; background = #8C003636 + +#background = #A6003636 +background = #003636 +background-alt = #CC0d6063 +transparent = #00000000 + +# background-2 = #004344 +background-2 = #004344 + + +foreground = #C5C8C6 +primary = #6ae8eb +secondary = #8ABEB7 +alert = #A54242 +disabled = #707880 +# darkerteal = #015959 +fade = #015959 + +[bar/primary] +width = 100% +height = 25 + +font-0 = "Source Code Pro:size=10.5:style=Normal" +# font-0 = xft:DejaVu Sans:size=11:style=Normal +# font-1 = "JetBrains Mono:size=12;1" +font-1 = "Symbols Nerd Font:style=Regular:size=9;1" +font-2 = Noto Sans CJK SC;1 +font-3 = "Inconsolata for Powerline:pixelsize=18.75:antialias=true;3" + +radius = 0 + +# background = ${colors.background} +background = ${colors.transparent} +foreground = ${colors.primary} + +line-size = 3pt + +# border-size = 1pt +# border-color = ${colors.transparent} +# border-color = ${colors.background} + +padding-left = 0 +padding-right = 0 + +module-margin = 0 + +# separator = " | " +# separator = " " +# separator-foreground = ${colors.fade} + +modules-left = wlan sep-right xwindow sep-right-last +modules-center = xworkspaces +modules-right = sep-left-last filesystem sep-left-2 pulseaudio sep-left xkeyboard sep-left-2 memory sep-left cpu sep-left-2 date sep-left time + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +wm-restack = bspwm + +#[module/systray] +#type = internal/tray +# +#format-margin = 8pt +#tray-spacing = 16pt + +[module/xwindow] +type = internal/xwindow + +format-prefix = " " +format-prefix-foreground = ${colors.primary} + +format-background = ${colors.background-2} +format-padding = 1 +label-maxlen = 50 + +[module/xworkspaces] +type = internal/xworkspaces + +label-active = %name% +# label-active-background = ${colors.background} +label-active-foreground = ${colors.primary} +label-active-padding = 1.5 + +label-occupied = %name% +label-occupied-foreground = ${colors.foreground} +label-occupied-padding = 1.5 + +label-urgent = %name% +label-urgent-background = ${colors.alert} +label-urgent-padding = 1.5 + +label-empty = %name% +label-empty-foreground = ${colors.disabled} +label-empty-padding = 1.5 + +[module/xkeyboard] +type = internal/xkeyboard + +format-prefix = " " +format-prefix-foreground = ${colors.primary} + +blacklist-0 = num lock +label-layout = %layout% + +format-background = ${colors.background} +format-padding = 1 + + +[module/systray] +type = internal/tray + +format-margin = 8pt +tray-spacing = 16pt + +[module/filesystem] +type = internal/fs + +format-mounted-background = ${colors.background} +format-unmounted-background = ${colors.background} +format-padding = 1 + +interval = 25 + +mount-0 = / + +label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%% + +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.disabled} + + +[module/pulseaudio] +type = internal/pulseaudio + +# format-volume-prefix = "VOL " +# format-volume-prefix-foreground = ${colors.primary} +format-volume-prefix = " " +format-volume-prefix-foreground = ${colors.primary} +format-volume = <label-volume> + +label-volume = %percentage%% + +label-muted = muted +label-muted-foreground = ${colors.disabled} + +format-volume-background = ${colors.background-2} +format-muted-background = ${colors.background-2} +format-volume-padding = 1 +format-muted-padding = 1 + + +[module/memory] +type = internal/memory +interval = 2 +format-prefix = " " +format-prefix-foreground = ${colors.primary} +label = %percentage_used:2%% + +format-background = ${colors.background-2} +format-padding = 1 + +[module/cpu] +type = internal/cpu +interval = 2 +format-prefix = "" +format-prefix-foreground = ${colors.primary} +label = %percentage:2%% + +format-background = ${colors.background} +format-padding = 1 + + +[module/wlan] +type = internal/network +interval = 5 +format-connected = <label-connected> +format-disconnected = <label-disconnected> +label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected +interface-type = wireless +label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip% + +format-connected-background = ${colors.background} +format-disconnected-background = ${colors.background} +format-connected-padding = 1 +format-disconnected-padding = 1 + +[module/date] +type = custom/script +format-prefix = " " +exec = ~/.config/polybar/date +interval = 1 + +format-background = ${colors.background-2} +format-padding = 1 + +[module/time] +type = internal/date + +format-prefix = " " +format-prefix-foreground = ${colors.primary} + +interval = 0.00001 +date = %H:%M:%S + +format-background = ${colors.background} +format-padding = 1 + +# Powerline Separators +[module/sep-left] +type = custom/text +label-foreground = ${colors.background} +format-background = ${colors.background-2} +label = "%{T4}%{T-}" + +[module/sep-left-2] +type = custom/text +label-foreground = ${colors.background-2} +format-background = ${colors.background} +label = "%{T4}%{T-}" + +[module/sep-left-last] +type = custom/text +label-foreground = ${colors.background} +format-background = ${colors.transparent} +label = "%{T4}%{T-}" + +[module/sep-right] +type = custom/text +label-foreground = ${colors.background} +format-background = ${colors.background-2} +label = "%{T4}%{T-}" + +[module/sep-right-2] +type = custom/text +label-foreground = ${colors.background-2} +format-background = ${colors.background} +label = "%{T4}%{T-}" + +[module/sep-right-last] +type = custom/text +label-foreground = ${colors.background-2} +format-background = ${colors.transparent} +label = "%{T4}%{T-}" + + +[settings] +pseudo-transparency = true diff --git a/polybar/.config/polybar/config.ini b/polybar/.config/polybar/config.ini new file mode 100644 index 0000000..3100fa8 --- /dev/null +++ b/polybar/.config/polybar/config.ini @@ -0,0 +1,280 @@ +;========================================================== +; +; +; ██████╗░██╗░░██╗░░░░░░██████╗░░█████╗░██████╗░ +; ██╔══██╗██║░░██║░░░░░░██╔══██╗██╔══██╗██╔══██╗ +; ██████╦╝███████║█████╗██████╦╝███████║██████╔╝ +; ██╔══██╗██╔══██║╚════╝██╔══██╗██╔══██║██╔══██╗ +; ██████╦╝██║░░██║░░░░░░██████╦╝██║░░██║██║░░██║ +; ╚═════╝░╚═╝░░╚═╝░░░░░░╚═════╝░╚═╝░░╚═╝╚═╝░░╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== + +[colors] +; background = #BF003636 +; background-alt = #CC0d6063 + +; High Transparency +; background = #33003636 +; background = #00003636 +; background = #8C003636 + +#background = #A6003636 +background = #003636 +background-alt = #CC0d6063 +transparent = #00000000 + +# background-2 = #004344 +background-2 = #004344 + + +foreground = #C5C8C6 +primary = #6ae8eb +secondary = #8ABEB7 +alert = #A54242 +# darkerteal = #015959 +fade = #015959 + +active = #8affff +# disabled = #707880 +disabled = #4d7f7f +selected = #ffc600 + +[bar/primary] +width = 100% +height = 25 + +font-0 = "Source Code Pro:size=10.5:style=Normal" +# font-0 = xft:DejaVu Sans:size=11:style=Normal +# font-1 = "JetBrains Mono:size=12;1" +font-1 = "Symbols Nerd Font:style=Regular:size=9;1" +font-2 = Noto Sans CJK SC;1 +font-3 = "Inconsolata for Powerline:pixelsize=18.75:antialias=true;3" + +radius = 0 + +# background = ${colors.background} +background = ${colors.transparent} +foreground = ${colors.primary} + +line-size = 3pt + +# border-size = 1pt +# border-color = ${colors.transparent} +# border-color = ${colors.background} + +padding-left = 0 +padding-right = 0 + +module-margin = 0 + +# separator = " | " +# separator = " " +# separator-foreground = ${colors.fade} + +modules-left = wlan sep-right xwindow sep-right-last +modules-center = xworkspaces +modules-right = sep-left-last filesystem sep-left-2 pulseaudio sep-left xkeyboard sep-left-2 memory sep-left cpu sep-left-2 date sep-left time + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +wm-restack = bspwm + +#[module/systray] +#type = internal/tray +# +#format-margin = 8pt +#tray-spacing = 16pt + +[module/xwindow] +type = internal/xwindow + +format-prefix = " " +format-prefix-foreground = ${colors.primary} + +format-background = ${colors.background-2} +format-padding = 1 +label-maxlen = 50 + +[module/xworkspaces] +type = internal/xworkspaces + +label-active = %name% +# label-active-background = ${colors.background} +# label-active-foreground = ${colors.primary} +label-active-foreground = ${colors.selected} +label-active-padding = 1.5 + +label-occupied = %name% +label-occupied-foreground = ${colors.active} +label-occupied-padding = 1.5 + +label-urgent = %name% +label-urgent-background = ${colors.alert} +label-urgent-padding = 1.5 + +label-empty = %name% +label-empty-foreground = ${colors.disabled} +label-empty-padding = 1.5 + +[module/xkeyboard] +type = internal/xkeyboard + +format-prefix = " " +format-prefix-foreground = ${colors.primary} + +blacklist-0 = num lock +label-layout = %layout% + +format-background = ${colors.background} +format-padding = 1 + + +[module/systray] +type = internal/tray + +format-margin = 8pt +tray-spacing = 16pt + +[module/filesystem] +type = internal/fs + +format-mounted-background = ${colors.background} +format-unmounted-background = ${colors.background} +format-padding = 1 + +interval = 25 + +mount-0 = / + +label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%% + +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.disabled} + + +[module/pulseaudio] +type = internal/pulseaudio + +# format-volume-prefix = "VOL " +# format-volume-prefix-foreground = ${colors.primary} +format-volume-prefix = " " +format-volume-prefix-foreground = ${colors.primary} +format-volume = <label-volume> + +label-volume = %percentage%% + +label-muted = muted +label-muted-foreground = ${colors.disabled} + +format-volume-background = ${colors.background-2} +format-muted-background = ${colors.background-2} +format-volume-padding = 1 +format-muted-padding = 1 + + +[module/memory] +type = internal/memory +interval = 2 +format-prefix = " " +format-prefix-foreground = ${colors.primary} +label = %percentage_used:2%% + +format-background = ${colors.background-2} +format-padding = 1 + +[module/cpu] +type = internal/cpu +interval = 2 +format-prefix = "" +format-prefix-foreground = ${colors.primary} +label = %percentage:2%% + +format-background = ${colors.background} +format-padding = 1 + + +[module/wlan] +type = internal/network +interval = 5 +format-connected = <label-connected> +format-disconnected = <label-disconnected> +label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected +interface-type = wireless +label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip% + +format-connected-background = ${colors.background} +format-disconnected-background = ${colors.background} +format-connected-padding = 1 +format-disconnected-padding = 1 + +[module/date] +type = custom/script +format-prefix = " " +exec = ~/.config/polybar/date +interval = 1 + +format-background = ${colors.background-2} +format-padding = 1 + +[module/time] +type = internal/date + +format-prefix = " " +format-prefix-foreground = ${colors.primary} + +interval = 0.00001 +date = %H:%M:%S + +format-background = ${colors.background} +format-padding = 1 + +# Powerline Separators +[module/sep-left] +type = custom/text +label-foreground = ${colors.background} +format-background = ${colors.background-2} +label = "%{T4}%{T-}" + +[module/sep-left-2] +type = custom/text +label-foreground = ${colors.background-2} +format-background = ${colors.background} +label = "%{T4}%{T-}" + +[module/sep-left-last] +type = custom/text +label-foreground = ${colors.background} +format-background = ${colors.transparent} +label = "%{T4}%{T-}" + +[module/sep-right] +type = custom/text +label-foreground = ${colors.background} +format-background = ${colors.background-2} +label = "%{T4}%{T-}" + +[module/sep-right-2] +type = custom/text +label-foreground = ${colors.background-2} +format-background = ${colors.background} +label = "%{T4}%{T-}" + +[module/sep-right-last] +type = custom/text +label-foreground = ${colors.background-2} +format-background = ${colors.transparent} +label = "%{T4}%{T-}" + + +[settings] +pseudo-transparency = true diff --git a/polybar/.config/polybar/date b/polybar/.config/polybar/date new file mode 100755 index 0000000..db0959a --- /dev/null +++ b/polybar/.config/polybar/date @@ -0,0 +1,16 @@ +#!/bin/bash + +day=$(date +"%u") +date=$(date +"%Y年%m月%d日 | %H:%M:%S") + +case $day in + 1) kanji="月" ;; # Monday + 2) kanji="火" ;; # Tuesday + 3) kanji="水" ;; # Wednesday + 4) kanji="木" ;; # Thursday + 5) kanji="金" ;; # Friday + 6) kanji="土" ;; # Saturday + 7) kanji="日" ;; # Sunday +esac + +echo "$(date +"%Y年%m月%d日") (${kanji})" diff --git a/rofi/.config/rofi/.bak/.clipboard-launcher-enhanced.sh.bak b/rofi/.config/rofi/.bak/.clipboard-launcher-enhanced.sh.bak new file mode 100755 index 0000000..5d39f5b --- /dev/null +++ b/rofi/.config/rofi/.bak/.clipboard-launcher-enhanced.sh.bak @@ -0,0 +1,206 @@ +#!/usr/bin/env bash +#============================================================================== +# Enhanced greenclip launcher with image thumbnail support +#============================================================================== +# This script provides an enhanced clipboard manager interface using rofi +# and greenclip, with support for image thumbnails and text truncation. +# +# Features: +# - Displays clipboard history from greenclip +# - Shows thumbnails for copied images +# - Truncates long text entries for better readability +# - Preserves original content when pasting (fixes display vs. actual content) +# +# Requirements: +# - rofi (with script mode support) +# - greenclip (clipboard manager daemon) +# - xclip (for clipboard operations) +#============================================================================== + +# Directory where greenclip caches image files +# NOTE: This should match your greenclip.toml image_cache_directory setting +IMGDIR="/tmp/greenclip" + +#------------------------------------------------------------------------------ +# clipboard_mode() - Main function that provides rofi script mode interface +#------------------------------------------------------------------------------ +# This function is called by rofi in two different contexts: +# +# 1. ROFI_RETV=0 (Initial call): Generate and display the menu items +# - Reads clipboard history from greenclip +# - Formats items with icons and thumbnails +# - Preserves original content in the 'info' field +# +# 2. ROFI_RETV=1 (Item selected): User selected an item +# - Returns the ORIGINAL content (from ROFI_INFO) for pasting +# - NOT the modified display text (from $1) +#------------------------------------------------------------------------------ +clipboard_mode() { + if [ "$ROFI_RETV" = "0" ]; then + #---------------------------------------------------------------------- + # INITIAL CALL - Build the clipboard menu + #---------------------------------------------------------------------- + + # Read clipboard history from greenclip, process line by line + greenclip print | while IFS= read -r line; do + + # Store original line for later retrieval (crucial for correct pasting) + original_content="$line" + + #------------------------------------------------------------------ + # IMAGE DETECTION - Check if this entry might be an image + #------------------------------------------------------------------ + # Greenclip stores copied images as files in IMGDIR + # We detect them by checking for short clipboard entries that might + # be image placeholders, then matching against cached image files + #------------------------------------------------------------------ + + image_found=0 # Flag to track if we found a matching image + + if [ -d "$IMGDIR" ]; then + # Iterate through image files in the cache directory + # NOTE: Using a for loop instead of while to avoid subshell issues + for img in "$IMGDIR"/*.png "$IMGDIR"/*.jpg "$IMGDIR"/*.jpeg; do + # Skip if no files match the glob pattern + [ -f "$img" ] || continue + + imgname=$(basename "$img") + + # Heuristic: Short lines (<50 chars) might be image placeholders + # This is a simple detection method and may need refinement + if [ ${#line} -lt 50 ] && [ -f "$img" ]; then + # Format for rofi with thumbnail support: + # display_text \0 icon \x1f icon_path \0 info \x1f original_content + # + # Breaking down the format: + # - display_text: What the user sees (with emoji and filename) + # - \0icon\x1f: Separator + icon field marker + # - thumbnail://path: Tells rofi to show image thumbnail + # - \0info\x1f: Separator + info field marker + # - original_content: The ACTUAL content to paste (preserved here!) + printf '%s\0icon\x1fthumbnail://%s\0info\x1f%s\n' \ + "🖼️ Image: $imgname" \ + "$img" \ + "$original_content" + + image_found=1 + break # Found matching image, stop searching + fi + done + fi + + # Skip to next clipboard entry if we already handled this as an image + # FIXED: Previously used 'continue 2' which could skip entries + [ $image_found -eq 1 ] && continue + + #------------------------------------------------------------------ + # TEXT ENTRY - Format regular clipboard text entries + #------------------------------------------------------------------ + + # Truncate long text for better display in the menu + # But preserve original content in the info field for pasting + if [ ${#line} -gt 100 ]; then + # Display truncated version with ellipsis + display_text="${line:0:100}..." + + # Format: display_text \0 info \x1f original_content + # The info field contains the FULL original text for pasting + printf '%s\0info\x1f%s\n' "$display_text" "$original_content" + else + # Short enough to display as-is, but still use info field + # for consistency (makes the selection handler simpler) + printf '%s\0info\x1f%s\n' "$line" "$original_content" + fi + done + else + #---------------------------------------------------------------------- + # ITEM SELECTED - User chose an item from the menu + #---------------------------------------------------------------------- + # CRITICAL FIX: Output $ROFI_INFO (original content) NOT $1 (display text) + # + # - $1 contains the display text (e.g., "Some long text..." or "🖼️ Image: ...") + # - $ROFI_INFO contains the original content we stored in the info field + # - This ensures we paste the actual clipboard content, not the modified display + #---------------------------------------------------------------------- + + echo "$ROFI_INFO" + + # OLD BUGGY CODE (commented out for reference): + # echo "$1" + # This would paste the DISPLAY text instead of the ORIGINAL content! + # For example, pasting "Some long text..." instead of the full text, + # or pasting "🖼️ Image: file.png" instead of the actual image data. + fi +} + +#============================================================================== +# Export functions and variables for rofi script mode +#============================================================================== +# These exports make the function and variables available when rofi +# calls this script as a subprocess +export -f clipboard_mode +export IMGDIR + +#============================================================================== +# SCRIPT ENTRY POINT +#============================================================================== +# This script has two execution modes: +# +# 1. Direct execution (user runs the script): +# - ROFI_RETV is empty/unset +# - Script launches rofi with itself as the data source +# +# 2. Called by rofi (rofi script mode): +# - ROFI_RETV is set (0 for initial, 1+ for selection) +# - Script provides menu items or processes selection +#============================================================================== + +# OLD CODE (commented out - caused rofi-in-rofi infinite recursion bug) +# This version didn't check if it was being called by rofi, so it would +# launch rofi again, which would call the script again, creating an infinite loop +# +# # Launch rofi with custom script mode +# rofi -modi "clipboard:$0" \ +# -show clipboard \ +# -run-command 'echo -n {cmd} | xclip -selection clipboard' \ +# -theme ~/.config/rofi/clipboard.rasi +# +# # If running in script mode (called by rofi) +# if [ -n "$ROFI_RETV" ]; then +# clipboard_mode "$@" +# fi + +#------------------------------------------------------------------------------ +# FIXED CODE - Prevents rofi-in-rofi recursion bug +#------------------------------------------------------------------------------ +# Check ROFI_RETV to determine execution context +if [ -z "$ROFI_RETV" ]; then + #-------------------------------------------------------------------------- + # MODE 1: Direct execution by user + #-------------------------------------------------------------------------- + # Launch rofi with this script as the clipboard data provider + # + # Parameters explained: + # -modi "clipboard:$0" : Register this script as a rofi mode named "clipboard" + # -show clipboard : Open rofi showing the clipboard mode + # -run-command '...' : What to do with the selected item + # {cmd} is replaced with the script's output (from ROFI_INFO) + # The output is piped to xclip to copy to system clipboard + # -theme ... : Custom theme file for appearance + #-------------------------------------------------------------------------- + rofi -modi "clipboard:$0" \ + -show clipboard \ + -run-command 'echo -n {cmd} | xclip -selection clipboard' \ + -theme ~/.config/rofi/clipboard.rasi +else + #-------------------------------------------------------------------------- + # MODE 2: Called by rofi (script mode) + #-------------------------------------------------------------------------- + # Rofi is calling us to either: + # - Get the list of menu items (ROFI_RETV=0) + # - Process a user selection (ROFI_RETV=1) + # + # The clipboard_mode function handles both cases + #-------------------------------------------------------------------------- + clipboard_mode "$@" +fi diff --git a/rofi/.config/rofi/.bak/.clipboard-launcher.sh.backup b/rofi/.config/rofi/.bak/.clipboard-launcher.sh.backup new file mode 100755 index 0000000..5f81f0e --- /dev/null +++ b/rofi/.config/rofi/.bak/.clipboard-launcher.sh.backup @@ -0,0 +1,60 @@ +#!/usr/bin/env bash +#============================================================================== +# Simple Greenclip Clipboard Manager Launcher +#============================================================================== +# This is a straightforward wrapper around greenclip that provides a +# clipboard history interface using rofi. +# +# Features: +# - Simple, reliable clipboard history +# - No modifications to clipboard content +# - No image thumbnail support (use enhanced version for that) +# - Minimal overhead and complexity +# +# Usage: +# ./clipboard-launcher.sh +# +# Requirements: +# - rofi (launcher/menu application) +# - greenclip (clipboard manager daemon - must be running) +# - xclip (for clipboard operations) +# +# How it works: +# 1. User runs this script +# 2. Rofi displays clipboard history from greenclip +# 3. User selects an item +# 4. Selected text is copied to system clipboard via xclip +# 5. User can paste normally (Ctrl+V) +#============================================================================== + +#------------------------------------------------------------------------------ +# Launch rofi with greenclip integration +#------------------------------------------------------------------------------ +# Parameters explained: +# +# -modi "clipboard:greenclip print" +# Register a rofi mode called "clipboard" that uses "greenclip print" +# to generate the menu items. Greenclip print outputs clipboard history. +# +# -show clipboard +# Open rofi showing the clipboard mode we just registered +# +# -run-command 'echo -n {cmd} | xclip -selection clipboard' +# When user selects an item: +# - {cmd} is replaced with the selected clipboard entry +# - Echo it (without newline: -n flag) to xclip +# - This copies it to the system clipboard +# - User can then paste it anywhere +# +# PREVIOUS BUGGY VERSION (commented out): +# # -run-command '{cmd}' +# This would try to EXECUTE the clipboard content as a command, +# which doesn't paste it and could be dangerous! +# +# -theme ~/.config/rofi/clipboard.rasi +# Use custom theme for consistent appearance +#------------------------------------------------------------------------------ +rofi -modi "clipboard:greenclip print" \ + -show clipboard \ + -run-command 'echo -n {cmd} | xclip -selection clipboard' \ + -theme ~/.config/rofi/clipboard.rasi diff --git a/rofi/.config/rofi/.bak/.clipboard-rasi.backup b/rofi/.config/rofi/.bak/.clipboard-rasi.backup new file mode 100644 index 0000000..fbf37b6 --- /dev/null +++ b/rofi/.config/rofi/.bak/.clipboard-rasi.backup @@ -0,0 +1,148 @@ +/******************************************************* + * CLIPBOARD MANAGER (GREENCLIP) + *******************************************************/ + + +configuration { + font: "Noto Sans Regular 10"; + show-icons: true; + icon-theme: "Qogir"; + display-clipboard: " "; + disable-history: false; + sidebar-mode: false; + kb-cancel: "Super+c,Escape"; +} + + +@import "~/.config/rofi/config.rasi" +/* Insert theme modifications after this */ + +window { + background-color: @background; + border: 0; + padding: 30; + width: 50%; +} +listview { + lines: 8; + columns: 1; +} +mainbox { + border: 0; + padding: 0; +} +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} +textbox { + text-color: @foreground; +} +listview { + fixed-height: 0; + border: 8px 0px 0px; + border-color: @separatorcolor; + /* spacing: 8px; */ + spacing: 2px; /* More condensed spacing */ + scrollbar: true; + padding: 2px 0px 0px; +} +element { + border: 0; + /* padding: 5px; */ + padding: 2px; /* More condensed padding */ + orientation: horizontal; +} +element-icon { + /* size: 2em; */ + size: 1.5em; /* Smaller icon for condensed view */ + /* padding: 0 10px 0 0; */ + padding: 0 5px 0 0; /* Less padding between icon and text */ +} +element-text { + background-color: inherit; + text-color: inherit; + vertical-align: 0.5; +} +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +scrollbar { + width: 4px; + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} +button { + spacing: 0; + text-color: @normal-foreground; +} +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +} +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +entry { + spacing: 0; + text-color: @normal-foreground; +} +prompt { + spacing: 0; + text-color: @normal-foreground; +} +inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +textbox-prompt-colon { + expand: false; + str: ""; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} diff --git a/rofi/.config/rofi/.bak/.clipboard.rasi.bak b/rofi/.config/rofi/.bak/.clipboard.rasi.bak new file mode 100644 index 0000000..fbf37b6 --- /dev/null +++ b/rofi/.config/rofi/.bak/.clipboard.rasi.bak @@ -0,0 +1,148 @@ +/******************************************************* + * CLIPBOARD MANAGER (GREENCLIP) + *******************************************************/ + + +configuration { + font: "Noto Sans Regular 10"; + show-icons: true; + icon-theme: "Qogir"; + display-clipboard: " "; + disable-history: false; + sidebar-mode: false; + kb-cancel: "Super+c,Escape"; +} + + +@import "~/.config/rofi/config.rasi" +/* Insert theme modifications after this */ + +window { + background-color: @background; + border: 0; + padding: 30; + width: 50%; +} +listview { + lines: 8; + columns: 1; +} +mainbox { + border: 0; + padding: 0; +} +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} +textbox { + text-color: @foreground; +} +listview { + fixed-height: 0; + border: 8px 0px 0px; + border-color: @separatorcolor; + /* spacing: 8px; */ + spacing: 2px; /* More condensed spacing */ + scrollbar: true; + padding: 2px 0px 0px; +} +element { + border: 0; + /* padding: 5px; */ + padding: 2px; /* More condensed padding */ + orientation: horizontal; +} +element-icon { + /* size: 2em; */ + size: 1.5em; /* Smaller icon for condensed view */ + /* padding: 0 10px 0 0; */ + padding: 0 5px 0 0; /* Less padding between icon and text */ +} +element-text { + background-color: inherit; + text-color: inherit; + vertical-align: 0.5; +} +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +scrollbar { + width: 4px; + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} +button { + spacing: 0; + text-color: @normal-foreground; +} +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +} +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +entry { + spacing: 0; + text-color: @normal-foreground; +} +prompt { + spacing: 0; + text-color: @normal-foreground; +} +inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +textbox-prompt-colon { + expand: false; + str: ""; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} diff --git a/rofi/.config/rofi/.bak/bak/clipboard-launcher.sh.20251203_221032 b/rofi/.config/rofi/.bak/bak/clipboard-launcher.sh.20251203_221032 new file mode 100755 index 0000000..235caf0 --- /dev/null +++ b/rofi/.config/rofi/.bak/bak/clipboard-launcher.sh.20251203_221032 @@ -0,0 +1,114 @@ +#!/usr/bin/env bash +#============================================================================== +# Safe Clipboard Launcher - Crash-Free Version +#============================================================================== +# FIXES: +# - Skips images with missing files (prevents crashes) +# - Only shows images that actually exist +# - Safer error handling +# - No thumbnails for now (simpler, more stable) +#============================================================================== + +# Directory where greenclip stores image files +IMGDIR="/tmp/greenclip" + +#------------------------------------------------------------------------------ +# clipboard_mode() - Handles rofi script mode SAFELY +#------------------------------------------------------------------------------ +clipboard_mode() { + if [ "$ROFI_RETV" = "0" ]; then + #---------------------------------------------------------------------- + # Show clipboard entries - SKIP BROKEN IMAGES + #---------------------------------------------------------------------- + greenclip print | while IFS= read -r line; do + + # Check if this is an image entry + if [[ "$line" =~ ^image/png ]]; then + # Extract hash (handles both "image/png HASH" and "image/png Zen HASH") + hash=$(echo "$line" | awk '{print $NF}') + imgfile="$IMGDIR/${hash}.png" + + # IMPORTANT: Only show image if file actually exists + # This prevents crashes from missing files + if [ -f "$imgfile" ]; then + # Show image entry (no thumbnail to keep it simple and stable) + # Store original line in info field + printf '[IMAGE] %s\0info\x1f%s\n' "$(basename "$imgfile")" "$line" + fi + # If file doesn't exist: SKIP IT (don't show at all) + # This prevents clicking on broken images + + else + # Regular text entry - show as-is + printf '%s\0info\x1f%s\n' "$line" "$line" + fi + done + + else + #---------------------------------------------------------------------- + # Handle selection SAFELY + #---------------------------------------------------------------------- + selection="$ROFI_INFO" + + # Safety check: exit if nothing selected + [ -z "$selection" ] && exit 0 + + if [[ "$selection" =~ ^image/png ]]; then + # Image selected - copy with extra safety checks + hash=$(echo "$selection" | awk '{print $NF}') + imgfile="$IMGDIR/${hash}.png" + + # Double-check file exists and is readable + if [ -f "$imgfile" ] && [ -r "$imgfile" ]; then + # Copy image safely + xclip -selection clipboard -t image/png -i "$imgfile" 2>/dev/null + exit_code=$? + if [ $exit_code -ne 0 ]; then + # xclip failed - notify user if possible + command -v dunstify &>/dev/null && dunstify -u critical "Clipboard Error" "Failed to copy image" + fi + fi + else + # Text selected - copy safely + echo -n "$selection" | xclip -selection clipboard 2>/dev/null + fi + + # Always exit cleanly + exit 0 + fi +} + +# Export for rofi script mode +export -f clipboard_mode +export IMGDIR + +#------------------------------------------------------------------------------ +# Main entry point - with safety check +#------------------------------------------------------------------------------ +if [ -z "$ROFI_RETV" ]; then + # Launch rofi + rofi -modi "clipboard:$0" \ + -show clipboard \ + -theme ~/.config/rofi/clipboard.rasi +else + # Handle rofi request + clipboard_mode "$@" +fi + +#============================================================================== +# OLD VERSIONS (kept for reference) +#============================================================================== + +# VERSION WITH THUMBNAILS (caused crashes): +# The thumbnail:// protocol might be causing rofi to crash +# when trying to load missing image files +# +# if [ -f "$imgfile" ]; then +# printf 'Image: %s\0icon\x1fthumbnail://%s\0info\x1f%s\n' \ +# "$(basename "$imgfile")" \ +# "$imgfile" \ +# "$line" +# fi + +# SIMPLE DMENU VERSION (no images at all): +# greenclip print | rofi -dmenu -i -p " " -theme ~/.config/rofi/clipboard.rasi | xclip -selection clipboard diff --git a/rofi/.config/rofi/.bak/bak/clipboard.rasi.20251203_221213 b/rofi/.config/rofi/.bak/bak/clipboard.rasi.20251203_221213 new file mode 100644 index 0000000..347d825 --- /dev/null +++ b/rofi/.config/rofi/.bak/bak/clipboard.rasi.20251203_221213 @@ -0,0 +1,197 @@ +/******************************************************* + * CLIPBOARD MANAGER - With Images + *******************************************************/ +/* + * Clipboard theme with nice padding and image support + * - Normal font (10pt) + * - Comfortable padding (like rofidmenu) + * - Icons and images enabled + * - Clean and simple + */ + +configuration { + font: "Noto Sans Regular 10"; + show-icons: true; /* Enable icons for images */ + icon-theme: "Qogir"; + display-clipboard: " "; /* Clipboard icon restored */ + disable-history: false; + sidebar-mode: false; + kb-cancel: "Super+c,Escape"; +} + +/* Import base theme */ +@import "~/.config/rofi/config.rasi" + +/* Window - comfortable padding like rofidmenu */ +window { + background-color: @background; + border: 0; + padding: 30; /* Nice padding like rofidmenu */ + width: 50%; +} + +mainbox { + border: 0; + padding: 0; +} + +/* List view - balanced spacing */ +listview { + lines: 10; /* Show 10 entries */ + columns: 1; + fixed-height: 0; + border: 8px 0px 0px; /* Like rofidmenu */ + border-color: @separatorcolor; + scrollbar: true; + padding: 2px 0px 0px; + spacing: 4px; /* Comfortable spacing */ +} + +/* Element - comfortable padding */ +element { + border: 0; + padding: 3px; /* Comfortable padding */ +} + +/* Icon configuration for images */ +element-icon { + size: 2em; /* Good size for image thumbnails */ + padding: 0 6px 0 0; /* Space between icon and text */ +} + +element-text { + background-color: inherit; + text-color: inherit; + vertical-align: 0.5; +} + +/* Element states */ +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} + +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} + +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} + +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} + +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} + +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} + +/* Scrollbar */ +scrollbar { + width: 4px; /* Like rofidmenu */ + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} + +/* Input bar */ +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} + +prompt { + spacing: 0; + text-color: @normal-foreground; +} + +textbox-prompt-colon { + expand: false; + str: ""; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} + +entry { + spacing: 0; + text-color: @normal-foreground; +} + +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} + +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} + +textbox { + text-color: @foreground; +} + +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} + +button { + spacing: 0; + text-color: @normal-foreground; +} + +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +/*------------------------------------------------------- + * PREVIOUS CONFIGURATIONS (commented for reference) + *------------------------------------------------------- + * + * Ultra-compact version had: + * - Font: 8pt + * - Window padding: 10px + * - List lines: 12 + * - Element padding: 1px vertical + * - Spacing: 1px + * - Icons: disabled + * + * Current comfortable version: + * - Font: 10pt + * - Window padding: 30px (like rofidmenu) + * - List lines: 10 + * - Element padding: 3px + * - Spacing: 4px + * - Icons: enabled for images + */ diff --git a/rofi/.config/rofi/.bak/bak2/clipboard.rasi.20251203_221807 b/rofi/.config/rofi/.bak/bak2/clipboard.rasi.20251203_221807 new file mode 100644 index 0000000..bcccfff --- /dev/null +++ b/rofi/.config/rofi/.bak/bak2/clipboard.rasi.20251203_221807 @@ -0,0 +1,201 @@ +/******************************************************* + * CLIPBOARD MANAGER - With Images + *******************************************************/ +/* + * Clipboard theme with nice padding and image support + * - Normal font (10pt) + * - Comfortable padding (like rofidmenu) + * - Icons and images enabled + * - Clean and simple + */ + +configuration { + font: "Noto Sans Regular 10"; + show-icons: true; /* Enable icons for images */ + icon-theme: "Qogir"; + display-clipboard: " "; /* Clipboard icon restored */ + disable-history: false; + sidebar-mode: false; + kb-cancel: "Super+c,Escape"; +} + +/* Import base theme */ +@import "~/.config/rofi/config.rasi" + +/* Window - comfortable padding like rofidmenu */ +window { + background-color: @background; + border: 0; + padding: 30; /* Nice padding like rofidmenu */ + width: 50%; +} + +mainbox { + border: 0; + padding: 0; +} + +/* List view - compact vertical spacing */ +listview { + lines: 10; /* Show 10 entries */ + columns: 1; + fixed-height: 0; + border: 8px 0px 0px; /* Like rofidmenu */ + border-color: @separatorcolor; + scrollbar: true; + padding: 2px 0px 0px; + spacing: 2px; /* Reduced: was 4px, now 2px */ +} + +/* Element - compact vertical padding */ +element { + border: 0; + padding: 1px 3px; /* Reduced vertical: 1px top/bottom, 3px left/right (was 3px all) */ +} + +/* Icon configuration for images */ +element-icon { + size: 2em; /* Good size for image thumbnails */ + padding: 0 6px 0 0; /* Space between icon and text */ +} + +element-text { + background-color: inherit; + text-color: inherit; + vertical-align: 0.5; +} + +/* Element states */ +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} + +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} + +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} + +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} + +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} + +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} + +/* Scrollbar */ +scrollbar { + width: 4px; /* Like rofidmenu */ + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} + +/* Input bar */ +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} + +prompt { + spacing: 0; + text-color: @normal-foreground; +} + +textbox-prompt-colon { + expand: false; + str: ""; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} + +entry { + spacing: 0; + text-color: @normal-foreground; +} + +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} + +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} + +textbox { + text-color: @foreground; +} + +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} + +button { + spacing: 0; + text-color: @normal-foreground; +} + +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +/*------------------------------------------------------- + * PREVIOUS CONFIGURATIONS (commented for reference) + *------------------------------------------------------- + * + * Ultra-compact version had: + * - Font: 8pt + * - Window padding: 10px + * - List lines: 12 + * - Element padding: 1px vertical + * - Spacing: 1px + * - Icons: disabled + * + * Comfortable version had: + * - Element padding: 3px all sides + * - Spacing: 4px + * + * Current version (compact vertical): + * - Font: 10pt + * - Window padding: 30px (like rofidmenu) + * - List lines: 10 + * - Element padding: 1px vertical, 3px horizontal + * - Spacing: 2px (smaller vertical gaps) + * - Icons: enabled for images + */ diff --git a/rofi/.config/rofi/.bak/clipboard-launcher-enhanced.sh.20251128_191045 b/rofi/.config/rofi/.bak/clipboard-launcher-enhanced.sh.20251128_191045 new file mode 100755 index 0000000..0c1589a --- /dev/null +++ b/rofi/.config/rofi/.bak/clipboard-launcher-enhanced.sh.20251128_191045 @@ -0,0 +1,278 @@ +#!/usr/bin/env bash +#============================================================================== +# Enhanced Greenclip Clipboard Manager with Image Support +#============================================================================== +# This script provides a fully-functional clipboard manager using rofi and +# greenclip, with proper support for both text and images. +# +# Features: +# - Displays clipboard history from greenclip +# - Shows image thumbnails for copied images +# - Truncates long text for readability +# - Properly pastes both text AND images back to clipboard +# - Handles greenclip's image format: "image/png Zen [hash]" +# +# Requirements: +# - rofi (with script mode and thumbnail support) +# - greenclip (clipboard manager daemon must be running) +# - xclip (for clipboard operations) +# - Image files stored in /tmp/greenclip/ (configured in greenclip.toml) +# +# How Greenclip Stores Images: +# 1. Text entries: Stored as-is in clipboard history +# 2. Image entries: Stored as "image/png Zen [hash]" in history +# 3. Actual PNG files: Saved to /tmp/greenclip/[hash].png +# 4. This script: Detects images, shows thumbnails, and restores them properly +#============================================================================== + +# Directory where greenclip caches image files +# IMPORTANT: This must match image_cache_directory in ~/.config/greenclip.toml +IMGDIR="/tmp/greenclip" + +# Maximum text length to display before truncating +MAX_TEXT_LENGTH=100 + +#------------------------------------------------------------------------------ +# clipboard_mode() - Main rofi script mode handler +#------------------------------------------------------------------------------ +# Called by rofi in two contexts: +# +# Context 1: ROFI_RETV=0 (Initial call) +# - Generate the menu items from greenclip history +# - Detect image vs text entries +# - Format with thumbnails and truncation +# - Store original content in info field for later retrieval +# +# Context 2: ROFI_RETV=1 (User selected item) +# - Receive selection via $ROFI_INFO +# - Determine if it's an image or text +# - Copy to clipboard appropriately (file for images, text for text) +#------------------------------------------------------------------------------ +clipboard_mode() { + if [ "$ROFI_RETV" = "0" ]; then + #---------------------------------------------------------------------- + # CONTEXT 1: Generate Menu Items + #---------------------------------------------------------------------- + + # Read clipboard history line by line from greenclip + greenclip print | while IFS= read -r line; do + + #------------------------------------------------------------------ + # IMAGE DETECTION AND DISPLAY + #------------------------------------------------------------------ + # Greenclip outputs image entries in format: "image/png Zen [hash]" + # We need to: + # 1. Detect these entries (starts with "image/") + # 2. Extract the hash/ID + # 3. Find the corresponding PNG file in IMGDIR + # 4. Display with thumbnail icon + #------------------------------------------------------------------ + + if [[ "$line" =~ ^image/png ]]; then + # This is an image entry! + + # Extract the hash from "image/png Zen [hash]" + # The hash is the last field (may be negative number) + hash=$(echo "$line" | awk '{print $NF}') + + # Construct the image file path + # Note: greenclip saves as [hash].png or [-hash].png + imgfile="$IMGDIR/${hash}.png" + + # Check if image file exists + if [ -f "$imgfile" ]; then + # Get just the filename for display + imgname=$(basename "$imgfile") + + # Display format for rofi: + # [display text] \0 icon \x1f [thumbnail path] \0 info \x1f [original line] + # + # Components: + # - Display: "🖼️ Image: filename.png" (what user sees) + # - Icon: thumbnail://path (shows image preview) + # - Info: original greenclip line (used for restoration) + printf '🖼️ Image: %s\0icon\x1fthumbnail://%s\0info\x1f%s\n' \ + "$imgname" \ + "$imgfile" \ + "$line" + else + # Image file not found, show as broken/missing + # Still preserve the original line in case file appears later + printf '🖼️ Image (missing): %s\0info\x1f%s\n' \ + "$hash" \ + "$line" + fi + + # Done processing this image entry, move to next line + continue + fi + + #------------------------------------------------------------------ + # TEXT ENTRY DISPLAY + #------------------------------------------------------------------ + # For regular text clipboard entries: + # 1. Truncate if too long (for display) + # 2. Preserve full original text in info field (for pasting) + #------------------------------------------------------------------ + + if [ ${#line} -gt $MAX_TEXT_LENGTH ]; then + # Text is long - truncate for display but preserve original + display_text="${line:0:$MAX_TEXT_LENGTH}..." + + # Format: [truncated text] \0 info \x1f [full original text] + # User sees truncated version, but pastes full version + printf '%s\0info\x1f%s\n' "$display_text" "$line" + else + # Text is short - can display as-is + # Still use info field for consistency in selection handling + printf '%s\0info\x1f%s\n' "$line" "$line" + fi + done + + else + #---------------------------------------------------------------------- + # CONTEXT 2: Handle User Selection + #---------------------------------------------------------------------- + # User selected an item. $ROFI_INFO contains the original content + # we stored in the info field during menu generation. + # + # We need to: + # 1. Check if selection is an image or text + # 2. For images: Copy the PNG file to clipboard + # 3. For text: Copy the text to clipboard + #---------------------------------------------------------------------- + + selection="$ROFI_INFO" + + #---------------------------------------------------------------------- + # IMAGE SELECTION HANDLING + #---------------------------------------------------------------------- + # Check if selected item is an image entry (starts with "image/png") + #---------------------------------------------------------------------- + if [[ "$selection" =~ ^image/png ]]; then + # This is an image! Extract hash and copy the actual PNG file + + # Parse hash from "image/png Zen [hash]" + hash=$(echo "$selection" | awk '{print $NF}') + + # Construct image file path + imgfile="$IMGDIR/${hash}.png" + + # Verify image file exists before copying + if [ -f "$imgfile" ]; then + # Copy the actual PNG file to clipboard as image data + # -selection clipboard: Use the standard clipboard (Ctrl+V) + # -t image/png: Set clipboard type to PNG image + # -i: Read from file + xclip -selection clipboard -t image/png -i "$imgfile" + + # Exit successfully - image is now in clipboard + exit 0 + else + # Image file not found - show error notification if dunstify available + if command -v dunstify &> /dev/null; then + dunstify -u critical "Clipboard Error" "Image file not found: $imgfile" + fi + # Exit with error code + exit 1 + fi + else + #------------------------------------------------------------------ + # TEXT SELECTION HANDLING + #------------------------------------------------------------------ + # This is regular text - copy to clipboard as text + #------------------------------------------------------------------ + + # Copy text directly to clipboard using xclip + # -selection clipboard: Use standard clipboard (Ctrl+V) + # -i: Read from stdin + # Using echo -n to avoid adding newline + echo -n "$selection" | xclip -selection clipboard + + # Exit successfully - text is now in clipboard + exit 0 + fi + fi +} + +#============================================================================== +# Export for rofi script mode +#============================================================================== +# Make function and variables available when rofi spawns this script +export -f clipboard_mode +export IMGDIR +export MAX_TEXT_LENGTH + +#============================================================================== +# MAIN SCRIPT ENTRY POINT +#============================================================================== +# Two execution modes based on ROFI_RETV environment variable: +# +# MODE 1: Direct execution (ROFI_RETV is unset/empty) +# - User ran this script from command line or keybind +# - Launch rofi with this script as the clipboard provider +# - Rofi will then call this script again in MODE 2 +# +# MODE 2: Called by rofi (ROFI_RETV is set) +# - Rofi is calling us to get menu items or handle selection +# - Call clipboard_mode() function to handle the request +#============================================================================== + +if [ -z "$ROFI_RETV" ]; then + #-------------------------------------------------------------------------- + # MODE 1: Launch rofi + #-------------------------------------------------------------------------- + + # Launch rofi with this script as the data source for "clipboard" mode + # + # Rofi parameters: + # -modi "clipboard:$0" + # Register "clipboard" mode that runs this script for data + # + # -show clipboard + # Display the clipboard mode immediately + # + # NO -run-command needed! + # The script handles clipboard copying internally for both text and images + # When user selects an item, rofi calls the script with ROFI_RETV=1 + # The script then copies to clipboard directly and exits + # + # -theme ... + # Custom theme file for visual styling + #-------------------------------------------------------------------------- + + rofi -modi "clipboard:$0" \ + -show clipboard \ + -theme ~/.config/rofi/clipboard.rasi + + # NOTE: All clipboard operations are handled inside clipboard_mode() + # when ROFI_RETV=1 (selection mode). No post-processing needed here. + +else + #-------------------------------------------------------------------------- + # MODE 2: Provide data to rofi or handle selection + #-------------------------------------------------------------------------- + + # Rofi is calling us - hand off to clipboard_mode function + clipboard_mode "$@" +fi + +#============================================================================== +# OLD/ALTERNATIVE APPROACHES (Commented out for reference) +#============================================================================== +# +# APPROACH 1: Using -run-command with xclip for text +# This was the old approach that didn't handle images properly: +# +# rofi -modi "clipboard:$0" \ +# -show clipboard \ +# -run-command 'echo -n {cmd} | xclip -selection clipboard' \ +# -theme ~/.config/rofi/clipboard.rasi +# +# PROBLEM: This pipes ALL selections (including "image/png Zen [hash]" text) +# to xclip as text, which doesn't restore the actual image to clipboard. +# +# SOLUTION: Handle image copying inside the script, before rofi's -run-command, +# by detecting image format and using xclip with -t image/png and the file. +# +#============================================================================== diff --git a/rofi/.config/rofi/.bak/clipboard-launcher-enhanced.sh.20251203_223308 b/rofi/.config/rofi/.bak/clipboard-launcher-enhanced.sh.20251203_223308 new file mode 100755 index 0000000..0c1589a --- /dev/null +++ b/rofi/.config/rofi/.bak/clipboard-launcher-enhanced.sh.20251203_223308 @@ -0,0 +1,278 @@ +#!/usr/bin/env bash +#============================================================================== +# Enhanced Greenclip Clipboard Manager with Image Support +#============================================================================== +# This script provides a fully-functional clipboard manager using rofi and +# greenclip, with proper support for both text and images. +# +# Features: +# - Displays clipboard history from greenclip +# - Shows image thumbnails for copied images +# - Truncates long text for readability +# - Properly pastes both text AND images back to clipboard +# - Handles greenclip's image format: "image/png Zen [hash]" +# +# Requirements: +# - rofi (with script mode and thumbnail support) +# - greenclip (clipboard manager daemon must be running) +# - xclip (for clipboard operations) +# - Image files stored in /tmp/greenclip/ (configured in greenclip.toml) +# +# How Greenclip Stores Images: +# 1. Text entries: Stored as-is in clipboard history +# 2. Image entries: Stored as "image/png Zen [hash]" in history +# 3. Actual PNG files: Saved to /tmp/greenclip/[hash].png +# 4. This script: Detects images, shows thumbnails, and restores them properly +#============================================================================== + +# Directory where greenclip caches image files +# IMPORTANT: This must match image_cache_directory in ~/.config/greenclip.toml +IMGDIR="/tmp/greenclip" + +# Maximum text length to display before truncating +MAX_TEXT_LENGTH=100 + +#------------------------------------------------------------------------------ +# clipboard_mode() - Main rofi script mode handler +#------------------------------------------------------------------------------ +# Called by rofi in two contexts: +# +# Context 1: ROFI_RETV=0 (Initial call) +# - Generate the menu items from greenclip history +# - Detect image vs text entries +# - Format with thumbnails and truncation +# - Store original content in info field for later retrieval +# +# Context 2: ROFI_RETV=1 (User selected item) +# - Receive selection via $ROFI_INFO +# - Determine if it's an image or text +# - Copy to clipboard appropriately (file for images, text for text) +#------------------------------------------------------------------------------ +clipboard_mode() { + if [ "$ROFI_RETV" = "0" ]; then + #---------------------------------------------------------------------- + # CONTEXT 1: Generate Menu Items + #---------------------------------------------------------------------- + + # Read clipboard history line by line from greenclip + greenclip print | while IFS= read -r line; do + + #------------------------------------------------------------------ + # IMAGE DETECTION AND DISPLAY + #------------------------------------------------------------------ + # Greenclip outputs image entries in format: "image/png Zen [hash]" + # We need to: + # 1. Detect these entries (starts with "image/") + # 2. Extract the hash/ID + # 3. Find the corresponding PNG file in IMGDIR + # 4. Display with thumbnail icon + #------------------------------------------------------------------ + + if [[ "$line" =~ ^image/png ]]; then + # This is an image entry! + + # Extract the hash from "image/png Zen [hash]" + # The hash is the last field (may be negative number) + hash=$(echo "$line" | awk '{print $NF}') + + # Construct the image file path + # Note: greenclip saves as [hash].png or [-hash].png + imgfile="$IMGDIR/${hash}.png" + + # Check if image file exists + if [ -f "$imgfile" ]; then + # Get just the filename for display + imgname=$(basename "$imgfile") + + # Display format for rofi: + # [display text] \0 icon \x1f [thumbnail path] \0 info \x1f [original line] + # + # Components: + # - Display: "🖼️ Image: filename.png" (what user sees) + # - Icon: thumbnail://path (shows image preview) + # - Info: original greenclip line (used for restoration) + printf '🖼️ Image: %s\0icon\x1fthumbnail://%s\0info\x1f%s\n' \ + "$imgname" \ + "$imgfile" \ + "$line" + else + # Image file not found, show as broken/missing + # Still preserve the original line in case file appears later + printf '🖼️ Image (missing): %s\0info\x1f%s\n' \ + "$hash" \ + "$line" + fi + + # Done processing this image entry, move to next line + continue + fi + + #------------------------------------------------------------------ + # TEXT ENTRY DISPLAY + #------------------------------------------------------------------ + # For regular text clipboard entries: + # 1. Truncate if too long (for display) + # 2. Preserve full original text in info field (for pasting) + #------------------------------------------------------------------ + + if [ ${#line} -gt $MAX_TEXT_LENGTH ]; then + # Text is long - truncate for display but preserve original + display_text="${line:0:$MAX_TEXT_LENGTH}..." + + # Format: [truncated text] \0 info \x1f [full original text] + # User sees truncated version, but pastes full version + printf '%s\0info\x1f%s\n' "$display_text" "$line" + else + # Text is short - can display as-is + # Still use info field for consistency in selection handling + printf '%s\0info\x1f%s\n' "$line" "$line" + fi + done + + else + #---------------------------------------------------------------------- + # CONTEXT 2: Handle User Selection + #---------------------------------------------------------------------- + # User selected an item. $ROFI_INFO contains the original content + # we stored in the info field during menu generation. + # + # We need to: + # 1. Check if selection is an image or text + # 2. For images: Copy the PNG file to clipboard + # 3. For text: Copy the text to clipboard + #---------------------------------------------------------------------- + + selection="$ROFI_INFO" + + #---------------------------------------------------------------------- + # IMAGE SELECTION HANDLING + #---------------------------------------------------------------------- + # Check if selected item is an image entry (starts with "image/png") + #---------------------------------------------------------------------- + if [[ "$selection" =~ ^image/png ]]; then + # This is an image! Extract hash and copy the actual PNG file + + # Parse hash from "image/png Zen [hash]" + hash=$(echo "$selection" | awk '{print $NF}') + + # Construct image file path + imgfile="$IMGDIR/${hash}.png" + + # Verify image file exists before copying + if [ -f "$imgfile" ]; then + # Copy the actual PNG file to clipboard as image data + # -selection clipboard: Use the standard clipboard (Ctrl+V) + # -t image/png: Set clipboard type to PNG image + # -i: Read from file + xclip -selection clipboard -t image/png -i "$imgfile" + + # Exit successfully - image is now in clipboard + exit 0 + else + # Image file not found - show error notification if dunstify available + if command -v dunstify &> /dev/null; then + dunstify -u critical "Clipboard Error" "Image file not found: $imgfile" + fi + # Exit with error code + exit 1 + fi + else + #------------------------------------------------------------------ + # TEXT SELECTION HANDLING + #------------------------------------------------------------------ + # This is regular text - copy to clipboard as text + #------------------------------------------------------------------ + + # Copy text directly to clipboard using xclip + # -selection clipboard: Use standard clipboard (Ctrl+V) + # -i: Read from stdin + # Using echo -n to avoid adding newline + echo -n "$selection" | xclip -selection clipboard + + # Exit successfully - text is now in clipboard + exit 0 + fi + fi +} + +#============================================================================== +# Export for rofi script mode +#============================================================================== +# Make function and variables available when rofi spawns this script +export -f clipboard_mode +export IMGDIR +export MAX_TEXT_LENGTH + +#============================================================================== +# MAIN SCRIPT ENTRY POINT +#============================================================================== +# Two execution modes based on ROFI_RETV environment variable: +# +# MODE 1: Direct execution (ROFI_RETV is unset/empty) +# - User ran this script from command line or keybind +# - Launch rofi with this script as the clipboard provider +# - Rofi will then call this script again in MODE 2 +# +# MODE 2: Called by rofi (ROFI_RETV is set) +# - Rofi is calling us to get menu items or handle selection +# - Call clipboard_mode() function to handle the request +#============================================================================== + +if [ -z "$ROFI_RETV" ]; then + #-------------------------------------------------------------------------- + # MODE 1: Launch rofi + #-------------------------------------------------------------------------- + + # Launch rofi with this script as the data source for "clipboard" mode + # + # Rofi parameters: + # -modi "clipboard:$0" + # Register "clipboard" mode that runs this script for data + # + # -show clipboard + # Display the clipboard mode immediately + # + # NO -run-command needed! + # The script handles clipboard copying internally for both text and images + # When user selects an item, rofi calls the script with ROFI_RETV=1 + # The script then copies to clipboard directly and exits + # + # -theme ... + # Custom theme file for visual styling + #-------------------------------------------------------------------------- + + rofi -modi "clipboard:$0" \ + -show clipboard \ + -theme ~/.config/rofi/clipboard.rasi + + # NOTE: All clipboard operations are handled inside clipboard_mode() + # when ROFI_RETV=1 (selection mode). No post-processing needed here. + +else + #-------------------------------------------------------------------------- + # MODE 2: Provide data to rofi or handle selection + #-------------------------------------------------------------------------- + + # Rofi is calling us - hand off to clipboard_mode function + clipboard_mode "$@" +fi + +#============================================================================== +# OLD/ALTERNATIVE APPROACHES (Commented out for reference) +#============================================================================== +# +# APPROACH 1: Using -run-command with xclip for text +# This was the old approach that didn't handle images properly: +# +# rofi -modi "clipboard:$0" \ +# -show clipboard \ +# -run-command 'echo -n {cmd} | xclip -selection clipboard' \ +# -theme ~/.config/rofi/clipboard.rasi +# +# PROBLEM: This pipes ALL selections (including "image/png Zen [hash]" text) +# to xclip as text, which doesn't restore the actual image to clipboard. +# +# SOLUTION: Handle image copying inside the script, before rofi's -run-command, +# by detecting image format and using xclip with -t image/png and the file. +# +#============================================================================== diff --git a/rofi/.config/rofi/.bak/clipboard-launcher-enhanced.sh.20251203_223628 b/rofi/.config/rofi/.bak/clipboard-launcher-enhanced.sh.20251203_223628 new file mode 100755 index 0000000..0c1589a --- /dev/null +++ b/rofi/.config/rofi/.bak/clipboard-launcher-enhanced.sh.20251203_223628 @@ -0,0 +1,278 @@ +#!/usr/bin/env bash +#============================================================================== +# Enhanced Greenclip Clipboard Manager with Image Support +#============================================================================== +# This script provides a fully-functional clipboard manager using rofi and +# greenclip, with proper support for both text and images. +# +# Features: +# - Displays clipboard history from greenclip +# - Shows image thumbnails for copied images +# - Truncates long text for readability +# - Properly pastes both text AND images back to clipboard +# - Handles greenclip's image format: "image/png Zen [hash]" +# +# Requirements: +# - rofi (with script mode and thumbnail support) +# - greenclip (clipboard manager daemon must be running) +# - xclip (for clipboard operations) +# - Image files stored in /tmp/greenclip/ (configured in greenclip.toml) +# +# How Greenclip Stores Images: +# 1. Text entries: Stored as-is in clipboard history +# 2. Image entries: Stored as "image/png Zen [hash]" in history +# 3. Actual PNG files: Saved to /tmp/greenclip/[hash].png +# 4. This script: Detects images, shows thumbnails, and restores them properly +#============================================================================== + +# Directory where greenclip caches image files +# IMPORTANT: This must match image_cache_directory in ~/.config/greenclip.toml +IMGDIR="/tmp/greenclip" + +# Maximum text length to display before truncating +MAX_TEXT_LENGTH=100 + +#------------------------------------------------------------------------------ +# clipboard_mode() - Main rofi script mode handler +#------------------------------------------------------------------------------ +# Called by rofi in two contexts: +# +# Context 1: ROFI_RETV=0 (Initial call) +# - Generate the menu items from greenclip history +# - Detect image vs text entries +# - Format with thumbnails and truncation +# - Store original content in info field for later retrieval +# +# Context 2: ROFI_RETV=1 (User selected item) +# - Receive selection via $ROFI_INFO +# - Determine if it's an image or text +# - Copy to clipboard appropriately (file for images, text for text) +#------------------------------------------------------------------------------ +clipboard_mode() { + if [ "$ROFI_RETV" = "0" ]; then + #---------------------------------------------------------------------- + # CONTEXT 1: Generate Menu Items + #---------------------------------------------------------------------- + + # Read clipboard history line by line from greenclip + greenclip print | while IFS= read -r line; do + + #------------------------------------------------------------------ + # IMAGE DETECTION AND DISPLAY + #------------------------------------------------------------------ + # Greenclip outputs image entries in format: "image/png Zen [hash]" + # We need to: + # 1. Detect these entries (starts with "image/") + # 2. Extract the hash/ID + # 3. Find the corresponding PNG file in IMGDIR + # 4. Display with thumbnail icon + #------------------------------------------------------------------ + + if [[ "$line" =~ ^image/png ]]; then + # This is an image entry! + + # Extract the hash from "image/png Zen [hash]" + # The hash is the last field (may be negative number) + hash=$(echo "$line" | awk '{print $NF}') + + # Construct the image file path + # Note: greenclip saves as [hash].png or [-hash].png + imgfile="$IMGDIR/${hash}.png" + + # Check if image file exists + if [ -f "$imgfile" ]; then + # Get just the filename for display + imgname=$(basename "$imgfile") + + # Display format for rofi: + # [display text] \0 icon \x1f [thumbnail path] \0 info \x1f [original line] + # + # Components: + # - Display: "🖼️ Image: filename.png" (what user sees) + # - Icon: thumbnail://path (shows image preview) + # - Info: original greenclip line (used for restoration) + printf '🖼️ Image: %s\0icon\x1fthumbnail://%s\0info\x1f%s\n' \ + "$imgname" \ + "$imgfile" \ + "$line" + else + # Image file not found, show as broken/missing + # Still preserve the original line in case file appears later + printf '🖼️ Image (missing): %s\0info\x1f%s\n' \ + "$hash" \ + "$line" + fi + + # Done processing this image entry, move to next line + continue + fi + + #------------------------------------------------------------------ + # TEXT ENTRY DISPLAY + #------------------------------------------------------------------ + # For regular text clipboard entries: + # 1. Truncate if too long (for display) + # 2. Preserve full original text in info field (for pasting) + #------------------------------------------------------------------ + + if [ ${#line} -gt $MAX_TEXT_LENGTH ]; then + # Text is long - truncate for display but preserve original + display_text="${line:0:$MAX_TEXT_LENGTH}..." + + # Format: [truncated text] \0 info \x1f [full original text] + # User sees truncated version, but pastes full version + printf '%s\0info\x1f%s\n' "$display_text" "$line" + else + # Text is short - can display as-is + # Still use info field for consistency in selection handling + printf '%s\0info\x1f%s\n' "$line" "$line" + fi + done + + else + #---------------------------------------------------------------------- + # CONTEXT 2: Handle User Selection + #---------------------------------------------------------------------- + # User selected an item. $ROFI_INFO contains the original content + # we stored in the info field during menu generation. + # + # We need to: + # 1. Check if selection is an image or text + # 2. For images: Copy the PNG file to clipboard + # 3. For text: Copy the text to clipboard + #---------------------------------------------------------------------- + + selection="$ROFI_INFO" + + #---------------------------------------------------------------------- + # IMAGE SELECTION HANDLING + #---------------------------------------------------------------------- + # Check if selected item is an image entry (starts with "image/png") + #---------------------------------------------------------------------- + if [[ "$selection" =~ ^image/png ]]; then + # This is an image! Extract hash and copy the actual PNG file + + # Parse hash from "image/png Zen [hash]" + hash=$(echo "$selection" | awk '{print $NF}') + + # Construct image file path + imgfile="$IMGDIR/${hash}.png" + + # Verify image file exists before copying + if [ -f "$imgfile" ]; then + # Copy the actual PNG file to clipboard as image data + # -selection clipboard: Use the standard clipboard (Ctrl+V) + # -t image/png: Set clipboard type to PNG image + # -i: Read from file + xclip -selection clipboard -t image/png -i "$imgfile" + + # Exit successfully - image is now in clipboard + exit 0 + else + # Image file not found - show error notification if dunstify available + if command -v dunstify &> /dev/null; then + dunstify -u critical "Clipboard Error" "Image file not found: $imgfile" + fi + # Exit with error code + exit 1 + fi + else + #------------------------------------------------------------------ + # TEXT SELECTION HANDLING + #------------------------------------------------------------------ + # This is regular text - copy to clipboard as text + #------------------------------------------------------------------ + + # Copy text directly to clipboard using xclip + # -selection clipboard: Use standard clipboard (Ctrl+V) + # -i: Read from stdin + # Using echo -n to avoid adding newline + echo -n "$selection" | xclip -selection clipboard + + # Exit successfully - text is now in clipboard + exit 0 + fi + fi +} + +#============================================================================== +# Export for rofi script mode +#============================================================================== +# Make function and variables available when rofi spawns this script +export -f clipboard_mode +export IMGDIR +export MAX_TEXT_LENGTH + +#============================================================================== +# MAIN SCRIPT ENTRY POINT +#============================================================================== +# Two execution modes based on ROFI_RETV environment variable: +# +# MODE 1: Direct execution (ROFI_RETV is unset/empty) +# - User ran this script from command line or keybind +# - Launch rofi with this script as the clipboard provider +# - Rofi will then call this script again in MODE 2 +# +# MODE 2: Called by rofi (ROFI_RETV is set) +# - Rofi is calling us to get menu items or handle selection +# - Call clipboard_mode() function to handle the request +#============================================================================== + +if [ -z "$ROFI_RETV" ]; then + #-------------------------------------------------------------------------- + # MODE 1: Launch rofi + #-------------------------------------------------------------------------- + + # Launch rofi with this script as the data source for "clipboard" mode + # + # Rofi parameters: + # -modi "clipboard:$0" + # Register "clipboard" mode that runs this script for data + # + # -show clipboard + # Display the clipboard mode immediately + # + # NO -run-command needed! + # The script handles clipboard copying internally for both text and images + # When user selects an item, rofi calls the script with ROFI_RETV=1 + # The script then copies to clipboard directly and exits + # + # -theme ... + # Custom theme file for visual styling + #-------------------------------------------------------------------------- + + rofi -modi "clipboard:$0" \ + -show clipboard \ + -theme ~/.config/rofi/clipboard.rasi + + # NOTE: All clipboard operations are handled inside clipboard_mode() + # when ROFI_RETV=1 (selection mode). No post-processing needed here. + +else + #-------------------------------------------------------------------------- + # MODE 2: Provide data to rofi or handle selection + #-------------------------------------------------------------------------- + + # Rofi is calling us - hand off to clipboard_mode function + clipboard_mode "$@" +fi + +#============================================================================== +# OLD/ALTERNATIVE APPROACHES (Commented out for reference) +#============================================================================== +# +# APPROACH 1: Using -run-command with xclip for text +# This was the old approach that didn't handle images properly: +# +# rofi -modi "clipboard:$0" \ +# -show clipboard \ +# -run-command 'echo -n {cmd} | xclip -selection clipboard' \ +# -theme ~/.config/rofi/clipboard.rasi +# +# PROBLEM: This pipes ALL selections (including "image/png Zen [hash]" text) +# to xclip as text, which doesn't restore the actual image to clipboard. +# +# SOLUTION: Handle image copying inside the script, before rofi's -run-command, +# by detecting image format and using xclip with -t image/png and the file. +# +#============================================================================== diff --git a/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251128_191045 b/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251128_191045 new file mode 100755 index 0000000..b26ad74 --- /dev/null +++ b/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251128_191045 @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +#============================================================================== +# Ultra-Simple Clipboard Launcher +#============================================================================== +# Displays greenclip clipboard history in rofi +# When you select an item, it copies to clipboard +# No images, no complexity, just works. +#============================================================================== + +# Simple approach: pipe greenclip history to rofi, then to xclip +greenclip print | rofi -dmenu -i -p " " -theme ~/.config/rofi/clipboard.rasi | xclip -selection clipboard + +# How it works: +# 1. greenclip print - Get all clipboard history +# 2. rofi -dmenu -i -p "..." - Show in rofi, case-insensitive search +# 3. User selects item +# 4. xclip -selection clipboard - Copy selection to clipboard + +#============================================================================== +# OLD VERSION (commented out - was more complex) +#============================================================================== +# rofi -modi "clipboard:greenclip print" \ +# -show clipboard \ +# -run-command 'echo -n {cmd} | xclip -selection clipboard' \ +# -theme ~/.config/rofi/clipboard.rasi diff --git a/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251128_191729 b/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251128_191729 new file mode 100755 index 0000000..f8bad9d --- /dev/null +++ b/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251128_191729 @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +#============================================================================== +# Simple Clipboard Launcher with Image Support +#============================================================================== +# Displays greenclip clipboard history in rofi +# Handles both text and images +# Simple and clean - no unnecessary complexity +#============================================================================== + +# Directory where greenclip stores image files +IMGDIR="/tmp/greenclip" + +# Show clipboard history in rofi and capture selection +selection=$(greenclip print | rofi -dmenu -i -p " " -theme ~/.config/rofi/clipboard.rasi) + +# Exit if nothing selected (user pressed Escape) +[ -z "$selection" ] && exit 0 + +#============================================================================== +# Handle the selection - check if image or text +#============================================================================== + +if [[ "$selection" =~ ^image/png ]]; then + #-------------------------------------------------------------------------- + # IMAGE HANDLING - Simple approach + #-------------------------------------------------------------------------- + # Greenclip stores images as: "image/png Zen [hash]" + # Extract the hash and copy the actual PNG file + + # Extract hash (last word in the line) + hash=$(echo "$selection" | awk '{print $NF}') + + # Construct image file path + imgfile="$IMGDIR/${hash}.png" + + # Copy image file to clipboard if it exists + if [ -f "$imgfile" ]; then + xclip -selection clipboard -t image/png -i "$imgfile" + else + # Image file not found - show notification if dunstify available + if command -v dunstify &> /dev/null; then + dunstify -u normal "Clipboard" "Image file not found" + fi + fi +else + #-------------------------------------------------------------------------- + # TEXT HANDLING - Simple approach + #-------------------------------------------------------------------------- + # Just copy the text to clipboard + + echo -n "$selection" | xclip -selection clipboard +fi + +#============================================================================== +# OLD VERSIONS (commented out for reference) +#============================================================================== + +# VERSION 1: Ultra-simple (no image support) +# greenclip print | rofi -dmenu -i -p " " -theme ~/.config/rofi/clipboard.rasi | xclip -selection clipboard + +# VERSION 2: Using rofi modi (was more complex and buggy) +# rofi -modi "clipboard:greenclip print" \ +# -show clipboard \ +# -run-command 'echo -n {cmd} | xclip -selection clipboard' \ +# -theme ~/.config/rofi/clipboard.rasi diff --git a/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251128_192345 b/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251128_192345 new file mode 100755 index 0000000..7961bb6 --- /dev/null +++ b/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251128_192345 @@ -0,0 +1,109 @@ +#!/usr/bin/env bash +#============================================================================== +# Simple Clipboard Launcher with Image Thumbnails +#============================================================================== +# Shows clipboard history with image thumbnails +# Simple script mode implementation - easy to understand and debug +#============================================================================== + +# Directory where greenclip stores image files +IMGDIR="/tmp/greenclip" + +#------------------------------------------------------------------------------ +# clipboard_mode() - Handles rofi script mode +#------------------------------------------------------------------------------ +# Two modes: +# 1. ROFI_RETV=0: Show menu items (with thumbnails for images) +# 2. ROFI_RETV=1: Handle selection (copy to clipboard) +#------------------------------------------------------------------------------ +clipboard_mode() { + if [ "$ROFI_RETV" = "0" ]; then + #---------------------------------------------------------------------- + # Show clipboard entries + #---------------------------------------------------------------------- + greenclip print | while IFS= read -r line; do + + # Check if this is an image entry + if [[ "$line" =~ ^image/png ]]; then + # Extract hash from "image/png Zen [hash]" + hash=$(echo "$line" | awk '{print $NF}') + imgfile="$IMGDIR/${hash}.png" + + # Show with thumbnail if file exists + if [ -f "$imgfile" ]; then + # Format: display_text \0 icon \x1f thumbnail://path \0 info \x1f original_line + # Display: Keep original text simple + # Icon: Show thumbnail + # Info: Store original line for later + printf 'Image: %s\0icon\x1fthumbnail://%s\0info\x1f%s\n' \ + "$(basename "$imgfile")" \ + "$imgfile" \ + "$line" + else + # Image file missing - show without thumbnail + printf '%s\0info\x1f%s\n' "$line" "$line" + fi + else + # Regular text entry - show as-is + # Store in info field for consistent handling + printf '%s\0info\x1f%s\n' "$line" "$line" + fi + done + + else + #---------------------------------------------------------------------- + # Handle selection - copy to clipboard + #---------------------------------------------------------------------- + # $ROFI_INFO contains the original greenclip line + selection="$ROFI_INFO" + + if [[ "$selection" =~ ^image/png ]]; then + # Copy image file to clipboard + hash=$(echo "$selection" | awk '{print $NF}') + imgfile="$IMGDIR/${hash}.png" + + if [ -f "$imgfile" ]; then + xclip -selection clipboard -t image/png -i "$imgfile" + fi + else + # Copy text to clipboard + echo -n "$selection" | xclip -selection clipboard + fi + fi +} + +# Export function for rofi script mode +export -f clipboard_mode +export IMGDIR + +#------------------------------------------------------------------------------ +# Main entry point +#------------------------------------------------------------------------------ +if [ -z "$ROFI_RETV" ]; then + # User running script directly - launch rofi + rofi -modi "clipboard:$0" \ + -show clipboard \ + -theme ~/.config/rofi/clipboard.rasi +else + # Rofi calling script - handle request + clipboard_mode "$@" +fi + +#============================================================================== +# OLD VERSIONS (commented for reference) +#============================================================================== + +# VERSION 1: Simple dmenu without thumbnails (worked for selection) +# IMGDIR="/tmp/greenclip" +# selection=$(greenclip print | rofi -dmenu -i -p " " -theme ~/.config/rofi/clipboard.rasi) +# [ -z "$selection" ] && exit 0 +# if [[ "$selection" =~ ^image/png ]]; then +# hash=$(echo "$selection" | awk '{print $NF}') +# imgfile="$IMGDIR/${hash}.png" +# [ -f "$imgfile" ] && xclip -selection clipboard -t image/png -i "$imgfile" +# else +# echo -n "$selection" | xclip -selection clipboard +# fi + +# VERSION 2: Complex version with lots of features (was buggy) +# [See clipboard-launcher-enhanced.sh for reference] diff --git a/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251203_222516 b/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251203_222516 new file mode 100755 index 0000000..3331159 --- /dev/null +++ b/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251203_222516 @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +#============================================================================== +# Ultra-Simple Text-Only Clipboard Launcher +#============================================================================== +# NO images, NO thumbnails, NO script mode - just text clipboard +# This is the absolute simplest version that should never crash +#============================================================================== + +# Simple one-liner: show greenclip history, copy selection to clipboard +greenclip print | rofi -dmenu -i -p " " -theme ~/.config/rofi/clipboard.rasi | xclip -selection clipboard + +#============================================================================== +# OLD COMPLEX VERSIONS (commented out - they caused crashes) +#============================================================================== + +# VERSION WITH SCRIPT MODE (was crashing): +# IMGDIR="/tmp/greenclip" +# +# clipboard_mode() { +# if [ "$ROFI_RETV" = "0" ]; then +# greenclip print | while IFS= read -r line; do +# if [[ "$line" =~ ^image/png ]]; then +# hash=$(echo "$line" | awk '{print $NF}') +# imgfile="$IMGDIR/${hash}.png" +# if [ -f "$imgfile" ]; then +# printf '[IMAGE] %s\0info\x1f%s\n' "$(basename "$imgfile")" "$line" +# fi +# else +# printf '%s\0info\x1f%s\n' "$line" "$line" +# fi +# done +# else +# selection="$ROFI_INFO" +# [ -z "$selection" ] && exit 0 +# if [[ "$selection" =~ ^image/png ]]; then +# hash=$(echo "$selection" | awk '{print $NF}') +# imgfile="$IMGDIR/${hash}.png" +# if [ -f "$imgfile" ] && [ -r "$imgfile" ]; then +# xclip -selection clipboard -t image/png -i "$imgfile" 2>/dev/null +# fi +# else +# echo -n "$selection" | xclip -selection clipboard 2>/dev/null +# fi +# exit 0 +# fi +# } +# +# export -f clipboard_mode +# export IMGDIR +# +# if [ -z "$ROFI_RETV" ]; then +# rofi -modi "clipboard:$0" -show clipboard -theme ~/.config/rofi/clipboard.rasi +# else +# clipboard_mode "$@" +# fi + +# VERSION WITH THUMBNAILS (crashed even more): +# [See backup files for reference] diff --git a/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251203_222912 b/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251203_222912 new file mode 100755 index 0000000..1084295 --- /dev/null +++ b/rofi/.config/rofi/.bak/clipboard-launcher.sh.20251203_222912 @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +#============================================================================== +# Ultra-Simple Text-Only Clipboard Launcher +#============================================================================== +# NO images, NO thumbnails, NO script mode - just text clipboard +# This is the absolute simplest version that should never crash +#============================================================================== + +# Simple one-liner: show greenclip history, copy selection to clipboard +# -p " " sets the prompt with clipboard icon +greenclip print | rofi -dmenu -i -p " " -theme ~/.config/rofi/clipboard.rasi | xclip -selection clipboard + +#============================================================================== +# OLD COMPLEX VERSIONS (commented out - they caused crashes) +#============================================================================== + +# VERSION WITH SCRIPT MODE (was crashing): +# IMGDIR="/tmp/greenclip" +# +# clipboard_mode() { +# if [ "$ROFI_RETV" = "0" ]; then +# greenclip print | while IFS= read -r line; do +# if [[ "$line" =~ ^image/png ]]; then +# hash=$(echo "$line" | awk '{print $NF}') +# imgfile="$IMGDIR/${hash}.png" +# if [ -f "$imgfile" ]; then +# printf '[IMAGE] %s\0info\x1f%s\n' "$(basename "$imgfile")" "$line" +# fi +# else +# printf '%s\0info\x1f%s\n' "$line" "$line" +# fi +# done +# else +# selection="$ROFI_INFO" +# [ -z "$selection" ] && exit 0 +# if [[ "$selection" =~ ^image/png ]]; then +# hash=$(echo "$selection" | awk '{print $NF}') +# imgfile="$IMGDIR/${hash}.png" +# if [ -f "$imgfile" ] && [ -r "$imgfile" ]; then +# xclip -selection clipboard -t image/png -i "$imgfile" 2>/dev/null +# fi +# else +# echo -n "$selection" | xclip -selection clipboard 2>/dev/null +# fi +# exit 0 +# fi +# } +# +# export -f clipboard_mode +# export IMGDIR +# +# if [ -z "$ROFI_RETV" ]; then +# rofi -modi "clipboard:$0" -show clipboard -theme ~/.config/rofi/clipboard.rasi +# else +# clipboard_mode "$@" +# fi + +# VERSION WITH THUMBNAILS (crashed even more): +# [See backup files for reference] diff --git a/rofi/.config/rofi/.bak/clipboard.rasi.20251128_191045 b/rofi/.config/rofi/.bak/clipboard.rasi.20251128_191045 new file mode 100644 index 0000000..fc9ae01 --- /dev/null +++ b/rofi/.config/rofi/.bak/clipboard.rasi.20251128_191045 @@ -0,0 +1,187 @@ +/******************************************************* + * CLIPBOARD MANAGER - Simple & Compact + *******************************************************/ +/* + * Ultra-compact theme for text-only clipboard + * - Small font (8pt) + * - Minimal padding + * - No images + * - Shows more entries + */ + +configuration { + font: "Noto Sans Regular 10"; /* Smaller font */ + show-icons: false; /* No icons for compact view */ + display-clipboard: " "; + disable-history: false; + sidebar-mode: false; + kb-cancel: "Super+c,Escape"; +} + +/* Import base theme */ +@import "~/.config/rofi/config.rasi" + +/* Window - compact with minimal padding */ +window { + background-color: @background; + border: 0; + padding: 10; /* Minimal padding (was 30) */ + width: 50%; +} + +mainbox { + border: 0; + padding: 0; +} + +/* List view - show more entries, minimal spacing */ +listview { + lines: 12; /* Show more entries (was 8) */ + columns: 1; + fixed-height: 0; + border: 4px 0px 0px; /* Thinner border (was 8px) */ + border-color: @separatorcolor; + scrollbar: true; + padding: 0; /* No padding */ + spacing: 1px; /* Minimal spacing (was 2px) */ +} + +/* Element - minimal vertical padding */ +element { + border: 0; + padding: 1px 4px; /* Very compact: 1px vertical, 4px horizontal */ +} + +/* No icons, but keep config for compatibility */ +/* element-icon { */ +/* size: 0em; */ +/* padding: 0; */ +/* } */ + +element-text { + background-color: inherit; + text-color: inherit; + vertical-align: 0.5; +} + +/* Element states */ +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} + +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} + +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} + +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} + +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} + +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} + +/* Thin scrollbar */ +scrollbar { + width: 3px; /* Thinner (was 4px) */ + border: 0; + handle-color: @normal-foreground; + handle-width: 6px; + padding: 0; +} + +/* Input bar - minimal padding */ +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 0; /* No padding (was 1px) */ + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} + +prompt { + spacing: 0; + text-color: @normal-foreground; +} + +textbox-prompt-colon { + expand: false; + str: ""; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} + +entry { + spacing: 0; + text-color: @normal-foreground; +} + +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} + +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} + +textbox { + text-color: @foreground; +} + +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} + +button { + spacing: 0; + text-color: @normal-foreground; +} + +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +/*------------------------------------------------------- + * OLD CONFIGURATION (commented out for reference) + *------------------------------------------------------- + * Previous version had: + * - Font: 10pt (now 8pt) + * - Window padding: 30px (now 10px) + * - List lines: 8 (now 12) + * - Element padding: 2px (now 1px vertical) + * - Spacing: 2px (now 1px) + * - Icons enabled (now disabled) + */ diff --git a/rofi/.config/rofi/.bak/clipboard.rasi.20251128_191729 b/rofi/.config/rofi/.bak/clipboard.rasi.20251128_191729 new file mode 100644 index 0000000..347d825 --- /dev/null +++ b/rofi/.config/rofi/.bak/clipboard.rasi.20251128_191729 @@ -0,0 +1,197 @@ +/******************************************************* + * CLIPBOARD MANAGER - With Images + *******************************************************/ +/* + * Clipboard theme with nice padding and image support + * - Normal font (10pt) + * - Comfortable padding (like rofidmenu) + * - Icons and images enabled + * - Clean and simple + */ + +configuration { + font: "Noto Sans Regular 10"; + show-icons: true; /* Enable icons for images */ + icon-theme: "Qogir"; + display-clipboard: " "; /* Clipboard icon restored */ + disable-history: false; + sidebar-mode: false; + kb-cancel: "Super+c,Escape"; +} + +/* Import base theme */ +@import "~/.config/rofi/config.rasi" + +/* Window - comfortable padding like rofidmenu */ +window { + background-color: @background; + border: 0; + padding: 30; /* Nice padding like rofidmenu */ + width: 50%; +} + +mainbox { + border: 0; + padding: 0; +} + +/* List view - balanced spacing */ +listview { + lines: 10; /* Show 10 entries */ + columns: 1; + fixed-height: 0; + border: 8px 0px 0px; /* Like rofidmenu */ + border-color: @separatorcolor; + scrollbar: true; + padding: 2px 0px 0px; + spacing: 4px; /* Comfortable spacing */ +} + +/* Element - comfortable padding */ +element { + border: 0; + padding: 3px; /* Comfortable padding */ +} + +/* Icon configuration for images */ +element-icon { + size: 2em; /* Good size for image thumbnails */ + padding: 0 6px 0 0; /* Space between icon and text */ +} + +element-text { + background-color: inherit; + text-color: inherit; + vertical-align: 0.5; +} + +/* Element states */ +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} + +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} + +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} + +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} + +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} + +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} + +/* Scrollbar */ +scrollbar { + width: 4px; /* Like rofidmenu */ + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} + +/* Input bar */ +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} + +prompt { + spacing: 0; + text-color: @normal-foreground; +} + +textbox-prompt-colon { + expand: false; + str: ""; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} + +entry { + spacing: 0; + text-color: @normal-foreground; +} + +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} + +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} + +textbox { + text-color: @foreground; +} + +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} + +button { + spacing: 0; + text-color: @normal-foreground; +} + +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +/*------------------------------------------------------- + * PREVIOUS CONFIGURATIONS (commented for reference) + *------------------------------------------------------- + * + * Ultra-compact version had: + * - Font: 8pt + * - Window padding: 10px + * - List lines: 12 + * - Element padding: 1px vertical + * - Spacing: 1px + * - Icons: disabled + * + * Current comfortable version: + * - Font: 10pt + * - Window padding: 30px (like rofidmenu) + * - List lines: 10 + * - Element padding: 3px + * - Spacing: 4px + * - Icons: enabled for images + */ diff --git a/rofi/.config/rofi/.bak/clipboard.rasi.20251128_192345 b/rofi/.config/rofi/.bak/clipboard.rasi.20251128_192345 new file mode 100644 index 0000000..347d825 --- /dev/null +++ b/rofi/.config/rofi/.bak/clipboard.rasi.20251128_192345 @@ -0,0 +1,197 @@ +/******************************************************* + * CLIPBOARD MANAGER - With Images + *******************************************************/ +/* + * Clipboard theme with nice padding and image support + * - Normal font (10pt) + * - Comfortable padding (like rofidmenu) + * - Icons and images enabled + * - Clean and simple + */ + +configuration { + font: "Noto Sans Regular 10"; + show-icons: true; /* Enable icons for images */ + icon-theme: "Qogir"; + display-clipboard: " "; /* Clipboard icon restored */ + disable-history: false; + sidebar-mode: false; + kb-cancel: "Super+c,Escape"; +} + +/* Import base theme */ +@import "~/.config/rofi/config.rasi" + +/* Window - comfortable padding like rofidmenu */ +window { + background-color: @background; + border: 0; + padding: 30; /* Nice padding like rofidmenu */ + width: 50%; +} + +mainbox { + border: 0; + padding: 0; +} + +/* List view - balanced spacing */ +listview { + lines: 10; /* Show 10 entries */ + columns: 1; + fixed-height: 0; + border: 8px 0px 0px; /* Like rofidmenu */ + border-color: @separatorcolor; + scrollbar: true; + padding: 2px 0px 0px; + spacing: 4px; /* Comfortable spacing */ +} + +/* Element - comfortable padding */ +element { + border: 0; + padding: 3px; /* Comfortable padding */ +} + +/* Icon configuration for images */ +element-icon { + size: 2em; /* Good size for image thumbnails */ + padding: 0 6px 0 0; /* Space between icon and text */ +} + +element-text { + background-color: inherit; + text-color: inherit; + vertical-align: 0.5; +} + +/* Element states */ +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} + +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} + +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} + +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} + +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} + +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} + +/* Scrollbar */ +scrollbar { + width: 4px; /* Like rofidmenu */ + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} + +/* Input bar */ +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} + +prompt { + spacing: 0; + text-color: @normal-foreground; +} + +textbox-prompt-colon { + expand: false; + str: ""; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} + +entry { + spacing: 0; + text-color: @normal-foreground; +} + +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} + +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} + +textbox { + text-color: @foreground; +} + +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} + +button { + spacing: 0; + text-color: @normal-foreground; +} + +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +/*------------------------------------------------------- + * PREVIOUS CONFIGURATIONS (commented for reference) + *------------------------------------------------------- + * + * Ultra-compact version had: + * - Font: 8pt + * - Window padding: 10px + * - List lines: 12 + * - Element padding: 1px vertical + * - Spacing: 1px + * - Icons: disabled + * + * Current comfortable version: + * - Font: 10pt + * - Window padding: 30px (like rofidmenu) + * - List lines: 10 + * - Element padding: 3px + * - Spacing: 4px + * - Icons: enabled for images + */ diff --git a/rofi/.config/rofi/.bak/clipboard.rasi.20251203_222142 b/rofi/.config/rofi/.bak/clipboard.rasi.20251203_222142 new file mode 100644 index 0000000..d9490af --- /dev/null +++ b/rofi/.config/rofi/.bak/clipboard.rasi.20251203_222142 @@ -0,0 +1,201 @@ +/******************************************************* + * CLIPBOARD MANAGER - With Images + *******************************************************/ +/* + * Clipboard theme with nice padding and image support + * - Normal font (10pt) + * - Comfortable padding (like rofidmenu) + * - Icons and images enabled + * - Clean and simple + */ + +configuration { + font: "Noto Sans Regular 10"; + show-icons: true; /* Enable icons for images */ + icon-theme: "Qogir"; + display-clipboard: " "; /* Clipboard icon restored */ + disable-history: false; + sidebar-mode: false; + kb-cancel: "Super+c,Escape"; +} + +/* Import base theme */ +@import "~/.config/rofi/config.rasi" + +/* Window - comfortable padding like rofidmenu */ +window { + background-color: @background; + border: 0; + padding: 30; /* Nice padding like rofidmenu */ + width: 50%; +} + +mainbox { + border: 0; + padding: 0; +} + +/* List view - compact vertical spacing */ +listview { + lines: 10; /* Show 10 entries */ + columns: 1; + fixed-height: 0; + border: 8px 0px 0px; /* Like rofidmenu */ + border-color: @separatorcolor; + scrollbar: true; + padding: 2px 0px 0px; + spacing: 2px; /* Reduced: was 4px, now 2px */ +} + +/* Element - minimal height (no vertical padding) */ +element { + border: 0; + padding: 0px 3px; /* No vertical padding: 0px top/bottom, 3px left/right */ +} + +/* Icon configuration for images */ +element-icon { + size: 2em; /* Good size for image thumbnails */ + padding: 0 6px 0 0; /* Space between icon and text */ +} + +element-text { + background-color: inherit; + text-color: inherit; + vertical-align: 0.5; +} + +/* Element states */ +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} + +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} + +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} + +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} + +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} + +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} + +/* Scrollbar */ +scrollbar { + width: 4px; /* Like rofidmenu */ + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} + +/* Input bar */ +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} + +prompt { + spacing: 0; + text-color: @normal-foreground; +} + +textbox-prompt-colon { + expand: false; + str: ""; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} + +entry { + spacing: 0; + text-color: @normal-foreground; +} + +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} + +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} + +textbox { + text-color: @foreground; +} + +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} + +button { + spacing: 0; + text-color: @normal-foreground; +} + +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +/*------------------------------------------------------- + * PREVIOUS CONFIGURATIONS (commented for reference) + *------------------------------------------------------- + * + * Ultra-compact version had: + * - Font: 8pt + * - Window padding: 10px + * - List lines: 12 + * - Element padding: 1px vertical + * - Spacing: 1px + * - Icons: disabled + * + * Comfortable version had: + * - Element padding: 3px all sides + * - Spacing: 4px + * + * Current version (compact vertical): + * - Font: 10pt + * - Window padding: 30px (like rofidmenu) + * - List lines: 10 + * - Element padding: 1px vertical, 3px horizontal + * - Spacing: 2px (smaller vertical gaps) + * - Icons: enabled for images + */ diff --git a/rofi/.config/rofi/clipboard-launcher-enhanced.sh b/rofi/.config/rofi/clipboard-launcher-enhanced.sh new file mode 100755 index 0000000..bdee2ec --- /dev/null +++ b/rofi/.config/rofi/clipboard-launcher-enhanced.sh @@ -0,0 +1,281 @@ +#!/usr/bin/env bash +#============================================================================== +# Enhanced Greenclip Clipboard Manager with Image Support +#============================================================================== +# This script provides a fully-functional clipboard manager using rofi and +# greenclip, with proper support for both text and images. +# +# Features: +# - Displays clipboard history from greenclip +# - Shows image thumbnails for copied images +# - Truncates long text for readability +# - Properly pastes both text AND images back to clipboard +# - Handles greenclip's image format: "image/png Zen [hash]" +# +# Requirements: +# - rofi (with script mode and thumbnail support) +# - greenclip (clipboard manager daemon must be running) +# - xsel (for clipboard operations - prevents rofi freeze issues) +# - Image files stored in /tmp/greenclip/ (configured in greenclip.toml) +# +# How Greenclip Stores Images: +# 1. Text entries: Stored as-is in clipboard history +# 2. Image entries: Stored as "image/png Zen [hash]" in history +# 3. Actual PNG files: Saved to /tmp/greenclip/[hash].png +# 4. This script: Detects images, shows thumbnails, and restores them properly +#============================================================================== + +# Directory where greenclip caches image files +# IMPORTANT: This must match image_cache_directory in ~/.config/greenclip.toml +IMGDIR="/tmp/greenclip" + +# Maximum text length to display before truncating +MAX_TEXT_LENGTH=100 + +#------------------------------------------------------------------------------ +# clipboard_mode() - Main rofi script mode handler +#------------------------------------------------------------------------------ +# Called by rofi in two contexts: +# +# Context 1: ROFI_RETV=0 (Initial call) +# - Generate the menu items from greenclip history +# - Detect image vs text entries +# - Format with thumbnails and truncation +# - Store original content in info field for later retrieval +# +# Context 2: ROFI_RETV=1 (User selected item) +# - Receive selection via $ROFI_INFO +# - Determine if it's an image or text +# - Copy to clipboard appropriately (file for images, text for text) +#------------------------------------------------------------------------------ +clipboard_mode() { + if [ "$ROFI_RETV" = "0" ]; then + #---------------------------------------------------------------------- + # CONTEXT 1: Generate Menu Items + #---------------------------------------------------------------------- + + # Read clipboard history line by line from greenclip + greenclip print | while IFS= read -r line; do + + #------------------------------------------------------------------ + # IMAGE DETECTION AND DISPLAY + #------------------------------------------------------------------ + # Greenclip outputs image entries in format: "image/png Zen [hash]" + # We need to: + # 1. Detect these entries (starts with "image/") + # 2. Extract the hash/ID + # 3. Find the corresponding PNG file in IMGDIR + # 4. Display with thumbnail icon + #------------------------------------------------------------------ + + if [[ "$line" =~ ^image/png ]]; then + # This is an image entry! + + # Extract the hash from "image/png Zen [hash]" + # The hash is the last field (may be negative number) + hash=$(echo "$line" | awk '{print $NF}') + + # Construct the image file path + # Note: greenclip saves as [hash].png or [-hash].png + imgfile="$IMGDIR/${hash}.png" + + # Check if image file exists + if [ -f "$imgfile" ]; then + # Get just the filename for display + imgname=$(basename "$imgfile") + + # Display format for rofi: + # [display text] \0 icon \x1f [thumbnail path] \0 info \x1f [original line] + # + # Components: + # - Display: "🖼️ Image: filename.png" (what user sees) + # - Icon: thumbnail://path (shows image preview) + # - Info: original greenclip line (used for restoration) + # printf '🖼️ Image: %s\0icon\x1fthumbnail://%s\0info\x1f%s\n' \ + printf ' IMAGE: %s\0icon\x1fthumbnail://%s\0info\x1f%s\n' \ + "$imgname" \ + "$imgfile" \ + "$line" + else + # Image file not found, show as broken/missing + # Still preserve the original line in case file appears later + # printf '🖼️ Image (missing): %s\0info\x1f%s\n' \ + printf ' IMAGE (MISSING): %s\0info\x1f%s\n' \ + "$hash" \ + "$line" + fi + + # Done processing this image entry, move to next line + continue + fi + + #------------------------------------------------------------------ + # TEXT ENTRY DISPLAY + #------------------------------------------------------------------ + # For regular text clipboard entries: + # 1. Truncate if too long (for display) + # 2. Preserve full original text in info field (for pasting) + #------------------------------------------------------------------ + + if [ ${#line} -gt $MAX_TEXT_LENGTH ]; then + # Text is long - truncate for display but preserve original + display_text="${line:0:$MAX_TEXT_LENGTH}..." + + # Format: [truncated text] \0 info \x1f [full original text] + # User sees truncated version, but pastes full version + printf '%s\0info\x1f%s\n' "$display_text" "$line" + else + # Text is short - can display as-is + # Still use info field for consistency in selection handling + printf '%s\0info\x1f%s\n' "$line" "$line" + fi + done + + else + #---------------------------------------------------------------------- + # CONTEXT 2: Handle User Selection + #---------------------------------------------------------------------- + # User selected an item. $ROFI_INFO contains the original content + # we stored in the info field during menu generation. + # + # We need to: + # 1. Check if selection is an image or text + # 2. For images: Copy the PNG file to clipboard + # 3. For text: Copy the text to clipboard + #---------------------------------------------------------------------- + + selection="$ROFI_INFO" + + #---------------------------------------------------------------------- + # IMAGE SELECTION HANDLING + #---------------------------------------------------------------------- + # Check if selected item is an image entry (starts with "image/png") + #---------------------------------------------------------------------- + if [[ "$selection" =~ ^image/png ]]; then + # This is an image! Extract hash and copy the actual PNG file + + # Parse hash from "image/png Zen [hash]" + hash=$(echo "$selection" | awk '{print $NF}') + + # Construct image file path + imgfile="$IMGDIR/${hash}.png" + + # Verify image file exists before copying + if [ -f "$imgfile" ]; then + # Copy the actual PNG file to clipboard as image data + # Using xsel instead of xclip to prevent rofi freeze issues + # -b: Use clipboard (equivalent to --clipboard) + # -i: Read from stdin/file + xsel --clipboard --input < "$imgfile" + + # Exit successfully - image is now in clipboard + exit 0 + else + # Image file not found - show error notification if dunstify available + if command -v dunstify &> /dev/null; then + dunstify -u critical "Clipboard Error" "Image file not found: $imgfile" + fi + # Exit with error code + exit 1 + fi + else + #------------------------------------------------------------------ + # TEXT SELECTION HANDLING + #------------------------------------------------------------------ + # This is regular text - copy to clipboard as text + #------------------------------------------------------------------ + + # Copy text directly to clipboard using xsel + # Using xsel instead of xclip to prevent rofi freeze issues + # -b: Use clipboard (equivalent to --clipboard) + # -i: Read from stdin + # Using echo -n to avoid adding newline + echo -n "$selection" | xsel --clipboard --input + + # Exit successfully - text is now in clipboard + exit 0 + fi + fi +} + +#============================================================================== +# Export for rofi script mode +#============================================================================== +# Make function and variables available when rofi spawns this script +export -f clipboard_mode +export IMGDIR +export MAX_TEXT_LENGTH + +#============================================================================== +# MAIN SCRIPT ENTRY POINT +#============================================================================== +# Two execution modes based on ROFI_RETV environment variable: +# +# MODE 1: Direct execution (ROFI_RETV is unset/empty) +# - User ran this script from command line or keybind +# - Launch rofi with this script as the clipboard provider +# - Rofi will then call this script again in MODE 2 +# +# MODE 2: Called by rofi (ROFI_RETV is set) +# - Rofi is calling us to get menu items or handle selection +# - Call clipboard_mode() function to handle the request +#============================================================================== + +if [ -z "$ROFI_RETV" ]; then + #-------------------------------------------------------------------------- + # MODE 1: Launch rofi + #-------------------------------------------------------------------------- + + # Launch rofi with this script as the data source for "clipboard" mode + # + # Rofi parameters: + # -modi "clipboard:$0" + # Register "clipboard" mode that runs this script for data + # + # -show clipboard + # Display the clipboard mode immediately + # + # NO -run-command needed! + # The script handles clipboard copying internally for both text and images + # When user selects an item, rofi calls the script with ROFI_RETV=1 + # The script then copies to clipboard directly and exits + # + # -theme ... + # Custom theme file for visual styling + #-------------------------------------------------------------------------- + + rofi -modi "clipboard:$0" \ + -show clipboard \ + -theme ~/.config/rofi/clipboard.rasi + + # NOTE: All clipboard operations are handled inside clipboard_mode() + # when ROFI_RETV=1 (selection mode). No post-processing needed here. + +else + #-------------------------------------------------------------------------- + # MODE 2: Provide data to rofi or handle selection + #-------------------------------------------------------------------------- + + # Rofi is calling us - hand off to clipboard_mode function + clipboard_mode "$@" +fi + +#============================================================================== +# OLD/ALTERNATIVE APPROACHES (Commented out for reference) +#============================================================================== +# +# APPROACH 1: Using -run-command with xclip for text +# This was the old approach that didn't handle images properly: +# +# rofi -modi "clipboard:$0" \ +# -show clipboard \ +# -run-command 'echo -n {cmd} | xclip -selection clipboard' \ +# -theme ~/.config/rofi/clipboard.rasi +# +# PROBLEM: This pipes ALL selections (including "image/png Zen [hash]" text) +# to xclip as text, which doesn't restore the actual image to clipboard. +# +# SOLUTION: Handle image copying inside the script, before rofi's -run-command, +# by detecting image format and using xclip with -t image/png and the file. +# +#============================================================================== diff --git a/rofi/.config/rofi/clipboard-launcher.sh b/rofi/.config/rofi/clipboard-launcher.sh new file mode 100755 index 0000000..c223fe9 --- /dev/null +++ b/rofi/.config/rofi/clipboard-launcher.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +#============================================================================== +# Ultra-Simple Text-Only Clipboard Launcher +#============================================================================== +# NO images, NO thumbnails, NO script mode - just text clipboard +# This is the absolute simplest version that should never crash +#============================================================================== + +# Simple one-liner: show greenclip history, copy selection to clipboard +# -p "" sets the prompt with clipboard icon +greenclip print | rofi -dmenu -i -p "" -theme ~/.config/rofi/clipboard.rasi | xclip -selection clipboard + +#============================================================================== +# OLD COMPLEX VERSIONS (commented out - they caused crashes) +#============================================================================== + +# VERSION WITH SCRIPT MODE (was crashing): +# IMGDIR="/tmp/greenclip" +# +# clipboard_mode() { +# if [ "$ROFI_RETV" = "0" ]; then +# greenclip print | while IFS= read -r line; do +# if [[ "$line" =~ ^image/png ]]; then +# hash=$(echo "$line" | awk '{print $NF}') +# imgfile="$IMGDIR/${hash}.png" +# if [ -f "$imgfile" ]; then +# printf '[IMAGE] %s\0info\x1f%s\n' "$(basename "$imgfile")" "$line" +# fi +# else +# printf '%s\0info\x1f%s\n' "$line" "$line" +# fi +# done +# else +# selection="$ROFI_INFO" +# [ -z "$selection" ] && exit 0 +# if [[ "$selection" =~ ^image/png ]]; then +# hash=$(echo "$selection" | awk '{print $NF}') +# imgfile="$IMGDIR/${hash}.png" +# if [ -f "$imgfile" ] && [ -r "$imgfile" ]; then +# xclip -selection clipboard -t image/png -i "$imgfile" 2>/dev/null +# fi +# else +# echo -n "$selection" | xclip -selection clipboard 2>/dev/null +# fi +# exit 0 +# fi +# } +# +# export -f clipboard_mode +# export IMGDIR +# +# if [ -z "$ROFI_RETV" ]; then +# rofi -modi "clipboard:$0" -show clipboard -theme ~/.config/rofi/clipboard.rasi +# else +# clipboard_mode "$@" +# fi + +# VERSION WITH THUMBNAILS (crashed even more): +# [See backup files for reference] diff --git a/rofi/.config/rofi/clipboard.rasi b/rofi/.config/rofi/clipboard.rasi new file mode 100644 index 0000000..6ec4a1b --- /dev/null +++ b/rofi/.config/rofi/clipboard.rasi @@ -0,0 +1,201 @@ +/******************************************************* + * CLIPBOARD MANAGER - With Images + *******************************************************/ +/* + * Clipboard theme with nice padding and image support + * - Normal font (10pt) + * - Comfortable padding (like rofidmenu) + * - Icons and images enabled + * - Clean and simple + */ + +configuration { + font: "Noto Sans Nerd Font 10"; + show-icons: true; /* Enable icons for images */ + icon-theme: "Qogir"; + display-clipboard: ""; /* Clipboard icon restored */ + disable-history: false; + sidebar-mode: false; + kb-cancel: "Super+c,Escape"; +} + +/* Import base theme */ +@import "~/.config/rofi/config.rasi" + +/* Window - comfortable padding like rofidmenu */ +window { + background-color: @background; + border: 0; + padding: 30; /* Nice padding like rofidmenu */ + width: 50%; +} + +mainbox { + border: 0; + padding: 0; +} + +/* List view - compact vertical spacing */ +listview { + lines: 10; /* Show 10 entries */ + columns: 1; + fixed-height: 0; + border: 8px 0px 0px; /* Like rofidmenu */ + border-color: @separatorcolor; + scrollbar: true; + padding: 2px 0px 0px; + spacing: 0px; /* Reduced: was 4px, now 2px */ +} + +/* Element - minimal height (no vertical padding) */ +element { + border: 0; + padding: -1px 3px; /* No vertical padding: 0px top/bottom, 3px left/right, negative if you want it to be thin */ +} + +/* Icon configuration for images */ +element-icon { + size: 2em; /* Good size for image thumbnails */ + padding: 0 6px 0 0; /* Space between icon and text */ +} + +element-text { + background-color: inherit; + text-color: inherit; + vertical-align: 0.5; +} + +/* Element states */ +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} + +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} + +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} + +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} + +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} + +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} + +/* Scrollbar */ +scrollbar { + width: 4px; /* Like rofidmenu */ + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} + +/* Input bar */ +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} + +prompt { + spacing: 0; + text-color: @normal-foreground; +} + +textbox-prompt-colon { + expand: false; + str: ""; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} + +entry { + spacing: 0; + text-color: @normal-foreground; +} + +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} + +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} + +textbox { + text-color: @foreground; +} + +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} + +button { + spacing: 0; + text-color: @normal-foreground; +} + +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +/*------------------------------------------------------- + * PREVIOUS CONFIGURATIONS (commented for reference) + *------------------------------------------------------- + * + * Ultra-compact version had: + * - Font: 8pt + * - Window padding: 10px + * - List lines: 12 + * - Element padding: 1px vertical + * - Spacing: 1px + * - Icons: disabled + * + * Comfortable version had: + * - Element padding: 3px all sides + * - Spacing: 4px + * + * Current version (compact vertical): + * - Font: 10pt + * - Window padding: 30px (like rofidmenu) + * - List lines: 10 + * - Element padding: 1px vertical, 3px horizontal + * - Spacing: 2px (smaller vertical gaps) + * - Icons: enabled for images + */ diff --git a/rofi/.config/rofi/config.rasi b/rofi/.config/rofi/config.rasi new file mode 100644 index 0000000..35599fc --- /dev/null +++ b/rofi/.config/rofi/config.rasi @@ -0,0 +1 @@ + @theme "/home/bh/.config/rofi/theal.rasi" diff --git a/rofi/.config/rofi/power-profiles.rasi b/rofi/.config/rofi/power-profiles.rasi new file mode 100644 index 0000000..f7c7755 --- /dev/null +++ b/rofi/.config/rofi/power-profiles.rasi @@ -0,0 +1,122 @@ +/******************************************************* + * ROFI configs i3 powermenu for EndeavourOS + * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com] + *******************************************************/ +configuration { + font: "Noto Sans Regular 10"; + show-icons: false; + icon-theme: "Qogir"; + scroll-method: 0; + disable-history: false; + fullscreen: false; + hide-scrollbar: true; + sidebar-mode: false; +} + +@import "~/.config/rofi/config.rasi" +/* Insert theme modifications after this */ + + +window { + background-color: @background; + border: 0; + padding: 10; + transparency: "real"; + width: 170px; + location: east; + /*y-offset: 18;*/ + /*x-offset: 850;*/ +} +listview { + lines: 4; + columns: 1; +} +element { + border: 0; + padding: 1px; +} +element-text { + background-color: inherit; + text-color: inherit; +} +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +scrollbar { + width: 4px; + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} +button { + spacing: 0; + text-color: @normal-foreground; +} +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +} +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +entry { + spacing: 0; + text-color: @normal-foreground; +} +prompt { + spacing: 0; + text-color: @normal-foreground; +} +inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +textbox-prompt-colon { + expand: false; + str: "Set Power Profile:"; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} diff --git a/rofi/.config/rofi/powermenu.rasi b/rofi/.config/rofi/powermenu.rasi new file mode 100644 index 0000000..8470a69 --- /dev/null +++ b/rofi/.config/rofi/powermenu.rasi @@ -0,0 +1,125 @@ +/******************************************************* + * ROFI configs i3 powermenu for EndeavourOS + * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com] + *******************************************************/ +configuration { + font: "Noto Sans Regular 10"; + show-icons: false; + icon-theme: "Qogir"; + scroll-method: 0; + disable-history: false; + sidebar-mode: false; +} + +@import "~/.config/rofi/config.rasi" +/* Insert theme modifications after this */ + +window { + background-color: @background; + border: 0; + padding: 10; + transparency: "real"; + width: 120px; + location: east; + /*y-offset: 18;*/ + /*x-offset: 850;*/ +} +listview { + lines: 7; + columns: 1; + scrollbar: false; +} +element { + border: 0; + padding: 1px; +} +element-text { + background-color: inherit; + text-color: inherit; +} +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +scrollbar { + width: 4px; + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} +button { + spacing: 0; + text-color: @normal-foreground; +} +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +} +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +entry { + spacing: 0; + text-color: @normal-foreground; +} +prompt { + spacing: 0; + text-color: @normal-foreground; +} +inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} + +/*removes the text input line*/ +mainbox { + children: [listview]; +} diff --git a/rofi/.config/rofi/rofidmenu.rasi b/rofi/.config/rofi/rofidmenu.rasi new file mode 100644 index 0000000..b989a42 --- /dev/null +++ b/rofi/.config/rofi/rofidmenu.rasi @@ -0,0 +1,142 @@ +/******************************************************* + * APP LAUNCHER + *******************************************************/ + + +configuration { + //font: "Noto Sans Regular 10"; + font: "Noto Sans Nerd Font 10"; + show-icons: true; + icon-theme: "Qogir"; + // display-drun: "软件"; + display-drun: ""; + drun-display-format: "{name}"; + scroll-method: 0; + disable-history: false; + sidebar-mode: false; + kb-cancel: "Super+c"; +} + + +@import "~/.config/rofi/config.rasi" +/* Insert theme modifications after this */ + +window { + background-color: @background; + border: 0; + padding: 30; +} +listview { + lines: 10; + columns: 3; +} +mainbox { + border: 0; + padding: 0; +} +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} +textbox { + text-color: @foreground; +} +listview { + fixed-height: 0; + border: 8px 0px 0px; + border-color: @separatorcolor; + spacing: 8px; + scrollbar: false; + padding: 2px 0px 0px; +} +element { + border: 0; + padding: 1px; +} +element-text { + background-color: inherit; + text-color: inherit; +} +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +scrollbar { + width: 4px; + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} +button { + spacing: 0; + text-color: @normal-foreground; +} +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +} +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +entry { + spacing: 0; + text-color: @normal-foreground; +} +prompt { + spacing: 0; + text-color: @normal-foreground; +} +inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +textbox-prompt-colon { + expand: false; + // str: ":"; + str: ""; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} diff --git a/rofi/.config/rofi/rofikeyhint.rasi b/rofi/.config/rofi/rofikeyhint.rasi new file mode 100644 index 0000000..9f9805a --- /dev/null +++ b/rofi/.config/rofi/rofikeyhint.rasi @@ -0,0 +1,138 @@ +/******************************************************* + * ROFI configs i3 keyhint-menu for EndeavourOS + * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com] + *******************************************************/ +configuration { + font: "Noto Sans Regular 10"; + show-icons: false; + icon-theme: "Qogir"; + display-drun: "KeyHint"; + drun-display-format: "{name}"; + scroll-method: 0; + disable-history: false; + fullscreen: false; + hide-scrollbar: true; + sidebar-mode: false; +} + +@import "~/.config/rofi/config.rasi" +/* Insert theme modifications after this */ + +window { + background-color: @background; + border: 0; + padding: 30; +} +listview { + lines: 10; + columns: 1; +} +mainbox { + border: 0; + padding: 0; +} +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} +textbox { + text-color: @foreground; +} +listview { + fixed-height: 0; + border: 8px 0px 0px; + border-color: @separatorcolor; + spacing: 8px; + scrollbar: false; + padding: 2px 0px 0px; +} +element { + border: 0; + padding: 1px; +} +element-text { + background-color: inherit; + text-color: inherit; +} +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +scrollbar { + width: 4px; + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} +button { + spacing: 0; + text-color: @normal-foreground; +} +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +} +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +entry { + spacing: 0; + text-color: @normal-foreground; +} +prompt { + spacing: 0; + text-color: @normal-foreground; +} +inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} diff --git a/rofi/.config/rofi/theal.rasi b/rofi/.config/rofi/theal.rasi new file mode 100644 index 0000000..a4a852e --- /dev/null +++ b/rofi/.config/rofi/theal.rasi @@ -0,0 +1,151 @@ +/******************************************************* + * CYAN THEME FOR ROFI + * by BH + *******************************************************/ + +* { + selected-normal-foreground: rgba(0, 255, 180, 100%); /* More cyanish light spring green */ + foreground: rgba(138, 255, 255, 100%); /* #8affff */ + normal-foreground: @foreground; + alternate-normal-background: rgba(45, 48, 59, 1%); + red: rgba(220, 50, 47, 100%); + selected-urgent-foreground: rgba(0, 255, 180, 100%); /* More cyanish light spring green */ + blue: rgba(38, 139, 210, 100%); + urgent-foreground: rgba(204, 102, 102, 100%); + alternate-urgent-background: rgba(75, 81, 96, 90%); + active-foreground: rgba(101, 172, 255, 100%); + lightbg: rgba(238, 232, 213, 100%); + selected-active-foreground: rgba(0, 255, 180, 100%); /* More cyanish light spring green */ + alternate-active-background: rgba(45, 48, 59, 88%); + background: rgba(0, 54, 54, 60%); /* #003636 */ + alternate-normal-foreground: @foreground; + normal-background: rgba(45, 48, 59, 1%); + lightfg: rgba(88, 104, 117, 100%); + selected-normal-background: rgba(0, 42, 42, 80%); /* Darker teal */ + border-color: rgba(124, 131, 137, 100%); + spacing: 2; + separatorcolor: rgba(45, 48, 59, 1%); + urgent-background: rgba(45, 48, 59, 15%); + selected-urgent-background: rgba(0, 42, 42, 80%); /* Darker teal */ + alternate-urgent-foreground: @urgent-foreground; + background-color: rgba(0, 0, 0, 0%); + alternate-active-foreground: @active-foreground; + active-background: rgba(29, 31, 33, 17%); + selected-active-background: rgba(0, 42, 42, 80%); /* Darker teal */ +} + + +window { + background-color: @background; + border: 1; + padding: 5; +} +mainbox { + border: 0; + padding: 0; +} +message { + border: 2px 0px 0px ; + border-color: @separatorcolor; + padding: 1px ; +} +textbox { + text-color: @foreground; +} +listview { + fixed-height: 0; + border: 2px 0px 0px ; + border-color: @separatorcolor; + spacing: 2px ; + scrollbar: true; + padding: 2px 0px 0px ; +} +element { + border: 0; + padding: 1px ; +} +element-text { + background-color: inherit; + text-color: inherit; +} +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +scrollbar { + width: 4px ; + border: 0; + handle-color: @normal-foreground; + handle-width: 8px ; + padding: 0; +} +mode-switcher { + border: 2px 0px 0px ; + border-color: @separatorcolor; +} +button { + spacing: 0; + text-color: @normal-foreground; +} +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px ; +} +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +entry { + spacing: 0; + text-color: @normal-foreground; +} +prompt { + spacing: 0; + text-color: @normal-foreground; +} +inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em ; + text-color: @normal-foreground; +} diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc new file mode 100644 index 0000000..fe349f2 --- /dev/null +++ b/sxhkd/.config/sxhkd/sxhkdrc @@ -0,0 +1,231 @@ +# ██████╗░██╗░░██╗░░░░░░░██████╗██╗░░██╗██╗░░██╗██╗░░██╗██████╗░ # +# ██╔══██╗██║░░██║░░░░░░██╔════╝╚██╗██╔╝██║░░██║██║░██╔╝██╔══██╗ # +# ██████╦╝███████║█████╗╚█████╗░░╚███╔╝░███████║█████═╝░██║░░██║ # +# ██╔══██╗██╔══██║╚════╝░╚═══██╗░██╔██╗░██╔══██║██╔═██╗░██║░░██║ # +# ██████╦╝██║░░██║░░░░░░██████╔╝██╔╝╚██╗██║░░██║██║░╚██╗██████╔╝ # +# ╚═════╝░╚═╝░░╚═╝░░░░░░╚═════╝░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═════╝░ # +# +#█▄▄ █░█ ▀ █▀ █▄▀ █▀▀ █▄█ █▄▄ █ █▄░█ █▀▄ █ █▄░█ █▀▀ █▀ █▀▀ █▀█ █▀█ █▄▄ █▀ █▀█ █░█░█ █▀▄▀█# +#█▄█ █▀█ ░ ▄█ █░█ ██▄ ░█░ █▄█ █ █░▀█ █▄▀ █ █░▀█ █▄█ ▄█ █▀░ █▄█ █▀▄ █▄█ ▄█ █▀▀ ▀▄▀▄▀ █░▀░█# + + +# Move Focus + +super + h + bspc node -f west +super + j + bspc node -f south +super + k + bspc node -f north +super + l + bspc node -f east + + +# Move Window + +super + shift + h + bspc node -s west +super + shift + j + bspc node -s south +super + shift + k + bspc node -s north +super + shift + l + bspc node -s east + + +# Presel Window + +ctrl + super + h + bspc node --presel-dir \~west +ctrl + super + j + bspc node --presel-dir \~south +ctrl + super + k + bspc node --presel-dir \~north +ctrl + super + l + bspc node --presel-dir \~east + +ctrl + super + n + bspc node --presel-ratio 0.75 +ctrl + super + t + bspc node --presel-ratio 0.25 + + + +# Switch Workspaces + +super + ampersand + bspc desktop -f "一" + +super + bracketleft + bspc desktop -f "二" + +super + braceleft + bspc desktop -f "三" + +super + braceright + bspc desktop -f "四" + +super + parenleft + bspc desktop -f "五" + +super + equal + bspc desktop -f "六" + +super + asterisk + bspc desktop -f "七" + +super + parenright + bspc desktop -f "八" + +super + plus + bspc desktop -f "九" + +super + bracketright + bspc desktop -f "十" + +super + exclam + bspc desktop -f "" + + +# Move to Different Workspaces + +super + shift + ampersand + bspc node -d "一" + +super + shift + bracketleft + bspc node -d "二" + +super + shift + braceleft + bspc node -d "三" + +super + shift + braceright + bspc node -d "四" + +super + shift + parenleft + bspc node -d "五" + +super + shift + equal + bspc node -d "六" + +super + shift + asterisk + bspc node -d "七" + +super + shift + parenright + bspc node -d "八" + +super + shift + plus + bspc node -d "九" + +super + shift + bracketright + bspc node -d "十" + +super + shift + exclam + bspc node -d "" + +# BSPWM Functions + +super + m + bspc desktop -l next # Toggle Monocle + +super + f + ~/Scripts/fullscreen + # bspc node -t \~fullscreen # Toggle Fullscreen + +super + c + bspc node -c # Delete Window + +super + shift + c + bspc wm -r && pkill -USR1 -x sxhkd # Restarts BSPWM & sxhkd + +ctrl + super + m + bspc node -s last + + +# Other Functions + +super + slash + ~/Scripts/blur-lock + + +# Applications + +super + Return + kitty # Teriminal Emulator + +super + alt + Return + kitty --class floating # Floating Terminal + +super + w + zen-browser # Browser + +super + d + rofi -modi drun -show drun -config ~/.config/rofi/rofidmenu.rasi # Application Launcher + +super + v + bash ~/Scripts/clipboard + +# super + v +# rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}' -config ~/.config/rofi/rofidmenu.rasi -show-icons + +super + e + emacs + +super + s + ~/Scripts/screenshot + +super + shift + s + ~/Scripts/snip + + +# Tools +# + +# Audio + +# XF86AudioRaiseVolume +# pactl set-sink-volume @DEFAULT_SINK@ +5% +# +# XF86AudioLowerVolume +# pactl set-sink-volume @DEFAULT_SINK@ -5% +# +# XF86AudioMute +# pactl set-sink-mute @DEFAULT_SINK@ toggle + + +# Increase volume +XF86AudioRaiseVolume + pactl set-sink-volume @DEFAULT_SINK@ +5% && \ + VOLUME=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '\d+%' | head -1) && \ + dunstify " Volume: $VOLUME" -h int:value:"${VOLUME%\%}" -r 2593 -t 1000 + +# Decrease volume +XF86AudioLowerVolume + pactl set-sink-volume @DEFAULT_SINK@ -5% && \ + VOLUME=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '\d+%' | head -1) && \ + dunstify " Volume: $VOLUME" -h int:value:"${VOLUME%\%}" -r 2593 -t 1000 + +# Mute/unmute +# XF86AudioMute +# pactl set-sink-mute @DEFAULT_SINK@ toggle; \ +# 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 +XF86AudioMute + ~/Scripts/mute + + +# # Increase brightness +# XF86MonBrightnessUp +# BRIGHT=$(xbacklight -inc 10) && \ +# dunstify "Brightness: ${BRIGHT%.*}%" -h int:value:"${BRIGHT%.*}" -r 2594 -t 1000 +# +# # Decrease brightness +# XF86MonBrightnessDown +# BRIGHT=$(xbacklight -dec 10) && \ +# dunstify "Brightness: ${BRIGHT%.*}%" -h int:value:"${BRIGHT%.*}" -r 2594 -t 1000 + + diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf new file mode 100644 index 0000000..93c5df7 --- /dev/null +++ b/tmux/.tmux.conf @@ -0,0 +1,58 @@ +# Clean TMUX Config with erikw's tmux-powerline + +# Turn status bar on +set -g status on + +# Background + foreground color +set -ga terminal-overrides ",xterm-256color:RGB" + +# Options to make tmux more pleasant +set -g mouse on +set -g default-terminal "tmux-256color" + +# Status bar colors +set -g status-bg "#003636" +set -g status-fg "#225859" + +# Window status - inactive windows with powerline separators +set -g window-status-format "#[fg=#004344,bg=#003636]#[fg=#FFFFFF,bg=#004344]#I #[fg=#6ae8eb,bg=#225859] #W #[fg=#225859,bg=#003636]" +set -g window-status-current-format "#[fg=#008282,bg=#003636]#[fg=#FFFFFF,bg=#008282]#I #[fg=#6ae8eb,bg=#225859] #W #[fg=#225859, bg=#003636]" + +# Previous Settings +# set -g window-status-format "#[fg=#004344,bg=#003636]#[fg=#6ae8eb,bg=#004344]#I|#W #[fg=#004344,bg=#003636]" +# set -g window-status-current-format "#[fg=#008282,bg=#003636]#[fg=#FFFFFF,bg=#008282]#I|#W #[fg=#008282, bg=#003636]" + +# set -g window-status-format "#[fg=#74c4c4,bg=#225859] #I|#W #[fg=#225859,bg=#003636] " + +# set -g window-status-format "#[fg=#002a2b,bg=#003636]#[fg=#74c4c4,bg=#002a2b] #I|#W #[fg=#002a2b,bg=#003636]" +# set -g window-status-current-format "#[fg=#008282,bg=#003636]#[fg=#FFFFFF,bg=#008282] #I|#W #[fg=#008282,bg=#003636]" + +# Status bar configuration - disabled all modules except windows +set -g status-left-length 1000 +set -g status-right-length 1000 +set -g status-left "#[fg=#74c4c4]#S " +set -g status-right "#[fg=#225859, bg=#003636]#[fg=#6ae8eb,bg=#225859] %H:%M #[fg=#FFFFFF,bg=#008282] #[fg=#008282,bg=#003636]" + +# Pane border colors +set -g pane-border-style "fg=#225859" +set -g pane-active-border-style "fg=#008282" + +# Keybindings +bind -r h select-pane -L +bind -r j select-pane -D +bind -r k select-pane -U +bind -r l select-pane -R + +bind -n M-h resize-pane -L 2 +bind -n M-j resize-pane -D 2 +bind -n M-k resize-pane -U 2 +bind -n M-l resize-pane -R 2 + +bind-key Tab last-window + +# # List of plugins +# set -g @plugin 'tmux-plugins/tpm' +# set -g @plugin 'tmux-plugins/tmux-sensible' +# +# # Initialize TMUX plugin manager (keep this line at the very bottom) +# run '~/.tmux/plugins/tpm/tpm' |
