From 7fceb0156819039d0952812c3f944d2dda73cf56 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 28 Feb 2019 23:01:01 -0500 Subject: [PATCH 01/29] migrate i3 configs to sway --- files/.config/sway/config | 274 +++++++++++++++++++++++++++++++ files/.config/sway/i3status.conf | 90 ++++++++++ files/.config/sway/rofi-radio.py | 75 +++++++++ files/.config/sway/rofi.bash | 3 + 4 files changed, 442 insertions(+) create mode 100644 files/.config/sway/config create mode 100644 files/.config/sway/i3status.conf create mode 100755 files/.config/sway/rofi-radio.py create mode 100755 files/.config/sway/rofi.bash diff --git a/files/.config/sway/config b/files/.config/sway/config new file mode 100644 index 0000000..e838ee5 --- /dev/null +++ b/files/.config/sway/config @@ -0,0 +1,274 @@ +### Vars +set $terminal termite + +### 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 +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 $font Hack Nerd Font +font pango:$font 8 + +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 " + +# window title +#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 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 [class="TeamViewer"] 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 +for_window [class="^Steam$" title=".* - Chat"] floating enable +for_window [class="^Steam$" title="^Settings$"] floating enable +for_window [class="^Steam$" title=".* - event started"] floating enable +for_window [class="^Steam$" title=".* CD key"] floating enable +for_window [class="^Steam$" title="^Steam - Self Updater$"] floating enable +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.jpg 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 + +input "2:18:FocalTechPS/2_FocalTech_Touchpad" { + tap enabled + tap_button_map lrm + middle_emulation enabled +} + +input "*" { + xkb_layout us + xkb_variant altgr-intl + xkb_options caps:super +} + +### Key bindings +# start a terminal +bindsym $mod+Return exec $terminal + +# thunar +bindsym $mod+Mod1+Return exec thunar + +# kill focused window +bindsym $mod+Shift+q kill + +# start rofi (a program launcher) +bindsym $mod+Control+Return exec /bin/bash ~/.config/sway/rofi.bash +# start rofi-pass for password autotype +bindsym $mod+Shift+Return exec rofi-pass +# start rofi-radio +bindsym $mod+p exec ~/.config/sway/rofi-radio.py + +# change focus +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right + +# alternatively, you can use the cursor keys: +#bindsym $mod+Left focus left +#bindsym $mod+Down focus down +#bindsym $mod+Up focus up +#bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+Shift+backslash split h # | +bindsym $mod+backslash split h + +# split in vertical orientation +bindsym $mod+minus split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space exec center-float + +# toggle sticky +bindsym $mod+Ctrl+space sticky toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +bindsym $mod+d focus child + +# switch to workspace +bindsym $mod+q workspace back_and_forth +bindsym $mod+1 workspace $ws1 +bindsym $mod+2 workspace $ws2 +bindsym $mod+3 workspace $ws3 +bindsym $mod+4 workspace $ws4 +bindsym $mod+5 workspace $ws5 +bindsym $mod+6 workspace $ws6 +bindsym $mod+7 workspace $ws7 +bindsym $mod+8 workspace $ws8 +bindsym $mod+9 workspace $ws9 +bindsym $mod+0 workspace $ws10 + +#bindsym $mod+Ctrl+Up workspace next +#bindsym $mod+Ctrl+Down workspace prev + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace $ws1 +bindsym $mod+Shift+2 move container to workspace $ws2 +bindsym $mod+Shift+3 move container to workspace $ws3 +bindsym $mod+Shift+4 move container to workspace $ws4 +bindsym $mod+Shift+5 move container to workspace $ws5 +bindsym $mod+Shift+6 move container to workspace $ws6 +bindsym $mod+Shift+7 move container to workspace $ws7 +bindsym $mod+Shift+8 move container to workspace $ws8 +bindsym $mod+Shift+9 move container to workspace $ws9 +bindsym $mod+Shift+0 move container to workspace $ws10 + +# Assignation +assign [class="^Slack$"] $ws1 +assign [class="^discord$"] $ws1 +assign [class="^looking-glass-client$"] $ws3 + +# screen +workspace $ws1 output HDMI-2 +workspace $ws2 output HDMI-2 +workspace $ws3 output HDMI-1 +workspace $ws4 output HDMI-1 +workspace $ws5 output HDMI-1 +workspace $ws6 output HDMI-1 +workspace $ws7 output HDMI-1 +workspace $ws8 output HDMI-1 +workspace $ws9 output HDMI-1 +workspace $ws10 output HDMI-1 + +# reload the configuration file +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 + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + #bindsym Left resize shrink width 10 px or 10 ppt + #bindsym Down resize grow height 10 px or 10 ppt + #bindsym Up resize shrink height 10 px or 10 ppt + #bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} + +bindsym $mod+r mode "resize" + +### Startup +# reach systemd target +exec /bin/systemctl --user import-environment +exec /bin/systemctl --user start user-graphical-login.target + +# autorun .desktop +exec /bin/dex -a + +# run a terminal +exec $terminal + +bar { + status_command i3status --config ~/.config/sway/i3status.conf + + 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 + } +} + diff --git a/files/.config/sway/i3status.conf b/files/.config/sway/i3status.conf new file mode 100644 index 0000000..234d5a1 --- /dev/null +++ b/files/.config/sway/i3status.conf @@ -0,0 +1,90 @@ +# i3status configuration file. +# see "man i3status" for documentation. + +# It is important that this file is edited as UTF-8. +# The following line should contain a sharp s: +# ß +# If the above line is not correctly displayed, fix your editor first! + +general { + colors = true + color_good = "#B7BBB7" + color_degraded = "#E2995C" + color_bad = "#B04C50" + + output_format = "i3bar" + interval = 5 +} + +order += "tztime local" +order += "wireless _first_" +order += "ethernet _first_" +order += "cpu_usage" +order += "memory" +order += "battery all" +order += "volume master" +order += "path_exists vpn" +order += "path_exists empty" + +tztime local { + format = " %Y-%m-%d %H:%M" +} + +wireless _first_ { + format_up = "直 <%essid> %ip" + format_down = "睊" + color_bad = "#4B5056" +} + +ethernet _first_ { + # if you use %speed, i3status requires root privileges + format_up = " %ip" + format_down = "" + color_bad = "#4B5056" +} + +cpu_usage { + format = " %usage" + degraded_threshold = 90 + max_threshold = 98 +} + +memory { + format = " %percentage_used" + memory_used_method = "memavailable" + threshold_degraded = "20%" + threshold_degraded = "5%" +} + +battery all { + format = "%status %percentage" + format_down = "" + status_chr = "" + status_bat = "" + status_unk = "" + status_full = "ﮣ" + integer_battery_capacity = true + last_full_capacity = true + hide_seconds = true + + threshold_type = "percentage" + low_threshold = 15 +} + +volume master { + device = "pulse" + format = "墳 %volume" + format_muted = "婢" + color_degraded = "#4B5056" +} + +path_exists vpn { + format = "" + format_down = "" + path = "/proc/sys/net/ipv4/conf/tun0" +} + +path_exists empty { + format = "" + path = "/" +} diff --git a/files/.config/sway/rofi-radio.py b/files/.config/sway/rofi-radio.py new file mode 100755 index 0000000..d9a9d4b --- /dev/null +++ b/files/.config/sway/rofi-radio.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 +import json +import os +from subprocess import Popen, PIPE, check_output, check_call + +import yaml + + +station_name_file = '/run/user/%s/rofi-radio-name' % os.getuid() + +def mpv_ipc(*args): + try: + j = json.loads(check_output(['mpv-ipc'] + list(args))) + if j: + return j['data'] + except: + pass + return '' + +with open(os.path.expanduser("~/.local/share/rofi-radio/playlists.yaml")) as f: + stations = yaml.load(f) + +rofi_command = ['rofi', '-i', '-selected-row', '0', '-dmenu', '-p', 'mpv'] + +current_song = mpv_ipc('get_property_string', 'media-title') +if current_song: + try: + with open(station_name_file) as f: + station_name = f.readline() + except: + station_name = '' + rofi_command += ['-mesg', station_name] + commands = b"Play/Pause\nStop\nShuffle\nNext\nPrevious" + +else: + commands = bytes('\n'.join([s["name"] for s in stations]), 'utf8') + +rofi = Popen(rofi_command, stdout=PIPE, stdin=PIPE) +choice = rofi.communicate(input=commands)[0].decode('utf8').rstrip() + +if current_song: + if choice == "Play/Pause": + mpv_ipc('cycle', 'pause') + elif choice == "Stop": + mpv_ipc('stop') + elif choice == "Shuffle": + mpv_ipc('playlist-shuffle') + elif choice == "Next": + mpv_ipc('playlist-next') + elif choice == "Previous": + mpv_ipc('playlist-prev') +else: + s = [s for s in stations if s["name"] == choice] + if s: + # Load the selected playlist + loc = s[0]["loc"] + station_name = s[0]["name"] + if loc.startswith('http') or loc.startswith('ytdl'): + # Load the url + mpv_ipc('loadfile', loc) + else: + # Load the file + workdir = mpv_ipc('get_property_string', 'working-directory') + mpv_ipc('loadfile', os.path.expanduser(loc)) + station_name = loc + with open(station_name_file, 'w') as f: + f.write(station_name) + else: + # Try to load the user input + mpv_ipc('loadfile', choice) + mpv_ipc('set_property_string', 'pause', 'no') + + +# force update of i3status +check_call(['killall', '-USR1', 'i3status']) diff --git a/files/.config/sway/rofi.bash b/files/.config/sway/rofi.bash new file mode 100755 index 0000000..53625e6 --- /dev/null +++ b/files/.config/sway/rofi.bash @@ -0,0 +1,3 @@ +#!/bin/bash +rofi -combi drun -show drun -modi drun,window + From 496e0f19a0e1da3ba738740ea931ce48548687a1 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 28 Mar 2019 20:40:26 -0400 Subject: [PATCH 02/29] sway configs --- files/.config/sway/config | 35 +++++++++++++++++++++++++---------- files/.profile | 5 ++++- files/.xprofile | 1 - files/.zshrc | 15 ++++++++++++--- 4 files changed, 41 insertions(+), 15 deletions(-) diff --git a/files/.config/sway/config b/files/.config/sway/config index e838ee5..f61abb3 100644 --- a/files/.config/sway/config +++ b/files/.config/sway/config @@ -20,16 +20,19 @@ client.background $bg set $font Hack Nerd Font font pango:$font 8 -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 " +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:[2]" # window title #for_window [class="^.*"] border pixel 2 title_format " %title" @@ -214,6 +217,17 @@ 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 @@ -242,6 +256,7 @@ bindsym $mod+r mode "resize" ### Startup # reach systemd target +#exec /bin/systemctl --user import-environment WAYLAND_DISPLAY exec /bin/systemctl --user import-environment exec /bin/systemctl --user start user-graphical-login.target diff --git a/files/.profile b/files/.profile index 5d77c74..66370fa 100644 --- a/files/.profile +++ b/files/.profile @@ -22,6 +22,9 @@ 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_AWT_WM_NONREPARENTING=1 +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/* + diff --git a/files/.xprofile b/files/.xprofile index 7e72072..84b7b19 100644 --- a/files/.xprofile +++ b/files/.xprofile @@ -29,5 +29,4 @@ feh --bg-fill --no-fehbg /usr/share/pixmaps/wallpaper.png # set screen blanking to 30 minutes xset s 1800 1800 -source ~/.local/profile.d/* diff --git a/files/.zshrc b/files/.zshrc index d400c19..a909a08 100644 --- a/files/.zshrc +++ b/files/.zshrc @@ -1,6 +1,15 @@ -# 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 + export XDG_SESSION_TYPE=wayland + + # SDL + export SDL_VIDEODRIVER=wayland + + # Elementary/EFL + export ECORE_EVAS_ENGINE=wayland_egl + export ELM_ENGINE=wayland_egl + + exec sway fi From c68b9499b5a212f09b8bb445874bdd4befac6175 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 28 Mar 2019 23:12:46 -0400 Subject: [PATCH 03/29] systemd integration --- files/.config/sway/config | 3 +-- files/.config/systemd/user/compton.service | 11 ----------- .../systemd/user/multi-user.target.wants/tmux.service | 1 + files/.config/systemd/user/redshift.service | 8 ++++---- files/.config/systemd/user/sway-session.target | 6 ++++++ .../redshift.service | 0 .../.config/systemd/user/user-graphical-login.target | 4 ---- .../user-graphical-login.target.wants/compton.service | 1 - files/.config/systemd/user/wallpaper.service | 11 ----------- files/.config/zsh/custom/100-alias.zsh | 10 +++++----- files/.zshrc | 5 +++++ 11 files changed, 22 insertions(+), 38 deletions(-) delete mode 100644 files/.config/systemd/user/compton.service create mode 120000 files/.config/systemd/user/multi-user.target.wants/tmux.service create mode 100644 files/.config/systemd/user/sway-session.target rename files/.config/systemd/user/{user-graphical-login.target.wants => sway-session.target.wants}/redshift.service (100%) delete mode 100644 files/.config/systemd/user/user-graphical-login.target delete mode 120000 files/.config/systemd/user/user-graphical-login.target.wants/compton.service delete mode 100644 files/.config/systemd/user/wallpaper.service diff --git a/files/.config/sway/config b/files/.config/sway/config index f61abb3..b421780 100644 --- a/files/.config/sway/config +++ b/files/.config/sway/config @@ -256,9 +256,8 @@ bindsym $mod+r mode "resize" ### Startup # reach systemd target -#exec /bin/systemctl --user import-environment WAYLAND_DISPLAY exec /bin/systemctl --user import-environment -exec /bin/systemctl --user start user-graphical-login.target +exec /bin/systemctl --user start sway-session.target # autorun .desktop exec /bin/dex -a diff --git a/files/.config/systemd/user/compton.service b/files/.config/systemd/user/compton.service deleted file mode 100644 index db7bb5c..0000000 --- a/files/.config/systemd/user/compton.service +++ /dev/null @@ -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 diff --git a/files/.config/systemd/user/multi-user.target.wants/tmux.service b/files/.config/systemd/user/multi-user.target.wants/tmux.service new file mode 120000 index 0000000..6ae3bc7 --- /dev/null +++ b/files/.config/systemd/user/multi-user.target.wants/tmux.service @@ -0,0 +1 @@ +/home/marchambault/.config/systemd/user/tmux.service \ No newline at end of file diff --git a/files/.config/systemd/user/redshift.service b/files/.config/systemd/user/redshift.service index 621040c..3fe439c 100644 --- a/files/.config/systemd/user/redshift.service +++ b/files/.config/systemd/user/redshift.service @@ -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 diff --git a/files/.config/systemd/user/sway-session.target b/files/.config/systemd/user/sway-session.target new file mode 100644 index 0000000..30151b3 --- /dev/null +++ b/files/.config/systemd/user/sway-session.target @@ -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 diff --git a/files/.config/systemd/user/user-graphical-login.target.wants/redshift.service b/files/.config/systemd/user/sway-session.target.wants/redshift.service similarity index 100% rename from files/.config/systemd/user/user-graphical-login.target.wants/redshift.service rename to files/.config/systemd/user/sway-session.target.wants/redshift.service diff --git a/files/.config/systemd/user/user-graphical-login.target b/files/.config/systemd/user/user-graphical-login.target deleted file mode 100644 index 8884b91..0000000 --- a/files/.config/systemd/user/user-graphical-login.target +++ /dev/null @@ -1,4 +0,0 @@ -[Unit] -Description=User Graphical Login -Requires=default.target -After=default.target diff --git a/files/.config/systemd/user/user-graphical-login.target.wants/compton.service b/files/.config/systemd/user/user-graphical-login.target.wants/compton.service deleted file mode 120000 index 1864562..0000000 --- a/files/.config/systemd/user/user-graphical-login.target.wants/compton.service +++ /dev/null @@ -1 +0,0 @@ -/home/marchambault/.config/systemd/user/compton.service \ No newline at end of file diff --git a/files/.config/systemd/user/wallpaper.service b/files/.config/systemd/user/wallpaper.service deleted file mode 100644 index d98e1cb..0000000 --- a/files/.config/systemd/user/wallpaper.service +++ /dev/null @@ -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 diff --git a/files/.config/zsh/custom/100-alias.zsh b/files/.config/zsh/custom/100-alias.zsh index f92d374..d83e8a3 100644 --- a/files/.config/zsh/custom/100-alias.zsh +++ b/files/.config/zsh/custom/100-alias.zsh @@ -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='lsd --group-dirs first -l ' +alias la='lsd --group-dirs first -a ' +alias lla='lsd --group-dirs first -la ' +alias lt='lsd --group-dirs first --tree ' # powershell seems to have trouble with xterm-256color alias pwsh="TERM=xterm pwsh" diff --git a/files/.zshrc b/files/.zshrc index a909a08..5e4344f 100644 --- a/files/.zshrc +++ b/files/.zshrc @@ -9,6 +9,11 @@ if [ -z "$WAYLAND_DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then export ECORE_EVAS_ENGINE=wayland_egl export ELM_ENGINE=wayland_egl + # FIXME: This is a workaround + # see: https://github.com/swaywm/wlroots/pull/1344 + #export WLR_DRM_NO_ATOMIC=1 + #export WLR_DRM_NO_ATOMIC_GAMMA=1 + exec sway fi From a160b9bf9d11284c5b1243e9bc7a35cbda07901c Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Tue, 2 Apr 2019 18:21:47 -0400 Subject: [PATCH 04/29] fix lsd aliases --- files/.config/zsh/custom/100-alias.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/files/.config/zsh/custom/100-alias.zsh b/files/.config/zsh/custom/100-alias.zsh index d83e8a3..559039a 100644 --- a/files/.config/zsh/custom/100-alias.zsh +++ b/files/.config/zsh/custom/100-alias.zsh @@ -9,11 +9,11 @@ alias rename="perl-rename" alias userctl="systemctl --user" # ls -alias ls='lsd --group-dirs first ' -alias l='lsd --group-dirs first -l ' -alias la='lsd --group-dirs first -a ' -alias lla='lsd --group-dirs first -la ' -alias lt='lsd --group-dirs first --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" From ad205512893633f6727c1c23778ec095cd5212fa Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Tue, 2 Apr 2019 22:14:14 -0400 Subject: [PATCH 05/29] fix sshot script --- files/.config/sway/config | 18 +++++++++------ files/.local/bin/get-focused-window-geometry | 3 +++ .../.local/bin/get-focused-window-properties | 3 +++ files/.local/bin/sshot | 23 ++++--------------- files/.zshrc | 2 +- 5 files changed, 23 insertions(+), 26 deletions(-) create mode 100755 files/.local/bin/get-focused-window-geometry create mode 100755 files/.local/bin/get-focused-window-properties diff --git a/files/.config/sway/config b/files/.config/sway/config index b421780..439a245 100644 --- a/files/.config/sway/config +++ b/files/.config/sway/config @@ -46,12 +46,16 @@ gaps outer -8 smart_gaps on # Floating mod -for_window [class="^Pavucontrol$"] floating enable -for_window [class="^Pulseeffects$"] floating enable +for_window [app_id="pavucontrol"] 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 [class="feh"] floating enable for_window [class="TeamViewer"] floating 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 @@ -223,10 +227,10 @@ 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 +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" { diff --git a/files/.local/bin/get-focused-window-geometry b/files/.local/bin/get-focused-window-geometry new file mode 100755 index 0000000..9345feb --- /dev/null +++ b/files/.local/bin/get-focused-window-geometry @@ -0,0 +1,3 @@ +#!/bin/bash + +get-focused-window-properties | jq --raw-output '.rect|((.x|tostring)+","+(.y|tostring)+" "+(.width|tostring)+"x"+(.height|tostring))' diff --git a/files/.local/bin/get-focused-window-properties b/files/.local/bin/get-focused-window-properties new file mode 100755 index 0000000..4828e1d --- /dev/null +++ b/files/.local/bin/get-focused-window-properties @@ -0,0 +1,3 @@ +#!/bin/bash + +swaymsg -t get_tree | jq --raw-output '..|if .focused? == true then . else empty end' diff --git a/files/.local/bin/sshot b/files/.local/bin/sshot index 26357a6..d814746 100755 --- a/files/.local/bin/sshot +++ b/files/.local/bin/sshot @@ -16,37 +16,24 @@ 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") - + geometry="$(slurp)" 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" + geometry="$(get-focused-window-geometry)" fi # take a screenshot -scrot "$file" - -if [[ -n "$geometry" ]]; then - # crop the screenshot to geometry - convert "$file" -crop "$geometry" "$file" -fi +grim -g "$geometry" -- "$file" # place to image in the clipboard -xclip -selection clipboard -target image/png "$file" +wl-copy < "$file" if [[ -n "$ARG_PIN" ]]; then # pin the screenshot - feh --title "pinned screenshot" --geometry "$geometry" "$file" & + feh --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 diff --git a/files/.zshrc b/files/.zshrc index 5e4344f..ef87d6c 100644 --- a/files/.zshrc +++ b/files/.zshrc @@ -14,7 +14,7 @@ if [ -z "$WAYLAND_DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then #export WLR_DRM_NO_ATOMIC=1 #export WLR_DRM_NO_ATOMIC_GAMMA=1 - exec sway + exec sway -d -V &>~/sway.log fi From 943b189141013b992e066e6c1f2c1376c04af569 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 4 Apr 2019 17:44:39 -0400 Subject: [PATCH 06/29] cleanup jq, sway config --- files/.config/sway/config | 8 ++++++-- files/.local/bin/get-focused-window-properties | 2 +- files/.local/bin/sshot | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/files/.config/sway/config b/files/.config/sway/config index 439a245..714f585 100644 --- a/files/.config/sway/config +++ b/files/.config/sway/config @@ -47,10 +47,14 @@ smart_gaps on # Floating mod for_window [app_id="pavucontrol"] floating enable -for_window [class="Remmina" title="Remmina Remote Desktop Client"] floating enable -for_window [class="feh"] floating enable +for_window [app_id="org.remmina.Remmina" title="Remmina Remote Desktop Client"] 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 diff --git a/files/.local/bin/get-focused-window-properties b/files/.local/bin/get-focused-window-properties index 4828e1d..c42ac84 100755 --- a/files/.local/bin/get-focused-window-properties +++ b/files/.local/bin/get-focused-window-properties @@ -1,3 +1,3 @@ #!/bin/bash -swaymsg -t get_tree | jq --raw-output '..|if .focused? == true then . else empty end' +swaymsg -t get_tree | jq --raw-output '..|select(.focused? == true)' diff --git a/files/.local/bin/sshot b/files/.local/bin/sshot index d814746..e5523ee 100755 --- a/files/.local/bin/sshot +++ b/files/.local/bin/sshot @@ -33,7 +33,7 @@ wl-copy < "$file" if [[ -n "$ARG_PIN" ]]; then # pin the screenshot - feh --geometry "$(echo -n "$geometry" | sed -E 's/([0-9]+),([0-9]+) ([0-9]+)x([0-9]+)/\3x\4+\1+\2/')" "$file" & + 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 From ee27de120c4bd531175ff88a8e86277475156965 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 4 Apr 2019 17:54:07 -0400 Subject: [PATCH 07/29] fix fzf hack --- files/.config/zsh/custom/001-fzf.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/.config/zsh/custom/001-fzf.zsh b/files/.config/zsh/custom/001-fzf.zsh index a951af8..879c451 100644 --- a/files/.config/zsh/custom/001-fzf.zsh +++ b/files/.config/zsh/custom/001-fzf.zsh @@ -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 From f9ff65c783ccdcc5d7026f3b830a82780b9e5f40 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 4 Apr 2019 18:36:19 -0400 Subject: [PATCH 08/29] extract sway env vars setup in it's own script --- files/.local/bin/sway | 34 ++++++++++++++++++++++++++++++++++ files/.profile | 2 +- files/.zshrc | 16 +--------------- 3 files changed, 36 insertions(+), 16 deletions(-) create mode 100755 files/.local/bin/sway diff --git a/files/.local/bin/sway b/files/.local/bin/sway new file mode 100755 index 0000000..ad19b7b --- /dev/null +++ b/files/.local/bin/sway @@ -0,0 +1,34 @@ +#!/bin/bash + +import-gsettings() { + # usage: import-gsettings : : ... + 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 + +# 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 + +exec /usr/bin/sway $@ diff --git a/files/.profile b/files/.profile index 66370fa..332eab3 100644 --- a/files/.profile +++ b/files/.profile @@ -1,5 +1,5 @@ # PATH -export PATH="$PATH:$HOME/.local/bin:$HOME/bin" +export PATH="$HOME/bin:$HOME/.local/bin:$PATH" # applications export TERMINAL=termite diff --git a/files/.zshrc b/files/.zshrc index ef87d6c..8c9a228 100644 --- a/files/.zshrc +++ b/files/.zshrc @@ -1,20 +1,6 @@ # Autostart sway if we are on tty1 if [ -z "$WAYLAND_DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then - export XDG_SESSION_TYPE=wayland - - # SDL - export SDL_VIDEODRIVER=wayland - - # Elementary/EFL - export ECORE_EVAS_ENGINE=wayland_egl - export ELM_ENGINE=wayland_egl - - # FIXME: This is a workaround - # see: https://github.com/swaywm/wlroots/pull/1344 - #export WLR_DRM_NO_ATOMIC=1 - #export WLR_DRM_NO_ATOMIC_GAMMA=1 - - exec sway -d -V &>~/sway.log + exec ~/.local/bin/sway fi From 7b062201a771d931d5e0b8cf6efb5ba7d47f99e9 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 4 Apr 2019 19:33:17 -0400 Subject: [PATCH 09/29] update lock script for sway --- files/.config/swaylock/config | 30 ++++++++++++++++++++++++++++++ files/.local/bin/lock | 14 ++------------ 2 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 files/.config/swaylock/config diff --git a/files/.config/swaylock/config b/files/.config/swaylock/config new file mode 100644 index 0000000..6dc5eed --- /dev/null +++ b/files/.config/swaylock/config @@ -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 diff --git a/files/.local/bin/lock b/files/.local/bin/lock index a75f99f..8494348 100755 --- a/files/.local/bin/lock +++ b/files/.local/bin/lock @@ -13,15 +13,5 @@ query_prop() { # 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" - +# lock +exec swaylock From 0cbc8bb136ec44f403390a5455a113fbe2b1cc78 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 4 Apr 2019 19:37:38 -0400 Subject: [PATCH 10/29] swayidle service --- .../sway-session.target.wants/swayidle.service | 1 + files/.config/systemd/user/swayidle.service | 15 +++++++++++++++ scripts/post-install.sh | 2 ++ 3 files changed, 18 insertions(+) create mode 120000 files/.config/systemd/user/sway-session.target.wants/swayidle.service create mode 100644 files/.config/systemd/user/swayidle.service diff --git a/files/.config/systemd/user/sway-session.target.wants/swayidle.service b/files/.config/systemd/user/sway-session.target.wants/swayidle.service new file mode 120000 index 0000000..2ba6dd7 --- /dev/null +++ b/files/.config/systemd/user/sway-session.target.wants/swayidle.service @@ -0,0 +1 @@ +/home/marchambault/.config/systemd/user/swayidle.service \ No newline at end of file diff --git a/files/.config/systemd/user/swayidle.service b/files/.config/systemd/user/swayidle.service new file mode 100644 index 0000000..a79251d --- /dev/null +++ b/files/.config/systemd/user/swayidle.service @@ -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 300 'lock' \ + timeout 600 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep 'lock' + +[Install] +WantedBy=sway-session.target diff --git a/scripts/post-install.sh b/scripts/post-install.sh index 8826d7e..db4e84c 100644 --- a/scripts/post-install.sh +++ b/scripts/post-install.sh @@ -3,6 +3,8 @@ # run units systemctl --user daemon-reload systemctl --user enable --now tmux.service +systemctl --user enable --now redshift.service +systemctl --user enable --now swayidle.service systemctl --user enable --now mpv.service # install tmux plugins From 45a48d156127d63ca1e6cd9c342b926ae0881bff Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 4 Apr 2019 19:41:05 -0400 Subject: [PATCH 11/29] enable ignore-empty-password for swaylock --- files/.config/sway/config | 2 +- files/.config/swaylock/config | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/files/.config/sway/config b/files/.config/sway/config index 714f585..9086766 100644 --- a/files/.config/sway/config +++ b/files/.config/sway/config @@ -74,7 +74,7 @@ for_window [title="^Steam Keyboard$"] floating enable ### Output configuration output "*" { - background ~/.local/share/wallpaper.jpg fill + background ~/.local/share/wallpaper fill } ### Input configuration diff --git a/files/.config/swaylock/config b/files/.config/swaylock/config index 6dc5eed..98391c6 100644 --- a/files/.config/swaylock/config +++ b/files/.config/swaylock/config @@ -2,6 +2,7 @@ image=~/.local/share/wallpaper scaling=fill color=111111 +ignore-empty-password disable-caps-lock-text line-uses-ring From 96108823da03688352b84d5cb3ea1c946415d845 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 4 Apr 2019 19:53:18 -0400 Subject: [PATCH 12/29] cleanup script folder --- files/.config/sway/config | 2 +- files/.local/bin/center-float | 6 --- files/.local/bin/emp | 80 ---------------------------------- files/.local/bin/mount-ramdisk | 36 --------------- files/.local/bin/mpv-bg | 2 - files/.local/bin/run-vm | 69 ----------------------------- files/.local/bin/wallpaper | 35 --------------- 7 files changed, 1 insertion(+), 229 deletions(-) delete mode 100755 files/.local/bin/center-float delete mode 100755 files/.local/bin/emp delete mode 100755 files/.local/bin/mount-ramdisk delete mode 100755 files/.local/bin/mpv-bg delete mode 100755 files/.local/bin/run-vm delete mode 100755 files/.local/bin/wallpaper diff --git a/files/.config/sway/config b/files/.config/sway/config index 9086766..c56b3e0 100644 --- a/files/.config/sway/config +++ b/files/.config/sway/config @@ -157,7 +157,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 diff --git a/files/.local/bin/center-float b/files/.local/bin/center-float deleted file mode 100755 index 9e25ac2..0000000 --- a/files/.local/bin/center-float +++ /dev/null @@ -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 diff --git a/files/.local/bin/emp b/files/.local/bin/emp deleted file mode 100755 index 31f31e2..0000000 --- a/files/.local/bin/emp +++ /dev/null @@ -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 $? - diff --git a/files/.local/bin/mount-ramdisk b/files/.local/bin/mount-ramdisk deleted file mode 100755 index 00a4879..0000000 --- a/files/.local/bin/mount-ramdisk +++ /dev/null @@ -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" diff --git a/files/.local/bin/mpv-bg b/files/.local/bin/mpv-bg deleted file mode 100755 index 71d0243..0000000 --- a/files/.local/bin/mpv-bg +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -exec xwinwrap -ov -fs -- mpv --no-osc --no-stop-screensaver --wid WID $@ diff --git a/files/.local/bin/run-vm b/files/.local/bin/run-vm deleted file mode 100755 index 57a56e4..0000000 --- a/files/.local/bin/run-vm +++ /dev/null @@ -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 - diff --git a/files/.local/bin/wallpaper b/files/.local/bin/wallpaper deleted file mode 100755 index fd64457..0000000 --- a/files/.local/bin/wallpaper +++ /dev/null @@ -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 From 74a0c75d403196dedac9f507237a1b7b2db545b2 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 4 Apr 2019 20:00:09 -0400 Subject: [PATCH 13/29] reorganize script --- files/.local/bin/.gitignore | 2 ++ files/.local/profile.d/.gitignore | 2 ++ files/.local/profile.d/setup_ssh_agent | 6 ------ files/.profile | 2 +- files/.zshrc | 2 +- files/{.local => }/bin/__on-gamemode | 0 files/{.local => }/bin/apod | 0 files/{.local => }/bin/brightness-control | 0 files/{.local => }/bin/get-focused-window-geometry | 0 files/{.local => }/bin/get-focused-window-properties | 0 files/{.local => }/bin/lock | 0 files/{.local => }/bin/lsiommu | 0 files/{.local => }/bin/motd | 0 files/{.local => }/bin/mpv-ipc | 0 files/{.local => }/bin/mvn-findclass | 0 files/{.local => }/bin/remmina-pretty | 0 files/{.local => }/bin/sshot | 0 files/{.local => }/bin/sway | 0 files/{.local => }/bin/to7zip | 0 files/{.local => }/bin/volume-control | 0 20 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 files/.local/bin/.gitignore create mode 100644 files/.local/profile.d/.gitignore delete mode 100644 files/.local/profile.d/setup_ssh_agent rename files/{.local => }/bin/__on-gamemode (100%) rename files/{.local => }/bin/apod (100%) rename files/{.local => }/bin/brightness-control (100%) rename files/{.local => }/bin/get-focused-window-geometry (100%) rename files/{.local => }/bin/get-focused-window-properties (100%) rename files/{.local => }/bin/lock (100%) rename files/{.local => }/bin/lsiommu (100%) rename files/{.local => }/bin/motd (100%) rename files/{.local => }/bin/mpv-ipc (100%) rename files/{.local => }/bin/mvn-findclass (100%) rename files/{.local => }/bin/remmina-pretty (100%) rename files/{.local => }/bin/sshot (100%) rename files/{.local => }/bin/sway (100%) rename files/{.local => }/bin/to7zip (100%) rename files/{.local => }/bin/volume-control (100%) diff --git a/files/.local/bin/.gitignore b/files/.local/bin/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/files/.local/bin/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/files/.local/profile.d/.gitignore b/files/.local/profile.d/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/files/.local/profile.d/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/files/.local/profile.d/setup_ssh_agent b/files/.local/profile.d/setup_ssh_agent deleted file mode 100644 index a29cb55..0000000 --- a/files/.local/profile.d/setup_ssh_agent +++ /dev/null @@ -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 - diff --git a/files/.profile b/files/.profile index 332eab3..38df9d8 100644 --- a/files/.profile +++ b/files/.profile @@ -1,5 +1,5 @@ # PATH -export PATH="$HOME/bin:$HOME/.local/bin:$PATH" +export PATH="$HOME/.local/bin:$HOME/bin:$PATH" # applications export TERMINAL=termite diff --git a/files/.zshrc b/files/.zshrc index 8c9a228..3ec27a4 100644 --- a/files/.zshrc +++ b/files/.zshrc @@ -1,6 +1,6 @@ # Autostart sway if we are on tty1 if [ -z "$WAYLAND_DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then - exec ~/.local/bin/sway + exec ~/bin/sway fi diff --git a/files/.local/bin/__on-gamemode b/files/bin/__on-gamemode similarity index 100% rename from files/.local/bin/__on-gamemode rename to files/bin/__on-gamemode diff --git a/files/.local/bin/apod b/files/bin/apod similarity index 100% rename from files/.local/bin/apod rename to files/bin/apod diff --git a/files/.local/bin/brightness-control b/files/bin/brightness-control similarity index 100% rename from files/.local/bin/brightness-control rename to files/bin/brightness-control diff --git a/files/.local/bin/get-focused-window-geometry b/files/bin/get-focused-window-geometry similarity index 100% rename from files/.local/bin/get-focused-window-geometry rename to files/bin/get-focused-window-geometry diff --git a/files/.local/bin/get-focused-window-properties b/files/bin/get-focused-window-properties similarity index 100% rename from files/.local/bin/get-focused-window-properties rename to files/bin/get-focused-window-properties diff --git a/files/.local/bin/lock b/files/bin/lock similarity index 100% rename from files/.local/bin/lock rename to files/bin/lock diff --git a/files/.local/bin/lsiommu b/files/bin/lsiommu similarity index 100% rename from files/.local/bin/lsiommu rename to files/bin/lsiommu diff --git a/files/.local/bin/motd b/files/bin/motd similarity index 100% rename from files/.local/bin/motd rename to files/bin/motd diff --git a/files/.local/bin/mpv-ipc b/files/bin/mpv-ipc similarity index 100% rename from files/.local/bin/mpv-ipc rename to files/bin/mpv-ipc diff --git a/files/.local/bin/mvn-findclass b/files/bin/mvn-findclass similarity index 100% rename from files/.local/bin/mvn-findclass rename to files/bin/mvn-findclass diff --git a/files/.local/bin/remmina-pretty b/files/bin/remmina-pretty similarity index 100% rename from files/.local/bin/remmina-pretty rename to files/bin/remmina-pretty diff --git a/files/.local/bin/sshot b/files/bin/sshot similarity index 100% rename from files/.local/bin/sshot rename to files/bin/sshot diff --git a/files/.local/bin/sway b/files/bin/sway similarity index 100% rename from files/.local/bin/sway rename to files/bin/sway diff --git a/files/.local/bin/to7zip b/files/bin/to7zip similarity index 100% rename from files/.local/bin/to7zip rename to files/bin/to7zip diff --git a/files/.local/bin/volume-control b/files/bin/volume-control similarity index 100% rename from files/.local/bin/volume-control rename to files/bin/volume-control From 78b3695dec42ee841d3c96d9d04cb0f9838dc4b0 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 4 Apr 2019 20:07:01 -0400 Subject: [PATCH 14/29] remove all x11 configs --- files/.Xresources | 120 -------------- files/.config/compton.conf | 254 ------------------------------ files/.config/gamemode.ini | 4 +- files/.config/i3/config | 279 --------------------------------- files/.config/i3/i3status.conf | 90 ----------- files/.config/i3/rofi-radio.py | 75 --------- files/.config/i3/rofi.bash | 3 - files/.config/i3/startup.bash | 9 -- files/.config/i3/wrapper.py | 83 ---------- files/.profile | 1 - files/.xbindkeysrc | 30 ---- files/.xinitrc | 2 - files/.xprofile | 32 ---- files/bin/sway | 3 + 14 files changed, 5 insertions(+), 980 deletions(-) delete mode 100644 files/.Xresources delete mode 100644 files/.config/compton.conf delete mode 100644 files/.config/i3/config delete mode 100644 files/.config/i3/i3status.conf delete mode 100755 files/.config/i3/rofi-radio.py delete mode 100755 files/.config/i3/rofi.bash delete mode 100755 files/.config/i3/startup.bash delete mode 100755 files/.config/i3/wrapper.py delete mode 100644 files/.xbindkeysrc delete mode 100644 files/.xinitrc delete mode 100644 files/.xprofile diff --git a/files/.Xresources b/files/.Xresources deleted file mode 100644 index f008d35..0000000 --- a/files/.Xresources +++ /dev/null @@ -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 minus: smaller-vt-font() \n\ - Ctrl plus: larger-vt-font() \n\ - Ctrl 0: set-vt-font(d) \n\ - Ctrl Shift C: copy-selection(CLIPBOARD) \n\ - Ctrl Shift V: insert-selection(CLIPBOARD) \n\ - Shift : exec-formatted("xdg-open '%t'", PRIMARY) - -! mouse selection -xterm*on3Clicks: regex ([[:alpha:]]+://)?([[:alnum:]!#+,./=?@_~-]|(%[[:xdigit:]][[:xdigit:]]))+ -xterm*highlightSelection: true -xterm*trimSelection: true - diff --git a/files/.config/compton.conf b/files/.config/compton.conf deleted file mode 100644 index 730d33b..0000000 --- a/files/.config/compton.conf +++ /dev/null @@ -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 doesn’t 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; - }; -}; diff --git a/files/.config/gamemode.ini b/files/.config/gamemode.ini index 966810f..f569072 100644 --- a/files/.config/gamemode.ini +++ b/files/.config/gamemode.ini @@ -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 diff --git a/files/.config/i3/config b/files/.config/i3/config deleted file mode 100644 index a2ea9b2..0000000 --- a/files/.config/i3/config +++ /dev/null @@ -1,279 +0,0 @@ -# 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). -# - -# 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 - -# class border backgr. text indicator child_border -client.focused $active $bg $fg $border $active -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 - -# 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 - -# 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 doesn’t 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 " - -# window title -for_window [class="^.*"] border pixel 2 title_format " %title" -for_window [floating] border pixel 1 -smart_borders on - -# 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 [class="TeamViewer"] 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 -for_window [class="^Steam$" title=".* - Chat"] floating enable -for_window [class="^Steam$" title="^Settings$"] floating enable -for_window [class="^Steam$" title=".* - event started"] floating enable -for_window [class="^Steam$" title=".* CD key"] floating enable -for_window [class="^Steam$" title="^Steam - Self Updater$"] floating enable -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 - -# mod key -set $mod Mod4 - -# Use Mouse+$mod to drag floating windows to their wanted position -floating_modifier $mod - -# start a terminal -bindsym $mod+Return exec i3-sensible-terminal - -# thunar -bindsym $mod+Mod1+Return exec thunar - -# kill focused window -bindsym $mod+Shift+q kill - -# start rofi (a program launcher) -bindsym $mod+Control+Return exec /bin/bash ~/.config/i3/rofi.bash -# 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 - -# change focus -bindsym $mod+h focus left -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 -#bindsym $mod+Up focus up -#bindsym $mod+Right focus right - -# move focused window -bindsym $mod+Shift+h move left -bindsym $mod+Shift+j move down -bindsym $mod+Shift+k move up -bindsym $mod+Shift+l move right - -# alternatively, you can use the cursor keys: -bindsym $mod+Shift+Left move left -bindsym $mod+Shift+Down move down -bindsym $mod+Shift+Up move up -bindsym $mod+Shift+Right move right - -# split in horizontal orientation -bindsym $mod+Shift+backslash split h # | -bindsym $mod+backslash split h - -# split in vertical orientation -bindsym $mod+minus split v - -# enter fullscreen mode for the focused container -bindsym $mod+f fullscreen toggle - -# change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed -bindsym $mod+e layout toggle split - -# toggle tiling / floating -bindsym $mod+Shift+space exec center-float - -# toggle sticky -bindsym $mod+Ctrl+space sticky toggle - -# change focus between tiling / floating windows -bindsym $mod+space focus mode_toggle - -# focus the parent container -bindsym $mod+a focus parent - -# focus the child container -bindsym $mod+d focus child - -# switch to workspace -bindsym $mod+q workspace back_and_forth -bindsym $mod+1 workspace $ws1 -bindsym $mod+2 workspace $ws2 -bindsym $mod+3 workspace $ws3 -bindsym $mod+4 workspace $ws4 -bindsym $mod+5 workspace $ws5 -bindsym $mod+6 workspace $ws6 -bindsym $mod+7 workspace $ws7 -bindsym $mod+8 workspace $ws8 -bindsym $mod+9 workspace $ws9 -bindsym $mod+0 workspace $ws10 - -#bindsym $mod+Ctrl+Up workspace next -#bindsym $mod+Ctrl+Down workspace prev - -# move focused container to workspace -bindsym $mod+Shift+1 move container to workspace $ws1 -bindsym $mod+Shift+2 move container to workspace $ws2 -bindsym $mod+Shift+3 move container to workspace $ws3 -bindsym $mod+Shift+4 move container to workspace $ws4 -bindsym $mod+Shift+5 move container to workspace $ws5 -bindsym $mod+Shift+6 move container to workspace $ws6 -bindsym $mod+Shift+7 move container to workspace $ws7 -bindsym $mod+Shift+8 move container to workspace $ws8 -bindsym $mod+Shift+9 move container to workspace $ws9 -bindsym $mod+Shift+0 move container to workspace $ws10 - -# Assignation -assign [class="^Slack$"] $ws1 -assign [class="^discord$"] $ws1 -assign [class="^looking-glass-client$"] $ws3 - -# screen -workspace $ws1 output HDMI-2 -workspace $ws2 output HDMI-2 -workspace $ws3 output HDMI-1 -workspace $ws4 output HDMI-1 -workspace $ws5 output HDMI-1 -workspace $ws6 output HDMI-1 -workspace $ws7 output HDMI-1 -workspace $ws8 output HDMI-1 -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 -# lock the screen -bindsym $mod+Pause exec lock -# suspend -bindsym $mod+Shift+Pause exec systemctl suspend - -# resize window (you can also use the mouse for that) -mode "resize" { - # These bindings trigger as soon as you enter the resize mode - - # Pressing left will shrink the window’s width. - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s height. - bindsym h resize shrink width 10 px or 10 ppt - bindsym j resize grow height 10 px or 10 ppt - bindsym k resize shrink height 10 px or 10 ppt - bindsym l resize grow width 10 px or 10 ppt - - # same bindings, but for the arrow keys - #bindsym Left resize shrink width 10 px or 10 ppt - #bindsym Down resize grow height 10 px or 10 ppt - #bindsym Up resize shrink height 10 px or 10 ppt - #bindsym Right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} - -bindsym $mod+r mode "resize" - -# reach systemd target -exec --no-startup-id systemctl --user import-environment -exec --no-startup-id systemctl --user start user-graphical-login.target - -exec --no-startup-id /bin/dex -a -exec --no-startup-id /bin/bash ~/.config/i3/startup.bash - -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 - } -} - diff --git a/files/.config/i3/i3status.conf b/files/.config/i3/i3status.conf deleted file mode 100644 index 234d5a1..0000000 --- a/files/.config/i3/i3status.conf +++ /dev/null @@ -1,90 +0,0 @@ -# i3status configuration file. -# see "man i3status" for documentation. - -# It is important that this file is edited as UTF-8. -# The following line should contain a sharp s: -# ß -# If the above line is not correctly displayed, fix your editor first! - -general { - colors = true - color_good = "#B7BBB7" - color_degraded = "#E2995C" - color_bad = "#B04C50" - - output_format = "i3bar" - interval = 5 -} - -order += "tztime local" -order += "wireless _first_" -order += "ethernet _first_" -order += "cpu_usage" -order += "memory" -order += "battery all" -order += "volume master" -order += "path_exists vpn" -order += "path_exists empty" - -tztime local { - format = " %Y-%m-%d %H:%M" -} - -wireless _first_ { - format_up = "直 <%essid> %ip" - format_down = "睊" - color_bad = "#4B5056" -} - -ethernet _first_ { - # if you use %speed, i3status requires root privileges - format_up = " %ip" - format_down = "" - color_bad = "#4B5056" -} - -cpu_usage { - format = " %usage" - degraded_threshold = 90 - max_threshold = 98 -} - -memory { - format = " %percentage_used" - memory_used_method = "memavailable" - threshold_degraded = "20%" - threshold_degraded = "5%" -} - -battery all { - format = "%status %percentage" - format_down = "" - status_chr = "" - status_bat = "" - status_unk = "" - status_full = "ﮣ" - integer_battery_capacity = true - last_full_capacity = true - hide_seconds = true - - threshold_type = "percentage" - low_threshold = 15 -} - -volume master { - device = "pulse" - format = "墳 %volume" - format_muted = "婢" - color_degraded = "#4B5056" -} - -path_exists vpn { - format = "" - format_down = "" - path = "/proc/sys/net/ipv4/conf/tun0" -} - -path_exists empty { - format = "" - path = "/" -} diff --git a/files/.config/i3/rofi-radio.py b/files/.config/i3/rofi-radio.py deleted file mode 100755 index d9a9d4b..0000000 --- a/files/.config/i3/rofi-radio.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python3 -import json -import os -from subprocess import Popen, PIPE, check_output, check_call - -import yaml - - -station_name_file = '/run/user/%s/rofi-radio-name' % os.getuid() - -def mpv_ipc(*args): - try: - j = json.loads(check_output(['mpv-ipc'] + list(args))) - if j: - return j['data'] - except: - pass - return '' - -with open(os.path.expanduser("~/.local/share/rofi-radio/playlists.yaml")) as f: - stations = yaml.load(f) - -rofi_command = ['rofi', '-i', '-selected-row', '0', '-dmenu', '-p', 'mpv'] - -current_song = mpv_ipc('get_property_string', 'media-title') -if current_song: - try: - with open(station_name_file) as f: - station_name = f.readline() - except: - station_name = '' - rofi_command += ['-mesg', station_name] - commands = b"Play/Pause\nStop\nShuffle\nNext\nPrevious" - -else: - commands = bytes('\n'.join([s["name"] for s in stations]), 'utf8') - -rofi = Popen(rofi_command, stdout=PIPE, stdin=PIPE) -choice = rofi.communicate(input=commands)[0].decode('utf8').rstrip() - -if current_song: - if choice == "Play/Pause": - mpv_ipc('cycle', 'pause') - elif choice == "Stop": - mpv_ipc('stop') - elif choice == "Shuffle": - mpv_ipc('playlist-shuffle') - elif choice == "Next": - mpv_ipc('playlist-next') - elif choice == "Previous": - mpv_ipc('playlist-prev') -else: - s = [s for s in stations if s["name"] == choice] - if s: - # Load the selected playlist - loc = s[0]["loc"] - station_name = s[0]["name"] - if loc.startswith('http') or loc.startswith('ytdl'): - # Load the url - mpv_ipc('loadfile', loc) - else: - # Load the file - workdir = mpv_ipc('get_property_string', 'working-directory') - mpv_ipc('loadfile', os.path.expanduser(loc)) - station_name = loc - with open(station_name_file, 'w') as f: - f.write(station_name) - else: - # Try to load the user input - mpv_ipc('loadfile', choice) - mpv_ipc('set_property_string', 'pause', 'no') - - -# force update of i3status -check_call(['killall', '-USR1', 'i3status']) diff --git a/files/.config/i3/rofi.bash b/files/.config/i3/rofi.bash deleted file mode 100755 index 53625e6..0000000 --- a/files/.config/i3/rofi.bash +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -rofi -combi drun -show drun -modi drun,window - diff --git a/files/.config/i3/startup.bash b/files/.config/i3/startup.bash deleted file mode 100755 index c0c4672..0000000 --- a/files/.config/i3/startup.bash +++ /dev/null @@ -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 - diff --git a/files/.config/i3/wrapper.py b/files/.config/i3/wrapper.py deleted file mode 100755 index 3be80e0..0000000 --- a/files/.config/i3/wrapper.py +++ /dev/null @@ -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 -# -# 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)) diff --git a/files/.profile b/files/.profile index 38df9d8..a416003 100644 --- a/files/.profile +++ b/files/.profile @@ -22,7 +22,6 @@ export QT_QPA_PLATFORMTHEME=gtk2 export QT_AUTO_SCREEN_SCALE_FACTOR=0 # java -export _JAVA_AWT_WM_NONREPARENTING=1 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 diff --git a/files/.xbindkeysrc b/files/.xbindkeysrc deleted file mode 100644 index 47da52e..0000000 --- a/files/.xbindkeysrc +++ /dev/null @@ -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 - diff --git a/files/.xinitrc b/files/.xinitrc deleted file mode 100644 index ae2a40d..0000000 --- a/files/.xinitrc +++ /dev/null @@ -1,2 +0,0 @@ -[ -f ~/.xprofile ] && source ~/.xprofile -exec i3 diff --git a/files/.xprofile b/files/.xprofile deleted file mode 100644 index 84b7b19..0000000 --- a/files/.xprofile +++ /dev/null @@ -1,32 +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 - - diff --git a/files/bin/sway b/files/bin/sway index ad19b7b..025eff0 100755 --- a/files/bin/sway +++ b/files/bin/sway @@ -31,4 +31,7 @@ export ELM_ENGINE=wayland_egl # SDL export SDL_VIDEODRIVER=wayland +# Java +export _JAVA_AWT_WM_NONREPARENTING=1 + exec /usr/bin/sway $@ From 2178cfba239af2440d9bd1a75f55a75c8e9b71c1 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 4 Apr 2019 20:13:15 -0400 Subject: [PATCH 15/29] remove dup function definition --- files/.zshrc | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/files/.zshrc b/files/.zshrc index 3ec27a4..21fcff0 100644 --- a/files/.zshrc +++ b/files/.zshrc @@ -89,20 +89,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 -) - From 5bb2abe8f3b6e513141f1ebe0bb0416ad683fce0 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 4 Apr 2019 20:21:15 -0400 Subject: [PATCH 16/29] fix rofi config --- files/.config/rofi/config | 14 ++++++++++++++ files/.config/sway/config | 2 +- files/.config/sway/rofi.bash | 3 --- files/bin/lock | 8 -------- 4 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 files/.config/rofi/config delete mode 100755 files/.config/sway/rofi.bash diff --git a/files/.config/rofi/config b/files/.config/rofi/config new file mode 100644 index 0000000..5273091 --- /dev/null +++ b/files/.config/rofi/config @@ -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 + diff --git a/files/.config/sway/config b/files/.config/sway/config index c56b3e0..bbb908e 100644 --- a/files/.config/sway/config +++ b/files/.config/sway/config @@ -111,7 +111,7 @@ bindsym $mod+Mod1+Return exec thunar bindsym $mod+Shift+q kill # start rofi (a program launcher) -bindsym $mod+Control+Return exec /bin/bash ~/.config/sway/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 diff --git a/files/.config/sway/rofi.bash b/files/.config/sway/rofi.bash deleted file mode 100755 index 53625e6..0000000 --- a/files/.config/sway/rofi.bash +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -rofi -combi drun -show drun -modi drun,window - diff --git a/files/bin/lock b/files/bin/lock index 8494348..d9adc39 100755 --- a/files/bin/lock +++ b/files/bin/lock @@ -2,14 +2,6 @@ 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 From 95ba9823bca32b0eb065daa1f9093af0314c8569 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 4 Apr 2019 20:23:29 -0400 Subject: [PATCH 17/29] move i3status config to it's proper place --- files/.config/{sway/i3status.conf => i3status/config} | 0 files/.config/sway/config | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename files/.config/{sway/i3status.conf => i3status/config} (100%) diff --git a/files/.config/sway/i3status.conf b/files/.config/i3status/config similarity index 100% rename from files/.config/sway/i3status.conf rename to files/.config/i3status/config diff --git a/files/.config/sway/config b/files/.config/sway/config index bbb908e..04a23d9 100644 --- a/files/.config/sway/config +++ b/files/.config/sway/config @@ -274,7 +274,7 @@ exec /bin/dex -a exec $terminal bar { - status_command i3status --config ~/.config/sway/i3status.conf + status_command i3status font pango:$font 10 height 30 From 435e18e4498387ea658e3b5515c1021c8636bfbe Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 4 Apr 2019 20:27:50 -0400 Subject: [PATCH 18/29] move rofi-radio to script folder --- files/.config/sway/config | 2 +- files/{.config/sway/rofi-radio.py => bin/rofi-radio} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename files/{.config/sway/rofi-radio.py => bin/rofi-radio} (100%) diff --git a/files/.config/sway/config b/files/.config/sway/config index 04a23d9..162f7bd 100644 --- a/files/.config/sway/config +++ b/files/.config/sway/config @@ -115,7 +115,7 @@ 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/sway/rofi-radio.py +bindsym $mod+p exec ~/bin/rofi-radio # change focus bindsym $mod+h focus left diff --git a/files/.config/sway/rofi-radio.py b/files/bin/rofi-radio similarity index 100% rename from files/.config/sway/rofi-radio.py rename to files/bin/rofi-radio From 261c686d3d9c30ae2e22f4939b38ec9ddbc176ee Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Sat, 13 Apr 2019 14:28:44 -0400 Subject: [PATCH 19/29] disable qt csd, wait 30 minute before locking --- files/.config/systemd/user/swayidle.service | 4 ++-- files/bin/sway | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/files/.config/systemd/user/swayidle.service b/files/.config/systemd/user/swayidle.service index a79251d..e7799c7 100644 --- a/files/.config/systemd/user/swayidle.service +++ b/files/.config/systemd/user/swayidle.service @@ -6,9 +6,9 @@ PartOf=graphical-session.target [Service] Type=simple ExecStart=/usr/bin/swayidle -w \ - timeout 300 'lock' \ - timeout 600 'swaymsg "output * dpms off"' \ + timeout 1800 'swaymsg "output * dpms off"' \ resume 'swaymsg "output * dpms on"' \ + timeout 1810 'lock' \ before-sleep 'lock' [Install] diff --git a/files/bin/sway b/files/bin/sway index 025eff0..ce4a63e 100755 --- a/files/bin/sway +++ b/files/bin/sway @@ -13,6 +13,10 @@ import-gsettings() { export XDG_SESSION_TYPE=wayland +# Qt +export QT_QPA_PLATFORM=wayland +export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 + # GTK export CLUTTER_BACKEND=wayland export GTK_CSD=0 From f7c48e7853ae0f7a41f7422be8d499a0bed54aad Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Mon, 15 Apr 2019 08:34:43 -0400 Subject: [PATCH 20/29] input tweak --- files/.config/mpv/mpv.conf | 1 + files/.config/pulse/default.pa | 3 +++ files/.config/sway/config | 17 +++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/files/.config/mpv/mpv.conf b/files/.config/mpv/mpv.conf index 530cd31..2743ab1 100644 --- a/files/.config/mpv/mpv.conf +++ b/files/.config/mpv/mpv.conf @@ -1,5 +1,6 @@ # video profile=gpu-hq +gpu-context=wayland video-sync=display-resample x11-bypass-compositor=yes display-fps=60 diff --git a/files/.config/pulse/default.pa b/files/.config/pulse/default.pa index 10298dd..b45a09c 100644 --- a/files/.config/pulse/default.pa +++ b/files/.config/pulse/default.pa @@ -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) diff --git a/files/.config/sway/config b/files/.config/sway/config index 162f7bd..5db629c 100644 --- a/files/.config/sway/config +++ b/files/.config/sway/config @@ -48,6 +48,7 @@ smart_gaps on # Floating mod 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"] { @@ -88,16 +89,32 @@ floating_modifier $mod # disable focus follow mouse #focus_follows_mouse no +# Touchpad input "2:18:FocalTechPS/2_FocalTech_Touchpad" { tap enabled tap_button_map lrm middle_emulation enabled + scroll_method two_finger + dwt enable + drag enable +} + +# Touchscreen +input "1003:35393:Atmel" { + map_to_output eDP-1 + tap enabled + drag enable } input "*" { + # Keyboard xkb_layout us xkb_variant altgr-intl xkb_options caps:super + + # Mouse + accel_profile flat + pointer_accel 0 } ### Key bindings From 03414e0a4d3edaf1786796aa763bddbf9e1807a5 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 2 May 2019 18:47:50 -0400 Subject: [PATCH 21/29] fix tmux config for 2.9 see https://github.com/tmux/tmux/issues/1688 --- files/.tmux.conf | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/files/.tmux.conf b/files/.tmux.conf index eaa8b04..6663670 100644 --- a/files/.tmux.conf +++ b/files/.tmux.conf @@ -26,28 +26,25 @@ 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 From 144c98b194de6af41ea94f0e95488c78e5a9e42a Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 2 May 2019 19:48:25 -0400 Subject: [PATCH 22/29] ajust swayidle --- files/.config/systemd/user/swayidle.service | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/.config/systemd/user/swayidle.service b/files/.config/systemd/user/swayidle.service index e7799c7..15068be 100644 --- a/files/.config/systemd/user/swayidle.service +++ b/files/.config/systemd/user/swayidle.service @@ -6,9 +6,9 @@ PartOf=graphical-session.target [Service] Type=simple ExecStart=/usr/bin/swayidle -w \ - timeout 1800 'swaymsg "output * dpms off"' \ + timeout 1200 'swaymsg "output * dpms off"' \ resume 'swaymsg "output * dpms on"' \ - timeout 1810 'lock' \ + timeout 1210 'lock' \ before-sleep 'lock' [Install] From 3b44579bf3755378f26b50699b8db7b9de956e01 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 9 May 2019 17:37:18 -0400 Subject: [PATCH 23/29] replace swaybar with waybar --- files/.config/sway/config | 59 ++++++++++++------------- files/.config/waybar/config | 79 ++++++++++++++++++++++++++++++++++ files/.config/waybar/style.css | 29 +++++++++++++ 3 files changed, 138 insertions(+), 29 deletions(-) create mode 100644 files/.config/waybar/config create mode 100644 files/.config/waybar/style.css diff --git a/files/.config/sway/config b/files/.config/sway/config index 5db629c..5548964 100644 --- a/files/.config/sway/config +++ b/files/.config/sway/config @@ -20,19 +20,19 @@ client.background $bg set $font Hack Nerd Font font pango:$font 8 -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]" +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" # default workspace -workspace "2:[2]" +workspace "2" # window title #for_window [class="^.*"] border pixel 2 title_format " %title" @@ -291,23 +291,24 @@ exec /bin/dex -a exec $terminal bar { - 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 - } + 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 +# } } diff --git a/files/.config/waybar/config b/files/.config/waybar/config new file mode 100644 index 0000000..8bde15e --- /dev/null +++ b/files/.config/waybar/config @@ -0,0 +1,79 @@ +{ + "layer": "top", // Waybar at top layer + // "position": "bottom", // Waybar position (top|bottom|left|right) + "height": 24, // 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": "{}" + }, + "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": { + // "interface": "wlp2s0", // (Optional) To force the use of this interface + "format-wifi": " <{essid}> {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 " + } +} + diff --git a/files/.config/waybar/style.css b/files/.config/waybar/style.css new file mode 100644 index 0000000..3e2a282 --- /dev/null +++ b/files/.config/waybar/style.css @@ -0,0 +1,29 @@ +* { + border: none; + font-family: Verdana, 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, #mode { + padding: 0 10px; + border-right: 1px solid white; +} + +#idle_inhibitor, #tray, #custom-vpn { + margin-left: 10px; +} From 955020e8f6fe926b83c55b3716a47ffcbe6c5507 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 9 May 2019 18:12:09 -0400 Subject: [PATCH 24/29] waybar icons --- files/.config/waybar/config | 19 +++++++++---------- files/.config/waybar/style.css | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/files/.config/waybar/config b/files/.config/waybar/config index 8bde15e..974173c 100644 --- a/files/.config/waybar/config +++ b/files/.config/waybar/config @@ -31,7 +31,7 @@ "format": " {:%Y-%m-%d %H:%M}" }, "cpu": { - "format": " {usage}%", + "format": " {usage}%", "tooltip": false }, "memory": { @@ -39,7 +39,7 @@ }, "backlight": { "format": "{icon} {percent}%", - "format-icons": ["", ""] + "format-icons": ["", "", ""] }, "battery": { "states": { @@ -53,27 +53,26 @@ "format-icons": ["", "", "", "", ""] }, "network": { - // "interface": "wlp2s0", // (Optional) To force the use of this interface "format-wifi": " <{essid}> {ipaddr}/{cidr}", - "format-ethernet": " {ipaddr}/{cidr}", + "format-ethernet": " {ipaddr}/{cidr}", "format-disconnected": "⚠ Disconnected" }, "pulseaudio": { //"scroll-step": 1, "format": "{icon} {volume}%", - //"format-bluetooth": "{icon} {volume}%", - "format-muted": "婢", + "format-bluetooth": "{icon} {volume}%", + "format-muted": "", "format-icons": { - "headphones": "", - "headset": "", - "default": ["", ""] + "headphones": "", + "headset": "", + "default": ["", "", ""] }, "on-click": "pavucontrol" }, "custom/vpn": { "format": "{}", "interval": 5, - "exec": "test -e /proc/sys/net/ipv4/conf/tun0 && echo  || echo " + "exec": "test -e /proc/sys/net/ipv4/conf/tun0 && echo  || echo " } } diff --git a/files/.config/waybar/style.css b/files/.config/waybar/style.css index 3e2a282..8eeea98 100644 --- a/files/.config/waybar/style.css +++ b/files/.config/waybar/style.css @@ -1,6 +1,6 @@ * { border: none; - font-family: Verdana, sans-serif; + font-family: "Font Awesome 5 Free", Verdana, sans-serif; font-size: 13px; } From c1c1bb586782edcaa28c0aaa28527083dab10655 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 9 May 2019 18:48:05 -0400 Subject: [PATCH 25/29] bar spacing --- files/.config/waybar/config | 4 ++-- files/.config/waybar/style.css | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/files/.config/waybar/config b/files/.config/waybar/config index 974173c..50692bc 100644 --- a/files/.config/waybar/config +++ b/files/.config/waybar/config @@ -1,7 +1,7 @@ { "layer": "top", // Waybar at top layer // "position": "bottom", // Waybar position (top|bottom|left|right) - "height": 24, // Waybar height (to be removed for auto height) + "height": 23, // Waybar height (to be removed for auto height) // Choose the order of the modules "modules-left": ["sway/workspaces", "sway/mode"], "modules-center": [], @@ -61,7 +61,7 @@ //"scroll-step": 1, "format": "{icon} {volume}%", "format-bluetooth": "{icon} {volume}%", - "format-muted": "", + "format-muted": " --%", "format-icons": { "headphones": "", "headset": "", diff --git a/files/.config/waybar/style.css b/files/.config/waybar/style.css index 8eeea98..94d3c75 100644 --- a/files/.config/waybar/style.css +++ b/files/.config/waybar/style.css @@ -1,6 +1,6 @@ * { border: none; - font-family: "Font Awesome 5 Free", Verdana, sans-serif; + font-family: "Font Awesome 5 Free", sans-serif; font-size: 13px; } @@ -19,11 +19,15 @@ window#waybar { background: #64727D; } -#clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #mode { +#clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio { padding: 0 10px; - border-right: 1px solid white; + border-right: 1px solid #b7bbb7; } #idle_inhibitor, #tray, #custom-vpn { - margin-left: 10px; + min-width: 25px; +} + +#tray { + margin-left: 5px; } From 581d6c55da530a43400c290eee3c6ad8dc5b71be Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 13 Jun 2019 18:25:47 -0400 Subject: [PATCH 26/29] thinkpad config --- files/.config/sway/config | 12 ++---------- files/.config/swaylock/config | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/files/.config/sway/config b/files/.config/sway/config index 5548964..6dd5e6d 100644 --- a/files/.config/sway/config +++ b/files/.config/sway/config @@ -17,8 +17,7 @@ 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 $font Hack Nerd Font -font pango:$font 8 +font pango:sans 8 set $ws1 "1" set $ws2 "2" @@ -90,7 +89,7 @@ floating_modifier $mod #focus_follows_mouse no # Touchpad -input "2:18:FocalTechPS/2_FocalTech_Touchpad" { +input "1739:0:Synaptics_TM3053-003" { tap enabled tap_button_map lrm middle_emulation enabled @@ -99,13 +98,6 @@ input "2:18:FocalTechPS/2_FocalTech_Touchpad" { drag enable } -# Touchscreen -input "1003:35393:Atmel" { - map_to_output eDP-1 - tap enabled - drag enable -} - input "*" { # Keyboard xkb_layout us diff --git a/files/.config/swaylock/config b/files/.config/swaylock/config index 98391c6..6dc5eed 100644 --- a/files/.config/swaylock/config +++ b/files/.config/swaylock/config @@ -2,7 +2,6 @@ image=~/.local/share/wallpaper scaling=fill color=111111 -ignore-empty-password disable-caps-lock-text line-uses-ring From 7a62049c3701e51326c6c17cfbe3cc67363c0332 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Wed, 17 Jul 2019 00:09:35 -0400 Subject: [PATCH 27/29] env var fix --- .../user/multi-user.target.wants/tmux.service | 1 - files/.profile | 9 --------- files/bin/sway | 18 ++++++++++++++++++ 3 files changed, 18 insertions(+), 10 deletions(-) delete mode 120000 files/.config/systemd/user/multi-user.target.wants/tmux.service diff --git a/files/.config/systemd/user/multi-user.target.wants/tmux.service b/files/.config/systemd/user/multi-user.target.wants/tmux.service deleted file mode 120000 index 6ae3bc7..0000000 --- a/files/.config/systemd/user/multi-user.target.wants/tmux.service +++ /dev/null @@ -1 +0,0 @@ -/home/marchambault/.config/systemd/user/tmux.service \ No newline at end of file diff --git a/files/.profile b/files/.profile index a416003..88c42aa 100644 --- a/files/.profile +++ b/files/.profile @@ -12,15 +12,6 @@ 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="-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 diff --git a/files/bin/sway b/files/bin/sway index ce4a63e..110248b 100755 --- a/files/bin/sway +++ b/files/bin/sway @@ -14,6 +14,10 @@ import-gsettings() { 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 @@ -38,4 +42,18 @@ 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 $@ From 7345764a7a77e26e49c83efac1b28790444e18aa Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Wed, 17 Jul 2019 00:23:04 -0400 Subject: [PATCH 28/29] use keychain to manage ssh agent --- files/.config/zsh/custom/000-env.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/.config/zsh/custom/000-env.zsh b/files/.config/zsh/custom/000-env.zsh index 72dd160..8c5457b 100644 --- a/files/.config/zsh/custom/000-env.zsh +++ b/files/.config/zsh/custom/000-env.zsh @@ -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) From 2fa2da2f03e73a2128212a2ac1b7b1b78ccc8d4f Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Sat, 14 Sep 2019 16:55:01 -0400 Subject: [PATCH 29/29] cleanup aliases and tmux a bit --- files/.config/zsh/custom/100-alias.zsh | 8 ++++---- files/.config/zsh/custom/300-tmux.zsh | 2 ++ files/.tmux.conf | 4 ---- files/.zshrc | 1 - 4 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 files/.config/zsh/custom/300-tmux.zsh diff --git a/files/.config/zsh/custom/100-alias.zsh b/files/.config/zsh/custom/100-alias.zsh index 559039a..352e5bb 100644 --- a/files/.config/zsh/custom/100-alias.zsh +++ b/files/.config/zsh/custom/100-alias.zsh @@ -9,11 +9,11 @@ alias rename="perl-rename" alias userctl="systemctl --user" # ls -alias ls='lsd --group-dirs=first ' +alias ls='lsd --group-dirs=first' alias l='ls -l' -alias la='ls -a ' -alias lla='ls -la ' -alias lt='ls --tree ' +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" diff --git a/files/.config/zsh/custom/300-tmux.zsh b/files/.config/zsh/custom/300-tmux.zsh new file mode 100644 index 0000000..846dc86 --- /dev/null +++ b/files/.config/zsh/custom/300-tmux.zsh @@ -0,0 +1,2 @@ +export ZSH_TMUX_AUTOSTART=true +export ZSH_TMUX_FIXTERM_WITH_256COLOR=true diff --git a/files/.tmux.conf b/files/.tmux.conf index 6663670..1c8f8bc 100644 --- a/files/.tmux.conf +++ b/files/.tmux.conf @@ -16,10 +16,6 @@ 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 diff --git a/files/.zshrc b/files/.zshrc index 21fcff0..086f8ae 100644 --- a/files/.zshrc +++ b/files/.zshrc @@ -3,7 +3,6 @@ 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