From f61d921fd24c24da4258217510c809825cdbf8f8 Mon Sep 17 00:00:00 2001 From: "bozo.kopic" Date: Thu, 16 Jul 2020 04:29:34 +0200 Subject: . --- bspwm/bspwmrc | 20 ++++++++ i3/config | 12 +---- install.sh | 14 +++-- mbsync/.mbsyncrc | 22 ++++++++ offlineimap/.offlineimap.py | 8 --- offlineimap/.offlineimaprc | 18 ------- polybar/config | 94 ++++++++++++++++++++++++++++++++++ polybar/launch.sh | 5 ++ subl3/Package Control.sublime-settings | 2 +- subl3/Preferences.sublime-settings | 3 +- sxhkd/sxhkdrc | 62 ---------------------- sxhkd/sxhkdrc.bspwm | 54 +++++++++++++++++++ sxhkd/sxhkdrc.i3 | 46 +++++++++++++++++ sxhkd/terminal_bspwm.py | 46 +++++++++++++++++ sxhkd/terminal_i3.py | 58 +++++++++++++++++++++ terminal.py | 58 --------------------- xorg/.xsession | 8 +-- yabar/yabar.conf | 34 ++++++++++++ 18 files changed, 400 insertions(+), 164 deletions(-) create mode 100755 bspwm/bspwmrc create mode 100644 mbsync/.mbsyncrc delete mode 100644 offlineimap/.offlineimap.py delete mode 100644 offlineimap/.offlineimaprc create mode 100644 polybar/config create mode 100755 polybar/launch.sh delete mode 100644 sxhkd/sxhkdrc create mode 100644 sxhkd/sxhkdrc.bspwm create mode 100644 sxhkd/sxhkdrc.i3 create mode 100644 sxhkd/terminal_bspwm.py create mode 100644 sxhkd/terminal_i3.py delete mode 100644 terminal.py create mode 100644 yabar/yabar.conf diff --git a/bspwm/bspwmrc b/bspwm/bspwmrc new file mode 100755 index 0000000..6afcdb6 --- /dev/null +++ b/bspwm/bspwmrc @@ -0,0 +1,20 @@ +#!/bin/bash + +sxhkd -c ~/.config/sxhkd/sxhkdrc.bspwm & +~/.config/polybar/launch.sh & + +bspc monitor primary -d 1 2 3 4 term +bspc monitor ^2 -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 + +bspc rule -a *:tmux_term desktop=term + diff --git a/i3/config b/i3/config index 90a6ebd..82492ba 100644 --- a/i3/config +++ b/i3/config @@ -41,15 +41,7 @@ bindsym $mod+Shift+s move container to workspace $wss bindsym $mod+Shift+d move container to workspace $wsd bindsym $mod+Shift+f move container to workspace $wsf -bar { - status_command py3status - tray_output primary - strip_workspace_numbers yes - workspace_min_width 40 - font pango:Font Awesome 5 Free, Font Awesome 5 Brands, Droid Sans Mono 12 -} - -exec_always --no-startup-id feh --bg-scale ~/.dotfiles/pictures/bg1.jpg \ - ~/.dotfiles/pictures/bg2.jpg +exec --no-startup-id sxhkd -c ~/.config/sxhkd/sxhkdrc.i3 +exec --no-startup-id ~/.config/polybar/launch.sh for_window [instance="scratchpad_term"] move container to workspace $wst diff --git a/install.sh b/install.sh index fc6a70e..6c53f72 100755 --- a/install.sh +++ b/install.sh @@ -22,10 +22,9 @@ ln -sf ~/.profile ~/.bash_profile # git ln -sf $DOTFILES/git/.gitconfig ~/.gitconfig -# offlineimap +# mbsync (isync) mkdir -p ~/mail/ket -ln -sf $DOTFILES/offlineimap/.offlineimaprc ~/.offlineimaprc -ln -sf $DOTFILES/offlineimap/.offlineimap.py ~/.offlineimap.py +ln -sf $DOTFILES/mbsync/.mbsyncrc ~/.mbsyncrc # qtile ln -sf -T $DOTFILES/qtile ~/.config/qtile @@ -33,6 +32,9 @@ ln -sf -T $DOTFILES/qtile ~/.config/qtile # i3 ln -sf -T $DOTFILES/i3 ~/.config/i3 +# bspwm +ln -sf -T $DOTFILES/bspwm ~/.config/bspwm + # sxhkd ln -sf -T $DOTFILES/sxhkd ~/.config/sxhkd @@ -45,6 +47,12 @@ ln -sf -T $DOTFILES/waybar ~/.config/waybar # py3status ln -sf -T $DOTFILES/py3status ~/.config/py3status +# polybar +ln -sf -T $DOTFILES/polybar ~/.config/polybar + +# polybar +ln -sf -T $DOTFILES/yabar ~/.config/yabar + # qutebrowser mkdir -p ~/.config/qutebrowser ln -sf $DOTFILES/qutebrowser/autoconfig.yml ~/.config/qutebrowser/autoconfig.yml diff --git a/mbsync/.mbsyncrc b/mbsync/.mbsyncrc new file mode 100644 index 0000000..e98a624 --- /dev/null +++ b/mbsync/.mbsyncrc @@ -0,0 +1,22 @@ +IMAPAccount ket +Host outlook.office365.com +User bozo.kopic@koncar-ket.hr +PassCmd "pass office.com/bozo.kopic" +SSLType STARTTLS +CertificateFile /etc/ssl/certs/ca-certificates.crt +AuthMech PLAIN + +IMAPStore ket-remote +Account ket + +MaildirStore ket-local +SubFolders Verbatim +Path ~/mail/ket +Inbox ~/mail/ket/INBOX + +Channel ket +Master :ket-remote: +Slave :ket-local: +Patterns * +Create Both +SyncState * diff --git a/offlineimap/.offlineimap.py b/offlineimap/.offlineimap.py deleted file mode 100644 index 0b0ec8f..0000000 --- a/offlineimap/.offlineimap.py +++ /dev/null @@ -1,8 +0,0 @@ -import subprocess - - -def get_password(name): - p = subprocess.Popen(['pass', name], stdout=subprocess.PIPE) - p.wait() - password = p.stdout.read().strip() - return password diff --git a/offlineimap/.offlineimaprc b/offlineimap/.offlineimaprc deleted file mode 100644 index 40e8608..0000000 --- a/offlineimap/.offlineimaprc +++ /dev/null @@ -1,18 +0,0 @@ -[general] -accounts = Ket -pythonfile = ~/.offlineimap.py - -[Account Ket] -localrepository = KetLocal -remoterepository = KetRemote - -[Repository KetLocal] -type = Maildir -localfolders = ~/mail/ket - -[Repository KetRemote] -type = IMAP -cert_fingerprint = 7f0804b4d0a6c83e46a3a00ec98f8343d7308566 -remotehost = outlook.office365.com -remoteuser = bozo.kopic@koncar-ket.hr -remotepasseval = get_password('office.com/bozo.kopic') diff --git a/polybar/config b/polybar/config new file mode 100644 index 0000000..9d1c82c --- /dev/null +++ b/polybar/config @@ -0,0 +1,94 @@ +[bar/base] +monitor-strict = false +monitor-exact = true +override-redirect = false +bottom = false +height = 30 +padding = 2 +background = #000000 +foreground = #ffffff +font-0 = "RobotoMono Nerd Font:size=12" +font-1 = "Roboto Nerd Font:size=12" +module-margin = 1 +separator = | +separator-foreground = #919191 +modules-left = bspwm title +modules-center = +modules-right = wlan0 eth0 pulseaudio battery date + +[bar/bar1] +inherit = bar/base +monitor = +tray-position = right + +[bar/bar2] +inherit = bar/base +monitor = DP1-2 +tray-position = none + +[module/bspwm] +type = internal/bspwm +pin-workspaces = true +format = +label-dimmed-focused-background = ${bar/base.background} +label-focused = [ %name% ] +label-focused-foreground = ${bar/base.foreground} +label-focused-background = #3f3f3f +label-occupied = %name% +label-urgent = %name% +label-urgent-foreground = ${bar/base.foreground} +label-urgent-background = #bd2c40 +label-empty = %name% +label-empty-foreground = #555555 +label-separator = | +label-separator-padding = 2 +label-separator-foreground = ${bar/base.separator-foreground} + +[module/title] +type = internal/xwindow +label = %{T2}%title% + +[module/wlan0] +type = internal/network +interface = wlan0 +label-connected = 直 %essid% %local_ip% +label-connected-foreground = ${bar/base.foreground} +label-disconnected = 睊 +label-disconnected-foreground = #66ffffff +click-right = connman-gtk & + +[module/eth0] +type = internal/network +interface = eth0 +label-connected = ﯱ %local_ip% +label-connected-foreground = ${bar/base.foreground} +label-disconnected =  +label-disconnected-foreground = #66ffffff +click-left = connman-gtk & + +[module/pulseaudio] +type = internal/pulseaudio +use-ui-max = false +format-volume = +label-volume = %percentage:3%% +label-muted = 婢 muted +label-muted-foreground = #666 +ramp-volume-0 = 奄 +ramp-volume-1 = 奔 +ramp-volume-2 = 墳 +click-right = pavucontrol & + +[module/battery] +type = internal/battery +label-charging =  %percentage:3% +label-discharging =  %percentage:3% +label-full =  %percentage:3% +ramp-capacity-0 =  +ramp-capacity-1 =  +ramp-capacity-2 =  +ramp-capacity-3 =  +ramp-capacity-4 =  + +[module/date] +type = internal/date +date =  %Y-%m-%d %H:%M diff --git a/polybar/launch.sh b/polybar/launch.sh new file mode 100755 index 0000000..14c2eee --- /dev/null +++ b/polybar/launch.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +killall -q polybar +polybar -q bar1 & +polybar -q bar2 & diff --git a/subl3/Package Control.sublime-settings b/subl3/Package Control.sublime-settings index 4051f26..d4fb5c0 100644 --- a/subl3/Package Control.sublime-settings +++ b/subl3/Package Control.sublime-settings @@ -7,11 +7,11 @@ [ "A File Icon", "Compare Side-By-Side", + "MagicPython", "Material Theme", "Origami", "Package Control", "PackageResourceViewer", - "Python Improved", "Sass", "SideBarEnhancements", "SublimeLinter", diff --git a/subl3/Preferences.sublime-settings b/subl3/Preferences.sublime-settings index cd002df..dfc3087 100644 --- a/subl3/Preferences.sublime-settings +++ b/subl3/Preferences.sublime-settings @@ -43,11 +43,12 @@ [ ], "font_face": "Droid Sans Mono", - "font_size": 11, + "font_size": 10, "highlight_line": true, "highlight_modified_tabs": true, "ignored_packages": [ + "Python", "Vintage" ], "line_padding_bottom": 1, diff --git a/sxhkd/sxhkdrc b/sxhkd/sxhkdrc deleted file mode 100644 index fa91ced..0000000 --- a/sxhkd/sxhkdrc +++ /dev/null @@ -1,62 +0,0 @@ -F12 - python ~/.dotfiles/terminal.py - -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 + shift + r - i3-msg "restart" -mod4 + shift + e - i3-msg "exit" -mod4 + shift + q - i3-msg "kill" -mod4 + shift + space - i3-msg "floating toggle" -mod4 + shift + Return - i3-msg "fullscreen toggle" - -mod4 + h - i3-msg "focus left" -mod4 + Left - i3-msg "focus left" -mod4 + j - i3-msg "focus down" -mod4 + Down - i3-msg "focus down" -mod4 + k - i3-msg "focus up" -mod4 + Up - i3-msg "focus up" -mod4 + l - i3-msg "focus right" -mod4 + Right - i3-msg "focus right" - -mod4 + shift + h - i3-msg "move left" -mod4 + shift + Left - i3-msg "move left" -mod4 + shift + j - i3-msg "move down" -mod4 + shift + Down - i3-msg "move down" -mod4 + shift + k - i3-msg "move up" -mod4 + shift + Up - i3-msg "move up" -mod4 + shift + l - i3-msg "move right" -mod4 + shift + Right - i3-msg "move right" diff --git a/sxhkd/sxhkdrc.bspwm b/sxhkd/sxhkdrc.bspwm new file mode 100644 index 0000000..aaeb018 --- /dev/null +++ b/sxhkd/sxhkdrc.bspwm @@ -0,0 +1,54 @@ +F12 + python ~/.config/sxhkd/terminal_bspwm.py + +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/sxhkd/sxhkdrc.i3 b/sxhkd/sxhkdrc.i3 new file mode 100644 index 0000000..ec9af48 --- /dev/null +++ b/sxhkd/sxhkdrc.i3 @@ -0,0 +1,46 @@ +F12 + python ~/.config/sxhkd/terminal_i3.py + +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 + shift + r + i3-msg "restart" +mod4 + shift + e + i3-msg "exit" +mod4 + shift + q + i3-msg "kill" +mod4 + shift + space + i3-msg "floating toggle" +mod4 + shift + Return + i3-msg "fullscreen toggle" + +mod4 + {h, Left} + i3-msg "focus left" +mod4 + {j, Down} + i3-msg "focus down" +mod4 + {k, Up} + i3-msg "focus up" +mod4 + {l, Right} + i3-msg "focus right" + +mod4 + shift + {h, Left} + i3-msg "move left" +mod4 + shift + {j, Down} + i3-msg "move down" +mod4 + shift + {k, Up} + i3-msg "move up" +mod4 + shift + {l, Right} + i3-msg "move right" diff --git a/sxhkd/terminal_bspwm.py b/sxhkd/terminal_bspwm.py new file mode 100644 index 0000000..eee7875 --- /dev/null +++ b/sxhkd/terminal_bspwm.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/sxhkd/terminal_i3.py b/sxhkd/terminal_i3.py new file mode 100644 index 0000000..c53ff53 --- /dev/null +++ b/sxhkd/terminal_i3.py @@ -0,0 +1,58 @@ +import json +import subprocess + + +def send_msg(msg_type, msg): + p = subprocess.run(['i3-msg', '-t', msg_type, msg], + capture_output=True, + check=True) + return json.loads(p.stdout.decode('utf-8')) + + +def is_term_running(): + + def node_exists(node): + if node.get('window_properties', {}).get('instance') == 'scratchpad_term': + return True + return any(node_exists(i) for i in node.get('nodes', [])) + + tree = send_msg('get_tree', '') + return node_exists(tree) + + +def run_term(): + subprocess.Popen([ + 'alacritty', '--class', 'scratchpad_term', + '-e', 'tmux', 'new-session', '-A', '-s', 'default']) + + +def get_focused_workspace(): + workspaces = send_msg('get_workspaces', '') + for workspace in workspaces: + if workspace['focused']: + return workspace['name'] + + +def get_focused_output(focused_workspace): + outputs = send_msg('get_outputs', '') + for out in outputs: + if out['current_workspace'] == focused_workspace: + return out['name'] + + +def main(): + focused_workspace = get_focused_workspace() + if focused_workspace == '9:term': + send_msg('command', 'workspace back_and_forth') + else: + focused_output = get_focused_output(focused_workspace) + if not is_term_running(): + run_term() + send_msg('command', '[instance="scratchpad_term"] ' + 'move container to workspace "9:term"') + send_msg('command', 'workspace "9:term"') + send_msg('command', f'move workspace to output {focused_output}') + + +if __name__ == '__main__': + main() diff --git a/terminal.py b/terminal.py deleted file mode 100644 index c53ff53..0000000 --- a/terminal.py +++ /dev/null @@ -1,58 +0,0 @@ -import json -import subprocess - - -def send_msg(msg_type, msg): - p = subprocess.run(['i3-msg', '-t', msg_type, msg], - capture_output=True, - check=True) - return json.loads(p.stdout.decode('utf-8')) - - -def is_term_running(): - - def node_exists(node): - if node.get('window_properties', {}).get('instance') == 'scratchpad_term': - return True - return any(node_exists(i) for i in node.get('nodes', [])) - - tree = send_msg('get_tree', '') - return node_exists(tree) - - -def run_term(): - subprocess.Popen([ - 'alacritty', '--class', 'scratchpad_term', - '-e', 'tmux', 'new-session', '-A', '-s', 'default']) - - -def get_focused_workspace(): - workspaces = send_msg('get_workspaces', '') - for workspace in workspaces: - if workspace['focused']: - return workspace['name'] - - -def get_focused_output(focused_workspace): - outputs = send_msg('get_outputs', '') - for out in outputs: - if out['current_workspace'] == focused_workspace: - return out['name'] - - -def main(): - focused_workspace = get_focused_workspace() - if focused_workspace == '9:term': - send_msg('command', 'workspace back_and_forth') - else: - focused_output = get_focused_output(focused_workspace) - if not is_term_running(): - run_term() - send_msg('command', '[instance="scratchpad_term"] ' - 'move container to workspace "9:term"') - send_msg('command', 'workspace "9:term"') - send_msg('command', f'move workspace to output {focused_output}') - - -if __name__ == '__main__': - main() diff --git a/xorg/.xsession b/xorg/.xsession index f29c7ae..02b0e52 100755 --- a/xorg/.xsession +++ b/xorg/.xsession @@ -4,7 +4,9 @@ xset -b autorandr --change [[ -n $(xrandr | grep "connected 3840x2160") ]] && xrandr --dpi 120 [[ -n $(xrandr | grep "connected 3840x2160") ]] && echo "Xft.dpi: 120" | xrdb -override -sxhkd & + +feh --bg-scale ~/.dotfiles/pictures/bg1.jpg \ + ~/.dotfiles/pictures/bg2.jpg + picom & -gajim & -zeal & +#gajim & diff --git a/yabar/yabar.conf b/yabar/yabar.conf new file mode 100644 index 0000000..634acdc --- /dev/null +++ b/yabar/yabar.conf @@ -0,0 +1,34 @@ +bar-list: ["base"]; + +base: { + monitor: ""; + position: "top"; + height: 40; + font: "Droid Sans, FontAwesome Bold 10"; + + block-list: ["workspace", "title"]; + workspace: { + exec: "YABAR_WORKSPACE"; + align: "left"; + fixed-size: 40; + } + title: { + exec: "YABAR_TITLE"; + align: "left"; + justify: "left"; + fixed-size: 300; + } + +} + + +bar1: { + inherit-all: "base"; + monitor: "eDP1"; +} + + +bar2: { + inherit-all: "base"; + monitor: "DP1-2"; +} -- cgit v1.2.3-70-g09d2