Compare commits

..

No commits in common. "8877db9b16b2f2abbe10efaaa15b25da711abeaf" and "9cdbd728c2385c7f20443e6c3c4ef61c2b3ca514" have entirely different histories.

12 changed files with 56 additions and 78 deletions

View File

@ -10,20 +10,24 @@ alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
alias sizes='du -hs .[^.]* * | sort -h' alias sizes='du -hs .[^.]* * | sort -h'
# bash tree alias # bash tree alias
alias gittree="git log --all --decorate --oneline --graph" alias gittree="git log --all --decorate --oneline --graph"
# turn screen off
alias lock="slock & sleep 1; xset dpms force off"
alias screenoff="sleep 2; xset dpms force off"
# sleep
alias suspend="slock & sleep 5 ; systemctl suspend"
# screen brightness script # screen brightness script
alias brightness="$HOME/.config/scripts/wm/brightness.sh" alias brightness="$HOME/.config/scripts/wm/brightness.sh"
alias linkmic='link-virtual-mic -a'
alias unlinkmic='link-virtual-mic -d'
alias sbSetfile='file=$(fzf)'
alias sbPlay='mpv "$file" --volume=70 --audio-device=pipewire/loopback &> /dev/null'
alias sbLoop='while true; do sbPlay; sleep 0.5; done'
alias sbSpam='c=5; while [[ $c -gt 0 ]]; do sbPlay & sleep 0.15; echo $c; c=$((c-1)); done'
# #
# TUI # TUI
# #
# run pulsemixer # run pulsemixer
alias mixer="pulsemixer" alias mixer="pulsemixer"
#
# GUI
#
# tmux '-2' colors
alias tmux="tmux -2"

View File

@ -1,6 +1,7 @@
# #
# ~/.bash_profile # ~/.bash_profile
# #
[[ -f ~/.bashrc ]] && . ~/.bashrc [[ -f ~/.bashrc ]] && . ~/.bashrc
# custom scripts and programs # custom scripts and programs
@ -22,8 +23,6 @@ export XMODIFIERS="@im=fcitx"
export QT_IM_MODULE=fcitx export QT_IM_MODULE=fcitx
export GTK_IM_MODULE=fcitx export GTK_IM_MODULE=fcitx
#export GTK_USE_PORTAL=1
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
if [[ ! -z "$IS_LAPTOP" ]]; then if [[ ! -z "$IS_LAPTOP" ]]; then
WLR_DRM_DEVICES=/dev/dri/card1:/dev/dri/card0 sway WLR_DRM_DEVICES=/dev/dri/card1:/dev/dri/card0 sway

18
.bashrc
View File

@ -23,7 +23,10 @@ export TERMINAL=alacritty
export WDIR_PATH="/tmp/$(id -u).wdir" export WDIR_PATH="/tmp/$(id -u).wdir"
# include bash aliases # include bash aliases
[ -f ~/.bash_aliases ] && source ~/.bash_aliases if [ -f ~/.bash_aliases ]
then
source ~/.bash_aliases
fi
# source custom functions. # source custom functions.
for f in ~/.config/scripts/functions/*; do source "$f"; done for f in ~/.config/scripts/functions/*; do source "$f"; done
@ -34,16 +37,3 @@ then
echo "Working directory from $WDIR_PATH" echo "Working directory from $WDIR_PATH"
cd "$wdir" cd "$wdir"
fi fi
# NNN configuration
export NNN_FIFO=/tmp/nnn.fifo
export NNN_PLUG='p:preview-tui'
# fzf
export FZF_DEFAULT_OPTS="--height 40% --layout=reverse"
export FZF_DEFAULT_COMMAND='find'
# source fzf bash completions
[ -f /usr/share/bash-completion/completions/fzf ] &&
source /usr/share/bash-completion/completions/fzf
[ -f /usr/share/fzf/key-bindings.bash ] &&
source /usr/share/fzf/key-bindings.bash

View File

@ -31,10 +31,3 @@ font:
window: window:
title: Terminal title: Terminal
padding:
x: 1
y: 1
dynamic_padding: true

View File

@ -0,0 +1 @@
../sway/set-correct-monitor

View File

@ -1 +0,0 @@
../sway/set-primary-monitor

View File

@ -0,0 +1 @@
../sway/wayland-run-on-new-display/wayland-run-on-new-display

View File

@ -2,7 +2,7 @@
# Times the screen off and puts it to background # Times the screen off and puts it to background
swayidle \ swayidle \
timeout 1 'swaymsg "output * dpms off"' \ timeout 1 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"; set-primary-monitor' & resume 'swaymsg "output * dpms on"' &
# Locks the screen immediately # Locks the screen immediately
swaylock -c 000000 swaylock -c 000000
# Kills last background task so idle timer doesn't keep running # Kills last background task so idle timer doesn't keep running

View File

@ -0,0 +1,8 @@
#!/bin/sh
display=$(xrandr --listactivemonitors | grep "$1" | head -n1 | cut -d' ' -f6)
if [ -n "$display" ]; then
xrandr --output $display --primary
fi

View File

@ -1,9 +0,0 @@
#!/bin/sh
# Get monitor offset using xrandr
monitor_offset="1920+0"
display=$(xrandr --listactivemonitors | grep "$monitor_offset" | head -n1 | cut -d' ' -f6)
if [ -n "$display" ]; then
xrandr --output $display --primary
fi

View File

@ -5,8 +5,8 @@
# Read `man 5 sway` for a complete reference. # Read `man 5 sway` for a complete reference.
# Environment # Environment
exec --no-startup-id dbus-update-activation-environment --all #exec --no-startup-id dbus-update-activation-environment --all
#exec --no-startup-id dbus-update-activation-environment DISPLAY SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec --no-startup-id dbus-update-activation-environment DISPLAY SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec /usr/libexec/polkit-gnome-authentication-agent-1 exec /usr/libexec/polkit-gnome-authentication-agent-1
exec_always ~/.config/scripts/sway/import-gsettings exec_always ~/.config/scripts/sway/import-gsettings
@ -25,8 +25,8 @@ set $down j
set $up k set $up k
set $right l set $right l
# Your preferred terminal emulator # Your preferred terminal emulator
set $term alacritty #set $term alacritty
#set $term kitty set $term kitty
# Your preferred application launcher # Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened # Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on. # on the original workspace that the command was run on.
@ -68,8 +68,8 @@ output * bg /home/sheldonmlee/wallpaper/wallpaper fill
# #
exec swayidle -w \ exec swayidle -w \
timeout 300 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"; set-primary-monitor' \ timeout 300 'swaylock -f -c 000000' \
timeout 310 'swaylock -f -c 000000' \ timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock -f -c 000000' before-sleep 'swaylock -f -c 000000'
# This will lock your screen after 300 seconds of inactivity, then turn off # This will lock your screen after 300 seconds of inactivity, then turn off
@ -264,7 +264,6 @@ exec swayidle -w \
# #
# Resizing containers: # Resizing containers:
# #
set $def_mode mode "default"
mode "resize" { mode "resize" {
# left will shrink the containers width # left will shrink the containers width
# right will grow the containers width # right will grow the containers width
@ -282,23 +281,15 @@ mode "resize" {
bindsym Right resize grow width 200px bindsym Right resize grow width 200px
# Return to default mode # Return to default mode
bindsym Return $def_mode bindsym Return mode "default"
bindsym Escape $def_mode bindsym Escape mode "default"
} }
bindsym $mod+Shift+Return mode "resize" bindsym $mod+Shift+Return mode "resize"
mode "gaming" { mode "gaming" {
bindsym $mod+g $def_mode bindsym $mod+g mode "default"
} }
bindsym $mod+g mode "gaming" bindsym $mod+g mode "gaming"
mode "mode" {
bindsym s sticky toggle; mode "default"
bindsym Return $def_mode
bindsym Escape $def_mode
}
bindsym $mod+e mode "mode"
# #
# Status ar: # Status ar:
# #
@ -347,40 +338,37 @@ bindsym $mod+Shift+f gaps horizontal current toggle 400
smart_gaps inverse_outer smart_gaps inverse_outer
#gaps inner 2 gaps inner 2
default_border pixel 3 default_border pixel 3
#smart_borders on smart_borders on
# #
# Startup programs: # Startup programs:
# #
exec gentoo-pipewire-launcher restart exec wayland-run-on-new-display set-correct-monitor 1920+0
exec gentoo-pipewire-launcher restart &> $HOME/.config/pipewire/pipewire.log
exec dunst exec dunst
exec wlsunset -l 55.0 -L -1.6 exec wlsunset -l 55.0 -L -1.6
exec $term exec alacritty
exec swaymsg "workspace 2:r; exec thunderbird" exec firefox
exec swaymsg "workspace 2:r; exec firefox"
exec discord-ff exec discord-ff
exec element-desktop
exec signal-desktop exec signal-desktop
exec swaymsg "workspace 1:a"
# #
# Application rules: # Application rules:
# #
# Xwayland applications tend to use 'class=<class>', whereas wayland applications use 'appid=<appid>' # Xwayland applications tend to use 'class=<class>', whereas wayland applications use 'appid=<appid>'
#assign [app_id="firefox"] workspace 2:r assign [app_id="firefox"] workspace 2:r
#assign [class="firefox"] workspace 2:r assign [class="firefox"] workspace 2:r
assign [app_id="Discord Firefox"] workspace 3:s assign [app_id="Discord Firefox"] workspace 3:s
for_window [title="^Discord — Mozilla Firefox$"] fullscreen disable for_window [title="^Discord — Mozilla Firefox$"] fullscreen disable
assign [class="WebCord"] workspace 3:s assign [class="WebCord"] workspace 3:s
assign [class="Signal"] workspace 3:s assign [class="Signal"] workspace 3:s
assign [class="Element"] workspace 3:s
for_window [title="^WhatsApp — Mozilla Firefox$"] move container to workspace 3:s; for_window [title="^WhatsApp — Mozilla Firefox$"] move container to workspace 3:s;
assign [class="steam"] workspace 4:t assign [class="Steam"] workspace 4:t
assign [class="steamwebhelper"] workspace 4:t
# Inhibit idle if fullscreen # Inhibit idle if fullscreen
for_window [app_id="^.*"] inhibit_idle fullscreen for_window [app_id="^.*"] inhibit_idle fullscreen
for_window [class="^.*"] inhibit_idle fullscreen for_window [class="^.*"] inhibit_idle fullscreen
@ -389,9 +377,9 @@ for_window [class="WebCord"] inhibit_idle focus
for_window [app_id="org.jellyfin.jellyfinmediaplayer"] inhibit_idle focus for_window [app_id="org.jellyfin.jellyfinmediaplayer"] inhibit_idle focus
# Floating windows # Floating windows
for_window [title="^Firefox — Sharing Indicator$"] floating enable, move position 50ppt 0px, move container to workspace trash; for_window [title="^Firefox — Sharing Indicator$"] floating enable, move position 50ppt 0px, move container to workspace trash;
for_window [app_id="firefox" title="^Picture-in-Picture$"] floating enable, sticky enable for_window [class="^Steam$"] floating enable
for_window [class="^steam$"] floating enable for_window [class="^steamwebhelper$"] floating enable
for_window [class="^steam$" title="^Steam$"] floating disable for_window [class="^Steam$" title="^Steam$"] floating disable
for_window [class="genshinimact.exe"] floating enable for_window [class="genshinimact.exe"] floating enable
for_window [class=".*.exe$"] floating enable for_window [class=".*.exe$"] floating enable
for_window [class="^QjackCtl$"] floating enable for_window [class="^QjackCtl$"] floating enable
@ -402,6 +390,4 @@ for_window [app_id="^io.crow_translate.CrowTranslate$"] floating enable
for_window [title="^Origin$"] floating enable, move container to workspace trash; for_window [title="^Origin$"] floating enable, move container to workspace trash;
for_window [title="^Wine System Tray$"] move container to workspace trash; for_window [title="^Wine System Tray$"] move container to workspace trash;
for_window [app_id="^com.example.MyApplication$"] floating enable
include /etc/sway/config.d/* include /etc/sway/config.d/*

6
.config/sway/monitor Normal file
View File

@ -0,0 +1,6 @@
set $mon1 DP-2
set $mon2 HDMI-A-3
set $mon3 HDMI-A-2
output $mon1 pos 1920 0 adaptive_sync on
output $mon2 pos 0 0