1
0
Fork 0

Merge branch 'sway'

This commit is contained in:
Massaki Archambault 2019-09-16 07:29:59 -04:00
commit f19fe22176
62 changed files with 449 additions and 1025 deletions

View File

@ -1,120 +0,0 @@
#define C_BG #1c1c1c
#define C_FG #B7BBB7
! black
#define C_COLOR0 #2C2F33
! red
#define C_COLOR1 #B04C50
! green
#define C_COLOR2 #919652
! yellow
#define C_COLOR3 #E2995C
! light blue
#define C_COLOR4 #527C77
! magenta
#define C_COLOR5 #8D6494
! blue
#define C_COLOR6 #66899D
! light
#define C_COLOR7 #A6ABA6
! dark
#define C_COLOR8 #4B5056
! white
#define C_COLOR15 #DDE3DC
#define C_PRIMARY C_COLOR3
#define C_SECONDARY C_COLOR5
#define C_ERROR C_COLOR1
#define C_FG_ENABLED C_COLOR15
#define C_FG_DISABLED C_COLOR8
#define C_BG_ENABLED #2c2f33
#define C_BG_DISABLED C_BG
! Fonts
#define F_MONO Hack Nerd Font
#define F_SANS Noto Sans
#define F_ICON_1 Material Icons
#define F_ICON_2 material\-wifi
!
! color
xterm*background: C_BG
xterm*foreground: C_FG
*color0: C_COLOR0
*color8: C_COLOR8
*color1: C_COLOR1
*color9: C_COLOR1
*color2: C_COLOR2
*color10: C_COLOR2
*color3: C_COLOR3
*color11: C_COLOR3
*color4: C_COLOR4
*color12: C_COLOR4
*color5: C_COLOR5
*color13: C_COLOR5
*color6: C_COLOR6
*color14: C_COLOR6
*color7: C_COLOR7
*color15: C_COLOR15
! X
Xcursor.size: 16
! Rofi
! State: 'bg', 'fg', 'bgalt', 'hlbg', 'hlfg'
rofi.color-normal: #383838, #ffffff, #383838, #f0544c, #ffffff
rofi.color-urgent: #383838, #ffffff, #383838, #f0544c, #ffffff
rofi.color-active: #383838, #ffffff, #383838, #f0544c, #ffffff
! 'bg', 'border','separator'
rofi.color-window: #383838, #c7c7c7, #383838
rofi.separator-style: none
rofi.bw: 0
rofi.width: 40
rofi.location: 0
rofi.font: F_SANS 12
! i3
i3wm*font: F_MONO
i3wm*bg: #3838383
i3wm*fg: C_FG
i3wm*border: #3838383
!i3wm*border: #c7c7c7
i3wm*active: #f0544c
! lock
lock.font: F_SANS
lock.color.foreground: C_FG_ENABLED
lock.color.background: C_BG_ENABLED
lock.color.primary: C_PRIMARY
lock.color.secondary: C_SECONDARY
lock.color.error: C_ERROR
! xterm
xterm.termName: xterm-256color
xterm.vt100.locale: true
xterm*borderWidth: 0
! font
xterm*renderFont: true
xterm*faceName: F_MONO
xterm*faceSize: 11
! encoding
xterm.ttyModes: erase ^?
xterm.vt100.backarrowKey: false
xterm.vt100.metaSendsEscape: true
xterm.vt100.translations: #override \n\
Ctrl <Key> minus: smaller-vt-font() \n\
Ctrl <Key> plus: larger-vt-font() \n\
Ctrl <Key> 0: set-vt-font(d) \n\
Ctrl Shift <Key>C: copy-selection(CLIPBOARD) \n\
Ctrl Shift <Key>V: insert-selection(CLIPBOARD) \n\
Shift <Btn1Up>: exec-formatted("xdg-open '%t'", PRIMARY)
! mouse selection
xterm*on3Clicks: regex ([[:alpha:]]+://)?([[:alnum:]!#+,./=?@_~-]|(%[[:xdigit:]][[:xdigit:]]))+
xterm*highlightSelection: true
xterm*trimSelection: true

View File

@ -1,254 +0,0 @@
# Thank you code_nomad: http://9m.no/ꪯ鵞
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
#################################
#
# GLX backend
#
#################################
glx-no-stencil = true;
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
# but a 20% increase when only 1/4 is.
# My tests on nouveau show terrible slowdown.
# Useful with --glx-swap-method, as well.
glx-copy-from-front = false;
# GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
# May break VSync and is not available on some drivers.
# Overrides --glx-copy-from-front.
glx-use-copysubbuffermesa = false;
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
glx-no-rebind-pixmap = true;
# GLX backend: GLX buffer swap method we assume.
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
# undefined is the slowest and the safest, and the default value.
# copy is fastest, but may fail on some drivers,
# 2-6 are gradually slower but safer (6 is still faster than 0).
# Usually, double buffer means 2, triple buffer means 3.
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
# Useless with --glx-use-copysubbuffermesa.
# Partially breaks --resize-damage.
# Defaults to undefined.
glx-swap-method ="-1";
#################################
#
# Shadows
#
#################################
# Enabled client-side shadows on windows.
shadow = true;
# Don't draw shadows on DND windows.
no-dnd-shadow = true;
# Avoid drawing shadows on dock/panel windows.
no-dock-shadow = true;
# Zero the part of the shadow's mask behind the window. Fix some weirdness with ARGB windows.
clear-shadow = true;
# The blur radius for shadows. (default 12)
shadow-radius = 5;
# The left offset for shadows. (default -15)
shadow-offset-x = -5;
# The top offset for shadows. (default -15)
shadow-offset-y = -5;
# The translucency for shadows. (default .75)
shadow-opacity = 0.5;
# Set if you want different colour shadows
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
shadow-exclude = [
"! name~=''",
"name = 'Notification'",
"name = 'Plank'",
"name = 'Docky'",
"name = 'Kupfer'",
"name = 'xfce4-notifyd'",
"name *= 'VLC'",
"name *= 'compton'",
"name *= 'Chromium'",
"name *= 'Chrome'",
"class_g = 'Conky'",
"class_g = 'Kupfer'",
"class_g = 'Synapse'",
"class_g ?= 'Notify-osd'",
"class_g ?= 'Cairo-dock'",
"class_g ?= 'Xfce4-notifyd'",
"class_g ?= 'Xfce4-power-manager'",
"_GTK_FRAME_EXTENTS@:c"
];
# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
shadow-ignore-shaped = false;
#################################
#
# Opacity
#
#################################
menu-opacity = 1;
inactive-opacity = 1;
active-opacity = 1;
frame-opacity = 1;
inactive-opacity-override = true;
alpha-step = 0.06;
# Dim inactive windows. (0.0 - 1.0)
#inactive-dim = 0.3;
# Do not let dimness adjust based on window opacity.
# inactive-dim-fixed = true;
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
blur-background = false;
# Blur background of opaque windows with transparent frames as well.
blur-background-frame = false;
# Do not let blur radius adjust based on window opacity.
blur-background-fixed = false;
blur-kern = "7x7box";
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'"
];
opacity-rule = [
"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
"85:class_g = 'UXTerm' && _NET_WM_STATE@:32a != '_NET_WM_STATE_HIDDEN' && _NET_WM_STATE@:32a != '_NET_WM_STATE_FULLSCREEN'"
]
#################################
#
# Fading
#
#################################
# Fade windows during opacity changes.
fading = true;
# The time between steps in a fade in milliseconds. (default 10).
fade-delta = 4;
# Opacity change between steps while fading in. (default 0.028).
fade-in-step = 0.03;
# Opacity change between steps while fading out. (default 0.03).
fade-out-step = 0.03;
# Fade windows in/out when opening/closing
# no-fading-openclose = true;
# Specify a list of conditions of windows that should not be faded.
fade-exclude = [
];
#################################
#
# Other
#
#################################
# Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark all non-WM but override-redirect windows active (e.g. menus).
mark-ovredir-focused = true;
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
# Usually more reliable but depends on a EWMH-compliant WM.
use-ewmh-active-win = true;
# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-rounded-corners = true;
# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows.
# This prevents opacity being ignored for some apps.
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
detect-client-opacity = true;
# Specify refresh rate of the screen.
# If not specified or 0, compton will try detecting this with X RandR extension.
refresh-rate = 0;
# Set VSync method. VSync methods currently available:
# none: No VSync
# drm: VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some drivers.
# opengl: Try to VSync with SGI_video_sync OpenGL extension. Only work on some drivers.
# opengl-oml: Try to VSync with OML_sync_control OpenGL extension. Only work on some drivers.
# opengl-swc: Try to VSync with SGI_swap_control OpenGL extension. Only work on some drivers. Works only with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing, only buffer swap is affected, so it doesnt have the effect of --sw-opti unlike other methods. Experimental.
# opengl-mswc: Try to VSync with MESA_swap_control OpenGL extension. Basically the same as opengl-swc above, except the extension we use.
# (Note some VSync methods may not be enabled at compile time.)
vsync = "none";
# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
# Reported to have no effect, though.
dbe = false;
# Painting on X Composite overlay window. Recommended.
paint-on-overlay = true;
# Limit compton to repaint at most once every 1 / refresh_rate second to boost performance.
# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
sw-opti = true;
# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games.
# Known to cause flickering when redirecting/unredirecting windows.
# paint-on-overlay may make the flickering less obvious.
unredir-if-possible = true;
# Specify a list of conditions of windows that should always be considered focused.
focus-exclude = [ ];
# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
detect-transient = true;
# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time.
# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too.
detect-client-leader = true;
#################################
#
# Window type settings
#
#################################
wintypes:
{
tooltip =
{
fade = true;
shadow = false;
opacity = 0.85;
focus = true;
};
dropdown_menu =
{
fade = false;
};
popup_menu =
{
fade = false;
};
combo =
{
fade = false;
};
};

View File

@ -1,3 +1,3 @@
[custom]
start=$HOME/.local/bin/__on-gamemode start
end=$HOME/.local/bin/__on-gamemode end
start=$HOME/bin/__on-gamemode start
end=$HOME/bin/__on-gamemode end

View File

@ -1,3 +0,0 @@
#!/bin/bash
rofi -combi drun -show drun -modi drun,window

View File

@ -1,9 +0,0 @@
#!/bin/bash
# Set wallpaper
$HOME/.fehbg || feh --bg-fill --no-xinerama /usr/share/pixmaps/wallpaper.jpg
# Initial workspace and startup app
i3-msg workspace number "2: 2 "
i3-sensible-terminal

View File

@ -1,83 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This script is a simple wrapper which prefixes each i3status line with custom
# information. It is a python reimplementation of:
# http://code.stapelberg.de/git/i3status/tree/contrib/wrapper.pl
#
# To use it, ensure your ~/.i3status.conf contains this line:
# output_format = "i3bar"
# in the 'general' section.
# Then, in your ~/.i3/config, use:
# status_command i3status | ~/i3status/contrib/wrapper.py
# In the 'bar' section.
#
# In its current version it will display the cpu frequency governor, but you
# are free to change it to display whatever you like, see the comment in the
# source code below.
#
# © 2012 Valentin Haenel <valentin.haenel@gmx.de>
#
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law. You can redistribute it and/or modify it under
# the terms of the Do What The Fuck You Want To Public License (WTFPL), Version
# 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
# details.
import sys
import json
from subprocess import check_output
def get_song_name():
""" Get the name of the currently playing song """
try:
j = json.loads(check_output(['mpv-ipc', 'get_property_string', 'media-title']))
if j['data']:
return '' + j['data']
except:
pass
return ''
def is_virtualbox():
return check_output(['lspci']).find(b"VirtualBox") != -1
def print_line(message):
""" Non-buffered printing to stdout. """
sys.stdout.write(message + '\n')
sys.stdout.flush()
def read_line():
""" Interrupted respecting reader for stdin. """
# try reading a line, removing any extra whitespace
try:
line = sys.stdin.readline().strip()
# i3status sends EOF, or an empty line
if not line:
sys.exit(3)
return line
# exit on ctrl-c
except KeyboardInterrupt:
sys.exit()
if __name__ == '__main__':
# Skip the first line which contains the version header.
print_line(read_line())
# The second line contains the start of the infinite array.
print_line(read_line())
while True:
line, prefix = read_line(), ''
# ignore comma at start of lines
if line.startswith(','):
line, prefix = line[1:], ','
j = json.loads(line)
# insert information into the start of the json, but could be anywhere
song_name = get_song_name()
if song_name:
j.insert(0, {'full_text' : '%s' % song_name, 'name' : 'music'})
if is_virtualbox():
j = [b for b in j if b["name"] not in ("wireless", "battery", "path_exists") or b["instance"] == "/"]
# and echo back new encoded json
print_line(prefix+json.dumps(j))

View File

@ -1,5 +1,6 @@
# video
profile=gpu-hq
gpu-context=wayland
video-sync=display-resample
x11-bypass-compositor=yes
display-fps=60

View File

@ -32,6 +32,9 @@ load-module module-augment-properties
### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available
# automatically switch to newly-connected devices
load-module module-switch-on-connect
### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)

14
files/.config/rofi/config Normal file
View File

@ -0,0 +1,14 @@
! State: 'bg', 'fg', 'bgalt', 'hlbg', 'hlfg'
rofi.color-normal: #383838, #ffffff, #383838, #f0544c, #ffffff
rofi.color-urgent: #383838, #ffffff, #383838, #f0544c, #ffffff
rofi.color-active: #383838, #ffffff, #383838, #f0544c, #ffffff
! 'bg', 'border','separator'
rofi.color-window: #383838, #c7c7c7, #383838
rofi.separator-style: none
rofi.bw: 0
rofi.width: 40
rofi.location: 0
rofi.font: F_SANS 12

View File

@ -1,24 +1,11 @@
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
### Vars
set $terminal termite
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# Set colors from Xresources
# Change 'color7' and 'color2' to whatever colors you want i3 to use
# from the generated scheme.
# NOTE: The '#f0f0f0' in the lines below is the color i3 will use if
# it fails to get colors from Xresources for some reason.
set_from_resource $fg i3wm.color.fg #000000
set_from_resource $bg i3wm.color.bg #FFFFFF
set_from_resource $border i3wm.color.border #FF0000
set_from_resource $active i3wm.color.active #FF0000
### Color configuration
set $bg #383838
set $fg #b7bbb7
set $border #383838
set $active #f0544c
# class border backgr. text indicator child_border
client.focused $active $bg $fg $border $active
@ -26,53 +13,53 @@ client.focused_inactive $bg $bg $fg $border $border
client.unfocused $bg $bg $fg $border $border
client.urgent $bg $bg $active $border $border
client.placeholder $bg $bg $fg $border $border
client.background $bg
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
set_from_resource $font i3wm.color.font monospace
font pango:$font 8
font pango:sans 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesnt scale on retina/hidpi displays.
set $ws1 "1: 1 "
set $ws2 "2: 2 "
set $ws3 "3: 3 "
set $ws4 "4: 4 "
set $ws5 "5: 5 "
set $ws6 "6: 6 "
set $ws7 "7: 7 "
set $ws8 "8: 8 "
set $ws9 "9: 9 "
set $ws10 "10: 10 "
# default workspace
workspace "2"
# window title
for_window [class="^.*"] border pixel 2 title_format " %title"
for_window [floating] border pixel 1
#for_window [class="^.*"] border pixel 2 title_format " %title"
default_border pixel 2
for_window [floating] default_border pixel 1
smart_borders on
# GapS
# Gaps
gaps inner 16
gaps outer -8
smart_gaps on
# Floating mod
for_window [class="^Pavucontrol$"] floating enable
for_window [class="^Pulseeffects$"] floating enable
for_window [class="Remmina" title="Remmina Remote Desktop Client"] floating enable
for_window [class="feh" title="pinned screenshot"] floating enable sticky enable
for_window [app_id="pavucontrol"] floating enable
for_window [app_id="org.remmina.Remmina" title="Remmina Remote Desktop Client"] floating enable
for_window [app_id="desktopclient.nextcloud.com.nextcloud"] floating enable
for_window [class="TeamViewer"] floating enable
for_window [class="feh" title="Pinned screenshot"] {
floating enable
sticky enable
}
for_window [window_type="dialog"] floating enable
for_window [window_type="utility"] floating enable
for_window [window_type="toolbar"] floating enable
for_window [window_type="splash"] floating enable
# https://github.com/ValveSoftware/steam-for-linux/issues/1040
for_window [class="^Steam$" title="^Friends$"] floating enable
for_window [class="^Steam$" title="Steam - News"] floating enable
@ -85,14 +72,46 @@ for_window [class="^Steam$" title="^Screenshot Uploader$"] floating enable
for_window [class="^Steam$" title="^Steam Guard - Computer Authorization Required$"] floating enable
for_window [title="^Steam Keyboard$"] floating enable
### Output configuration
output "*" {
background ~/.local/share/wallpaper fill
}
### Input configuration
# mod key
set $mod Mod4
# caps lock is rebinded to mod key
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# disable focus follow mouse
#focus_follows_mouse no
# Touchpad
input "1739:0:Synaptics_TM3053-003" {
tap enabled
tap_button_map lrm
middle_emulation enabled
scroll_method two_finger
dwt enable
drag enable
}
input "*" {
# Keyboard
xkb_layout us
xkb_variant altgr-intl
xkb_options caps:super
# Mouse
accel_profile flat
pointer_accel 0
}
### Key bindings
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Return exec $terminal
# thunar
bindsym $mod+Mod1+Return exec thunar
@ -101,11 +120,11 @@ bindsym $mod+Mod1+Return exec thunar
bindsym $mod+Shift+q kill
# start rofi (a program launcher)
bindsym $mod+Control+Return exec /bin/bash ~/.config/i3/rofi.bash
bindsym $mod+Control+Return exec rofi -combi drun -show drun -modi drun,window
# start rofi-pass for password autotype
bindsym $mod+Shift+Return exec rofi-pass
# start rofi-radio
bindsym $mod+p exec ~/.config/i3/rofi-radio.py
bindsym $mod+p exec ~/bin/rofi-radio
# change focus
bindsym $mod+h focus left
@ -113,9 +132,6 @@ bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# disable focus follow mouse
focus_follows_mouse no
# alternatively, you can use the cursor keys:
#bindsym $mod+Left focus left
#bindsym $mod+Down focus down
@ -150,7 +166,7 @@ bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space exec center-float
bindsym $mod+Shift+space floating toggle
# toggle sticky
bindsym $mod+Ctrl+space sticky toggle
@ -210,18 +226,25 @@ workspace $ws9 output HDMI-1
workspace $ws10 output HDMI-1
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# toggle compton
bindsym $mod+c exec --no-startup-id systemctl --user is-active compton && systemctl --user stop compton || systemctl --user start compton
bindsym $mod+Shift+r reload
# exit
bindsym $mod+Shift+e exec "swaynag -t warning -m 'Do you really want to exit sway?' -b 'Yes, exit sway' 'swaymsg exit'"
# lock the screen
bindsym $mod+Pause exec lock
# suspend
bindsym $mod+Shift+Pause exec systemctl suspend
# function keys
bindsym XF86MonBrightnessUp exec brightness-control up
bindsym XF86MonBrightnessDown exec brightness-control down
bindsym XF86AudioMute exec volume-control mute
bindsym XF86AudioRaiseVolume exec volume-control up
bindsym XF86AudioLowerVolume exec volume-control down
bindsym Shift+print exec sshot --pin
bindsym Control+print exec sshot --partial
bindsym Alt+print exec sshot --window
bindsym print exec sshot
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
@ -248,32 +271,36 @@ mode "resize" {
bindsym $mod+r mode "resize"
### Startup
# reach systemd target
exec --no-startup-id systemctl --user import-environment
exec --no-startup-id systemctl --user start user-graphical-login.target
exec /bin/systemctl --user import-environment
exec /bin/systemctl --user start sway-session.target
exec --no-startup-id /bin/dex -a
exec --no-startup-id /bin/bash ~/.config/i3/startup.bash
# autorun .desktop
exec /bin/dex -a
# run a terminal
exec $terminal
bar {
status_command i3status --config ~/.config/i3/i3status.conf | ~/.config/i3/wrapper.py
output primary
font pango:$font 10
height 28
tray_padding 7
position top
separator_symbol "|"
strip_workspace_numbers yes
colors {
background #000000
statusline $fg
focused_workspace $bg_enabled $bg_enabled $fg
active_workspace #000000 #000000 $fg
inactive_workspace #000000 #000000 $fg_disabled
urgent_workspace #000000 #000000 $color3
}
swaybar_command waybar
# status_command i3status
#
# font pango:$font 10
# height 30
# tray_padding 7
# position top
# separator_symbol " ▏"
# strip_workspace_numbers yes
#
# colors {
# background #000000
# statusline $fg
#
# focused_workspace #2c2f33 #2c2f33 $fg
# active_workspace #000000 #000000 $fg
# inactive_workspace #000000 #000000 #4b5056
# urgent_workspace #000000 #000000 #e27c77
# }
}

View File

@ -0,0 +1,30 @@
image=~/.local/share/wallpaper
scaling=fill
color=111111
disable-caps-lock-text
line-uses-ring
indicator-radius=100
indicator-thickness=10
inside-color=00000000
inside-clear-color=00000000
inside-caps-lock-color=00000000
inside-ver-color=00000000
inside-wrong-color=00000000
ring-color=b7bbb7
ring-ver-color=e2995c
ring-clear-color=b04c50
ring-wrong-color=b04c50
separator-color=b7bbb7
key-hl-color=e2995c
bs-hl-color=b04c50
text-color=00000000
text-clear-color=00000000
text-caps-lock-color=00000000
text-ver-color=00000000
text-wrong-color=00000000

View File

@ -1,11 +0,0 @@
[Unit]
Description=A compositor for X11
Requires=user-graphical-login.target
After=user-graphical-login.target
[Service]
ExecStart=/usr/bin/compton
Restart=always
[Install]
WantedBy=user-graphical-login.target

View File

@ -1,12 +1,12 @@
[Unit]
Description=Redshift display colour temperature adjustment
Documentation=http://jonls.dk/redshift/
Requires=user-graphical-login.target
After=user-graphical-login.target
Requires=sway-session.target
After=sway-session.target
[Service]
ExecStart=/usr/bin/redshift
ExecStart=/usr/bin/redshift -m wayland
Restart=always
[Install]
WantedBy=user-graphical-login.target
WantedBy=sway-session.target

View File

@ -0,0 +1,6 @@
[Unit]
Description=sway compositor session
Documentation=man:systemd.special(7)
BindsTo=graphical-session.target
Wants=graphical-session-pre.target
After=graphical-session-pre.target

View File

@ -0,0 +1 @@
/home/marchambault/.config/systemd/user/swayidle.service

View File

@ -0,0 +1,15 @@
[Unit]
Description=Idle manager for Wayland
Documentation=man:swayidle(1)
PartOf=graphical-session.target
[Service]
Type=simple
ExecStart=/usr/bin/swayidle -w \
timeout 1200 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
timeout 1210 'lock' \
before-sleep 'lock'
[Install]
WantedBy=sway-session.target

View File

@ -1,4 +0,0 @@
[Unit]
Description=User Graphical Login
Requires=default.target
After=default.target

View File

@ -1 +0,0 @@
/home/marchambault/.config/systemd/user/compton.service

View File

@ -1,11 +0,0 @@
[Unit]
Description=Animated wallpaper
Requires=user-graphical-login.target
After=user-graphical-login.target
[Service]
ExecStart=/bin/bash -c '"$HOME/.local/bin/wallpaper"'
Restart=always
[Install]
WantedBy=user-graphical-login.target

View File

@ -0,0 +1,78 @@
{
"layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 23, // Waybar height (to be removed for auto height)
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode"],
"modules-center": [],
"modules-right": ["clock", "network", "cpu", "memory", "battery", "backlight", "pulseaudio", "custom/vpn", "idle_inhibitor", "tray"],
// Modules configuration
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": true,
"format": "{name}"
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"format": " {:%Y-%m-%d %H:%M}"
},
"cpu": {
"format": " {usage}%",
"tooltip": false
},
"memory": {
"format": " {}%"
},
"backlight": {
"format": "{icon} {percent}%",
"format-icons": ["", "", ""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": " {icon} {capacity}%",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"network": {
"format-wifi": " &lt;{essid}&gt; {ipaddr}/{cidr}",
"format-ethernet": " {ipaddr}/{cidr}",
"format-disconnected": "⚠ Disconnected"
},
"pulseaudio": {
//"scroll-step": 1,
"format": "{icon} {volume}%",
"format-bluetooth": "{icon} {volume}%",
"format-muted": " --%",
"format-icons": {
"headphones": "",
"headset": "",
"default": ["", "", ""]
},
"on-click": "pavucontrol"
},
"custom/vpn": {
"format": "{}",
"interval": 5,
"exec": "test -e /proc/sys/net/ipv4/conf/tun0 && echo  || echo "
}
}

View File

@ -0,0 +1,33 @@
* {
border: none;
font-family: "Font Awesome 5 Free", sans-serif;
font-size: 13px;
}
window#waybar {
background: rgba(43, 48, 59, 0.8);
color: white;
}
#workspaces button {
padding: 0 5px;
background: transparent;
color: white;
}
#workspaces button.focused {
background: #64727D;
}
#clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio {
padding: 0 10px;
border-right: 1px solid #b7bbb7;
}
#idle_inhibitor, #tray, #custom-vpn {
min-width: 25px;
}
#tray {
margin-left: 5px;
}

View File

@ -11,3 +11,5 @@ setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye >/dev/null
# keychain (for ssh agent)
eval $(keychain --eval --quiet --noask --nogui)

View File

@ -10,12 +10,12 @@ export FZF_TMUX_HEIGHT=90%
# attach some extra options to path and dir completion
eval "_$(declare -f _fzf_path_completion)"
_fzf_path_completion() {
FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" __fzf_path_completion $@
FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" __fzf_path_completion "$1" "$2"
}
eval "_$(declare -f _fzf_dir_completion)"
_fzf_dir_completion() {
FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" __fzf_dir_completion $@
FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" __fzf_dir_completion "$1" "$2"
}
# Remove duplicate when using Ctrl+R

View File

@ -9,11 +9,11 @@ alias rename="perl-rename"
alias userctl="systemctl --user"
# ls
alias ls="lsd --group-dirs first"
alias l='lsd --group-dirs -l'
alias la='lsd --group-dirs -a'
alias lla='lsd --group-dirs -la'
alias lt='lsd --group-dirs --tree'
alias ls='lsd --group-dirs=first'
alias l='ls -l'
alias la='ls -a'
alias lla='ls -la'
alias lt='ls --tree'
# powershell seems to have trouble with xterm-256color
alias pwsh="TERM=xterm pwsh"

View File

@ -0,0 +1,2 @@
export ZSH_TMUX_AUTOSTART=true
export ZSH_TMUX_FIXTERM_WITH_256COLOR=true

2
files/.local/bin/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -1,6 +0,0 @@
#!/bin/bash
set -- \
$(i3-msg -t get_workspaces | jq --raw-output '. | map(select(.focused == true)) | .[].rect | [.width, .height] | @sh')
i3-msg -q floating toggle
i3-msg -q resize set $(( $1/3*2 )) $(( $2/3*2 ))
i3-msg -q move absolute position center

View File

@ -1,80 +0,0 @@
#!/bin/bash
#pvid: streamlink wrapper
print_help() {
echo "A streamlink wrapper"
echo ""
echo "Usage: emp [options] url"
echo ""
echo "Options:"
echo " -h, --help Print this help text"
echo " -b, --bg Play the video on the root window"
echo " -a, --audio Play only the audio"
echo ""
exit 0
}
short_args=hba
long_args=help,bg,audio
# default
default_stream="best"
mpv_cmd="mpv"
player_args="--wid="$(xdotool getactivewindow)""
streamlink_args="--retry-stream 30"
# Parse arguments
parsed_args=$(getopt --options $short_args --longoptions $long_args --name "$0" -- "$@")
if [[ $? -ne 0 ]]; then
echo "Failed to parse arguments"
exit 2
fi
eval set -- "$parsed_args"
while true; do
case "$1" in
-h|--help)
print_help
;;
-b|--bg)
a=y
streamlink_args="$streamlink_args --quiet"
mpv_cmd="xwinwrap -ov -fs -- mpv"
player_args="--no-osc --wid WID"
shift
;;
-a|--audio)
a=y
streamlink_args="$streamlink_args --quiet"
player_args="--no-video"
shift
;;
--)
shift
break
;;
*)
#the following args will be passed to streamlink
break
;;
esac
done
if [[ -z "$@" ]]; then
print_help
fi
streamlink \
$streamlink_args \
--default-stream "$default_stream" \
--player="$mpv_cmd" \
--player-args "$player_args -- {filename}" \
$@ &
if [[ -n "$a" ]]; then
cava
fi
wait
exit $?

View File

@ -1,27 +0,0 @@
#!/bin/bash
unset LD_PRELOAD
query_color() {
xrdb -query | grep -m 1 "lock.color.$1" | sed -E 's/^.+:\s*#?//g'
}
query_prop() {
xrdb -query | grep -m 1 "lock.$1" | sed -E 's/^.+:\s*//g'
}
# flush gpg-agent cache
echo RELOADAGENT | gpg-connect-agent
exec i3lock --image="$HOME/.local/share/wallpaper" --indicator --force-clock --color "$(query_color background)" \
--veriftext="" --wrongtext="" --noinputtext="" --layoutcolor="00000000" --insidevercolor="00000000" --insidewrongcolor="00000000" --insidecolor="00000000" \
--ringvercolor="$(query_color primary)FF" --ringwrongcolor="$(query_color error)FF" --ringcolor="$(query_color foreground)FF" \
--keyhlcolor="$(query_color primary)FF" --bshlcolor="$(query_color secondary)FF" \
--modifpos="w:h" \
--separatorcolor="00000000" --line-uses-inside \
--radius=50 --indpos="x+100:h-150" \
--timecolor="00000000" --time-font="$(query_prop font)" --timecolor="$(query_color foreground)FF" --timesize=72 \
--time-align=1 --timepos="ix+r+20:iy+50" --timestr="%H:%M" \
--date-font="$(query_prop font)" --datecolor="$(query_color foreground)FF" --datesize=48 \
--date-align=1 --datepos="tx:ty-70" --datestr="%A, %b %e"

View File

@ -1,36 +0,0 @@
#!/bin/bash
#mount_dir="$(mktemp -d /tmp/ramdisk.XXXX)"
mount_dir="/tmp/ramdisk"
mkdir "$mount_dir"
img_file="$mount_dir/img"
if [[ ! -f "$1" ]]; then
echo "'$1' is an invalid file"
exit 1
fi
# create tmpfs and copy the file on it
img_size="$(stat --printf="%s" "$1")"
sudo mount -t tmpfs size=$img_size,noexec,nosid,uid=$UID,gid=$GID "$mount_dir"
cp "$1" "$img_file"
read -p "press enter to unmount"
# check if the file is in use
while lsof "$mount_dir" | grep -q "$mount_dir"; do
echo "Device is busy"
read -p "press enter to unmount"
done
# save the image to disk
if cp "$img_file" "$1.tmp"; then
mv "$1.tmp" "$1"
else
echo "Error copying '$img_file' back to disk!"
exit 1
fi
# cleanup
sudo umount "$mount_dir"
rmdir "$mount_dir"

View File

@ -1,2 +0,0 @@
#!/bin/bash
exec xwinwrap -ov -fs -- mpv --no-osc --no-stop-screensaver --wid WID $@

View File

@ -1,69 +0,0 @@
#!/bin/bash
export QEMU_AUDIO_DRV=pa
export QEMU_PA_SAMPLE=1024
export QEMU_AUDIO_TIMER_PERIOD=150
export QEMU_PA_SERVER=/run/user/1000/pulse/native
# defrag ram
sudo sh -c "echo 1 > /proc/sys/vm/compact_memory"
# assign hugepages
sudo sysctl -w vm.nr_hugepages=8192
# start qemu
qemu-system-x86_64 -name win10 -S \
-machine q35,accel=kvm -device intel-iommu \
-cpu host,hv_time,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff,hv_vendor_id=0xDEADBEEFFF,kvm=off \
-smp 6,sockets=1,cores=3,threads=2 \
-m 16G -mem-prealloc -mem-path /dev/hugepages/libvirt/qemu/win10 \
-drive file=/usr/share/ovmf/x64/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \
-realtime mlock=off \
-uuid 9d7df055-d6d1-4551-bb25-ef2ddb835c4d \
-no-user-config \
-rtc base=localtime,driftfix=slew \
-global kvm-pit.lost_tick_policy=delay \
-no-hpet -no-shutdown \
-global ICH9-LPC.disable_s3=1 \
-global ICH9-LPC.disable_s4=1 \
-boot strict=on \
-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \
-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
-device pcie-root-port,port=0x10,chassis=3,id=pci.3,bus=pcie.0,multifunction=on,addr=0x2 \
-device pcie-root-port,port=0x11,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x1 \
-device pcie-root-port,port=0x12,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x2 \
-device pcie-root-port,port=0x13,chassis=6,id=pci.6,bus=pcie.0,addr=0x2.0x3 \
-device pcie-root-port,port=0x14,chassis=7,id=pci.7,bus=pcie.0,addr=0x2.0x4 \
-device pcie-root-port,port=0x15,chassis=8,id=pci.8,bus=pcie.0,addr=0x2.0x5 \
-device ich9-usb-ehci1,id=usb,bus=pcie.0,addr=0x1d.0x7 \
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pcie.0,multifunction=on,addr=0x1d \
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pcie.0,addr=0x1d.0x1 \
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 \
-device virtio-scsi-pci,id=scsi0,num_queues=6,bus=pci.5,addr=0x0 \
-device virtio-serial-pci,id=virtio-serial0,bus=pci.3,addr=0x0 \
-device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 \
-drive file=$HOME/Documents/virtualmachines/img/win10.img,format=raw,if=none,id=drive-scsi0-0-0-0 \
-drive file=/dev/disk/by-label/DATA,format=raw,if=none,id=drive-scsi0-0-0-3,cache=none,aio=native \
-device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=3,drive=drive-scsi0-0-0-3,id=scsi0-0-0-3,write-cache=on \
-drive if=none,id=drive-sata0-0-1,media=cdrom,readonly=on \
-device ide-cd,bus=ide.1,drive=drive-sata0-0-1,id=sata0-0-1 \
-chardev spicevmc,id=charchannel0,name=vdagent \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \
-spice unix,addr=/tmp/win10.sock,disable-ticketing,image-compression=off,seamless-migration=on \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pcie.0,addr=0x1 \
-device intel-hda,id=sound0,bus=pci.2,addr=0x2 \
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 \
-chardev spicevmc,id=charredir0,name=usbredir \
-device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=2 \
-device usb-host,hostbus=1,hostaddr=3,id=hostdev0,bus=usb.0,port=1 \
-device vfio-pci,host=01:00.0,id=hostdev1,bus=pci.6,addr=0x0 \
-device vfio-pci,host=00:1f.6,id=hostdev2,bus=pci.2,addr=0x3 \
-device usb-host,hostbus=1,hostaddr=11,id=hostdev3,bus=usb.0,port=3 \
-device virtio-balloon-pci,id=balloon0,bus=pci.7,addr=0x0 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-object memory-backend-file,id=shmmem-shmem0,mem-path=/dev/shm/looking-glass,size=33554432,share=yes \
-device ivshmem-plain,id=shmem0,memdev=shmmem-shmem0,bus=pci.2,addr=0x4 \
-msg timestamp=on
# free hugepages
sudo sysctl -w vm.nr_hugepages=0

View File

@ -1,54 +0,0 @@
#!/bin/bash
## sshot - Take a screenshot
if [[ "$1" == "--partial" ]]; then
ARG_PARTIAL=1
elif [[ "$1" == "--pin" ]]; then
ARG_PARTIAL=1
ARG_PIN=1
elif [[ "$1" == "--window" ]]; then
ARG_WINDOW=1
fi
file="$HOME/Pictures/screenshots/$(date --iso-8601=seconds).png"
mkdir -p "$(dirname $file)" 2>/dev/null
if [[ -n "$ARG_PARTIAL" ]]; then
# prompt the user for the area to take a screenshot from
read -r geometry < <(slop --highlight --color="0.6,0.4,0.3,0.4" --tolerance=0 --format "%wx%h+%x+%y")
if [ -z "$geometry" ]; then
exit 1
fi
elif [[ -n $ARG_WINDOW ]]; then
# get the active window geometry
while read -r line; do
if echo "$line" | grep -q "Position"; then
p="$(echo "$line" | grep -Eo '[0-9]+,[0-9]+' | sed 's/,/+/')"
elif echo "$line" | grep -q "Geometry"; then
g="$(echo "$line" | grep -Eo '[0-9]+x[0-9]+')"
fi
done <<< "$(xdotool getactivewindow getwindowgeometry)"
geometry="$g"+"$p"
fi
# take a screenshot
scrot "$file"
if [[ -n "$geometry" ]]; then
# crop the screenshot to geometry
convert "$file" -crop "$geometry" "$file"
fi
# place to image in the clipboard
xclip -selection clipboard -target image/png "$file"
if [[ -n "$ARG_PIN" ]]; then
# pin the screenshot
feh --title "pinned screenshot" --geometry "$geometry" "$file" &
fi
# print the file name
echo "$file"

View File

@ -1,35 +0,0 @@
#!/bin/bash
# Animated wallpaper
# quick and dirty script, but it works
wallpaper_source="https://massaki.ca/extra/wallpaper.mp4"
wallpaper_static="$HOME/.local/share/wallpaper.jpg"
wallpaper_anim="$HOME/.local/share/wallpaper.mp4"
if [ ! -f "$HOME/.cache/wallpaper_enabled" ]; then
echo "Animated wallpaper disabled"
echo "touch $HOME/.cache/wallpaper_enabled to enable it"
exit
fi
if [ ! -f "$wallpaper_anim" ]; then
# calculate screen geometry
screen_size="$(xrandr --screen 0 | grep '^Screen' | grep -Eo 'current [0-9]+ x [0-9]+' | sed -E 's/current ([0-9]+) x ([0-9]+)/\1 \2/g')"
set -- $screen_size
# download, crop and scale
ffmpeg -i "$wallpaper_source" -vf "scale=w=$1:h=$2:force_original_aspect_ratio=increase, crop=w=$1:h=$2:y=(in_w-out_w)" -sws_flags lanczos \
-c:v libx264 -tune fastdecode -preset ultrafast -crf 18 -r 15 "$wallpaper_anim"
# extract static image
ffmpeg -i "$wallpaper_anim" -vframes 1 "$wallpaper_static"
# set static wallpaper
feh --bg-fill --no-xinerama "$wallpaper_static"
fi
if ! acpi --ac-adapter 2>/dev/null | grep -q 'off-line'; then
exec "$HOME/.local/bin/mpv-bg" --really-quiet \
--no-config --no-border --no-audio --vd-lavc-fast \
--loop --panscan=1.0 --scale=oversample --cache-file=TMP "$wallpaper_anim"
fi

2
files/.local/profile.d/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -1,6 +0,0 @@
# Set SSH to use gpg-agent
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi

View File

@ -1,5 +1,5 @@
# PATH
export PATH="$PATH:$HOME/.local/bin:$HOME/bin"
export PATH="$HOME/.local/bin:$HOME/bin:$PATH"
# applications
export TERMINAL=termite
@ -12,16 +12,9 @@ export DIFFPROG=meld
# motd
export MOTD_SERVICES="$MOTD_SERVICES docker.socket"
# firefox
export MOZ_USE_XINPUT2=1
# qt5
export DESKTOP_SESSION=gnome
export QT_STYLE_OVERRIDE=gtk
export QT_QPA_PLATFORMTHEME=gtk2
export QT_AUTO_SCREEN_SCALE_FACTOR=0
# java
export _JAVA_OPTIONS="-XX:MaxPermSize=128m -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dsun.java2d.opengl=true"
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dsun.java2d.opengl=true"
export JAVA_FONTS=/usr/share/fonts/TTF
source ~/.local/profile.d/*

View File

@ -16,38 +16,31 @@ set -s escape-time 0
# Mouse
set -g mouse on
# tmux-256color is badly supported on some system, especially servers so we pretend to be screen instead
set -g default-terminal 'screen-256color'
set -ga terminal-overrides ',screen-256color:Tc'
# Window
set -g base-index 1
# Pane
setw -g pane-base-index 1
setw -g allow-rename off
set -g pane-border-fg 'colour7'
set -g pane-active-border-fg 'colour5'
set -g pane-border-style fg='colour7'
set -g pane-active-border-style fg='colour5'
# Status bar
set -g status-position top
set -g status-bg 'default'
setw -g window-status-fg 'colour7'
setw -g window-status-bg 'default'
setw -g window-status-style fg='colour7'
setw -g window-status-format ' #I:#W'
setw -g window-status-current-fg 'colour15'
setw -g window-status-current-bg 'default'
setw -g window-status-current-style fg='colour15'
setw -g window-status-current-format ' [#I:#W]'
setw -g window-status-activity-attr bold
setw -g window-status-activity-style bold
set -g status-left-fg 'colour7'
set -g status-left '{#[fg=colour6]#S#[fg=default]}'
set -g status-left-style fg='colour7'
set -g status-left '{#[fg=colour6]#S#[fg=colour7]}'
set -g status-right-length 100
set -g status-right-fg 'colour7'
set -g status-right-style fg='colour7'
set -g status-right '#U@#H'
# Plugins

@ -1 +1 @@
Subproject commit 42bb2bf48bef881be504278cf5156371b542cf81
Subproject commit 476f6ca69922c9e67c408ae92dff0eb0ccb8ee51

View File

@ -1,30 +0,0 @@
# backlight
"brightness-control up"
XF86MonBrightnessUp
"brightness-control down"
XF86MonBrightnessDown
# volume
"volume-control mute"
XF86AudioMute
"volume-control up"
XF86AudioRaiseVolume
"volume-control down"
XF86AudioLowerVolume
# printscreen
"sshot --pin"
Shift + Print
"sshot --partial"
Control + Print
"sshot --window"
Alt + Print
"sshot"
Print

View File

@ -1,2 +0,0 @@
[ -f ~/.xprofile ] && source ~/.xprofile
exec i3

View File

@ -1,33 +0,0 @@
systemctl --user import-environment DISPLAY
# gtk3-nocsd
export GTK_CSD=0
export LD_PRELOAD="$LD_PRELOAD /usr/lib/libgtk3-nocsd.so.0"
# screen layout
if xrandr | grep 'HDMI-1 connected'; then
xrandr \
--output HDMI-1 --auto --pos 1080x190 --primary \
--output HDMI-2 --rotate right --auto --pos 0x0
fi
export PRIMARY_MONITOR="$(xrandr | grep 'primary' | grep -Eo '^[^ ]+')"
# lockscreen
xss-lock -- lock &
# key binding
[ -f ~/.xbindkeysrc ] && xbindkeys
[ -f ~/.Xmodmap ] && xmodmap ~/.Xmodmap
# xrdb
[ -f ~/.Xresources ] && xrdb -I"$HOME" ~/.Xresources
# wallpaper and colorschemes
sh ~/.fehbg || \
feh --bg-fill --no-fehbg /usr/share/pixmaps/wallpaper.png
# set screen blanking to 30 minutes
xset s 1800 1800
source ~/.local/profile.d/*

View File

@ -1,9 +1,8 @@
# Autostart Xorg if we are on tty1
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
exec startx
# Autostart sway if we are on tty1
if [ -z "$WAYLAND_DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
exec ~/bin/sway
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
@ -89,20 +88,3 @@ source $ZSH/oh-my-zsh.sh
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# Remove duplicate when using Ctrl+R
# https://github.com/junegunn/fzf/issues/626
__fzf_history__() (
local line
shopt -u nocaseglob nocasematch
line=$(
HISTTIMEFORMAT= history | tac | sort --key=2.1 -bus | sort -n |
FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS --tac -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS +m" $(__fzfcmd) |
command grep '^ *[0-9]') &&
if [[ $- =~ H ]]; then
sed 's/^ *\([0-9]*\)\** .*/!\1/' <<< "$line"
else
sed 's/^ *\([0-9]*\)\** *//' <<< "$line"
fi
)

View File

@ -0,0 +1,3 @@
#!/bin/bash
get-focused-window-properties | jq --raw-output '.rect|((.x|tostring)+","+(.y|tostring)+" "+(.width|tostring)+"x"+(.height|tostring))'

View File

@ -0,0 +1,3 @@
#!/bin/bash
swaymsg -t get_tree | jq --raw-output '..|select(.focused? == true)'

9
files/bin/lock Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
unset LD_PRELOAD
# flush gpg-agent cache
echo RELOADAGENT | gpg-connect-agent
# lock
exec swaylock

41
files/bin/sshot Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
## sshot - Take a screenshot
if [[ "$1" == "--partial" ]]; then
ARG_PARTIAL=1
elif [[ "$1" == "--pin" ]]; then
ARG_PARTIAL=1
ARG_PIN=1
elif [[ "$1" == "--window" ]]; then
ARG_WINDOW=1
fi
file="$HOME/Pictures/screenshots/$(date --iso-8601=seconds).png"
mkdir -p "$(dirname $file)" 2>/dev/null
if [[ -n "$ARG_PARTIAL" ]]; then
# prompt the user for the area to take a screenshot from
geometry="$(slurp)"
if [ -z "$geometry" ]; then
exit 1
fi
elif [[ -n $ARG_WINDOW ]]; then
# get the active window geometry
geometry="$(get-focused-window-geometry)"
fi
# take a screenshot
grim -g "$geometry" -- "$file"
# place to image in the clipboard
wl-copy < "$file"
if [[ -n "$ARG_PIN" ]]; then
# pin the screenshot
feh --title "Pinned screenshot" --geometry "$(echo -n "$geometry" | sed -E 's/([0-9]+),([0-9]+) ([0-9]+)x([0-9]+)/\3x\4+\1+\2/')" "$file" &
fi
# print the file name
echo "$file"

59
files/bin/sway Executable file
View File

@ -0,0 +1,59 @@
#!/bin/bash
import-gsettings() {
# usage: import-gsettings <gsettings key>:<settings.ini key> <gsettings key>:<settings.ini key> ...
expression=""
for pair in "$@"; do
IFS=:; set -- $pair
expressions="$expressions -e 's:^$2=(.*)$:gsettings set org.gnome.desktop.interface $1 \1:e'"
done
IFS=
eval sed -E $expressions "${XDG_CONFIG_HOME:-$HOME/.config}"/gtk-3.0/settings.ini >/dev/null
}
export XDG_SESSION_TYPE=wayland
# Qt
export DESKTOP_SESSION=gnome
export QT_STYLE_OVERRIDE=gtk
export QT_QPA_PLATFORMTHEME=gtk2
export QT_AUTO_SCREEN_SCALE_FACTOR=0
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
# GTK
export CLUTTER_BACKEND=wayland
export GTK_CSD=0
if [[ -f /usr/lib/libgtk3-nocsd.so.0 ]]; then
export LD_PRELOAD=/usr/lib/libgtk3-nocsd.so.0
fi
import-gsettings \
gtk-theme:gtk-theme-name \
icon-theme:gtk-icon-theme-name \
cursor-theme:gtk-cursor-theme-name
# Elementary/EFL
export ECORE_EVAS_ENGINE=wayland_egl
export ELM_ENGINE=wayland_egl
# SDL
export SDL_VIDEODRIVER=wayland
# Java
export _JAVA_AWT_WM_NONREPARENTING=1
# wlroot rdp
wlroot_rdp_cache="$HOME/.cache/wlr-rdp"
wlroot_rdp_cert="$wlroot_rdp_cache/tls.crt"
wlroot_rdp_key="$wlroot_rdp_cache/tls.key"
wlroot_rdp_csr="$wlroot_rdp_cache/tls.csr"
mkdir "$wlroot_rdp_cache" 2>/dev/null
if [[ ! -e "$wlroot_rdp_cert" ]] || [[ ! -e "$wlroot_rdp_key" ]]; then
openssl genrsa -out "$wlroot_rdp_key" 2048
openssl req -new -key "$wlroot_rdp_key" -out "$wlroot_rdp_csr"
openssl x509 -req -days 365 -signkey "$wlroot_rdp_key" -in "$wlroot_rdp_csr" -out "$wlroot_rdp_cert"
fi
WLR_RDP_TLS_CERT_PATH="$wlroot_rdp_cert" \
WLR_RDP_TLS_KEY_PATH="$wlroot_rdp_key" \
exec /usr/bin/sway $@

View File

@ -3,7 +3,8 @@
# run units
systemctl --user daemon-reload
systemctl --user enable --now tmux.service
systemctl --user enable --now mpd.service
systemctl --user enable --now redshift.service
systemctl --user enable --now swayidle.service
# install tmux plugins
tmux run-shell ~/.tmux/plugins/tpm/bin/install_plugins