diff --git a/.gitignore b/.gitignore index e6441a4..aaa35b3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,19 @@ git/local !mksh/* !tmux/ !tmux/* +!dmenu/ +!dmenu/* +!dunst/ +!dunst/* +!foot/ +!foot/* +!sway/ +!sway/* +!swaylock/ +!swaylock/* +!ghostty/ +!ghostty/** +!mango/ +!mango/** +!waybar/ +!waybar/** diff --git a/bin/con b/bin/con new file mode 100755 index 0000000..f6a4f05 --- /dev/null +++ b/bin/con @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ -z $2 ]; then + c=`nmcli -t -e yes -c no -f name c show | wmenu -i -l 10` +else + c="$2" +fi + +o=`nmcli c $1 "${c}"` + +dunstify -a $0 "con $1 ${c}" "${o}" +killall -USR1 i3status diff --git a/bin/dmenu_run b/bin/dmenu_run new file mode 100755 index 0000000..ac60745 --- /dev/null +++ b/bin/dmenu_run @@ -0,0 +1,57 @@ +#!/bin/sh +# +# dmenu_run with custom history +# +set -e + +export PATH=$PATH:~/.local/bin:~/.local/bin/sh + +# . $HOME/.config/rc/config/dmenu/dmenu.rc +# . $HOME/.config/rc/sh/dmenu_path + +# NB="#303446" +#NF="#838ba7" +#SF="#303446" +#SB="#ebcb8b" +NB="#090e13fa" + +NF="#c6d0f5" +NF="#c6d0f54d" +SB="#303446" +SF="#babbf1" +#$nf #c6d0f5$TR +#$nb #303446$TR +#$sf #ebcb8b$TR + +# NORD: NF="#4c566aEF" +# NORD: NB="#2e3440EF" +# NORD: SF="#2e3440EF" +# NORD: SB="#ebcb8bEF" + +# FONT="monospace:size=11" +FONT="JetBrainsMono Nerd Font 10" + +HISTORY=$HOME/.cache/dmenu_run.history + +# MONITOR="$(swaymsg -t get_outputs | jq -r 'map(.focused) | index(true)')" +# MONITORNAME="$(swaymsg -t get_outputs | jq -r '.[] | select(.focused==true) | .name')" +_HIST_PREPEND() { + ( printf "%s\n" 1 i "$@" . w | ex $HISTORY ) &>/dev/null + awk -i inplace '!x[$0]++' "$HISTORY" +} + +# dmenu -m $MONITOR -fn ${FONT} -nb ${NB} -nf ${NF} -sb ${SB} -sf ${SF} -p "dmenu: " "$@") \ +cmd=$(( + cat "$HISTORY"; \ + flatpak list --columns=application | awk '$0="Ƒ "$0' ; \ + dmenu_path) | \ + wmenu -i -f "${FONT}" -M ${NB} -m ${SB} -N ${NB} -n ${NF} -S ${SB} -s ${SF} -p "dmenu: " "$@" ) \ + || exit + +_HIST_PREPEND "$cmd" & + +case $cmd in + Ƒ*) flatpak run "${cmd#Ƒ }" ;; + !*) exec foot -e -T "${cmd#!}" "${cmd#!}" ;; + *) exec $cmd & ;; +esac diff --git a/bin/dmenu_sh b/bin/dmenu_sh new file mode 100755 index 0000000..d54bd06 --- /dev/null +++ b/bin/dmenu_sh @@ -0,0 +1,3 @@ +#!/bin/sh + +. $HOME/.config/dmenu/dmenurc && $DMENU $@ diff --git a/bin/hass b/bin/hass new file mode 100755 index 0000000..b2effcb --- /dev/null +++ b/bin/hass @@ -0,0 +1,14 @@ +#!/bin/sh +# +set -a; . "${HOME}/.config/secrets/hass"; set +a +# curl -s -X GET \ +# -H "Authorization: Bearer ${token}" \ +# -H "Content-Type: application/json" \ +# https://hass.dafu.dev/api/states +# + +curl -s -X POST \ + -H "Authorization: Bearer ${token}" \ + -H "Content-Type: application/json" \ + -d '{"entity_id":"switch.'${1}'"}' \ + https://hass.dafu.dev/api/services/switch/toggle || notify-send "${1} failed" diff --git a/bin/home_wifi b/bin/home_wifi new file mode 100755 index 0000000..5ddb4fc --- /dev/null +++ b/bin/home_wifi @@ -0,0 +1,3 @@ +#!/bin/sh +(nmcli con show --active | grep CR_5G)&>/dev/null || \ + nmcli connection up CR_5G diff --git a/bin/mpiv b/bin/mpiv new file mode 100755 index 0000000..5d1c19a --- /dev/null +++ b/bin/mpiv @@ -0,0 +1,11 @@ +#!/bin/sh + +url=$(wl-paste) +notify-send "Playing on pi: $url" +# url="https://youtu.be/LbkO84MsmyM?list=PL1Yf6ZEJhckBun3ijEL7DjtxUQ_DlFq-U" +# ssh set env +# url="https://stream.dafu.dev/Items/87d4b7901f7615ebbb270738825d640c/Download?api_key=6089eeeb929f4be98667fb4d19046041" +mpvcmd="mpv --save-position-on-quit -fs -gpu-api=opengl -hls-bitrate=3000000 --fullscreen ${url}" + +ssh pi -t "WAYLAND_DISPLAY=wayland-0 dtach -n /tmp/xmpv ${mpvcmd}" +# ssh pi -t "tmux start-server \; new-session -d -A -s mpv \; new-window -d '${mpvcmd}'" diff --git a/bin/mpvx b/bin/mpvx new file mode 100755 index 0000000..cb91381 --- /dev/null +++ b/bin/mpvx @@ -0,0 +1,5 @@ +#!/bin/sh + +url=$(wl-paste) +notify-send "Playing: $url" +mpv --log-file=/tmp/mpv_output.txt "$url" || notify-send "mpv failed" diff --git a/bin/open_url b/bin/open_url new file mode 100755 index 0000000..4ecc3fc --- /dev/null +++ b/bin/open_url @@ -0,0 +1,3 @@ +#!/bin/sh + +flatpak run org.mozilla.firefox $@ diff --git a/bin/pi_rdp b/bin/pi_rdp new file mode 100755 index 0000000..d2b8554 --- /dev/null +++ b/bin/pi_rdp @@ -0,0 +1,4 @@ +#!/bin/sh + +flatpak run org.remmina.Remmina -c \ + .var/app/org.remmina.Remmina/data/remmina/group_vnc_pi_192-168-5-21.remmina diff --git a/bin/screen_switch b/bin/screen_switch new file mode 100755 index 0000000..f4409bd --- /dev/null +++ b/bin/screen_switch @@ -0,0 +1 @@ +sudo screen /dev/ttyUSB0 11520,ixon diff --git a/bin/screenshot b/bin/screenshot new file mode 100755 index 0000000..5f6e0f7 --- /dev/null +++ b/bin/screenshot @@ -0,0 +1,3 @@ +#!/bin/sh +# https://github.com/jtheoof/swappy +grim -g "$(slurp)" - | swappy -f - diff --git a/bin/screenshot-area b/bin/screenshot-area new file mode 100755 index 0000000..79721d9 --- /dev/null +++ b/bin/screenshot-area @@ -0,0 +1,3 @@ +#!/bin/sh +# https://github.com/jtheoof/swappy +grim -g "$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp)" - | swappy -f - diff --git a/bin/vol b/bin/vol new file mode 100755 index 0000000..99d2d7b --- /dev/null +++ b/bin/vol @@ -0,0 +1,95 @@ +#!/bin/bash +# TODO +# - display both PCM & Master +# - display mute status + +# case $1 in +# o) amixer sset PCM toggle > /dev/null ;; +# +) amixer set PCM 2dB+ unmute > /dev/null;; +# -) amixer set PCM 2dB- unmute > /dev/null;; +# # *) echo -n "`amixer get Master | sed -ne '/Front Left/s/.*\[\(.*\)%\].*/\1/p'`" ; echo -n " / `amixer get PCM | sed -ne '/Front Left/s/.*\[\(.*\)%\].*/\1/p'`" ; ( amixer get Master | grep Front | grep -q off ) && echo -n " [MUTE]" ; exit;; +# *) echo -n "`amixer get PCM | sed -ne '/Front Left/s/.*\[\(.*\)%\].*/\1/p'`" ; ( amixer get PCM | grep Front | grep -q off ) && echo -n " [MUTE]" ; exit;; +# esac + + +# VOLUME=`amixer get Master | sed -ne '/Front Left/s/.*\[\(.*\)%\].*/\1/p'` +# xsetroot -name "Vol: $VOLUME" + +# `( amixer get Master | grep Front | grep -q off ) || echo \"$(~/sh/vol) •\"` + +# SINK="`pactl info | grep -P '^Default Sink: ' | sed 's/[^:]\+:\s\+//'`" + +. $HOME/.dmenurc + +SINK="`pactl info | grep -P '^Standard-Ziel: ' | sed 's/[^:]\+:\s\+//'`" +[[ -z "$SINK" ]] && exit 1 + +if [[ "$SINK" =~ DragonFly ]]; then + INCR='24' + MIN_VOLUME=65050 + MAX_VOLUME=65146 +else + INCR='2%' + MIN_VOLUME=0 + MAX_VOLUME=65536 +fi + +function volume() { + VOLUME="`pacmd dump | grep -P '^set-sink-volume.*\s+0x[1-9a-f][0-9a-f]*$'`" + echo "$VOLUME" | grep -qF "$SINK" + if [[ $? -eq 0 ]]; then + VOLUME="`echo "$VOLUME" | grep -oP '0x[1-9a-f][0-9a-f]*$'`" + printf "%d\n" "$VOLUME" + else + echo 0 + fi + unset VOLUME +} + +# volume + +if [[ -z "$1" ]]; then + notify-send "Usage: $0 " + exit 1 +fi + +case "$1" in + "+") + pactl -- set-sink-volume "$SINK" "+$INCR" + VOLUME="`volume`" + if [[ $VOLUME -gt $MAX_VOLUME ]]; then + pactl -- set-sink-volume "$SINK" "$MAX_VOLUME" + fi + ;; + "-") + pactl -- set-sink-volume "$SINK" "-$INCR" + VOLUME="`volume`" + if [[ $VOLUME -lt $MIN_VOLUME ]]; then + pactl -- set-sink-volume "$SINK" "$MIN_VOLUME" + fi + ;; + mute) + pactl -- set-sink-mute "$SINK" 1 + ;; + unmute) + pactl -- set-sink-mute "$SINK" 0 + ;; + switch) + pactl list short sinks | awk 'BEGIN {FS=" "}; {print $2}' | $DMENU -p "Output: " -l 3 | xargs -r pactl set-default-sink + ;; + toggle) + MUTED="`pacmd dump | grep -P '^set-sink-mute.*\s+yes$'`" + echo "$MUTED" | grep -qF "$SINK" + if [[ $? -eq 0 ]]; then + pactl -- set-sink-mute "$SINK" 0 + else + pactl -- set-sink-mute "$SINK" 1 + fi + ;; + *) + notify-send "Unknown command: $1" + exit 1 + ;; +esac + +# volume diff --git a/bin/work b/bin/work new file mode 100755 index 0000000..9adb554 --- /dev/null +++ b/bin/work @@ -0,0 +1,9 @@ +#!/bin/sh +(nmcli con show --active | grep PR_WRK) > /dev/null 2>&1 || \ + nmcli connection up PR_WRK && killall -USR1 i3status + +# swaymsg workspace 9:9 +mmsg -s -t 9 + +flatpak run org.remmina.Remmina -c \ + "${HOME}/.var/app/org.remmina.Remmina/data/remmina/group_rdp_wrk_10-0-10-224.remmina" diff --git a/dmenu/dmenu.rc b/dmenu/dmenu.rc new file mode 100644 index 0000000..8055586 --- /dev/null +++ b/dmenu/dmenu.rc @@ -0,0 +1,5 @@ +NF="#707880" +NB="#1d1f21" +SF="#1d1f21" +SB="#f0c674" +DMENU="dmenu -fn monospace:size=8 -nb #1d1f21 -nf #707880 -sb #f0c674 -sf #1d1f21" diff --git a/dunst/dunstrc b/dunst/dunstrc new file mode 100644 index 0000000..247bcd6 --- /dev/null +++ b/dunst/dunstrc @@ -0,0 +1,24 @@ +[global] +monitor = 1 +frame_width = 0 +frame_color = "#b4befe" +separator_color= frame +highlight = "#74c7ec" +background = "#1e1e2e" +foreground = "#cdd6f4" +progress_bar_corners = top-left,bottom-right +offset = (15, 25) +gap_size = 5 +format = "󰁕 %a\n%s\n\n%b" + +[urgency_low] +foreground = "#74c7ec" +frame_color = "#74c7ec" + +[urgency_normal] +foreground = "#cdd6f4" +frame_color = "#cdd6f4" + +[urgency_critical] +foreground = "#f38ba8" +frame_color = "#f38ba8" diff --git a/foot/foot.ini b/foot/foot.ini new file mode 100644 index 0000000..633fedf --- /dev/null +++ b/foot/foot.ini @@ -0,0 +1,79 @@ +font=JetBrainsMonoNl:size=11:weight=normal +include=/home/dafu/.config/foot/kanso.ini +pad=10x10 +[colors] +alpha=0.7 + +# catppuccin +# [colors] +# alpha=0.8 +# cursor=11111b f5e0dc +# foreground=cdd6f4 +# background=1e1e2e +# +# regular0=45475a +# regular1=f38ba8 +# regular2=a6e3a1 +# regular3=f9e2af +# regular4=89b4fa +# regular5=f5c2e7 +# regular6=94e2d5 +# regular7=bac2de +# +# bright0=585b70 +# bright1=f38ba8 +# bright2=a6e3a1 +# bright3=f9e2af +# bright4=89b4fa +# bright5=f5c2e7 +# bright6=94e2d5 +# bright7=a6adc8 +# +# 16=fab387 +# 17=f5e0dc +# +# selection-foreground=cdd6f4 +# selection-background=414356 +# +# search-box-no-match=11111b f38ba8 +# search-box-match=cdd6f4 313244 +# +# jump-labels=11111b fab387 +# urls=89b4fa + +# name: MAYHEM colors for Foot +# url: https://codeberg.org/dnkl/foot +# upstream: ${upstream} +# author: Andrea Schiavini (original code by Casey Miller) + +# [cursor] +# color=c1c1c1 333333 +# +# [colors] +# foreground=c1c1c1 +# background=000000 +# # alternate, darker background=111113 +# selection-foreground=c1c1c1 +# selection-background=333333 +# urls=aaaaaa +# +# regular0=111113 +# regular1=5f8787 +# regular2=c1c1c1 +# regular3=888888 +# regular4=aaaaaa +# regular5=999999 +# regular6=f3ecd4 +# regular7=c1c1c1 +# +# bright0=505050 +# bright1=5f8787 +# bright2=c1c1c1 +# bright3=888888 +# bright4=aaaaaa +# bright5=eecc6c +# bright6=f3ecd4 +# bright7=c1c1c1 +# +# 16=aaaaaa +# 17=5f8787 diff --git a/foot/kanso.ini b/foot/kanso.ini new file mode 100644 index 0000000..de5b444 --- /dev/null +++ b/foot/kanso.ini @@ -0,0 +1,29 @@ +[colors] +foreground=c5c9c7 +background=090e13 + +regular0=090e13 +regular1=c4746e +regular2=8a9a7b +regular3=c4b28a +regular4=8ba4b0 +regular5=a292a3 +regular6=8ea4a2 +regular7=a4a7a4 + +bright0=5c6066 +bright1=e46876 +bright2=87a987 +bright3=e6c384 +bright4=7fb4ca +bright5=938aa9 +bright6=7aa89f +bright7=c5c9c7 + +16=b6927b +17=b98d7b + +selection-foreground=c5c9c7 +selection-background=22262d + +urls=72a7bc diff --git a/ghostty/config b/ghostty/config new file mode 100644 index 0000000..dcd69b4 --- /dev/null +++ b/ghostty/config @@ -0,0 +1,20 @@ +font-style = default +font-style-bold = default +font-style-italic = default +font-style-bold-italic = default +font-synthetic-style = bold,italic,bold-italic +mouse-hide-while-typing = true +background-opacity = 0.9 +background-opacity-cells = true +clipboard-read = ask +clipboard-write = allow +clipboard-trim-trailing-spaces = true +clipboard-paste-protection = false +clipboard-paste-bracketed-safe = true +confirm-close-surface = false +quit-after-last-window-closed = true +bell-features = no-system,no-audio,attention,title,no-border +bell-audio-volume = 0.5 +desktop-notifications = true +term = xterm-ghostty +resize-overlay = never diff --git a/mango/autostart.sh b/mango/autostart.sh new file mode 100755 index 0000000..afee77a --- /dev/null +++ b/mango/autostart.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +set +e + +# obs +dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=wlroots >/dev/null 2>&1 + + +# some env can't auto run the portal, so need this +/usr/lib/xdg-desktop-portal-wlr >/dev/null 2>&1 & + +# xwayland dpi scale +# echo "Xft.dpi: 140" | xrdb -merge #dpi缩放 +# xrdb merge ~/.Xresources >/dev/null 2>&1 + +# dms shell +# dms run >/dev/null 2>&1 & + +# ime input +# fcitx5 --replace -d >/dev/null 2>&1 & + +# keep clipboard content +wl-clip-persist --clipboard regular --reconnect-tries 0 >/dev/null 2>&1 & + +# clipboard content manager +wl-paste --type text --watch cliphist store >/dev/null 2>&1 & + +swaybg -m full -i ~/Downloads/brandon-siu-nI7knd5sQfo-unsplash.jpg & + +# inhibit by audio +# sway-audio-idle-inhibit >/dev/null 2>&1 & + +mako & + +# Start network and bluetooth tray applets +nm-applet --indicator & +blueman-applet & + +# Start waybar +~/.config/waybar/waybar.sh & diff --git a/mango/bind.conf b/mango/bind.conf new file mode 100644 index 0000000..9d6363c --- /dev/null +++ b/mango/bind.conf @@ -0,0 +1,174 @@ +# reload config +bind=SUPER,r,spawn_shell,bash ~/.config/mango/scripts/config_check.sh +bind=SUPER,r,reload_config +bind=SHIFT+SUPER,e,quit +bind=ALT,q,killclient, + +# menu and terminal +bind=Alt,Return,spawn,foot +# bind=Alt,space,spawn,dms ipc call spotlight toggle +# bind=Alt,b,spawn,dms ipc call bar toggle index 0 +bind=Alt,b,spawn,kill -SIGUSR1 $(pidof waybar) +bind=Alt,p,spawn,~/.local/bin/sh/dmenu_run + + +# switch window focus +bind=Alt,Tab,focusstack,next +bind=SUPER,u,focuslast +# bind=ALT,Left,focusdir,left +# bind=ALT,Right,focusdir,right +# bind=ALT,Up,focusdir,up +# bind=ALT,Down,focusdir,down + +# swap window +bind=SUPER+SHIFT,Up,exchange_client,up +bind=SUPER+SHIFT,Down,exchange_client,down +bind=SUPER+SHIFT,Left,exchange_client,left +bind=SUPER+SHIFT,Right,exchange_client,right + +# movewin +# bind=CTRL+SHIFT,Up,movewin,+0,-50 +# bind=CTRL+SHIFT,Down,movewin,+0,+50 +# bind=CTRL+SHIFT,Left,movewin,-50,+0 +# bind=CTRL+SHIFT,Right,movewin,+50,+0 + + +# resizewin +# bind=CTRL+ALT,Up,resizewin,+0,-50 +# bind=CTRL+ALT,Down,resizewin,+0,+50 +# bind=CTRL+ALT,Left,resizewin,-50,+0 +# bind=CTRL+ALT,Right,resizewin,+50,+0 + +# switch window status +bind=SUPER,g,toggleglobal, +bind=SUPER,Tab,toggleoverview, +bind=ALT,s,togglefloating, +bind=ALT,a,togglemaximizescreen, +bind=ALT,f,togglefullscreen, +bind=ALT+SHIFT,f,togglefakefullscreen, +bind=SUPER,i,minimized, +bind=SUPER,o,toggleoverlay, +bind=SUPER+SHIFT,I,restore_minimized + +bind=ALT,z,toggle_scratchpad + +# scroller layout +bind=ALT,e,set_proportion,1.0 +bind=ALT,x,switch_proportion_preset, + +# tile layout +bind=SUPER,e,incnmaster,1 +bind=SUPER,t,incnmaster,-1 +bind=ALT+SHIFT,s,zoom, + +# switch layout +bind=CTRL+SUPER,i,setlayout,tile +bind=CTRL+SUPER,l,setlayout,scroller +bind=SUPER,n,switch_layout + +# tag switch +bind=SUPER,Left,viewtoleft_have_client,0 +# bind=SUPER,Left,viewtoleft,0 +# bind=CTRL,Left,viewtoleft_have_client,0 +bind=SUPER,Right,viewtoright_have_client,0 +# bind=SUPER,Right,viewtoright,0 +# bind=CTRL,Right,viewtoright_have_client,0 +# bind=CTRL,Right,viewtoright_have_client,0 +bind=CTRL+SUPER,Left,tagtoleft,0 +bind=CTRL+SUPER,Right,tagtoright,0 + +bind=Alt,1,view,1,0 +bind=Alt,2,view,2,0 +bind=Alt,3,view,3,0 +bind=Alt,4,view,4,0 +bind=Alt,5,view,5,0 +bind=Alt,6,view,6,0 +bind=Alt,7,view,7,0 +bind=Alt,8,view,8,0 +bind=Alt,9,view,9,0 + +bind=Alt+Shift,1,tag,1,0 +bind=Alt+Shift,2,tag,2,0 +bind=Alt+Shift,3,tag,3,0 +bind=Alt+Shift,4,tag,4,0 +bind=Alt+Shift,5,tag,5,0 +bind=Alt+Shift,6,tag,6,0 +bind=Alt+Shift,7,tag,7,0 +bind=Alt+Shift,8,tag,8,0 +bind=Alt+Shift,9,tag,9,0 + +bind=ctrl+Super,1,toggletag,1 +bind=ctrl+Super,2,toggletag,2 +bind=ctrl+Super,3,toggletag,3 +bind=ctrl+Super,4,toggletag,4 +bind=ctrl+Super,5,toggletag,5 +bind=ctrl+Super,6,toggletag,6 +bind=ctrl+Super,7,toggletag,7 +bind=ctrl+Super,8,toggletag,8 +bind=ctrl+Super,9,toggletag,9 + +bind=Super,1,toggleview,1 +bind=Super,2,toggleview,2 +bind=Super,3,toggleview,3 +bind=Super,4,toggleview,4 +bind=Super,5,toggleview,5 +bind=Super,6,toggleview,6 +bind=Super,7,toggleview,7 +bind=Super,8,toggleview,8 +bind=Super,9,toggleview,9 + +# monitor switch +bind=alt+shift,Left,focusmon,left +bind=SUPER+Alt,Left,tagmon,left + +# gaps +bind=ALT+SHIFT,X,incgaps,1 +bind=ALT+SHIFT,Z,incgaps,-1 +bind=ALT+SHIFT,R,togglegaps + + +# Mouse Button Bindings +mousebind=ALT,btn_left,moveresize,curmove +mousebind=ALT,btn_right,moveresize,curresize +mousebind=alt,btn_middle,set_proportion,0.5 +# mousebind=SUPER+CTRL,btn_left,minimized +# mousebind=SUPER+CTRL,btn_right,killclient +# mousebind=SUPER+CTRL,btn_middle,togglefullscreen +# mousebind=SUPER,btn_middle,togglemaximizescreen,0 + +# Axis Bindings +# axisbind=SUPER,UP,viewtoleft_have_client +# axisbind=SUPER,DOWN,viewtoright_have_client +# axisbind=alt,UP,focusdir,left +# axisbind=alt,DOWN,focusdir,right +# axisbind=shift+super,UP,exchange_client,left +# axisbind=shift+super,DOWN,exchange_client,right + +# Gesturebind +# gesturebind=none,left,3,focusdir,left +# gesturebind=none,right,3,focusdir,right +# gesturebind=none,up,3,focusdir,up +# gesturebind=none,down,3,focusdir,down +# gesturebind=none,left,4,viewtoleft_have_client +# gesturebind=none,right,4,viewtoright_have_client +# gesturebind=none,up,4,toggleoverview,1 +# gesturebind=none,down,4,toggleoverview,1 + +# brightness and volume +bind=CTRL,comma,spawn,dms ipc call brightness decrement 2 "" +bind=CTRL,period,spawn,dms ipc call brightness increment 2 "" +bind=ALT,comma,spawn,dms ipc call audio decrement 3 +bind=ALT,period,spawn,dms ipc call audio increment 3 + +bind=none,XF86AudioRaiseVolume,spawn,dms ipc call audio increment 3 +bind=none,XF86AudioLowerVolume,spawn,dms ipc call audio decrement 3 +bind=none,XF86MonBrightnessUp,spawn,dms ipc call brightness increment 1 +bind=none,XF86MonBrightnessDown,spawn,dms ipc call brightness decrement 1 + +#custom app bind +bind=SUPER,Return,spawn,google-chrome +bind=CTRL+ALT,a,spawn_shell,grim -g "$(slurp -b '#2E2A1E55' -c '#fb751bff')" -t ppm - | satty -f - +bind=SUPER,h,spawn,bash ~/.config/mango/scripts/hide_waybar_mango.sh +bind=SUPER,l,spawn,dms ipc call lock lock + + diff --git a/mango/config.conf b/mango/config.conf new file mode 100644 index 0000000..68680a0 --- /dev/null +++ b/mango/config.conf @@ -0,0 +1,148 @@ +# https://github.com/strcat/dotfiles/blob/main/.config/mango/config.conf +# Effect +blur=0 +blur_layer=1 +blur_optimized=1 +blur_params_num_passes = 2 +blur_params_radius = 5 +blur_params_noise = 0.02 +blur_params_brightness = 0.9 +blur_params_contrast = 0.9 +blur_params_saturation = 1.2 + +shadows = 0 +layer_shadows = 1 +shadow_only_floating=1 +shadows_size = 12 +shadows_blur = 15 +shadows_position_x = 0 +shadows_position_y = 0 +shadowscolor= 0x000000ff + +border_radius=0 +no_radius_when_single=0 +focused_opacity=1.0 +unfocused_opacity=1.0 +# unfocused_opacity=0.85 + +# Animation Configuration +animations=0 +layer_animations=0 +animation_type_open=fade +animation_type_close=fade +layer_animation_type_open=fade +layer_animation_type_close=fade +animation_fade_in=1 +animation_fade_out=1 +tag_animation_direction=1 +zoom_initial_ratio=0.3 +zoom_end_ratio=0.7 +fadein_begin_opacity=0.6 +fadeout_begin_opacity=0.8 +animation_duration_move=500 +animation_duration_open=400 +animation_duration_tag=350 +animation_duration_close=800 +animation_duration_focus=400 +animation_curve_open=0.46,1.0,0.29,1.1 +animation_curve_move=0.46,1.0,0.29,1 +animation_curve_tag=0.46,1.0,0.29,1 +animation_curve_close=0.08,0.92,0,1 +animation_curve_focus=0.46,1.0,0.29,1 +animation_curve_opafadeout=0.58,0.98,0.58,0.98 +animation_curve_opafadein=0.46,1.0,0.29,1 + +# Scroller Layout Setting +scroller_structs=20 +scroller_default_proportion=0.8 +scroller_focus_center=0 +scroller_prefer_center=1 +edge_scroller_pointer_focus=1 +scroller_default_proportion_single=1.0 +scroller_proportion_preset=0.5,0.8,1.0 + +# Master-Stack Layout Setting +new_is_master=1 +smartgaps=0 +default_mfact=0.55 +default_nmaster=1 + +# Overview Setting +hotarea_size=10 +enable_hotarea=0 +ov_tab_mode=1 +overviewgappi=5 +overviewgappo=30 + +# Misc +xwayland_persistence=1 +syncobj_enable=0 +# VRR is global: set adaptive_sync=1 in config.conf +no_border_when_single=1 +axis_bind_apply_timeout=100 +focus_on_activate=1 +sloppyfocus=1 +warpcursor=1 +focus_cross_monitor=0 +focus_cross_tag=0 +circle_layout=tile,monocle,grid,tgmix +enable_floating_snap=1 +snap_distance=50 +# cursor_size=24 +# cursor_theme=Bibata-Modern-Ice +cursor_hide_timeout=0 +drag_tile_to_tile=1 +single_scratchpad = 1 + +# keyboard +repeat_rate=25 +repeat_delay=600 +numlockon=1 +xkb_rules_layout=de,de +# xkb_rules_options=ctrl:nocaps +# xkb_rules_options=grp:alt_altgr_toggle,caps:hyper + +# Trackpad +disable_trackpad=0 +tap_to_click=1 +tap_and_drag=1 +drag_lock=1 +mouse_natural_scrolling=0 +trackpad_natural_scrolling=0 +disable_while_typing=1 +left_handed=0 +middle_button_emulation=0 +swipe_min_threshold=1 +#accel_profile=2 +#accel_speed=0.0 +# scroll_button=274 +# scroll_method=1 + +# Appearance +gappih=0 +gappiv=0 +gappoh=0 +gappov=0 +scratchpad_width_ratio=0.8 +scratchpad_height_ratio=0.9 +borderpx=1 +rootcolor=0x201b14ff +bordercolor=0x444444ff +focuscolor=0xc9b890ff +maximizescreencolor=0xDA7510ff +urgentcolor=0xad401fff +scratchpadcolor=0xc4939dff +globalcolor=0x8d64cfff +overlaycolor=0x89aa61ff + +# sub config load +source=./env.conf +source=./bind.conf +source=./rule.conf +# source=./monitor.conf +source=./tag.conf +exec-once=~/.config/mango/autostart.sh + +# source=./dms/outputs.conf +source=./monitor.conf +source=./dms/colors.conf diff --git a/mango/dms/colors.conf b/mango/dms/colors.conf new file mode 100644 index 0000000..048de70 --- /dev/null +++ b/mango/dms/colors.conf @@ -0,0 +1,7 @@ +# ! Auto-generated file. Do not edit directly. +# Remove source = ./dms/colors.conf from your config to override. + +bordercolor = 0x00000080 +focuscolor = 0x30344680 +# focuscolor = 0xbfc2ff80 +urgentcolor = 0xffb4abff diff --git a/mango/dms/layout.conf b/mango/dms/layout.conf new file mode 100644 index 0000000..c2f794c --- /dev/null +++ b/mango/dms/layout.conf @@ -0,0 +1,7 @@ +# Auto-generated by DMS - do not edit manually +border_radius=4 +gappih=4 +gappiv=4 +gappoh=4 +gappov=4 +borderpx=2 diff --git a/mango/dms/outputs.conf b/mango/dms/outputs.conf new file mode 100644 index 0000000..cb422e7 --- /dev/null +++ b/mango/dms/outputs.conf @@ -0,0 +1,5 @@ +# Auto-generated by DMS - do not edit manually +# VRR is global: set adaptive_sync=1 in config.conf + +monitorrule=eDP-1,0.55,1,tile,0,1,0,2160,1920,1080,60 +monitorrule=DP-2,0.55,1,tile,0,1,0,0,3840,2160,60 diff --git a/mango/env.conf b/mango/env.conf new file mode 100644 index 0000000..e6d2183 --- /dev/null +++ b/mango/env.conf @@ -0,0 +1,11 @@ +# env=XCURSOR_SIZE,24 +# env=XCURSOR_THEME,Bibata-Modern-Ice +# env=GTK_IM_MODULE,fcitx +# env=QT_IM_MODULE,fcitx +# env=SDL_IM_MODULE,fcitx +# env=XMODIFIERS,@im=fcitx +# env=GLFW_IM_MODULE,ibus +# env=QT_QPA_PLATFORMTHEME,qt6ct +# env=QT_AUTO_SCREEN_SCALE_FACTOR,1 +# # env=QT_WAYLAND_FORCE_DPI,140 +# env=QT_QPA_PLATFORM,Wayland;xcb diff --git a/mango/foot/foot.ini b/mango/foot/foot.ini new file mode 100644 index 0000000..e3b0ba0 --- /dev/null +++ b/mango/foot/foot.ini @@ -0,0 +1,285 @@ +# -*- conf -*- + +# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) +# term=foot (or xterm-256color if built with -Dterminfo=disabled) +# login-shell=no + +# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode +# title=foot +# locked-title=no +font=Maple Mono NF CN:size=20:style=Medium:antialias=true:autohint=true +# font=monospace:size=8 +# font-bold= +# font-italic= +# font-bold-italic= +# font-size-adjustment=0.5 +# line-height= +# letter-spacing=0 +# horizontal-letter-offset=0 +# vertical-letter-offset=0 +# underline-offset= +# underline-thickness= +# strikeout-thickness= +# box-drawings-uses-font-glyphs=no +# dpi-aware=no + +initial-window-size-pixels=1500x900 +# initial-window-size-chars= +# initial-window-mode=windowed +# pad=0x0 # optionally append 'center' +# resize-by-cells=yes +# resize-keep-grid=yes +# resize-delay-ms=100 + +# bold-text-in-bright=no +# word-delimiters=,│`|:"'()[]{}<> +selection-target=clipboard +# selection-target=primary +# workers= +# utmp-helper=/usr/lib/utempter/utempter # When utmp backend is ‘libutempter’ (Linux) +# utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ‘ulog’ (FreeBSD) + +[environment] +# name=value +TIMG_PIXELATION=sixel +TERM=foot + +[security] +# osc52=enabled # disabled|copy-enabled|paste-enabled|enabled + +[bell] +# system=yes +# urgent=no +# notify=no +# visual=no +# command= +# command-focused=no + +[desktop-notifications] +# command=notify-send --wait --app-name ${app-id} --icon ${app-id} --category ${category} --urgency ${urgency} --expire-time ${expire-time} --hint STRING:image-path:${icon} --hint BOOLEAN:suppress-sound:${muted} --hint STRING:sound-name:${sound-name} --replace-id ${replace-id} ${action-argument} --print-id -- ${title} ${body} +# command-action-argument=--action ${action-name}=${action-label} +# close="" +# inhibit-when-focused=yes + + +[scrollback] +lines=999999 +# lines=1000 +# multiplier=3.0 +# indicator-position=relative +# indicator-format="" + +[url] +launch=xdg-open ${url} +label-letters=jklsdfgheiunaowcmp +osc8-underline=url-mode +regex=(([a-z][[:alnum:]-]+:(/{1,3}|[a-z0-9%])|www[:digit:]{0,3}[.])([^[:space:](){}<>]+|\(([^[:space:](){}<>]+|(\([^[:space:](){}<>]+\)))*\)|\[([^]\[[:space:](){}<>]+|(\[[^]\[[:space:](){}<>]+\]))*\])+(\(([^[:space:](){}<>]+|(\([^[:space:](){}<>]+\)))*\)|\[([^]\[[:space:](){}<>]+|(\[[^]\[[:space:](){}<>]+\]))*\]|[^]\[[:space:]`!(){};:'".,<>?«»“”‘’])) + +# You can define your own regex's, by adding a section called +# 'regex:' with a 'regex' and 'launch' key. These can then be tied +# to a key-binding. See foot.ini(5) for details + +# [regex:your-fancy-name] +# regex= +# launch= ${match} +# +# [key-bindings] +# regex-launch=[your-fancy-name] Control+Shift+q +# regex-copy=[your-fancy-name] Control+Alt+Shift+q + +[regex:data] +regex=((([~]{0,1}(/[^/\0]+)+)/[^\^ ]+)|([a-fA-f0-9]{7,128})|(ghp_[0-9a-zA-Z]{36})|([0-9]{4,})|([0-9a-f]{7,40})|(core-[0-9A-Za-z]+-[0-9A-Za-z]+-[0-9A-Za-z]+)|(0x[0-9a-fA-F]+)|([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})|([A-f0-9:]+:+[A-f0-9:]+[A-f0-9]+)|([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,})|([a-z][[:alnum:]-]+:(/{1,3}|[a-z0-9%])|www[:digit:]{0,3}[.])([^[:space:](){}<>]+|\(([^[:space:](){}<>]+|(\([^[:space:](){}<>]+\)))*\)|\[([^]\[[:space:](){}<>]+|(\[[^]\[[:space:](){}<>]+\]))*\])+(\(([^[:space:](){}<>]+|(\([^[:space:](){}<>]+\)))*\)|\[([^]\[[:space:](){}<>]+|(\[[^]\[[:space:](){}<>]+\]))*\]|[^]\[[:space:]`!(){};:'".,<>?«»“”‘’])) + +[key-bindings] +regex-copy=[data] Control+Shift+o + + +[cursor] +style=block +# color= +# blink=no +# blink-rate=500 +# beam-thickness=1.5 +# underline-thickness= + +[mouse] +hide-when-typing=no +# alternate-scroll-mode=yes + +[touch] +# long-press-delay=400 + +[colors] +alpha=0.7 +foreground=D1B88E +background=201b14 +# flash=7f7f00 +# flash-alpha=0.5 + +## Normal/regular colors (color palette 0-7) +regular0=262626 #gray +regular1=cc0000 #red +regular2=42B63F # green +regular3=DD9400 #yello +regular4=DD9400 #yello +regular5=bf78cf #purple +regular6=74cd45 #blue-green +regular7=D1B88E #yellow-white + +## Bright colors (color palette 8-15) +bright0=a79e67 #gray-green +bright1=ef2929 # red +bright2=8ae234 #green +bright3=ead96b #yellow +bright4=729fcf #blue +bright5=ad7fa8 #pink +bright6=ead96b #yellow +bright7=eeeeec #light-yellow + +## dimmed colors (see foot.ini(5) man page) +# dim0= +# ... +# dim7= + +## The remaining 256-color palette +# 16 = <256-color palette #16> +# ... +# 255 = <256-color palette #255> + +## Sixel colors +# sixel0 = 000000 +# sixel1 = 3333cc +# sixel2 = cc2121 +# sixel3 = 33cc33 +# sixel4 = cc33cc +# sixel5 = 33cccc +# sixel6 = cccc33 +# sixel7 = 878787 +# sixel8 = 424242 +# sixel9 = 545499 +# sixel10 = 994242 +# sixel11 = 549954 +# sixel12 = 995499 +# sixel13 = 549999 +# sixel14 = 999954 +# sixel15 = cccccc + +## Misc colors +# selection-foreground= +# selection-background= +# jump-labels= # black-on-yellow +# scrollback-indicator= # black-on-bright-blue +# search-box-no-match= # black-on-red +# search-box-match= # black-on-yellow +# urls= + +[csd] +# preferred=server +# size=26 +# font= +# color= +# hide-when-maximized=no +# double-click-to-maximize=yes +# border-width=0 +# border-color= +# button-width=26 +# button-color= +# button-minimize-color= +# button-maximize-color= +# button-close-color= + +[key-bindings] +# scrollback-up-page=Shift+Page_Up Shift+KP_Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down Shift+KP_Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# scrollback-home=none +# scrollback-end=none +# clipboard-copy=Control+Shift+c XF86Copy +# clipboard-paste=Control+Shift+v XF86Paste +# primary-paste=Shift+Insert +# search-start=Control+Shift+r +# font-increase=Control+plus Control+equal Control+KP_Add +# font-decrease=Control+minus Control+KP_Subtract +# font-reset=Control+0 Control+KP_0 +# spawn-terminal=Control+Shift+n +# minimize=none +# maximize=none +# fullscreen=none +# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-selected=[xargs -r firefox] none +# pipe-command-output=[wl-copy] none # Copy last command's output to the clipboard +show-urls-launch=Control+Shift+j +# show-urls-copy=none +# show-urls-persistent=none +# prompt-prev=Control+Shift+z +# prompt-next=Control+Shift+x +# unicode-input=Control+Shift+u +# noop=none +# quit=none + +[search-bindings] +# cancel=Control+g Control+c Escape +# commit=Return KP_Enter +# find-prev=Control+r +# find-next=Control+s +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-next=Delete +# delete-next-word=Mod1+d Control+Delete +# delete-to-start=Control+u +# delete-to-end=Control+k +# extend-char=Shift+Right +# extend-to-word-boundary=Control+w Control+Shift+Right +# extend-to-next-whitespace=Control+Shift+w +# extend-line-down=Shift+Down +# extend-backward-char=Shift+Left +# extend-backward-to-word-boundary=Control+Shift+Left +# extend-backward-to-next-whitespace=none +# extend-line-up=Shift+Up +# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste +# primary-paste=Shift+Insert +# unicode-input=none +# scrollback-up-page=Shift+Page_Up Shift+KP_Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down Shift+KP_Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# scrollback-home=none +# scrollback-end=none + +[url-bindings] +# cancel=Control+g Control+c Control+d Escape +# toggle-url-visible=t + +[text-bindings] +# \x03=Mod4+c # Map Super+c -> Ctrl+c + +[mouse-bindings] +# scrollback-up-mouse=BTN_WHEEL_BACK +# scrollback-down-mouse=BTN_WHEEL_FORWARD +# font-increase=Control+BTN_WHEEL_BACK +# font-decrease=Control+BTN_WHEEL_FORWARD +# selection-override-modifiers=Shift +clipboard-paste=BTN_RIGHT +# primary-paste=BTN_MIDDLE +# select-begin=BTN_LEFT +# select-begin-block=Control+BTN_LEFT +select-extend=BTN_LEFT-5 # select-extend=BTN_RIGHT +# select-extend-character-wise=Control+BTN_RIGHT +# select-word=BTN_LEFT-2 +# select-word-whitespace=Control+BTN_LEFT-2 +# select-quote = BTN_LEFT-3 +# select-row=BTN_LEFT-4 + +# vim: ft=dosini diff --git a/mango/monitor.conf b/mango/monitor.conf new file mode 100644 index 0000000..bbbbfaf --- /dev/null +++ b/mango/monitor.conf @@ -0,0 +1,3 @@ +# Monitor Rules +monitorrule=name:eDP-1,width:1920,height:1080,refresh:59.999001,x:0,y:2160,scale:1,vrr:0,rr:0 +monitorrule=name:DP-,width:3840,height:2160,refresh:59.997002,x:0,y:0,scale:1,vrr:0,rr:0 diff --git a/mango/rule.conf b/mango/rule.conf new file mode 100644 index 0000000..0c4a229 --- /dev/null +++ b/mango/rule.conf @@ -0,0 +1,122 @@ +# Window Rules +windowrule=isfullscreen:1,appid:org.remmina.Remmina +windowrule=tags:9,appid:org.remmina.Remmina + +windowrule=unfocused_opacity:1.0,focused_opacity:1.0,appid:org.mozilla.firefox +# windowrule=force_maximize:1,appid:org.mozilla.firefox + +windowrule=unfocused_opacity:1.0,focused_opacity:1.0,appid:chromium-browser +# windowrule=force_maximize:1,appid:chromium-browser + +windowrule=unfocused_opacity:1.0,focused_opacity:1.0,appid:google-chrome-unstable +# windowrule=force_maximize:1,appid:google-chrome-unstable + +#windowrule=force_maximize:1,appid:org.telegram.desktop +#windowrule=appid:org.telegram.desktop,tags:8, +windowrule=appid:org.telegram.desktop,istagsilent:1,isfloating:1,width:420,height:660,offsetx:95,offsety:-90,isnoborder:1,isglobal:1 + +windowrule=title:pi_mpv,isfloating:1,width:420,height:660,isnoborder:1 + +## notme +## windowrule=isfloating:1,appid:xdg-desktop-portal-gtk,title:打开本地仓库 +## windowrule=isfloating:1,appid:xdg-desktop-portal-gtk,title:打开文件 +## +## windowrule=isfloating:1,isnosizehint:1,title:迅雷 +## windowrule=width:800,height:900,title:迅雷 +## +## windowrule=isfloating:1,title:Translate +## windowrule=width:800,height:900,title:Translate +## +## windowrule=globalkeybinding:ctrl+alt-o,appid:com.obsproject.Studio +## windowrule=globalkeybinding:ctrl+alt-n,appid:com.obsproject.Studio +## # windowrule=isopensilent:1,appid:com.obsproject.Studio +## +## windowrule=noswallow:1,appid:flameshot +## windowrule=isfullscreen:1,appid:flameshot +## windowrule=animation_type_open:none,appid:flameshot +## windowrule=animation_type_close:none,appid:flameshot +## # windowrule=animation_type_close:none,appid:Sxiv +## +## windowrule=noswallow:1,title:Event Tester +## +## windowrule=isfloating:1,width:1500,height:900,appid:yesplaymusic +## windowrule=animation_type_open:slide,appid:yesplaymusic +## windowrule=animation_type_close:slide,appid:yesplaymusic +## +## windowrule=isfloating:1,appid:clash-verge +## windowrule=width:1500,height:900,appid:clash-verge +## windowrule=animation_type_open:slide,animation_type_close:slide,appid:clash-verge +## +## windowrule=isfloating:1,width:1500,height:900,appid:pot,title:Recognize +## windowrule=animation_type_open:none,animation_type_close:none,isnoshadow:1,isnoradius:1,isnoborder:1,appid:^wps$,title:^wps$ +## windowrule=force_maximize:1,appid:^wpsoffice$ +## +## windowrule=isfloating:1,appid:blueman-manager +## windowrule=width:1500,height:900,appid:blueman-manager +## +## windowrule=isfloating:1,title:图片查看器 +## windowrule=isfloating:1,title:预览 +## windowrule=isfloating:1,title:图片查看 +## windowrule=isfloating:1,title:选择文件 +## windowrule=isfloating:1,title:打开文件 +## windowrule=isfloating:1,appid:python3,title:qxdrag +## windowrule=isfloating:1,title:rofi - Networks +## +## windowrule=animation_type_open:zoom,title:图片查看器 +## windowrule=animation_type_open:zoom,title:图片查看 +## windowrule=animation_type_open:zoom,title:选择文件 +## windowrule=animation_type_open:zoom,title:打开文件 +## windowrule=animation_type_open:zoom,appid:python3,title:qxdrag +## windowrule=animation_type_open:zoom,title:rofi - Networks +## +## +## windowrule=isfloating:1,appid:Rofi +## windowrule=isfloating:1,appid:qxdrag.py +## windowrule=isfloating:1,appid:xfce-polkit +## +## windowrule=isnoborder:1,appid:Rofi +## windowrule=animation_type_open:slide,appid:Rofi +## windowrule=animation_type_close:zoom,appid:Rofi +## windowrule=animation_type_open:zoom,appid:qxdrag.py +## windowrule=animation_type_open:zoom,appid:python3,title:qxdrag +## windowrule=animation_type_close:zoom,appid:qxdrag.py +## windowrule=animation_type_close:zoom,appid:python3,title:qxdrag +## windowrule=animation_type_close:zoom,appid:^com.gabm.satty$ +## +## windowrule=isterm:1,appid:St +## +## # These applications can only strictly adhere to the tiling size when maximized +## windowrule=force_maximize:1,appid:org.gnome.SystemMonitor +## windowrule=force_maximize:1,appid:org.gnome.gThumb +## +## windowrule=tags:4,appid:Google-chrome +## windowrule=tags:3,appid:QQ +## windowrule=tags:2,appid:mpv +## windowrule=tags:6,appid:obs +## +## windowrule=animation_type_open:none,nofadein:1,title:wechat +## windowrule=animation_type_close:none,nofadeout:1,title:wechat +## windowrule=isfloating:1,isoverlay:1,isnoborder:1,isunglobal:1,width:400,height:400,offsetx:9999,offsety:9999,appid:bongo-cat,title:BongoCat +## windowrule=isfloating:1,isoverlay:1,isnoborder:1,isunglobal:1,width:280,height:200,offsetx:9999,offsety:9999,appid:mpv,title:video0 - mpv +## windowrule=isfloating:1,isnosizehint:1,width:1500,height:900,appid:baidunetdisk,title:百度网盘 +## windowrule=isoverlay:1,appid:^com.gabm.satty$ +## +## +## windowrule=unfocused_opacity:1.0,focused_opacity:1.0,appid:^mpv$ +## windowrule=unfocused_opacity:1.0,focused_opacity:1.0,appid:^St$ +## windowrule=unfocused_opacity:1.0,focused_opacity:1.0,appid:^foot$ +## windowrule=unfocused_opacity:1.0,focused_opacity:1.0,appid:^obsidian$ +## windowrule=unfocused_opacity:1.0,focused_opacity:1.0,appid:^Google-chrome$ +## windowrule=unfocused_opacity:1.0,focused_opacity:1.0,appid:^QQ$ +## +## # layer rule +## layerrule=noblur:1,noanim:1,layer_name:selection +## layerrule=noblur:1,noanim:1,layer_name:quickshell +## layerrule=noblur:1,noanim:1,layer_name:quickshell:popout +## layerrule=noblur:1,noanim:1,layer_name:dms +## layerrule=noblur:1,noanim:1,layer_name:dms:.* +## layerrule=noblur:1,noanim:1,layer_name:dimland_layer +## layerrule=noanim:1,noblur:1,noshadow:1,layer_name:hyprpicker +## layerrule=noanim:1,layer_name:showkeys +## +## diff --git a/mango/scripts/brightness.sh b/mango/scripts/brightness.sh new file mode 100755 index 0000000..1735bd3 --- /dev/null +++ b/mango/scripts/brightness.sh @@ -0,0 +1,32 @@ +#!/usr/bin/bash + +# Change brightness level with `light`. +# You can call this script like this: +# brightness.sh [up|down] + +function get_brightness { + var=$(brightnessctl get) + echo "${var##* }" | sed 's/[^0-9][^.]*//g' +} + +function send_notification { + DIR=$(dirname "$0") + brightness=$(get_brightness) + icon_name="${HOME}/.config/rice_assets/Icons/b.png" + + # Send the notification + dunstify "Brightness: $brightness%" -h int:value:$brightness -i /usr/share/icons/Adwaita/96x96/status/display-brightness-symbolic.symbolic.png -t 1000 --replace=555 -u low +} + +case $1 in +up) + swayosd-client --brightness +2 + # brightnessctl set +1% + # send_notification + ;; +down) + swayosd-client --brightness -2 + # brightnessctl set 1%- + # send_notification + ;; +esac diff --git a/mango/scripts/config_check.sh b/mango/scripts/config_check.sh new file mode 100644 index 0000000..e963735 --- /dev/null +++ b/mango/scripts/config_check.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# 获取mango命令输出并清理格式 +output=$(mango -p 2>&1 | sed -r ' + s/\x1b\[[0-9;]*[a-zA-Z]//g # 移除ANSI颜色代码 + s/ ╰─/ ╰─/g # 压缩多余空格 + s/^[[:space:]]*// # 删除行首空格 + s/[[:space:]]*$// # 删除行尾空格 +') + +# 设置通知图标 +icon="$HOME/.config/mango/wallpaper/mango.png" + +# 如果没有输出或输出为空,则退出 +if [[ -z "$output" ]]; then + exit 0 +fi + +# 发送通知 +notify-send --urgency=critical --icon="$icon" "Mango Status" "$output" \ No newline at end of file diff --git a/mango/scripts/exitdim.sh b/mango/scripts/exitdim.sh new file mode 100755 index 0000000..d4ab217 --- /dev/null +++ b/mango/scripts/exitdim.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bash + +ps aux | grep -v grep |grep dimland | grep -v idle | awk '{print $2}' | xargs kill diff --git a/mango/scripts/hide_waybar_mango.sh b/mango/scripts/hide_waybar_mango.sh new file mode 100755 index 0000000..1a57dd8 --- /dev/null +++ b/mango/scripts/hide_waybar_mango.sh @@ -0,0 +1,9 @@ +#!/usr/bin/bash + +startd=$(pgrep waybar) + +if [ -n "$startd" ]; then + pkill waybar +else + waybar -c ~/.config/mango/waybar/config.jsonc -s ~/.config/mango/waybar/style.css +fi diff --git a/mango/scripts/idle.sh b/mango/scripts/idle.sh new file mode 100755 index 0000000..e702d28 --- /dev/null +++ b/mango/scripts/idle.sh @@ -0,0 +1,15 @@ +#!/usr/bin/bash + +#swayidle -w \ +# timeout 1800 'swaylock -f -c 000000' \ +# timeout 1800 'hyprctl dispatch dpms off' \ +# resume 'hyprctl dispatch dpms on && ~/.config/hypr/scripts/restart_wlsunset.sh' \ +# timeout 300 'bash $HOME/.config/hypr/scripts/lightresume.sh dark' \ +# resume 'bash $HOME/.config/hypr/scripts/lightresume.sh resume' \ +# timeout 3600 'systemctl suspend' + +swayidle \ + timeout 1800 'wlr-dpms off' \ + resume 'wlr-dpms on && ~/.config/mango/scripts/restart_wlsunset.sh' \ + timeout 300 'dimland -a 0.3' \ + resume 'bash ~/.config/mango/scripts/exitdim.sh' diff --git a/mango/scripts/monitor.sh b/mango/scripts/monitor.sh new file mode 100755 index 0000000..b21a8ab --- /dev/null +++ b/mango/scripts/monitor.sh @@ -0,0 +1,8 @@ +#!/usr/bin/bash + +enable=$(wlr-randr --json | jq --arg name "eDP-1" '.[] | select(.name == $name) | .enabled') +if [ $enable == "true" ]; then + wlr-randr --output eDP-1 --off +else + wlr-randr --output eDP-1 --on +fi diff --git a/mango/scripts/restart_wlsunset.sh b/mango/scripts/restart_wlsunset.sh new file mode 100755 index 0000000..d0fee88 --- /dev/null +++ b/mango/scripts/restart_wlsunset.sh @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +set +e + +ps aux | grep wlsunset | grep -v swayidle | grep -v restart | grep -v grep | awk '{print $2}' | xargs sudo kill + +nohup wlsunset -T 3501 -t 3500 >> /dev/null 2<&1 & \ No newline at end of file diff --git a/mango/scripts/virmon.sh b/mango/scripts/virmon.sh new file mode 100755 index 0000000..3689728 --- /dev/null +++ b/mango/scripts/virmon.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Function to find the first HEADLESS-* display +find_headless_display() { + wlr-randr --json | jq -r '.[] | select(.name | startswith("HEADLESS-")) | .name' | head -n 1 +} + +# Get the first HEADLESS display +HEADLESS_DISPLAY=$(find_headless_display) + +if [ -z "$HEADLESS_DISPLAY" ]; then + mmsg -d create_virtual_output + notify-send "Creating virtual monitor" + HEADLESS_DISPLAY=$(find_headless_display) + # wlr-randr --output "$HEADLESS_DISPLAY" --pos 1926,0 --scale 1 --custom-mode 1920x1080@60Hz --on + # wlr-randr --output eDP-1 --pos 0,0 --scale 1 + notify-send "Starting sunshine" + sunshine & + notify-send "Sunshine on" + exit 0 +fi + +# Now check and toggle status +enable=$(wlr-randr --json | jq --arg name "$HEADLESS_DISPLAY" '.[] | select(.name == $name) | .enabled') +if [ "$enable" == "true" ]; then + wlr-randr --output "$HEADLESS_DISPLAY" --off + pkill sunshine + notify-send "Sunshine off" + mmsg -d destroy_all_virtual_output + notify-send "Removed virtual monitor" + wlr-randr --output eDP-1 --pos 0,0 --scale 1 +else + wlr-randr --output "$HEADLESS_DISPLAY" --on + sunshine & + notify-send "Sunshine on" +fi diff --git a/mango/scripts/volume.sh b/mango/scripts/volume.sh new file mode 100755 index 0000000..a459ffd --- /dev/null +++ b/mango/scripts/volume.sh @@ -0,0 +1,75 @@ +#!/usr/bin/bash + +# Changes de volume of the default sink +# Warning: This script offers no cap for volume, +# I'd advice to not go above 150% (which is the standard cap). +# You can call this script like this: +# volume.sh [up|down|mute] + +function get_volume { + pactl get-sink-volume @DEFAULT_SINK@ | awk '{printf $5}' | cut -d '%' -f 1 +} + +function is_mute { + pactl get-sink-mute @DEFAULT_SINK@ +} + +function send_notification { + + overvolume=`get_volume` + [[ $overvolume -gt 100 ]] && volume=100 || volume=$overvolume + #Set correct icon + if [[ $volume -eq 0 ]] + then + icon_name="${HOME}/.config/rice_assets/Icons/nov.png" + elif [[ $volume -lt 35 ]] + then + icon_name="${HOME}/.config/rice_assets/Icons/vlow.png" + elif [[ $volume -lt 70 ]] + then + icon_name="${HOME}/.config/rice_assets/Icons/vmid.png" + elif [[ $volume -lt 100 ]] + then + icon_name="${HOME}/.config/rice_assets/Icons/vhigh.png" + else + icon_name="${HOME}/.config/rice_assets/Icons/vthigh.png" + fi; + #bn=$(( (volume + 5) / 5 )) + + #bar=$(seq -s "" $bn | sed 's/[0-9]//g') + + # Send the notification + dunstify "Volume: $overvolume%" -h int:value:$volume -i /usr/share/icons/Adwaita/96x96/status/audio-volume-medium-symbolic.symbolic.png -t 1000 --replace=555 -u normal +} + +case $1 in + up) + swayosd-client --output-volume 5 + # # Set the volume on (if it was muted) + # pactl set-sink-mute @DEFAULT_SINK@ 0 > /dev/null + # # Up the volume (+ 5%) + # curvol=`get_volume` + # rem=$(( (curvol + 5) % 5 )) + # inc="+$(( 5 - rem ))%" + # pactl set-sink-volume @DEFAULT_SINK@ $inc > /dev/null + # send_notification + ;; + down) + swayosd-client --output-volume -5 + # pactl set-sink-mute @DEFAULT_SINK@ 0 > /dev/null + # curvol=`get_volume` + # rem=$(( (curvol - 5) % 5 )) + # inc="-$(( 5 + rem ))%" + # pactl set-sink-volume @DEFAULT_SINK@ $inc > /dev/null + # send_notification + ;; + mute) + # Toggle mute + pactl set-sink-mute @DEFAULT_SINK@ toggle > /dev/null + if [[ `is_mute` == "Mute: yes" ]] ; then + dunstify -i "${HOME}/.config/rice_assets/Icons/mute.png" --replace=555 -u normal "Volume: Mute" -t 1000 -u critical + else + send_notification + fi + ;; +esac diff --git a/mango/tag.conf b/mango/tag.conf new file mode 100644 index 0000000..f84e2ee --- /dev/null +++ b/mango/tag.conf @@ -0,0 +1,11 @@ +# tags rule +tagrule=id:1,layout_name:tile +tagrule=id:2,layout_name:tile +tagrule=id:3,layout_name:tile +tagrule=id:4,layout_name:tile +tagrule=id:5,layout_name:tile +tagrule=id:6,layout_name:tile +tagrule=id:7,layout_name:tile +tagrule=id:8,layout_name:tile +tagrule=id:9,layout_name:monocle + diff --git a/sway/config b/sway/config new file mode 100644 index 0000000..fb4b7c0 --- /dev/null +++ b/sway/config @@ -0,0 +1,282 @@ +# Default config for sway + +# TODO: https://github.com/Crandel/home/blob/master/.config/sway/config + +## monitor: +# wlr-randr --output eDP-1 --pos 0,2160 --output DP-1 --pos 0,0 + +# COLORS +# nord: $nf #4c566a$TR +# nord: $nb #2e3440$TR +# nord: $sf #ebcb8b$TR +set { + $TR CC + $nf #a5adce$TR + $nb #303446$TR + $sf #ebcb8b$TR + $bf $nf + $sb $nb + $uf $sf + $db $nb +} +set { + $mod Mod1 + $left h + $down j + $up k + $right l + + $term foot + $menu ~/.local/bin/dmenu_run | xargs swaymsg exec -- + $clipmenu clipman pick --tool=CUSTOM -T "$HOME/.local/bin/dmenu_sh -p 'Clip:' -l 10" + +# Mocha + $bmenu bemenu-run --fb $nb --ff $nf --nb $nb --nf $nf --tb "#1e1e2e" --hb "#1e1e2e" --tf "#f38ba8" --hf $nf --af "#cdd6f4" --ab "#1e1e2e" + # $bmenu bemenu-run --fb "#1e1e2e" --ff "#cdd6f4" --nb "#1e1e2e" --nf "#cdd6f4" --tb "#1e1e2e" --hb "#1e1e2e" --tf "#f38ba8" --hf "#f9e2af" --af "#cdd6f4" --ab "#1e1e2e" + + $screenshot grim -g "$(slurp)" - | swappy -f - +# ~/.local/bin/screenshot + + # outputs + $out0 eDP-1 + $out1 DP-1 + + $maximize border none, move position center, resize set width 100 ppt height 100 ppt +} + + + +output { + $out0 background ~/sync/data/wall2.webp fill + $out1 background ~/sync/data/wall2.webp fill + + $out0 adaptive_sync on + $out1 adaptive_sync on + + $out0 pos 0 2170 res 1920x1080@60Hz + $out1 pos 0 0 res 3840x2160@60Hz +} + +# OPTS +# drag floating windows by holding down $mod and left mouse button. +floating_modifier $mod normal +focus_follows_mouse yes + +# Key bindings +bindsym { + $mod+p exec $menu + $mod+Shift+P exec $bmenu + $mod+Return exec $term + # $mod+Shift+p exec $clipmenu + $mod+Shift+s exec $screenshot + $mod+q kill + $mod+Shift+c reload + $mod+Shift+r restart + $mod+Shift+e exec swaynag -t warning -m 'Do you really want to exit sway?' -B 'Yes, exit sway' 'swaymsg exit' + + # $mod+Tab focus next window + # $mod+Shift+Tab focus prev window + +# focus hjkl + $mod+$left focus left + $mod+$right focus right + $mod+$up focus up + $mod+$down focus down +# move hjkl + $mod+Shift+$left move left + $mod+Shift+$right move right + $mod+Shift+$up move up + $mod+Shift+$down move down + +# focus cursor keys + $mod+Left focus left + $mod+Down focus down + $mod+Up focus up + $mod+Right focus right +# move cursor keys + $mod+Shift+Left move left + $mod+Shift+Down move down + $mod+Shift+Up move up + $mod+Shift+Right move right + + $mod+i workspace back_and_forth + $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth + +# split orientation + $mod+g split toggle + +# toggle fullscreen mode for the focused container +# focus the parent container + $mod+a focus parent + $mod+s floating toggle + # $mod+Shift+s sticky toggle + $mod+f fullscreen toggle + $mod+d layout stacking + $mod+w layout tabbed + $mod+e layout toggle split + +# change focus between tiling / floating windows + $mod+space focus mode_toggle + + $mod+b bar mode toggle + +# move the currently focused window to the scratchpad + $mod+Shift+minus move scratchpad + $mod+minus scratchpad show + +#navigate workspaces next / previous + $mod+Ctrl+Right workspace next + $mod+Ctrl+Left workspace prev + + $mod+Shift+m floating enable; sticky enable; resize set 200 175; move position 865 20; + + XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% && killall -USR1 i3status + XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && killall -USR1 i3status + XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && killall -USR1 i3status + XF86AudioMicMute exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ 150% && killall -USR1 i3status + XF86MonBrightnessUp exec --no-startup-id notify-send $(brightnessctl) && brightnessctl s +10% && killall -USR1 i3status + XF86MonBrightnessDown exec --no-startup-id brightnessctl s 10%- && killall -USR1 i3status +} + +# workspace back and forth (with/without active container) +workspace_auto_back_and_forth no + +set { + $ws1 1: + $ws2 2: + $ws3 3:3 + $ws4 4:4 + $ws5 5:5 + $ws6 6:6 + $ws7 7:7 + $ws8 8:8 + $ws9 9:9 +} + +workspace { + $ws1 output $out0 + $ws2 output $out0 + $ws3 output $out0 + $ws4 output $out0 + $ws5 output $out0 + $ws6 output $out0 + $ws7 output $out1 + $ws9 output $out1 + $ws9 output $out1 +} + +# switch to workspace +bindsym { + $mod+1 workspace $ws1 + $mod+2 workspace $ws2 + $mod+3 workspace $ws3 + $mod+4 workspace $ws4 + $mod+5 workspace $ws5 + $mod+6 workspace $ws6 + $mod+7 workspace $ws7 + $mod+8 workspace $ws8 + $mod+9 workspace $ws9 + +# Move focused container to workspace + $mod+Shift+1 move container to workspace $ws1 + $mod+Shift+2 move container to workspace $ws2 + $mod+Shift+3 move container to workspace $ws3 + $mod+Shift+4 move container to workspace $ws4 + $mod+Shift+5 move container to workspace $ws5 + $mod+Shift+6 move container to workspace $ws6 + $mod+Shift+7 move container to workspace $ws7 + $mod+Shift+8 move container to workspace $ws8 + $mod+Shift+9 move container to workspace $ws9 + +# Move to workspace with focused container + $mod+Ctrl+1 move container to workspace $ws1; workspace $ws1 + $mod+Ctrl+2 move container to workspace $ws2; workspace $ws2 + $mod+Ctrl+3 move container to workspace $ws3; workspace $ws3 + $mod+Ctrl+4 move container to workspace $ws4; workspace $ws4 + $mod+Ctrl+5 move container to workspace $ws5; workspace $ws5 + $mod+Ctrl+6 move container to workspace $ws6; workspace $ws6 + $mod+Ctrl+7 move container to workspace $ws7; workspace $ws7 + $mod+Ctrl+8 move container to workspace $ws8; workspace $ws8 + $mod+Ctrl+9 move container to workspace $ws9; workspace $ws9 +} + +# Open specific applications in floating mode +assign { + [app_id="org.mozilla.firefox"] $ws1 + [app_id="org.remmina.Remmina"] $ws9 + # [app_id="org.telegram.desktop"] $ws6 + # [app_id="mpv"] $ws7 +} + +for_window { + [app_id=".telegram."] flaoting enable + [app_id="org.pulseaudio.pavucontrol"] floating enable + # [app_id="mpv"] focus inhibit_idle + [app_id="mpv"] floating enable, focus, inhibit_idle, sticky enable, resize set 400 400 + [app_id="firefox" title="Picture-in-Picture"] floating enable, resize set 400 400 + [urgent=latest] focus + [window_type="dialog"] floating enable, resize set 700 800 + [app_id="remmina"] shortcuts_inhibitor enable +} + +# Status Bar: +font Jetbrains Mono NL Light 9 +default_border pixel 1 +#smart both none +hide_edge_borders smart + +# focus_wrapping yes|no|force|workspace +# focus_wrapping yes + + +#class border backgr. text indicator child_border +client.focused_inactive $nf $nb $sf $nf $db +client.focused $db $nb $sf $uf $bf +client.unfocused $db $nb $nf $db $db +client.urgent $nb $nb $uf $uf $nf + +bar { + position top + status_padding 0 + # status_edge_padding 20 + tray_padding 7 + tray_output $out0 + separator_symbol " ⋮ " + icon_theme locolor + strip_workspace_numbers yes + status_command i3status -c /home/dafu/.config/sway/i3status.conf + workspace_min_width 50 + + colors { + # + separator $sf + background $nb + statusline $nf + focused_workspace $nb $sf $nb + active_workspace $nb $nb $sf + inactive_workspace $nb $nb $nf + urgent_workspace $nb $nb $uf + } +} + +input type:touchpad events disabled +input type:keyboard { + xkb_layout de + xkb_variant nodeadkeys + xkb_options ctrl:nocaps +} + +# other config +include /etc/sway/config.d/* + +# startup +exec --no-startup-id { + lxpolkit + /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 + eval $(gnome-keyring-daemon --start) + export SSH_AUTH_SOCK + /usr/libexec/polkit-gnome-authentication-agent-1 + wl-paste -t text --watch clipman store + /home/dafu/.config/rc/bin/bat_alert.sh +# exec --no-startup-id nm-applet --sm-disable +} diff --git a/sway/i3status.conf b/sway/i3status.conf new file mode 100644 index 0000000..5a78c89 --- /dev/null +++ b/sway/i3status.conf @@ -0,0 +1,116 @@ +# i3status configuration file. + +general { + colors = true + interval = 30 + output_format = "i3bar" + markup = "pango" +} + +order += "wireless _first_" +order += "path_exists WG_LON" +# order += "ethernet _first_" +# order += "cpu_temperature 0" +# order += "memory" +# order += "load" +# order += "disk /" +# +# order += "run_watch VPN" +# run_watch TMUX { +# pidfile = "/tmp/tmux-1000/default" +# } + +order += "path_exists SYNCTHING" +order += "volume master" +order += "battery 0" +order += "tztime local" + + +load { + format = "%5min" +} + +path_exists WG_LON { + path = "/sys/class/net/gb-lon-wg-303/dev_id" + format_down = "" + format= "  lon-wg-303" + color_good = "#a5adce" + color_degraded = "#e5c890" + color_bad = "#bf616a" +} + +path_exists SYNCTHING { + path = "/home/dafu/.local/state/syncthing/syncthing.lock" + format = "" + format_down = "" +} + +cpu_temperature 0 { + format = "%degrees°" + path = "/sys/devices/platform/coretemp.0/hwmon/hwmon7/temp1_input" + color_good = "#a5adce" + color_degraded = "#e5c890" + color_bad = "#bf616a" +} + +memory { + format = "%free" + threshold_degraded = "10%" + format_degraded = "MEMORY: %free" + color_good = "#a5adce" + color_degraded = "#e5c890" + color_bad = "#bf616a" +} + +disk "/" { + format = "%free" +} + +wireless _first_ { + format_up = " %quality %essid" + format_down = "睊" + color_good = "#a5adce" + color_degraded = "#e5c890" + color_bad = "#bf616a" +} + +ethernet _first_ { + format_up = " ip" + format_down = "" + color_good = "#a5adce" + color_degraded = "#a5adce" + color_bad = "#a5adce" + +} + +volume master { + format = " %volume" + format_muted = " %volume" + device = "default" + mixer = "Master" + mixer_idx = 0 +} + +battery 0 { + format = "%status %percentage" +# format = "%status %percentage %remaining" +# format_degraded = "%status %percentage %remaining" + format_down = "No battery" + integer_battery_capacity = true + last_full_capacity = true + status_chr = "" + status_bat = "" + status_unk = "?" + status_full = "" + low_threshold = "30" + threshold_type = "percent" + path = "/sys/class/power_supply/BAT%d/uevent" +# colors = true +# color_good = "#e5c890" +# color_degraded = "#ef9f76" +# color_bad = "#e78284" +} + +tztime local { + format = "%d.%m. %H:%M" +} diff --git a/swaylock/config b/swaylock/config new file mode 100644 index 0000000..c41d74a --- /dev/null +++ b/swaylock/config @@ -0,0 +1,29 @@ +color=303446 +bs-hl-color=f2d5cf +caps-lock-bs-hl-color=f2d5cf +caps-lock-key-hl-color=a6d189 +inside-color=00000000 +inside-clear-color=00000000 +inside-caps-lock-color=00000000 +inside-ver-color=00000000 +inside-wrong-color=00000000 +key-hl-color=a6d189 +layout-bg-color=00000000 +layout-border-color=00000000 +layout-text-color=c6d0f5 +line-color=00000000 +line-clear-color=00000000 +line-caps-lock-color=00000000 +line-ver-color=00000000 +line-wrong-color=00000000 +ring-color=babbf1 +ring-clear-color=f2d5cf +ring-caps-lock-color=ef9f76 +ring-ver-color=8caaee +ring-wrong-color=ea999c +separator-color=00000000 +text-color=c6d0f5 +text-clear-color=f2d5cf +text-caps-lock-color=ef9f76 +text-ver-color=8caaee +text-wrong-color=ea999c diff --git a/waybar/battery_menu.xml b/waybar/battery_menu.xml new file mode 100644 index 0000000..449438e --- /dev/null +++ b/waybar/battery_menu.xml @@ -0,0 +1,21 @@ + + + + + + Performance + + + + + Balanced + + + + + Powersaver + + + + + diff --git a/waybar/config.jsonc b/waybar/config.jsonc new file mode 100644 index 0000000..8bc6aa5 --- /dev/null +++ b/waybar/config.jsonc @@ -0,0 +1,163 @@ +// -*- mode: jsonc -*- +{ + "layer": "top", + "position": "top", + "exclusive": true, + "passthrough": false, + "gtk-layer-shell": true, + "ipc": false, + //"reload_style_on_change": true, + "height": 18, + "margin": "0", + "modules-left": [ + "dwl/tags", + // "ext/workspaces", + "dwl/window" + // "wlr/taskbar" + ], + // "modules-center": [ // "mpris" ], + "modules-right": [ + "battery", + "pulseaudio", + "custom/notification", + "tray", + "custom/power", + "clock" + ], + // Modules configuration + "dwl/tags": { + "num-tags": 9, + "hide-vacant": false, + "expand": true, + "disable-click": false, + "tag-labels": [ + ], + }, + + "ext/workspaces": { + "format": "{icon}", + "ignore-hidden": true, + "on-click": "activate", + "on-click-right": "deactivate", + "sort-by-id": true + }, + "dwl/window": { + "format": "{layout} {title}", + "max-length": 50, + "rewrite": { + " \\| ": "" + } + }, + "wlr/taskbar": { + "format": "{icon}", + "icon-size": 12, + "all-outputs": false, + "tooltip-format": "{title}", + "markup": true, + "on-click": "activate", + "on-click-right": "close", + "ignore-list": ["Rofi", "wofi"] + }, + "tray": { + "icon-size": 12, + "spacing": 12 + }, + "mpris": { + "format": "{player_icon} {artist} - {title}", + "format-paused": "{status_icon} {artist} - {title}", + "player-icons": { + "vivaldi-stable": "▶", + "spotify": "", + "default": "" + }, + "status-icons": { + "paused": "" + }, + "max-length": 80 + // "ignored-players": ["firefox"] + }, + "custom/music": { + "format": " {}", + "escape": true, + "interval": 5, + "tooltip": false, + "exec": "playerctl metadata --format='{{ titles }}'", + "on-click": "playerctl play-pause", + "max-length": 50 + }, + "clock": { + // "timezone": "America/New_York", + // "tooltip-format": "{:%Y %B}\n{calendar}", + // "format-alt": "{:%d/%m/%Y}", + "format": "{:%H:%M}" + }, + "battery": { + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{icon} {capacity}%", + "tooltip": false, + "menu": "on-click", + "menu-file": "~/.config/waybar/battery_menu.xml", + "menu-actions": { + "performance": "powerprofilesctl set performance", + "balanced": "powerprofilesctl set balanced", + "powersaver": "powerprofilesctl set power-saver", + }, + + // "format-alt": "{icon}", + // "format-charging": "", + // "format-plugged": "", + "format-icons": ["󰂎", "󰁻", "󰁽", "󰁿", "󰂁", "󰁹"] + }, + "pulseaudio": { + "disable-scroll": true, + "format": "{icon} {volume}%", + "format-muted": "", + "format-icons": { + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + }, + "bluetooth": { + "format": "󰂲", + "format-on": "{icon}", + "format-off": "{icon}", + "format-connected": "{icon}", + "format-icons": { + "on": "󰂯", + "off": "󰂲", + "connected": "󰂱" + }, + "on-click": "blueman-manager", + "tooltip-format-connected": "{device_enumerate}" + }, + "custom/notification": { + "format": "{icon} {text}", + "tooltip": false, + "format-icons": { + "notification": "󱅫", + "none": "", + "dnd-notification": "", + "dnd-none": "󰂛", + "inhibited-notification": "", + "inhibited-none": "", + "dnd-inhibited-notification": "", + "dnd-inhibited-none": "" + }, + "return-type": "json", + "exec-if": "which swaync-client", + "exec": "swaync-client -swb", + "on-click": "swaync-client -t -sw", + "on-click-right": "swaync-client -d -sw", + "escape": true + }, + "custom/power": { + "format" : "⏻", + "tooltip": false, + "on-click": "wlogout" + } +} + diff --git a/waybar/frappe.css b/waybar/frappe.css new file mode 100644 index 0000000..9d64f67 --- /dev/null +++ b/waybar/frappe.css @@ -0,0 +1,84 @@ +/* + * Catppuccin Frappé Color Palette for Waybar + * Colors from https://github.com/catppuccin/catppuccin + */ + +/* Raw Catppuccin Frappé Colors */ +@define-color rosewater #f2d5cf; +@define-color flamingo #eebebe; +@define-color pink #f4b8e4; +@define-color mauve #ca9ee6; +@define-color red #e78284; +@define-color maroon #ea999c; +@define-color peach #ef9f76; +@define-color yellow #e5c890; +@define-color green #a6d189; +@define-color teal #81c8be; +@define-color sky #99d1db; +@define-color sapphire #85c1dc; +@define-color blue #8caaee; +@define-color lavender #babbf1; + +@define-color text #c6d0f5; +@define-color subtext1 #b5bfe2; +@define-color subtext0 #a5adce; +@define-color overlay2 #949cbb; +@define-color overlay1 #838ba7; +@define-color overlay0 #737994; +@define-color surface2 #626880; +@define-color surface1 #51576d; +@define-color surface0 #414559; +@define-color base #303446; +@define-color mantle #292c3c; +@define-color crust #232634; + +/* GTK/Waybar Theme Variable Mappings */ +/* Widget text/foreground color */ +@define-color theme_fg_color @text; +/* Text color for entries, views, and general content */ +@define-color theme_text_color @text; +/* Widget base background color (#090e13 @ 70% opacity) */ +@define-color theme_bg_color rgba(9, 14, 19, 0.7); +/* Text widgets and the like base background color (dark grey-blue) */ +@define-color theme_base_color @surface0; +/* Base background color of selections */ +@define-color theme_selected_bg_color @lavender; +/* Text/foreground color of selections */ +@define-color theme_selected_fg_color @base; + +/* Disabled widgets styling */ +@define-color insensitive_bg_color @surface1; +@define-color insensitive_fg_color @overlay1; +@define-color insensitive_base_color @mantle; + +/* Backdrop/unfocused window styling */ +@define-color theme_unfocused_fg_color @subtext0; +@define-color theme_unfocused_text_color @subtext0; +@define-color theme_unfocused_bg_color rgba(9, 14, 19, 0.7); +@define-color theme_unfocused_base_color @mantle; +@define-color theme_unfocused_selected_bg_color @surface2; +@define-color theme_unfocused_selected_fg_color @text; + +/* Border styling */ +@define-color borders @crust; +@define-color unfocused_borders @crust; + +/* State & Status Colors */ +@define-color warning_color @peach; +@define-color error_color @red; +@define-color success_color @green; + +/* Duplicate / Fallback definitions for compatibility */ +@define-color fg_color @text; +@define-color text_color @text; +@define-color bg_color rgba(9, 14, 19, 0.7); +@define-color base_color @surface0; +@define-color selected_bg_color @lavender; +@define-color selected_fg_color @base; + +@define-color unfocused_fg_color @subtext0; +@define-color unfocused_text_color @subtext0; +@define-color unfocused_bg_color rgba(9, 14, 19, 0.7); +@define-color unfocused_base_color @mantle; +@define-color unfocused_selected_bg_color @surface2; +@define-color unfocused_selected_fg_color @text; diff --git a/waybar/nord.css b/waybar/nord.css new file mode 100644 index 0000000..cd8e9ff --- /dev/null +++ b/waybar/nord.css @@ -0,0 +1,50 @@ +/* widget text/foreground color */ +@define-color theme_fg_color #d8dee9; +/* text color for entries, views and content in general */ +@define-color theme_text_color #d8dee9; +/* widget base background color */ +@define-color theme_bg_color #434c5e; +/* text widgets and the like base background color */ +@define-color theme_base_color #3b4252; +/* base background color of selections */ +@define-color theme_selected_bg_color #8fbcbb; +/* text/foreground color of selections */ +@define-color theme_selected_fg_color #fff; +/* base background color of disabled widgets */ +@define-color insensitive_bg_color #404859; +/* text foreground color of disabled widgets */ +@define-color insensitive_fg_color #8e95a4; +/* disabled text widgets and the like base background color */ +@define-color insensitive_base_color #3b4252; +/* widget text/foreground color on backdrop windows */ +@define-color theme_unfocused_fg_color #8e95a4; +/* text color for entries, views and content in general on backdrop windows */ +@define-color theme_unfocused_text_color #d8dee9; +/* widget base background color on backdrop windows */ +@define-color theme_unfocused_bg_color #434c5e; +/* text widgets and the like base background color on backdrop windows */ +@define-color theme_unfocused_base_color #3d4455; +/* base background color of selections on backdrop windows */ +@define-color theme_unfocused_selected_bg_color #8fbcbb; +/* text/foreground color of selections on backdrop windows */ +@define-color theme_unfocused_selected_fg_color #2e3440; +/* widgets main borders color */ +@define-color borders #232831; +/* widgets main borders color on backdrop windows */ +@define-color unfocused_borders #262c36; +/* these are pretty self explicative */ +@define-color warning_color #c3674a; +@define-color error_color #b84f59; +@define-color success_color #49688e; +@define-color fg_color #d8dee9; +@define-color text_color #d8dee9; +@define-color bg_color #434c5e; +@define-color base_color #3b4252; +@define-color selected_bg_color #8fbcbb; +@define-color selected_fg_color #fff; +@define-color unfocused_fg_color #8e95a4; +@define-color unfocused_text_color #d8dee9; +@define-color unfocused_bg_color #434c5e; +@define-color unfocused_base_color #3d4455; +@define-color unfocused_selected_bg_color #8fbcbb; +@define-color unfocused_selected_fg_color #2e3440; \ No newline at end of file diff --git a/waybar/style.css b/waybar/style.css new file mode 100644 index 0000000..e22c186 --- /dev/null +++ b/waybar/style.css @@ -0,0 +1,100 @@ +@import "frappe.css"; + + +* { + all: unset; + font-family: "JetBrainsMono Nerd Font Propo", "JetBrainsMono Nerd Font", monospace; + font-size: 12px; + text-shadow: 0 0 1px rgba(0, 0, 0, 0.1); + letter-spacing: 0.2px; + border: none; + border-radius: 0; + /*min-height: 0;*/ + margin: 0; + padding: 0; +} + +#waybar { + background: @theme_bg_color; + color: @theme_fg_color; +} +#window, +#mpris { + padding: 0 0.5rem; +} +#clock, +#battery, +#pulseaudio, +#custom-notification, +#tray, +#custom-power { + padding: 0 0.75rem; +} +#tags { + padding-right: 0.25rem; +} + +#tags button { + font-weight: normal; + border-radius: 4px; + margin: 2px 3px; + padding: 0px; + min-width: 24px; + color: rgba(198, 208, 245, 0.3); +} + +#tags button.occupied { + background-color: transparent; + color: @theme_fg_color; +} + +#tags button.focused { + background-color: rgba(186, 187, 241, 0.18); + color: @theme_selected_bg_color; + font-weight: bold; +} + +#tags button.urgent { + /* background-color: rgba(231, 130, 132, 0.2); */ + color: @error_color; + animation: blink 1s infinite; +} + +#tags button:hover { + /* background-color: rgba(255, 255, 255, 0.08); */ + /* color: @theme_fg_color; */ + background-color: transparent; + color: @theme_selected_bg_color; +} + +/* Optional: Add subtle transition for hover effects */ +#tags button { + /* transition: all 0.2s ease-in-out; */ +} + +@keyframes blink { + 0% { opacity: 1; } + 50% { opacity: 0.5; } + 100% { opacity: 1; } +} + +#battery.charging { + color: @success_color; +} + +#battery.warning:not(.charging) { + color: @warning_color; +} + +#custom-power { + color: @theme_selected_fg_color; +} + +#tray button { + padding: 0 4px; + border-radius: 4px; +} + +#tray button:hover { + background-color: rgba(255, 255, 255, 0.08); +} diff --git a/waybar/waybar.sh b/waybar/waybar.sh new file mode 100755 index 0000000..720620c --- /dev/null +++ b/waybar/waybar.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +# Terminate already running bar instances +killall -q waybar + +# Wait until the processes have been shut down +while pgrep -x waybar >/dev/null; do sleep 1; done + +# Launch main +waybar