aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alacritty/alacritty.yml4
-rw-r--r--bash/.profile6
-rwxr-xr-xbspwm/bspwmrc35
-rw-r--r--bspwm/sxhkdrc54
-rw-r--r--bspwm/terminal.py46
-rwxr-xr-xbspwm/terminal.sh16
-rw-r--r--i3/config83
-rwxr-xr-xi3/load_resources.sh7
-rwxr-xr-xi3/set_wallpaper.sh4
-rw-r--r--i3/terminal.py54
-rwxr-xr-xinstall.sh57
-rwxr-xr-xpolybar/launch.sh2
-rw-r--r--sway/config86
-rwxr-xr-xsway/load_resources.sh6
-rw-r--r--sway/terminal.py54
-rwxr-xr-xxorg/.xsession13
-rwxr-xr-xxorg/load_resources.sh7
-rwxr-xr-xxorg/set_wallpaper.sh4
18 files changed, 476 insertions, 62 deletions
diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml
index 774fa4d..6c08e4a 100644
--- a/alacritty/alacritty.yml
+++ b/alacritty/alacritty.yml
@@ -88,7 +88,7 @@ font:
#style: Italic
# Point size
- size: 11.0
+ size: 12
# Offset is the extra space around each character. `offset.y` can be thought of
# as modifying the line spacing, and `offset.x` as modifying the letter spacing.
@@ -107,7 +107,7 @@ font:
# screens and make reading text a little easier.
# On X11 it is possible to change the DPI for each instance of alacritty by using
# `WINIT_HIDPI_FACTOR=1.0 alacritty` to scale the font.
- scale_with_dpi: true
+ #scale_with_dpi: true
# If `true`, bold text is drawn using the bright color variants.
diff --git a/bash/.profile b/bash/.profile
index 046794e..a34726e 100644
--- a/bash/.profile
+++ b/bash/.profile
@@ -2,7 +2,11 @@ export PATH=~/python/bin:~/programs:~/programs/chicken/bin:~/.gem/ruby/2.7.0/bin
export CHICKEN_REPOSITORY=~/programs/chicken_repository
export ATOM_NODE_URL=http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist
export QT_QPA_PLATFORMTHEME=qt5ct
+export VISUAL=nvim
+#export WLR_DRM_NO_MODIFIERS=1
+#export QT_QPA_PLATFORM=wayland
+#export SDL_VIDEODRIVER=wayland
+#export GDK_BACKEND=wayland
#export QT_AUTO_SCREEN_SCALE_FACTOR=1
#export QT_ENABLE_HIGHDPI_SCALING=1
#export QT_WAYLAND_FORCE_DPI=120
-export VISUAL=nvim
diff --git a/bspwm/bspwmrc b/bspwm/bspwmrc
index 26c534c..f6d3a99 100755
--- a/bspwm/bspwmrc
+++ b/bspwm/bspwmrc
@@ -1,30 +1,19 @@
-#!/bin/bash
+#!/bin/sh
-sxhkd -c ~/.config/sxhkd/sxhkdrc.bspwm &
+sxhkd -c ~/.config/bspwm/sxhkdrc &
~/.config/polybar/launch.sh &
bspc monitor primary -d 1 2 3 4 term
-
-python <<EOF
-import subprocess
-import sys
-p = subprocess.run(['xrandr', '--listactivemonitors'],
- capture_output=True, check=True)
-count = int(p.stdout.decode('utf-8').split('\n')[0].split(':')[1])
-if count < 2:
- sys.exit(1)
-EOF
-[ $? -eq 0 ] && bspc monitor primary#next -d a s d f
-
-bspc config border_width 4
-bspc config window_gap 5
-
-bspc config focus_follows_pointer true
-bspc config pointer_follows_monitor true
-
-bspc config split_ratio 0.52
-bspc config borderless_monocle true
-bspc config gapless_monocle true
+[ $(xrandr --listactivemonitors | wc -l) -gt 2 ] && \
+ bspc monitor primary#next -d a s d f
+
+bspc config border_width 4
+bspc config window_gap 0
+bspc config focus_follows_pointer true
+bspc config pointer_follows_monitor true
+bspc config split_ratio 0.52
+bspc config borderless_monocle true
+bspc config gapless_monocle true
bspc rule -a *:tmux_term desktop=term
diff --git a/bspwm/sxhkdrc b/bspwm/sxhkdrc
new file mode 100644
index 0000000..3837ab3
--- /dev/null
+++ b/bspwm/sxhkdrc
@@ -0,0 +1,54 @@
+F12
+ ~/.config/bspwm/terminal.sh
+
+mod4 + Return
+ alacritty
+mod4 + space
+ rofi -show drun
+#mod4 + backslash
+# i3-msg "split h"
+#mod4 + minus
+# i3-msg "split v"
+#mod4 + Tab
+# i3-msg "layout toggle split"
+#mod4 + p
+# i3-msg "focus parent"
+#mod4 + r
+# i3-msg "mode resize"
+
+
+mod4 + {1, 2, 3, 4, a, s, d, f}
+ bspc desktop -f {1, 2, 3, 4, a, s, d, f}
+
+mod4 + shift + {1, 2, 3, 4, a, s, d, f}
+ bspc node -d {1, 2, 3, 4, a, s, d, f}
+
+
+mod4 + shift + r
+ bspc wm -r
+mod4 + shift + e
+ bspc quit
+mod4 + shift + q
+ bspc node -c
+mod4 + shift + space
+ bspc node -t ~floating
+mod4 + shift + Return
+ bspc node -t ~fullscreen
+
+mod4 + {h, Left}
+ bspc node -f west
+mod4 + {j, Down}
+ bspc node -f south
+mod4 + {k, Up}
+ bspc node -f north
+mod4 + {l, Right}
+ bspc node -f east
+
+mod4 + shift + {h, Left}
+ bspc node -s west
+mod4 + shift + {j, Down}
+ bspc node -s west
+mod4 + shift + {k, Up}
+ bspc node -s west
+mod4 + shift + {l, Right}
+ bspc node -s west
diff --git a/bspwm/terminal.py b/bspwm/terminal.py
new file mode 100644
index 0000000..eee7875
--- /dev/null
+++ b/bspwm/terminal.py
@@ -0,0 +1,46 @@
+import subprocess
+
+
+desktop_name = 'term'
+instance_name = 'tmux_term'
+
+
+def is_term_running():
+ p = subprocess.run(['xdo', 'id', '-n', instance_name])
+ return p.returncode == 0
+
+
+def run_term():
+ subprocess.Popen(['alacritty', '--class', instance_name,
+ '-e', 'tmux', 'new-session', '-A', '-s', 'default'])
+
+
+def get_focused_desktop():
+ p = subprocess.run(['bspc', 'query', '-D', '--names', '-d', 'focused'],
+ capture_output=True,
+ check=True)
+ return p.stdout.decode('utf-8').strip()
+
+
+def hide_term():
+ subprocess.run(['bspc', 'desktop', '-f', 'last.local'], check=True)
+
+
+def show_term():
+ subprocess.run(['bspc', 'desktop', 'term', '-m', 'focused'])
+ subprocess.run(['bspc', 'desktop', '-f', 'term'], check=True)
+
+
+def main():
+ if not is_term_running():
+ run_term()
+
+ focused_desktop = get_focused_desktop()
+ if focused_desktop == desktop_name:
+ hide_term()
+ else:
+ show_term()
+
+
+if __name__ == '__main__':
+ main()
diff --git a/bspwm/terminal.sh b/bspwm/terminal.sh
new file mode 100755
index 0000000..8cd5418
--- /dev/null
+++ b/bspwm/terminal.sh
@@ -0,0 +1,16 @@
+
+
+DESKTOP=term
+INSTANCE=tmux_term
+
+(xdo id -n $INSTANCE > /dev/null) || \
+ alacritty --class $INSTANCE -e \
+ tmux new-session -A -s default
+
+if [ $(bspc query -D --names -d focused) = $DESKTOP ]; then
+ echo "sakrit"
+ bspc desktop -f last.local
+else
+ bspc desktop $DESKTOP -m focused
+ bspc desktop -f $DESKTOP
+fi
diff --git a/i3/config b/i3/config
new file mode 100644
index 0000000..8e14ae2
--- /dev/null
+++ b/i3/config
@@ -0,0 +1,83 @@
+
+set $ws1 "1:1"
+set $ws2 "2:2"
+set $ws3 "3:3"
+set $ws4 "4:4"
+set $ws5 "5:a"
+set $ws6 "6:s"
+set $ws7 "7:d"
+set $ws8 "8:f"
+set $ws9 "9:term"
+workspace $ws1 output primary
+workspace $ws2 output primary
+workspace $ws3 output primary
+workspace $ws4 output primary
+workspace $ws5 output DP1-3
+workspace $ws6 output DP1-3
+workspace $ws7 output DP1-3
+workspace $ws8 output DP1-3
+
+set $mod Mod4
+font pango:Inter Medium 12
+floating_modifier $mod
+default_border pixel 4
+
+bindsym $mod+Return exec alacritty
+bindsym $mod+space exec rofi -run dmenu
+bindsym $mod+Tab layout toggle
+
+bindsym $mod+Shift+q kill
+bindsym $mod+Shift+r restart
+bindsym $mod+Shift+e exit
+bindsym $mod+Shift+space floating toggle
+bindsym $mod+Shift+Return fullscreen toggle
+
+bindsym $mod+h focus left
+bindsym $mod+j focus down
+bindsym $mod+k focus up
+bindsym $mod+l focus right
+bindsym $mod+Left focus left
+bindsym $mod+Down focus down
+bindsym $mod+Up focus up
+bindsym $mod+Right focus right
+
+bindsym $mod+Shift+h move left
+bindsym $mod+Shift+j move down
+bindsym $mod+Shift+k move up
+bindsym $mod+Shift+l move right
+bindsym $mod+Shift+Left move left
+bindsym $mod+Shift+Down move down
+bindsym $mod+Shift+Up move up
+bindsym $mod+Shift+Right move right
+
+bindsym $mod+1 workspace number $ws1
+bindsym $mod+2 workspace number $ws2
+bindsym $mod+3 workspace number $ws3
+bindsym $mod+4 workspace number $ws4
+bindsym $mod+a workspace number $ws5
+bindsym $mod+s workspace number $ws6
+bindsym $mod+d workspace number $ws7
+bindsym $mod+f workspace number $ws8
+
+bindsym $mod+Shift+1 move container to workspace number $ws1
+bindsym $mod+Shift+2 move container to workspace number $ws2
+bindsym $mod+Shift+3 move container to workspace number $ws3
+bindsym $mod+Shift+4 move container to workspace number $ws4
+bindsym $mod+Shift+a move container to workspace number $ws5
+bindsym $mod+Shift+s move container to workspace number $ws6
+bindsym $mod+Shift+d move container to workspace number $ws7
+bindsym $mod+Shift+f move container to workspace number $ws8
+
+bindsym F12 exec python ~/.config/i3/terminal.py
+assign [instance="^tmux_term$"] $ws9
+
+bar {
+ status_command i3status
+ position top
+ strip_workspace_numbers yes
+ tray_output primary
+}
+
+exec ~/.config/i3/load_resources.sh
+exec ~/.config/i3/set_wallpaper.sh
+
diff --git a/i3/load_resources.sh b/i3/load_resources.sh
new file mode 100755
index 0000000..59f8ee2
--- /dev/null
+++ b/i3/load_resources.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+xrdb -load ~/.Xresources
+(xrandr | grep -q "connected 3840x2160") && \
+ xrandr --dpi 120 && \
+ echo "Xft.dpi: 120" | xrdb -override
+
diff --git a/i3/set_wallpaper.sh b/i3/set_wallpaper.sh
new file mode 100755
index 0000000..af7d126
--- /dev/null
+++ b/i3/set_wallpaper.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+feh --bg-scale ~/.pictures/bg1.jpg \
+ ~/.pictures/bg2.jpg
diff --git a/i3/terminal.py b/i3/terminal.py
new file mode 100644
index 0000000..3993dcd
--- /dev/null
+++ b/i3/terminal.py
@@ -0,0 +1,54 @@
+import subprocess
+
+workspace_name = '9:term'
+instance_name = 'tmux_term'
+
+
+def is_term_running():
+ p = subprocess.run(['swaymsg', '-t', 'get_tree'],
+ capture_output=True,
+ check=True)
+ return f'"app_id": "{instance_name}"' in p.stdout.decode('utf-8')
+
+
+def run_term():
+ subprocess.Popen(['alacritty', '--class', instance_name,
+ '-e', 'tmux', 'new-session', '-A', '-s', 'default'])
+
+
+def get_focused(name):
+ p = subprocess.run(['swaymsg', '-p', '-t', f'get_{name}'],
+ capture_output=True,
+ check=True)
+ for line in p.stdout.decode('utf-8').strip().split('\n'):
+ if not line or line[0] == ' ':
+ continue
+ segments = line.split(' ')
+ if segments[-1] == '(focused)':
+ return segments[1]
+
+
+def hide_term():
+ subprocess.run(['swaymsg', 'workspace', 'back_and_forth'], check=True)
+
+
+def show_term():
+ output = get_focused('outputs')
+ subprocess.run(['swaymsg', 'workspace', workspace_name], check=True)
+ subprocess.run(['swaymsg', 'move', 'workspace', 'to', output], check=True)
+ subprocess.run(['swaymsg', 'workspace', workspace_name], check=True)
+
+
+def main():
+ if not is_term_running():
+ run_term()
+
+ focused_workspace = get_focused('workspaces')
+ if focused_workspace == workspace_name:
+ hide_term()
+ else:
+ show_term()
+
+
+if __name__ == '__main__':
+ main()
diff --git a/install.sh b/install.sh
index 20eaab5..8ce7320 100755
--- a/install.sh
+++ b/install.sh
@@ -1,57 +1,59 @@
#!/usr/bin/env bash
set -e
-
-DOTFILES=$(realpath $(dirname ${BASH_SOURCE[0]}))
+ln -sf -T $(realpath $(dirname ${BASH_SOURCE[0]})) ~/.dotfiles
# alacritty
-ln -sf -T $DOTFILES/alacritty ~/.config/alacritty
+ln -sf -T ~/.dotfiles/alacritty ~/.config/alacritty
# atom
mkdir -p ~/.atom
-ln -sf $DOTFILES/atom/config.cson ~/.atom/config.cson
-ln -sf $DOTFILES/atom/init.coffee ~/.atom/init.coffee
-ln -sf $DOTFILES/atom/keymap.cson ~/.atom/keymap.cson
-ln -sf $DOTFILES/atom/styles.less ~/.atom/styles.less
+ln -sf ~/.dotfiles/atom/config.cson ~/.atom/config.cson
+ln -sf ~/.dotfiles/atom/init.coffee ~/.atom/init.coffee
+ln -sf ~/.dotfiles/atom/keymap.cson ~/.atom/keymap.cson
+ln -sf ~/.dotfiles/atom/styles.less ~/.atom/styles.less
# bash
-ln -sf $DOTFILES/bash/.profile ~/.profile
-ln -sf $DOTFILES/bash/.bashrc ~/.bashrc
+ln -sf ~/.dotfiles/bash/.profile ~/.profile
+ln -sf ~/.dotfiles/bash/.bashrc ~/.bashrc
ln -sf ~/.profile ~/.bash_profile
# bspwm
-ln -sf -T $DOTFILES/bspwm ~/.config/bspwm
+ln -sf -T ~/.dotfiles/bspwm ~/.config/bspwm
# fish
-ln -sf -T $DOTFILES/fish ~/.config/fish
+ln -sf -T ~/.dotfiles/fish ~/.config/fish
# git
-ln -sf $DOTFILES/git/.gitconfig ~/.gitconfig
+ln -sf ~/.dotfiles/git/.gitconfig ~/.gitconfig
+
+# i3
+ln -sf -T ~/.dotfiles/i3 ~/.config/i3
# mbsync (isync)
mkdir -p ~/mail/ket
-ln -sf $DOTFILES/mbsync/.mbsyncrc ~/.mbsyncrc
+ln -sf ~/.dotfiles/mbsync/.mbsyncrc ~/.mbsyncrc
# neomutt
-ln -sf -T $DOTFILES/neomutt ~/.config/neomutt
+ln -sf -T ~/.dotfiles/neomutt ~/.config/neomutt
# pictures
-ln -sf -T $DOTFILES/pictures ~/.pictures
+ln -sf -T ~/.dotfiles/pictures ~/.pictures
# polybar
-ln -sf -T $DOTFILES/polybar ~/.config/polybar
+ln -sf -T ~/.dotfiles/polybar ~/.config/polybar
# qutebrowser
mkdir -p ~/.config/qutebrowser
-ln -sf $DOTFILES/qutebrowser/autoconfig.yml ~/.config/qutebrowser/autoconfig.yml
+ln -sf ~/.dotfiles/qutebrowser/autoconfig.yml ~/.config/qutebrowser/autoconfig.yml
# ranger
mkdir -p ~/.config/ranger
-ln -sf $DOTFILES/ranger/rc.conf ~/.config/ranger/rc.conf
+ln -sf ~/.dotfiles/ranger/rc.conf ~/.config/ranger/rc.conf
# sublime
mkdir -p ~/.config/sublime-text-3/Packages/User
-ln -sf "$DOTFILES/subl3/Package Control.sublime-settings" \
+ln -sf "~/.dotfiles/subl3/Package Control.sublime-settings" \
~/.config/sublime-text-3/Packages/User/"Package Control.sublime-settings"
for i in Adaptive.sublime-theme \
Preferences.sublime-settings \
@@ -59,23 +61,26 @@ for i in Adaptive.sublime-theme \
PythonImproves.sublime-settings \
SublimeLinter.sublime-settings
do
- ln -sf $DOTFILES/subl3/$i ~/.config/sublime-text-3/Packages/User/$i
+ ln -sf ~/.dotfiles/subl3/$i ~/.config/sublime-text-3/Packages/User/$i
done
+# sway
+ln -sf -T ~/.dotfiles/sway ~/.config/sway
+
# sxhkd
-ln -sf -T $DOTFILES/sxhkd ~/.config/sxhkd
+ln -sf -T ~/.dotfiles/sxhkd ~/.config/sxhkd
# tmux
-ln -sf $DOTFILES/tmux/.tmux.conf ~/.tmux.conf
+ln -sf ~/.dotfiles/tmux/.tmux.conf ~/.tmux.conf
# vim / nvim
mkdir -p ~/.vim/autoload
mkdir -p ~/.config
-ln -sf $DOTFILES/vim/.vimrc ~/.vimrc
-ln -sf $DOTFILES/vim/plug.vim ~/.vim/autoload/plug.vim
+ln -sf ~/.dotfiles/vim/.vimrc ~/.vimrc
+ln -sf ~/.dotfiles/vim/plug.vim ~/.vim/autoload/plug.vim
ln -sf ~/.vimrc ~/.vim/init.vim
ln -sf ~/.vim ~/.config/nvim
# xorg
-ln -sf $DOTFILES/xorg/.xsession ~/.xsession
-ln -sf $DOTFILES/xorg/.Xresources ~/.Xresources
+ln -sf ~/.dotfiles/xorg/.xsession ~/.xsession
+ln -sf ~/.dotfiles/xorg/.Xresources ~/.Xresources
diff --git a/polybar/launch.sh b/polybar/launch.sh
index 14c2eee..bfac059 100755
--- a/polybar/launch.sh
+++ b/polybar/launch.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
killall -q polybar
polybar -q bar1 &
diff --git a/sway/config b/sway/config
new file mode 100644
index 0000000..a042ab3
--- /dev/null
+++ b/sway/config
@@ -0,0 +1,86 @@
+set $primary eDP-1
+set $secondary DP-5
+output $primary pos 0 0 res 1920x1080 bg ~/.pictures/bg1.jpg stretch
+output $secondary pos 1920 0 res 3840x2160 bg ~/.pictures/bg2.jpg stretch
+
+set $ws1 "1:1"
+set $ws2 "2:2"
+set $ws3 "3:3"
+set $ws4 "4:4"
+set $ws5 "5:a"
+set $ws6 "6:s"
+set $ws7 "7:d"
+set $ws8 "8:f"
+set $ws9 "9:term"
+workspace $ws1 output $primary
+workspace $ws2 output $primary
+workspace $ws3 output $primary
+workspace $ws4 output $primary
+workspace $ws5 output $secondary
+workspace $ws6 output $secondary
+workspace $ws7 output $secondary
+workspace $ws8 output $secondary
+
+set $mod Mod4
+font pango:Inter Medium 12
+floating_modifier $mod
+default_border pixel 4
+#xwayland disable
+
+bindsym $mod+Return exec alacritty
+bindsym $mod+space exec wofi --show drun --allow-images --allow-markup --gtk-dark
+bindsym $mod+Tab layout toggle
+
+bindsym $mod+Shift+q kill
+bindsym $mod+Shift+r restart
+bindsym $mod+Shift+e exit
+bindsym $mod+Shift+space floating toggle
+bindsym $mod+Shift+Return fullscreen toggle
+
+bindsym $mod+h focus left
+bindsym $mod+j focus down
+bindsym $mod+k focus up
+bindsym $mod+l focus right
+bindsym $mod+Left focus left
+bindsym $mod+Down focus down
+bindsym $mod+Up focus up
+bindsym $mod+Right focus right
+
+bindsym $mod+Shift+h move left
+bindsym $mod+Shift+j move down
+bindsym $mod+Shift+k move up
+bindsym $mod+Shift+l move right
+bindsym $mod+Shift+Left move left
+bindsym $mod+Shift+Down move down
+bindsym $mod+Shift+Up move up
+bindsym $mod+Shift+Right move right
+
+bindsym $mod+1 workspace number $ws1
+bindsym $mod+2 workspace number $ws2
+bindsym $mod+3 workspace number $ws3
+bindsym $mod+4 workspace number $ws4
+bindsym $mod+a workspace number $ws5
+bindsym $mod+s workspace number $ws6
+bindsym $mod+d workspace number $ws7
+bindsym $mod+f workspace number $ws8
+
+bindsym $mod+Shift+1 move container to workspace number $ws1
+bindsym $mod+Shift+2 move container to workspace number $ws2
+bindsym $mod+Shift+3 move container to workspace number $ws3
+bindsym $mod+Shift+4 move container to workspace number $ws4
+bindsym $mod+Shift+a move container to workspace number $ws5
+bindsym $mod+Shift+s move container to workspace number $ws6
+bindsym $mod+Shift+d move container to workspace number $ws7
+bindsym $mod+Shift+f move container to workspace number $ws8
+
+bindsym F12 exec python ~/.config/sway/terminal.py
+assign [app_id="^tmux_term$"] $ws9
+
+bar {
+ swaybar_command waybar
+ position top
+ strip_workspace_numbers yes
+ tray_output $primary
+}
+
+exec ~/.config/sway/load_resources.sh
diff --git a/sway/load_resources.sh b/sway/load_resources.sh
new file mode 100755
index 0000000..b1c07a2
--- /dev/null
+++ b/sway/load_resources.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+xrdb -load ~/.Xresources
+(swaymsg -p -t get_outputs | grep -q "Current mode: 3840x2160") && \
+ echo "Xft.dpi: 120" | xrdb -override
+
diff --git a/sway/terminal.py b/sway/terminal.py
new file mode 100644
index 0000000..3993dcd
--- /dev/null
+++ b/sway/terminal.py
@@ -0,0 +1,54 @@
+import subprocess
+
+workspace_name = '9:term'
+instance_name = 'tmux_term'
+
+
+def is_term_running():
+ p = subprocess.run(['swaymsg', '-t', 'get_tree'],
+ capture_output=True,
+ check=True)
+ return f'"app_id": "{instance_name}"' in p.stdout.decode('utf-8')
+
+
+def run_term():
+ subprocess.Popen(['alacritty', '--class', instance_name,
+ '-e', 'tmux', 'new-session', '-A', '-s', 'default'])
+
+
+def get_focused(name):
+ p = subprocess.run(['swaymsg', '-p', '-t', f'get_{name}'],
+ capture_output=True,
+ check=True)
+ for line in p.stdout.decode('utf-8').strip().split('\n'):
+ if not line or line[0] == ' ':
+ continue
+ segments = line.split(' ')
+ if segments[-1] == '(focused)':
+ return segments[1]
+
+
+def hide_term():
+ subprocess.run(['swaymsg', 'workspace', 'back_and_forth'], check=True)
+
+
+def show_term():
+ output = get_focused('outputs')
+ subprocess.run(['swaymsg', 'workspace', workspace_name], check=True)
+ subprocess.run(['swaymsg', 'move', 'workspace', 'to', output], check=True)
+ subprocess.run(['swaymsg', 'workspace', workspace_name], check=True)
+
+
+def main():
+ if not is_term_running():
+ run_term()
+
+ focused_workspace = get_focused('workspaces')
+ if focused_workspace == workspace_name:
+ hide_term()
+ else:
+ show_term()
+
+
+if __name__ == '__main__':
+ main()
diff --git a/xorg/.xsession b/xorg/.xsession
index 806262b..e41fb0b 100755
--- a/xorg/.xsession
+++ b/xorg/.xsession
@@ -1,14 +1,9 @@
-#!/bin/bash
+#!/bin/sh
xrandr
-xrdb -merge ~/.Xresources
xset -b
autorandr --change
-[[ -n $(xrandr | grep "connected 3840x2160") ]] && xrandr --dpi 120
-[[ -n $(xrandr | grep "connected 3840x2160") ]] && echo "Xft.dpi: 120" | xrdb -override
+~/.dotfiles/xorg/load_resources.sh
+~/.dotfiles/xorg/set_wallpaper.sh
-feh --bg-scale ~/.pictures/bg1.jpg \
- ~/.pictures/bg2.jpg
-
-picom &
-#gajim &
+picom -I 1 -O 1 -D 0 &
diff --git a/xorg/load_resources.sh b/xorg/load_resources.sh
new file mode 100755
index 0000000..59f8ee2
--- /dev/null
+++ b/xorg/load_resources.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+xrdb -load ~/.Xresources
+(xrandr | grep -q "connected 3840x2160") && \
+ xrandr --dpi 120 && \
+ echo "Xft.dpi: 120" | xrdb -override
+
diff --git a/xorg/set_wallpaper.sh b/xorg/set_wallpaper.sh
new file mode 100755
index 0000000..af7d126
--- /dev/null
+++ b/xorg/set_wallpaper.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+feh --bg-scale ~/.pictures/bg1.jpg \
+ ~/.pictures/bg2.jpg