From 962fc10ef1cb6438c6c006df3ed4e44a0959b9d3 Mon Sep 17 00:00:00 2001 From: jabuxas Date: Wed, 15 Jan 2025 21:26:31 -0300 Subject: [PATCH] feat: change to leftwm --- desktop/configs/fish/.config/fish/config.fish | 12 ++-- .../configs/leftwm/.config/leftwm/config.ron | 47 +++++++------- .../leftwm/.config/leftwm/themes/current | 2 +- .../leftwm/.config/leftwm/themes/rose/down | 9 +++ .../.config/leftwm/themes/rose/theme.ron | 9 +++ .../leftwm/.config/leftwm/themes/rose/up | 21 ++++++ .../polybar/.config/polybar/everforest.ini | 19 +++--- .../configs/scripts/scripts/screenlayout.sh | 2 +- desktop/configs/scripts/scripts/x-print.sh | 65 +++++++++++++++++++ desktop/configs/shell-files/.xinitrc | 2 +- 10 files changed, 145 insertions(+), 43 deletions(-) create mode 100755 desktop/configs/leftwm/.config/leftwm/themes/rose/down create mode 100644 desktop/configs/leftwm/.config/leftwm/themes/rose/theme.ron create mode 100755 desktop/configs/leftwm/.config/leftwm/themes/rose/up create mode 100755 desktop/configs/scripts/scripts/x-print.sh diff --git a/desktop/configs/fish/.config/fish/config.fish b/desktop/configs/fish/.config/fish/config.fish index 9515971..c1ec4f9 100644 --- a/desktop/configs/fish/.config/fish/config.fish +++ b/desktop/configs/fish/.config/fish/config.fish @@ -1,18 +1,14 @@ if status --is-login fish_add_path ~/.local/bin fish_add_path "$HOME/.cargo/bin" + source "$HOME/.cargo/env.fish" + bass source /etc/profile set -gx BAT_THEME "Solarized (light)" set -gx SOLARIZED true set -gx EDITOR "nvim" - - if test -z "$WAYLAND_DISPLAY" && test "$XDG_VTNR" -eq 1 - set -gx XDG_CURRENT_DESKTOP "sway" - WLR_NO_HARDWARE_CURSORS=1 sway - end - - bass source /etc/profile end + if status is-interactive alias cb="~/repos/cports/cbuild" alias g="git" @@ -26,7 +22,7 @@ if status is-interactive alias feh="imv" alias lg="lazygit" alias cpr="cd ~/repos/cports-docker && docker compose run --build --rm cports" - alias cop="wl-copy" + alias cop="xclip -sel clip" alias poweroff="systemctl poweroff" alias cat="bat" diff --git a/desktop/configs/leftwm/.config/leftwm/config.ron b/desktop/configs/leftwm/.config/leftwm/config.ron index 0e5ccdc..01f2d78 100644 --- a/desktop/configs/leftwm/.config/leftwm/config.ron +++ b/desktop/configs/leftwm/.config/leftwm/config.ron @@ -21,20 +21,20 @@ ], max_window_width: None, layouts: [ - MainAndVertStack, - Monocle, - MainAndHorizontalStack, - // MainAndDeck, - GridHorizontal, - EvenHorizontal, - // EvenVertical, - Fibonacci, - LeftMain, - CenterMain, - // CenterMainBalanced, - // CenterMainFluid, - // RightWiderLeftStack, - // LeftWiderRightStack, + "MainAndVertStack", + "Monocle", + "MainAndHorizontalStack", + // // MainAndDeck, + "GridHorizontal", + "EvenHorizontal", + // // EvenVertical, + "Fibonacci", + "LeftMain", + "CenterMain", + // // CenterMainBalanced, + // // CenterMainFluid, + // // RightWiderLeftStack, + // // LeftWiderRightStack, ], layout_mode: Tag, insert_behavior: Bottom, @@ -74,7 +74,7 @@ (window_class: "obs", spawn_on_tag: 5), (window_class: "krita", spawn_on_tag: 5), (window_class: "obsidian", spawn_on_tag: 3), - (window_class: "parsecd", spawn_on_tag: 5, spawn_fullscreen: true), + (window_class: "parsecd", spawn_on_tag: 5), (window_class: "Dbeaver", spawn_on_tag: 3), (window_class: "Chromium-browser", spawn_on_tag: 10), (window_class: "steam", spawn_on_tag: 8), @@ -109,7 +109,7 @@ auto_derive_workspaces: true, keybind: [ (command: Execute, value: "rofi -show drun", modifier: ["modkey", "Shift"], key: "Return"), - (command: Execute, value: "~/.local/bin/wezterm-gui", modifier: ["modkey"], key: "Return"), + (command: Execute, value: "alacritty", modifier: ["modkey"], key: "Return"), (command: CloseWindow, value: "", modifier: ["modkey", "Shift"], key: "c"), (command: SoftReload, value: "", modifier: ["modkey", "Shift"], key: "r"), (command: Execute, value: "loginctl kill-session $XDG_SESSION_ID", modifier: ["modkey", "Shift"], key: "x"), @@ -166,13 +166,14 @@ (command: ToggleFullScreen, modifier: ["modkey"], key: "f"), // apps - (command: Execute, value: "flameshot full", modifier: [], key: "Print"), - (command: Execute, value: "flameshot gui", modifier: ["Shift"], key: "Print"), - (command: Execute, value: "~/.local/bin/print-tmp.sh", modifier: ["Control", "Shift"], key: "Print"), - (command: Execute, value: "~/.local/bin/print-window.sh", modifier: ["Control"], key: "Print"), - (command: Execute, value: "flameshot screen", modifier: ["Control", "Alt"], key: "Print"), - (command: Execute, value: "firefox", modifier: ["modkey"], key: "b"), - (command: Execute, value: "steam --noverifyfiles -cef-enable-debugging", modifier: ["modkey", "Shift"], key: "s"), + (command: Execute, value: "~/scripts/x-print.sh p", modifier: [], key: "XF86Calculator"), + (command: Execute, value: "~/scripts/x-print.sh s", modifier: ["Shift"], key: "XF86Calculator"), + (command: Execute, value: "~/scripts/x-print.sh m", modifier: ["Control", "Shift"], key: "XF86Calculator"), + (command: Execute, value: "~/scripts/x-print.sh w", modifier: ["Control"], key: "XF86Calculator"), + (command: Execute, value: "~/scripts/x-print.sh t", modifier: ["modkey"], key: "XF86Calculator"), + + (command: Execute, value: "~/.local/share/AppImage/ZenBrowser.AppImage", modifier: ["modkey"], key: "b"), + (command: Execute, value: "steam", modifier: ["modkey", "Shift"], key: "s"), (command: Execute, value: "pcmanfm", modifier: ["modkey"], key: "e"), (command: Execute, value: "~/scripts/macro.sh", modifier: ["Control", "Shift"], key: "m"), (command: Execute, value: "flatpak run --env=XL_SECRET_PROVIDER=file dev.goats.xivlauncher", modifier: ["modkey", "Alt"], key: "x"), diff --git a/desktop/configs/leftwm/.config/leftwm/themes/current b/desktop/configs/leftwm/.config/leftwm/themes/current index 82a8cd8..31b7bbb 120000 --- a/desktop/configs/leftwm/.config/leftwm/themes/current +++ b/desktop/configs/leftwm/.config/leftwm/themes/current @@ -1 +1 @@ -/yang/.config/leftwm/themes/everforest \ No newline at end of file +/yang/.config/leftwm/themes/rose \ No newline at end of file diff --git a/desktop/configs/leftwm/.config/leftwm/themes/rose/down b/desktop/configs/leftwm/.config/leftwm/themes/rose/down new file mode 100755 index 0000000..3e5c36b --- /dev/null +++ b/desktop/configs/leftwm/.config/leftwm/themes/rose/down @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" + + +leftwm-command "UnloadTheme" + +pkill polybar +pkill picom diff --git a/desktop/configs/leftwm/.config/leftwm/themes/rose/theme.ron b/desktop/configs/leftwm/.config/leftwm/themes/rose/theme.ron new file mode 100644 index 0000000..c9dbcdd --- /dev/null +++ b/desktop/configs/leftwm/.config/leftwm/themes/rose/theme.ron @@ -0,0 +1,9 @@ +#![enable(implicit_some)] +( +border_width : 2, +margin : 5, +workspace_margin : 4, +default_border_color : "#242b2e", +floating_border_color : "#242b2e", +focused_border_color : "#e57474", +) diff --git a/desktop/configs/leftwm/.config/leftwm/themes/rose/up b/desktop/configs/leftwm/.config/leftwm/themes/rose/up new file mode 100755 index 0000000..772226e --- /dev/null +++ b/desktop/configs/leftwm/.config/leftwm/themes/rose/up @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +export SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" +#down the last running theme +if [ -f "/tmp/leftwm-theme-down" ]; then + /tmp/leftwm-theme-down + rm /tmp/leftwm-theme-down +fi +ln -s $SCRIPTPATH/down /tmp/leftwm-theme-down +leftwm-command "LoadTheme $SCRIPTPATH/theme.ron" + +WALLPAPER_PATH=~/pics/wallpapers +sh ~/scripts/screenlayout.sh +setxkbmap us intl ctrl:nocaps +gsettings set org.gnome.desktop.interface gtk-theme "Material-Black-Blueberry-LA" +gsettings set org.gnome.desktop.interface cursor-theme 'Simp1e' +gsettings set org.gnome.desktop.interface font-name 'Terminess Nerd Font 12' +gsettings set org.gnome.desktop.interface icon-theme "We10X-black-dark" +echo rose > ~/colorscheme +pkill nitrogen; nitrogen --restore & +bash ~/.config/polybar/launch.sh +~/.local/bin/picom-ibhagwan -b --experimental-backends & diff --git a/desktop/configs/polybar/.config/polybar/everforest.ini b/desktop/configs/polybar/.config/polybar/everforest.ini index 12d0678..08a782c 100644 --- a/desktop/configs/polybar/.config/polybar/everforest.ini +++ b/desktop/configs/polybar/.config/polybar/everforest.ini @@ -1,11 +1,11 @@ [colors] -background = #1e2326 -background-alt = -foreground = #93b259 -primary = #a7c080 -secondary = #93b259 -alert = #394522 -disabled = #d3c6aa +background = #141b1e +background-alt = #242b2e +foreground = #e57474 +primary = #e57474 +secondary = #c96666 +alert = #c57fd6 +disabled = #b3b9b8 [bar/bar0] width = 100% @@ -27,10 +27,10 @@ padding-right = 2 module-margin = 1 -font-0 = CartographCF Nerd Font;2 +font-0 = Terminess Nerd Font;2 font-1 = SauceCodePro Nerd Font:size=16;3 -modules-left = xworkspaces spotify-title spotify-prev spotify-playpause spotify-next +modules-left = xworkspaces modules-right = tray xwindow pulseaudio modules-center = date @@ -81,6 +81,7 @@ format-volume-prefix-foreground = ${colors.primary} format-volume = label-volume = %percentage%% +click-right = pavucontrol label-muted = muted label-muted-foreground = ${colors.disabled} diff --git a/desktop/configs/scripts/scripts/screenlayout.sh b/desktop/configs/scripts/scripts/screenlayout.sh index ce6408c..044935e 100755 --- a/desktop/configs/scripts/scripts/screenlayout.sh +++ b/desktop/configs/scripts/scripts/screenlayout.sh @@ -1,2 +1,2 @@ #!/bin/sh -xrandr --output DisplayPort-0 --off --output DisplayPort-1 --mode 1920x1080 --pos 2560x1080 --rotate normal --output DisplayPort-2 --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-A-0 --primary --mode 2560x1080 --pos 0x1080 --rotate normal +xrandr --output DisplayPort-0 --off --output DisplayPort-2 --mode 2560x1080 --pos 2560x0 --rotate normal --output HDMI-A-0 --mode 2560x1080 --pos 0x0 --rotate normal --primary diff --git a/desktop/configs/scripts/scripts/x-print.sh b/desktop/configs/scripts/scripts/x-print.sh new file mode 100755 index 0000000..56b0f9f --- /dev/null +++ b/desktop/configs/scripts/scripts/x-print.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env sh + +save_dir="$HOME/pics/screenshots" +save_file="screenshot-$(date -Iseconds | cut -d '+' -f1).png" +temp_screenshot="/tmp/screenshot.png" + +mkdir -p "$save_dir" + +upload() { + curl -F'file=@'"${temp_screenshot}" \ + -Fsecret= \ + -H "X-Auth: $(cat ~/.key)" \ + https://paste.jabuxas.xyz | xclip -selection clipboard +} + +print_error() { +cat << "EOF" + ./x-print.sh + ...valid actions are... + p : print all screens + s : snip current screen + m : print focused monitor + t : tmp print + w : current window +EOF +} + +case $1 in + p) # print all screens + maim "$temp_screenshot" && \ + xclip -selection clipboard -t image/png < "$temp_screenshot" + ;; + + s) # select area to screenshot + maim -s "$temp_screenshot" && \ + xclip -selection clipboard -t image/png < "$temp_screenshot" + ;; + + m) # screenshot focused monitor + focused_monitor=$(xrandr --query | grep " connected primary" | cut -d" " -f1) + maim -g "$(xrandr --query | grep "$focused_monitor" | grep -oP '\d+x\d+\+\d+\+\d+')" "$temp_screenshot" && \ + xclip -selection clipboard -t image/png < "$temp_screenshot" + ;; + + t) # upload to paste + maim -s "$temp_screenshot" && \ + xclip -selection clipboard -t image/png < "$temp_screenshot" && \ + upload + ;; + + w) # current window + active_window=$(xdotool getactivewindow) + maim -i "$active_window" "$temp_screenshot" && \ + xclip -selection clipboard -t image/png < "$temp_screenshot" + ;; + + *) # invalid option + print_error + exit 1 + ;; +esac + +# Save and cleanup +cp "$temp_screenshot" "${save_dir}/${save_file}" +rm "$temp_screenshot" diff --git a/desktop/configs/shell-files/.xinitrc b/desktop/configs/shell-files/.xinitrc index 2b884a7..415d207 100755 --- a/desktop/configs/shell-files/.xinitrc +++ b/desktop/configs/shell-files/.xinitrc @@ -45,7 +45,7 @@ fi if [ -n "$failsafe" ]; then export GTK_THEME="Everforest-Dark-BL" export XDG_SESSION_TYPE="x11" - exec dbus-launch --exit-with-session leftwm > ~/leftwm.log + exec leftwm > ~/leftwm.log else exec $command fi