aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbozo.kopic <bozo@kopic.xyz>2021-10-03 23:21:15 +0200
committerbozo.kopic <bozo@kopic.xyz>2021-10-03 23:21:15 +0200
commitfa5dd5f3c014a250b1748c340255d8b4d0b7d773 (patch)
treeb923aabfdfd4e46fe8c0a42164dc78ceb5435217
parent112a38a0d4f3debab29749352c61968bee98e477 (diff)
.
-rwxr-xr-xchromium/chromium6
-rwxr-xr-xinstall.sh29
-rwxr-xr-xlock/lock7
-rw-r--r--lock/lock.desktop5
-rw-r--r--pictures/icons/sublime-music.pngbin0 -> 5127 bytes
-rwxr-xr-xriver/init31
-rwxr-xr-xsetkbmap/setkbmap7
-rwxr-xr-xsublime-music/sublime-music.desktop9
-rw-r--r--sublimetext/Preferences.sublime-settings3
-rw-r--r--sway/config136
-rwxr-xr-xsway/init.sh29
-rwxr-xr-xsway/load_resources.sh6
-rw-r--r--sway/terminal.py54
-rwxr-xr-xsway/terminal.sh28
-rw-r--r--tmux/.tmux.conf2
-rwxr-xr-xtmux/paste.sh7
-rw-r--r--waybar/config34
-rw-r--r--waybar/style.css42
-rwxr-xr-xxorg/lock3
19 files changed, 289 insertions, 149 deletions
diff --git a/chromium/chromium b/chromium/chromium
new file mode 100755
index 0000000..8498b76
--- /dev/null
+++ b/chromium/chromium
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+exec /usr/bin/chromium \
+ $([ -n "$WAYLAND_DISPLAY" ] && \
+ echo "--enable-features=UseOzonePlatform --ozone-platform=wayland") \
+ "$@"
diff --git a/install.sh b/install.sh
index 59e5fd8..c8a4c6b 100755
--- a/install.sh
+++ b/install.sh
@@ -45,6 +45,8 @@ install_python() {
mkdir -p ~/bin
mkdir -p ~/opt
mkdir -p ~/repos
+mkdir -p ~/.local/share/applications
+mkdir -p ~/.local/share/icons/hicolor/128x128/apps
symlink $(cd $(dirname "$0"); pwd -P) ~/.dotfiles
yay --save --sudo doas
install_packages ~/.dotfiles/packages.txt
@@ -55,6 +57,12 @@ symlink ~/.dotfiles/alacritty ~/.config/alacritty
# bspwm
symlink ~/.dotfiles/bspwm ~/.config/bspwm
+# chromium
+symlink ~/.dotfiles/chromium/chromium ~/bin/chromium
+cp /usr/share/applications/chromium.desktop ~/.local/share/applications
+sed -i "s/^Exec=\\/usr/Exec=$(cd; pwd | sed 's/\//\\\//g')/g" \
+ ~/.local/share/applications/chromium.desktop
+
# cudatext
mkdir -p ~/.config/cudatext/settings
symlink ~/.dotfiles/cudatext/user.json ~/.config/cudatext/settings/user.json
@@ -79,6 +87,11 @@ fi
# lein
symlink ~/.dotfiles/lein/lein ~/bin/lein
+# lock
+symlink ~/.dotfiles/lock/lock ~/bin/lock
+symlink ~/.dotfiles/lock/lock.desktop \
+ ~/.local/share/applications/lock.desktop
+
# neomutt
symlink ~/.dotfiles/neomutt ~/.config/neomutt
@@ -102,10 +115,16 @@ symlink ~/.dotfiles/qutebrowser/autoconfig.yml ~/.config/qutebrowser/autoconfig.
mkdir -p ~/.config/ranger
symlink ~/.dotfiles/ranger/rc.conf ~/.config/ranger/rc.conf
+# river
+symlink ~/.dotfiles/river ~/.config/river
+
# rofi
mkdir -p ~/.config/rofi
symlink ~/.dotfiles/rofi/config.rasi ~/.config/rofi/config.rasi
+# setkbmap
+symlink ~/.dotfiles/setkbmap/setkbmap ~/bin/setkbmap
+
# shell
symlink ~/.dotfiles/shell/.profile ~/.profile
@@ -120,6 +139,12 @@ symlink ~/.dotfiles/shell/fish ~/.config/fish
symlink ~/.dotfiles/shell/zsh/.zshrc ~/.zshrc
symlink ~/.profile ~/.zprofile
+# sublime-music
+symlink ~/.dotfiles/sublime-music/sublime-music.desktop \
+ ~/.local/share/applications/sublime-music.desktop
+symlink ~/.dotfiles/pictures/icons/sublime-music.png \
+ ~/.local/share/icons/hicolor/128x128/apps/sublime-music.png
+
# sublimetext
mkdir -p ~/.config/sublime-text/Packages/User
for i in Adaptive.sublime-theme \
@@ -150,9 +175,11 @@ symlink ~/.vim ~/.config/nvim
# win10
symlink ~/.dotfiles/vm/vm-win10 ~/bin/vm-win10
+# waybar
+symlink ~/.dotfiles/waybar ~/.config/waybar
+
# xorg
symlink ~/.dotfiles/xorg/.xinitrc ~/.xinitrc
symlink ~/.dotfiles/xorg/.Xresources ~/.Xresources
symlink ~/.dotfiles/xorg/loadxresources ~/bin/loadxresources
-symlink ~/.dotfiles/xorg/lock ~/bin/lock
symlink ~/.dotfiles/xorg/setwallpaper ~/bin/setwallpaper
diff --git a/lock/lock b/lock/lock
new file mode 100755
index 0000000..a5a1287
--- /dev/null
+++ b/lock/lock
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ -n "$WAYLAND_DISPLAY" ]; then
+ swaylock -i ~/.pictures/lock.png
+else
+ i3lock -i ~/.pictures/lock.png
+fi
diff --git a/lock/lock.desktop b/lock/lock.desktop
new file mode 100644
index 0000000..019e742
--- /dev/null
+++ b/lock/lock.desktop
@@ -0,0 +1,5 @@
+[Desktop Entry]
+Type=Application
+Name=Lock
+Exec=lock
+Categories=System;
diff --git a/pictures/icons/sublime-music.png b/pictures/icons/sublime-music.png
new file mode 100644
index 0000000..ca9cfd7
--- /dev/null
+++ b/pictures/icons/sublime-music.png
Binary files differ
diff --git a/river/init b/river/init
new file mode 100755
index 0000000..91c0156
--- /dev/null
+++ b/river/init
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+mod=Mod4
+
+# riverctl map normal None F12 spawn ~/.config/river/terminal.sh
+# riverctl map normal None Print spawn spectacle
+
+riverctl map-pointer normal $mod BTN_LEFT move-view
+riverctl map-pointer normal $mod BTN_RIGHT resize-view
+
+riverctl map normal $mod Return spawn alacritty
+riverctl map normal $mod Space spawn 'wofi --show drun'
+
+riverctl map normal $mod+Shift E exit
+riverctl map normal $mod+Shift Q close
+
+riverctl map normal $mod+Shift Return toggle-fullscreen
+riverctl map normal $mod+Shift Space toggle-float
+
+for i in $(seq 1 9)
+do
+ tags=$((1 << ($i - 1)))
+ riverctl map normal $mod $i set-focused-tags $tags
+ riverctl map normal $mod+Shift $i set-view-tags $tags
+done
+
+riverctl focus-follows-cursor normal
+riverctl set-cursor-wrap on-output-change
+riverctl default-layout rivertile
+
+exec rivertile
diff --git a/setkbmap/setkbmap b/setkbmap/setkbmap
new file mode 100755
index 0000000..a1d8056
--- /dev/null
+++ b/setkbmap/setkbmap
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ -n '$SWAYSOCK' ]; then
+ swaymsg input '*' xkb_layout "$@"
+else
+ setxkbmap "$@"
+fi
diff --git a/sublime-music/sublime-music.desktop b/sublime-music/sublime-music.desktop
new file mode 100755
index 0000000..75fd96b
--- /dev/null
+++ b/sublime-music/sublime-music.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Application
+Name=Sublime Music
+GenericName=Music Player
+Comment=Native Subsonic client for Linux
+Exec=sublime-music
+Icon=sublime-music
+Terminal=false
+Categories=AudioVideo;Audio;Music;
diff --git a/sublimetext/Preferences.sublime-settings b/sublimetext/Preferences.sublime-settings
index c72cb78..4a27c16 100644
--- a/sublimetext/Preferences.sublime-settings
+++ b/sublimetext/Preferences.sublime-settings
@@ -44,7 +44,7 @@
[
],
"font_face": "Roboto Mono",
- "font_size": 12,
+ "font_size": 13,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
@@ -69,4 +69,5 @@
"theme": "Adaptive.sublime-theme",
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
+ "update_check": false,
}
diff --git a/sway/config b/sway/config
index 93f0db3..2a18165 100644
--- a/sway/config
+++ b/sway/config
@@ -1,86 +1,56 @@
-set $primary eDP-1
-set $secondary DP-6
-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
+xwayland disable
+bar swaybar_command waybar
+
+exec_always ~/.config/sway/init.sh
+
+bindsym {
+ $mod+Return exec alacritty
+ $mod+space exec wofi --show drun --allow-images --allow-markup --gtk-dark
+ $mod+Tab layout toggle
+
+ $mod+Shift+q kill
+ $mod+Shift+r restart
+ $mod+Shift+e exit
+ $mod+Shift+space floating toggle
+ $mod+Shift+Return fullscreen toggle
+
+ $mod+h focus left
+ $mod+j focus down
+ $mod+k focus up
+ $mod+l focus right
+ $mod+Left focus left
+ $mod+Down focus down
+ $mod+Up focus up
+ $mod+Right focus right
+
+ $mod+Shift+h move left
+ $mod+Shift+j move down
+ $mod+Shift+k move up
+ $mod+Shift+l move right
+ $mod+Shift+Left move left
+ $mod+Shift+Down move down
+ $mod+Shift+Up move up
+ $mod+Shift+Right move right
+
+ $mod+1 workspace number "1:1"
+ $mod+2 workspace number "2:2"
+ $mod+3 workspace number "3:3"
+ $mod+4 workspace number "4:4"
+ $mod+a workspace number "5:a"
+ $mod+s workspace number "6:s"
+ $mod+d workspace number "7:d"
+ $mod+f workspace number "8:f"
+
+ $mod+Shift+1 move container to workspace number "1:1"
+ $mod+Shift+2 move container to workspace number "2:2"
+ $mod+Shift+3 move container to workspace number "3:3"
+ $mod+Shift+4 move container to workspace number "4:4"
+ $mod+Shift+a move container to workspace number "5:a"
+ $mod+Shift+s move container to workspace number "6:s"
+ $mod+Shift+d move container to workspace number "7:d"
+ $mod+Shift+f move container to workspace number "8:f"
+
+ F12 exec ~/.config/sway/terminal.sh
}
-
-exec ~/.config/sway/load_resources.sh
diff --git a/sway/init.sh b/sway/init.sh
new file mode 100755
index 0000000..c854d80
--- /dev/null
+++ b/sway/init.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+mod=Mod4
+primary=eDP-1
+secondary=$(swaymsg -t get_outputs -r |
+ jq "map(select(.name != \"$primary\") | .name)[0]" 2> /dev/null |
+ tr -d "\"")
+
+swaymsg output $primary pos 0 0 res 1920x1080 bg ~/.pictures/bg1.jpg stretch
+[ ! -z "$secondary" ] && swaymsg output $secondary pos 1920 0 bg ~/.pictures/bg2.jpg stretch
+
+swaymsg workspace 1:1 output $primary
+swaymsg workspace 2:2 output $primary
+swaymsg workspace 3:3 output $primary
+swaymsg workspace 4:4 output $primary
+swaymsg workspace 5:a output ${secondary:-$primary}
+swaymsg workspace 6:s output ${secondary:-$primary}
+swaymsg workspace 7:d output ${secondary:-$primary}
+swaymsg workspace 8:f output ${secondary:-$primary}
+
+swaymsg font "pango:Inter Medium 12"
+swaymsg floating_modifier $mod
+swaymsg default_border pixel 4
+
+swaymsg assign "[app_id=\"^tmux_term\$\"]" 9:term
+
+# export GDK_DPI_SCALE=0.95
+gsettings set org.gnome.desktop.interface scaling-factor 1
+gsettings set org.gnome.desktop.interface text-scaling-factor 1
diff --git a/sway/load_resources.sh b/sway/load_resources.sh
deleted file mode 100755
index b1c07a2..0000000
--- a/sway/load_resources.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/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
deleted file mode 100644
index 3993dcd..0000000
--- a/sway/terminal.py
+++ /dev/null
@@ -1,54 +0,0 @@
-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/sway/terminal.sh b/sway/terminal.sh
new file mode 100755
index 0000000..ec864ab
--- /dev/null
+++ b/sway/terminal.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+DESKTOP=term
+INSTANCE=tmux_term
+
+TERM_WORKSPACE="9:term"
+TERM_APP_ID=tmux_term
+
+FOCUSED_OUTPUT=$(swaymsg -t get_outputs -r |
+ jq '.[] | select(.focused == true) | .name' |
+ tr -d '"')
+FOCUSED_WORKSPACE=$(swaymsg -t get_workspaces -r |
+ jq '.[] | select(.focused == true) | .name' |
+ tr -d '"')
+
+if [ "$FOCUSED_WORKSPACE" = "$TERM_WORKSPACE" ]; then
+ swaymsg workspace back_and_forth
+else
+ swaymsg workspace $TERM_WORKSPACE
+ swaymsg move workspace to $FOCUSED_OUTPUT
+ swaymsg workspace $TERM_WORKSPACE
+
+ if ! (swaymsg -t get_tree -r |
+ jq -e "recurse(.nodes[]) | select(.app_id == \"$TERM_APP_ID\")" > /dev/null); then
+ exec alacritty --class $TERM_APP_ID -e \
+ tmux new-session -A -s default
+ fi
+fi
diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf
index d31c1d7..17cfe5e 100644
--- a/tmux/.tmux.conf
+++ b/tmux/.tmux.conf
@@ -34,7 +34,7 @@ bind-key 'Up' select-pane -P 'fg=white,bg=black'
bind-key 'Down' select-pane -P 'fg=black,bg=white'
-bind-key ] run "xclip -o -selection clipboard | tmux load-buffer - && tmux paste-buffer"
+bind-key ] run "sh ~/.dotfiles/tmux/paste.sh"
set -g @plugin 'christoomey/vim-tmux-navigator'
diff --git a/tmux/paste.sh b/tmux/paste.sh
new file mode 100755
index 0000000..b09a794
--- /dev/null
+++ b/tmux/paste.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ -z "$WAYLAND_DISPLAY" ]; then
+ xclip -o -selection clipboard | tmux load-buffer - && tmux paste-buffer
+else
+ wl-paste --no-newline | tmux load-buffer - && tmux paste-buffer
+fi
diff --git a/waybar/config b/waybar/config
new file mode 100644
index 0000000..8f0862d
--- /dev/null
+++ b/waybar/config
@@ -0,0 +1,34 @@
+{
+ "position": "top",
+ "modules-left": ["sway/workspaces"],
+ "modules-center": ["sway/window"],
+ "modules-right": ["network", "pulseaudio", "battery", "clock", "tray"],
+
+ "sway/workspaces" : {
+ "format": "{name}"
+ },
+
+ "network": {
+ "format-wifi": "直 {essid}",
+ "format-ethernet": "ﯱ {ifname}",
+ "format-disconnected": " disconnected",
+ "on-click": "connman-gtk"
+ },
+
+ "pulseaudio": {
+ "format": "墳 {volume:3}%",
+ "format-muted": "婢 mute",
+ "scroll-step": 5,
+ "on-click": "pavucontrol",
+ "on-click-right": "pulsemixer --toggle-mute"
+ },
+
+ "battery": {
+ "format": "{icon} {capacity:3}%",
+ "format-icons": ["", "", ""]
+ },
+
+ "clock": {
+ "format": " {:%Y-%m-%d %H:%M}"
+ }
+}
diff --git a/waybar/style.css b/waybar/style.css
new file mode 100644
index 0000000..2b56907
--- /dev/null
+++ b/waybar/style.css
@@ -0,0 +1,42 @@
+* {
+ font-family: Inter Regular;
+ font-size: 12pt;
+ color: white;
+}
+
+window#waybar {
+ background-color: black;
+ padding: 5px;
+}
+
+#workspaces button {
+ padding: 0 10px;
+ background-color: transparent;
+ border-radius: 0;
+}
+
+#workspaces button:hover {
+ box-shadow: inherit;
+ text-shadow: inherit;
+ background: transparent;
+ border: 1px solid rgba(255, 255, 255, 0.5);
+}
+
+#workspaces button.focused {
+ background-color: rgba(255, 255, 255, 0.3);
+}
+
+#workspaces button.urgent {
+ background-color: #eb4d4b;
+}
+
+#clock,
+#battery,
+#network,
+#pulseaudio,
+#custom-media,
+#tray {
+ padding: 0 15px;
+ border-left: 2px solid rgba(255, 255, 255, 0.2);
+ font-family: "RobotoMono Nerd Font";
+}
diff --git a/xorg/lock b/xorg/lock
deleted file mode 100755
index b316336..0000000
--- a/xorg/lock
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-i3lock -i ~/.pictures/lock.png