Add initial support for a pure Sway-based environment

This includes configuration for various other parts, such as Waybar and
Wofi, and will continue to evolve.
This commit is contained in:
Alex Palaistras 2021-05-07 19:00:48 +01:00
parent 1b05e51255
commit b34196800d
31 changed files with 793 additions and 727 deletions

19
.bashrc
View File

@ -1,19 +0,0 @@
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Set `fish` shell as default for Termite
[[ $TERM == "xterm-termite" || $TERM == "xterm-256color" ]] && exec fish
# Various includes and what-not.
[[ -f ~/.bash_profile ]] && . ~/.bash_profile
# Completion for commands after 'sudo'
complete -cf sudo
# Colorization for various applications
alias ls='ls --color=auto'
alias grep='grep --color=always'

View File

@ -0,0 +1,50 @@
window:
decorations: none
gtk_theme_variant: dark
padding:
x: 10
y: 10
font:
size: 18.5
normal:
family: Iosevka
draw_bold_text_with_bright_colors: false
colors:
# Default colors
primary:
background: '0x2d2d2d'
foreground: '0xd8d8d8'
# Colors the cursor will use if `custom_cursor_colors` is true
cursor:
text: '0x181818'
cursor: '0xd8d8d8'
# Normal colors
normal:
black: '0x181818'
red: '0xab4642'
green: '0xa1b56c'
yellow: '0xf7ca88'
blue: '0x7cafc2'
magenta: '0xba8baf'
cyan: '0x86c1b9'
white: '0xd8d8d8'
# Bright colors
bright:
black: '0x585858'
red: '0xdc9656'
green: '0x282828'
yellow: '0x383838'
blue: '0xb8b8b8'
magenta: '0xe8e8e8'
cyan: '0xa16946'
white: '0xf8f8f8'
shell:
program: /usr/bin/fish
args:
- --login

View File

@ -0,0 +1,5 @@
[org/gnome/desktop/interface]
document-font-name='IBM Plex Sans 11'
font-name='IBM Plex Sans 11'
monospace-font-name='IBM Plex Mono 11'
text-scaling-factor=1.6

View File

@ -13,8 +13,8 @@
doom-theme 'doom-monokai-pro
;; Font definitions.
doom-font (font-spec :family "Iosevka Term SS02" :size 11.50 :weight 'light)
doom-big-font (font-spec :family "Iosevka Term SS02" :size 12.50 :weight 'light)
doom-font (font-spec :family "Iosevka" :size 18.00 :weight 'light)
doom-big-font (font-spec :family "Iosevka" :size 20.00 :weight 'light)
doom-variable-pitch-font (font-spec :family "IBM Plex Sans" :weight 'light)
doom-serif-font (font-spec :family "IBM Plex Serif" :weight 'light)

View File

@ -6,6 +6,4 @@
;; (package! another-package :recipe (:host github :repo "username/repo"))
;; (package! builtin-package :disable t)
;; Install Kubernetes client support.
(package! kubel :pin "5d5639cac5d98bca74cad44b5a1e128df77050bd0a4ddb41698bb8aa02b18e07ac509")
(package! kubel-evil :pin "5d5639cac5d")
(package! systemd :pin "b6ae63a236605b1c5e1069f7d3afe06ae32a7bae")

View File

@ -1,243 +1,96 @@
[global]
font = Iosevka Term SS02 12
# Allow a small subset of html markup:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>ki
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
# If markup is not allowed, those tags will be stripped out of the
# message.
allow_markup = yes
# Display settings.
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# Markup is allowed
format = "<b>%s</b>\n%b"
monitor = 0 # Which monitor should the notifications be displayed on.
follow = mouse # Display notification on focused monitor.
geometry = "600x50-20-20" # The geometry of the window: [{width}]x{height}[+/-{x}+/-{y}]
# Sort messages by urgency.
sort = yes
progress_bar = true # Turn on the progess bar.
progress_bar_height = 20 # Set the progress bar height.
progress_bar_frame_width = 1 # Set the frame width of the progress bar.
progress_bar_min_width = 600 # Set the minimum width for the progress bar.
progress_bar_max_width = 600 # Set the maximum width for the progress bar.
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes
indicate_hidden = yes # Show how many messages are currently hidden (because of geometry).
shrink = no # Shrink window if it's smaller than the width.
transparency = 15 # The transparency of the window. Range: [0; 100].
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = center
notification_height = 0 # The height of the entire notification.
separator_height = 2 # Draw a line of "separator_height" pixel height between two notifications.
padding = 15 # Padding between text and separator.
horizontal_padding = 15 # Horizontal padding.
text_icon_padding = 0 # Padding between text and icon.
# The frequency with wich text that is longer than the notification
# window allows bounces back and forth.
# This option conflicts with "word_wrap".
# Set to 0 to disable.
bounce_freq = 0
frame_width = 2 # Width in pixels of frame around the notification window.
frame_color = "#d8d8d8" # Defines color of the frame around the notification window.
separator_color = auto # Color for the separator.
corner_radius = 0 # The corner radius for the notification window.
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 300
sort = yes # Sort messages by urgency.
idle_threshold = 120 # Don't remove messages, if the user is idle # for longer than idle_threshold seconds.
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = yes
# Text settings.
# Ignore newlines '\n' in notifications.
ignore_newline = no
font = Iosevka 18 # The font name and size.
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels. If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like). If width is 0, the window expands to the longest
# message displayed. A positive x is measured from the left, a
# negative from the right side of the screen. Y is measured from
# the top and down respectevly.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "600x50-20-20"
line_height = 1 # The spacing between lines.
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = no
markup = full # Pango markup in notifications. Choice of 'full', 'strip', and 'no'.
format = "<b>%s</b>\n%b" # Message format.
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing windowmanager is
# present (e.g. xcompmgr, compiz, etc.).
transparency = 15
alignment = center # Alignment of message text. Choice of 'left', 'center', and 'right'.
vertical_alignment = center # Vertical alignment of message text and icon. Choice of 'top', 'center', and 'bottom'.
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
idle_threshold = 120
show_age_threshold = 300 # Show age of message if message is older than show_age_threshold seconds.
# Which monitor should the notifications be displayed on.
monitor = 0
word_wrap = yes # Split notifications into multiple lines if they don't fit into geometry.
ignore_newline = no # Ignore newlines ('\n') in notifications.
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a windowmanager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern windowmanagers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = mouse
stack_duplicates = true # Stack together notifications with the same content.
hide_duplicate_count = true # Hide the count of stacked notifications with the same content.
show_indicators = no # Display indicators for URLs (U) and actions (A).
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Icon settings.
# Maximum amount of notifications kept in history
history_length = 20
icon_path = /usr/share/icons/Adwaita/scalable/status/:/usr/share/icons/Adwaita/scalable/devices/
# Display indicators for URLs (U) and actions (A).
show_indicators = no
icon_position = left # Icon alignment. Choice of 'left', 'right', 'off'.
min_icon_size = 32 # Scale small icons up to this size, set to 0 to disable.
max_icon_size = 64 # Scale larger icons down to this size, set to 0 to disable.
# The height of a single line. If the height is smaller than the
# font height, it will get raised to the font height.
# This adds empty space above and under the text.
line_height = 1
# History settings.
# Draw a line of "separatpr_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 2
sticky_history = yes # Whether notifications from history should be sticky.
history_length = 20 # Maximum amount of notifications kept in history.
# Padding between text and separator.
padding = 8
# Misc/Advanced settings.
# Horizontal padding.
horizontal_padding = 15
dmenu = /usr/bin/wofi --dmenu -p dunst: # Path to dmenu-compatible launcher.
browser = /usr/bin/qutebrowser --target tab # Browser for opening URLs in context menu.
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = auto
# Interaction settings.
# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = false
mouse_left_click = close_current
mouse_middle_click = do_action, close_current
mouse_right_click = close_all
# dmenu path.
dmenu = /usr/bin/rofi -dmenu -p dunst:
# Browser for opening urls in context menu.
browser = /usr/bin/firefox -new-tab
# Align icons left/right/off
icon_position = off
# Paths to default icons.
icon_folders = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
[frame]
width = 2
color = "#d8d8d8"
[shortcuts]
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
close = mod4+x
# Close all notifications.
close_all = mod4+shift+x
# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1".
history = mod4+grave
# Context menu.
context = mod4+shift+grave
# Notification-specific settings.
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
highlight = "#d8d8d8"
foreground = "#d8d8d8"
background = "#282828"
timeout = 10
[urgency_normal]
highlight = "#d8d8d8"
foreground = "#d8d8d8"
background = "#282828"
timeout = 10
[urgency_critical]
highlight = "#d8d8d8"
foreground = "#ab4642"
background = "#282828"
timeout = 10
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
# Messages can be matched by "appname", "summary", "body", "icon", "category",
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
# "background", "new_icon" and "format".
# Shell-like globbing will get expanded.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# format = ""
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
# vim: ft=cfg

View File

@ -0,0 +1,14 @@
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<fontconfig>
<match target="font">
<edit mode="assign" name="hinting">
<bool>false</bool>
</edit>
</match>
<match target="font">
<edit name="lcdfilter" mode="assign">
<const>lcddefault</const>
</edit>
</match>
</fontconfig>

View File

@ -0,0 +1,10 @@
[general]
temp-day=6500
temp-night=4200
fade=1
adjustment-method=wayland
location-provider=manual
[manual]
lat=51.5
lon=-0.11

28
.config/mpd/mpd.conf Normal file
View File

@ -0,0 +1,28 @@
# Files and directories.
music_directory "~/Music"
playlist_directory "~/.local/share/mpd/playlists"
db_file "~/.local/share/mpd/mpd.db"
state_file "~/.local/share/mpd/mpd.state"
sticker_file "~/.local/share/mpd/sticker.db"
log_file "~/.cache/mpd/mpd.log"
pid_file "~/.cache/mpd/mpd.pid"
# General options.
port "6600"
log_level "notice"
restore_paused "no"
auto_update "yes"
zeroconf_enabled "no"
filesystem_charset "UTF-8"
# Audio output options.
replaygain "album"
replaygain_limit "yes"
volume_normalization "no"
audio_output {
type "pulse"
name "MPD"
}

View File

@ -23,20 +23,20 @@ c.qt.highdpi = True
c.scrolling.smooth = True
c.statusbar.widgets = ["url", "progress", "scroll"]
c.tabs.background = True
c.tabs.new_position.related = "last"
c.tabs.new_position.related = "next"
c.url.default_page = 'https://duckduckgo.com'
c.input.insert_mode.auto_leave = False
c.input.insert_mode.auto_load = True
c.zoom.default = "150%"
c.zoom.default = "100%"
# Searches.
c.url.searchengines['DEFAULT'] = 'https://duckduckgo.com/?q={}'
c.url.searchengines['a'] = 'https://wiki.archlinux.org/?search={}'
c.url.searchengines['ap'] = 'https://www.archlinux.org/packages/?sort=&q={}'
c.url.searchengines['g'] = 'http://www.google.com/search?hl=en&source=hp&ie=ISO-8859-l&q={}'
c.url.searchengines['y'] = 'https://www.youtube.com/results?search_query={}'
c.url.searchengines['w'] = 'https://secure.wikimedia.org/wikipedia/en/w/index.php?title=Special%%3ASearch&search={}'
c.url.searchengines['gh'] = 'https://github.com/search?q={}&type=Code'
c.url.searchengines['!aw'] = 'https://wiki.archlinux.org/?search={}'
c.url.searchengines['!ap'] = 'https://www.archlinux.org/packages/?sort=&q={}'
c.url.searchengines['!g'] = 'http://www.google.com/search?hl=en&source=hp&ie=ISO-8859-l&q={}'
c.url.searchengines['!yt'] = 'https://www.youtube.com/results?search_query={}'
c.url.searchengines['!w'] = 'https://secure.wikimedia.org/wikipedia/en/w/index.php?title=Special%%3ASearch&search={}'
c.url.searchengines['!gh'] = 'https://github.com/search?q={}&type=Code'
# Key bindings.
config.bind('gH', 'tab-move -', mode='normal')
@ -52,6 +52,7 @@ config.bind('L', 'tab-next', mode='normal')
# UI controls.
c.completion.height = "30%"
c.downloads.position = "bottom"
c.hints.padding = {"bottom": 2, "left": 5, "right": 5, "top": 2}
c.statusbar.padding = {"bottom": 5, "left": 5, "right": 5, "top": 5}
c.tabs.favicons.show = "pinned"
@ -61,9 +62,9 @@ c.tabs.title.format = "{current_title}"
c.window.title_format = "qutebrowser"
# Fonts.
c.fonts.default_family = ["Iosevka Term SS02"]
c.fonts.default_size = "11.5pt"
c.fonts.prompts = "11.5pt Iosevka Term SS02"
c.fonts.default_family = ["Iosevka"]
c.fonts.default_size = "12pt"
c.fonts.prompts = "12pt Iosevka"
# Colors.
base00 = "#181818"

273
.config/sway/config Normal file
View File

@ -0,0 +1,273 @@
# ---------
# BEHAVIOUR
# ---------
# Start graphical session dependencies.
exec_always "systemctl --user import-environment; systemctl --user start sway-session.target"
exec_always "cat ~/.config/dconf/user-defaults | dconf load /"
# Window manipulation.
focus_follows_mouse no
# Workspace names.
set $www 1:www
set $code 2:code
set $cmd 3:cmd
set $chat 4:chat
set $media 5:media
set $games 6:games
set $misc 7:misc
# Workspace assignments for applications
# Example: assign [class="firefox"] $www
assign [app_id="org.qutebrowser.qutebrowser"] $www
assign [app_id="org.gajim.Gajim"] $chat
assign [app_id="cantata"] $media
assign [class="Emacs"] $code
assign [class="Steam"] $games
assign [class="itch"] $games
# Mode aliases.
set $resize "resize"
set $session "Session: Ⓢ Suspend, Ⓛ Logout, Ⓡ Reboot, Ⓟ Power off"
# Display output configuration.
output * scale 1
bindswitch --reload --locked lid:on output eDP-1 disable
bindswitch --reload --locked lid:off output eDP-1 enable
# Input configuration.
input "type:keyboard" {
xkb_layout us,gr
xkb_options grp:caps_toggle,grp_led:caps
repeat_delay 400
repeat_rate 80
}
input "type:touchpad" {
tap enabled
natural_scroll enabled
}
# Hide cursor after 30 seconds of inactivity.
seat * hide_cursor 30000
# Idle state management.
exec swayidle -w \
timeout 300 '$locker' \
timeout 420 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
before-sleep '$locker' \
lock '$player pause' \
lock '$notify set-paused true' \
unlock '$player pause' \
unlock '$notify set-paused false'
# Inhibit idle tracking for specific applications.
for_window [class="^.*"] inhibit_idle fullscreen
for_window [app_id="^.*"] inhibit_idle fullscreen
for_window [class="zoom"] inhibit_idle open
# -----------
# KEYBINDINGS
# -----------
# Default modifier key is the 'Super' key.
set $mod Mod4
# Application aliases.
set $terminal alacritty
set $applaunch wofi --conf ~/.config/wofi/config.drun --term $terminal
set $cmdlaunch wofi --term $terminal
set $locker swaylock -f
set $player mpc
set $notify dunstctl
set $mixer pulsemixer --max-volume 100
# Application launching
bindsym $mod+Return exec $terminal
bindsym $mod+d exec $applaunch
bindsym $mod+Shift+d exec $cmdlaunch
# Change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# 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
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# Move workspace to output.
bindsym $mod+Ctrl+Shift+h move workspace to output left
bindsym $mod+Ctrl+Shift+j move workspace to output down
bindsym $mod+Ctrl+Shift+k move workspace to output up
bindsym $mod+Ctrl+Shift+l move workspace to output right
bindsym $mod+Ctrl+Shift+Left move workspace to output left
bindsym $mod+Ctrl+Shift+Down move workspace to output down
bindsym $mod+Ctrl+Shift+Up move workspace to output up
bindsym $mod+Ctrl+Shift+Right move workspace to output right
# Window size
bindsym $mod+f fullscreen toggle
# Horizontal/vertical orientation switching
bindsym $mod+bracketleft split h
bindsym $mod+bracketright split v
# 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+o floating toggle
bindsym $mod+Shift+o sticky toggle
# Focus the parent/child container.
bindsym $mod+a focus parent
# Focus between floating and split containers.
bindsym $mod+Shift+Tab focus mode_toggle
# Focus urgent window.
bindsym $mod+u [urgent=latest] focus
# Resize floating windows with modifider + mouse.
floating_modifier $mod
# Toggle between last used workspaces.
bindsym $mod+Tab workspace back_and_forth
# Switch to workspace.
bindsym $mod+1 workspace $www
bindsym $mod+2 workspace $code
bindsym $mod+3 workspace $cmd
bindsym $mod+4 workspace $chat
bindsym $mod+5 workspace $media
bindsym $mod+6 workspace $games
bindsym $mod+7 workspace $misc
# Move focused window to workspace.
bindsym $mod+Shift+1 move container to workspace $www
bindsym $mod+Shift+2 move container to workspace $code
bindsym $mod+Shift+3 move container to workspace $cmd
bindsym $mod+Shift+4 move container to workspace $chat
bindsym $mod+Shift+5 move container to workspace $media
bindsym $mod+Shift+6 move container to workspace $games
bindsym $mod+Shift+7 move container to workspace $misc
# Window manager.
bindsym $mod+q kill
bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart
bindsym $mod+Shift+Delete exec $locker
# Volume keys.
bindsym XF86AudioRaiseVolume exec $mixer --change-volume +5
bindsym XF86AudioLowerVolume exec $mixer --change-volume -5
bindsym XF86AudioMute exec $mixer --toggle-mute
# Media keys.
bindsym $mod+Ctrl+Up exec $player stop
bindsym $mod+Ctrl+Down exec $player toggle
bindsym $mod+Ctrl+Left exec $player prev
bindsym $mod+Ctrl+Right exec $player next
bindsym XF86AudioStop exec $player stop
bindsym XF86AudioPlay exec $player toggle
bindsym XF86AudioPrev exec $player prev
bindsym XF86AudioNext exec $player next
bindsym XF86MonBrightnessDown exec brightnessctl set 10%-
bindsym XF86MonBrightnessUp exec brightnessctl set +10%
# Notification handling.
bindsym $mod+x exec $notify close
bindsym $mod+Shift+x exec $notify close-all
bindsym $mod+grave exec $notify history-pop
bindsym $mod+Shift+grave exec $notify context
# Modes.
bindsym $mod+r mode $resize
bindsym $mod+Shift+q mode $session
# ----------
# APPEARANCE
# ----------
# Default font.
font pango:Iosevka 18
# Wallpaper.
output * bg ~/.config/sway/default-bg fill
# Gaps.
default_border pixel 3
default_floating_border pixel 3
hide_edge_borders --i3 smart
gaps inner 10
smart_gaps on
# Color names.
set $background #282828
set $foreground #d8d8d8
set $focused #2d2d2d
set $unfocused #585858
set $urgent #ab4642
# Window manager colors.
# Class Border Background Text Indicator
client.focused $background $background $foreground $focused
client.focused_inactive $background $background $unfocused $focused
client.unfocused $background $background $unfocused $background
client.urgent $urgent $urgent $background $urgent
client.background $background
# ---------------
# MODES & MODULES
# ---------------
mode $resize {
# These bindings trigger as soon as you enter the resize mode.
bindsym k resize grow up 10 px or 10 ppt
bindsym j resize shrink up 10 px or 10 ppt
bindsym h resize grow left 10 px or 10 ppt
bindsym l resize shrink left 10 px or 10 ppt
# Same bindings, but for the arrow keys
bindsym Up resize grow up 10 px or 10 ppt
bindsym Down resize shrink up 10 px or 10 ppt
bindsym Left resize grow left 10 px or 10 ppt
bindsym Right resize shrink left 10 px or 10 ppt
# Back to normal mode: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode $session {
bindsym s exec systemctl suspend, mode "default"
bindsym l exec swaymsg exit, mode "default"
bindsym r exec systemctl reboot, mode "default"
bindsym p exec systemctl poweroff -i, mode "default"
# Back to normal mode: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bar {
swaybar_command waybar
}

8
.config/swaylock/config Normal file
View File

@ -0,0 +1,8 @@
# Fonts.
font=Iosevka
font-size=18
# Colors and wallpaper.
image=~/.config/sway/default-bg
scaling=fill
color=282828

View File

@ -0,0 +1 @@
/usr/lib/systemd/user/mpd.service

View File

@ -0,0 +1 @@
/usr/lib/systemd/user/gammastep.service

View File

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

View File

@ -0,0 +1,2 @@
[Service]
Environment="XDG_CURRENT_DESKTOP=sway"

View File

@ -1,46 +0,0 @@
[options]
font = Iosevka Term SS02 12
urgent_on_bell = true
clickable_url = true
scrollback_lines = 10000
cursor_blink = off
[colors]
# special
foreground = #d3d0c8
foreground_bold = #d3d0c8
cursor = #d3d0c8
background = #2d2d2d
# black
color0 = #2d2d2d
color8 = #747369
# red
color1 = #f2777a
color9 = #f2777a
# green
color2 = #99cc99
color10 = #99cc99
# yellow
color3 = #ffcc66
color11 = #ffcc66
# blue
color4 = #6699cc
color12 = #6699cc
# magenta
color5 = #cc99cc
color13 = #cc99cc
# cyan
color6 = #66cccc
color14 = #66cccc
# white
color7 = #d3d0c8
color15 = #f2f0ec

105
.config/waybar/config Normal file
View File

@ -0,0 +1,105 @@
{
"layer": "top",
"height": 32,
"modules-left": ["sway/window", "mpd", "sway/mode"],
"modules-center": ["sway/workspaces"],
"modules-right": ["pulseaudio", "network", "battery", "cpu", "memory", "temperature", "sway/language", "clock", "tray"],
"battery": {
"interval": 60,
"states": {
"warning": 30,
"critical": 15
},
"format": "<span color='#585858'>bat</span> {capacity}%",
"format-icons": ["", "", "", "", ""],
"max-length": 25
},
"clock": {
"format": "<span color='#585858'>time</span> {:%H:%M}",
"format-alt": "<span color='#585858'>date</span> {:%A, %d %B %H:%M}"
},
"cpu": {
"interval": 10,
"format": "<span color='#585858'>cpu</span> {usage}%",
"max-length": 10,
"on-click": "alacritty -e htop"
},
"memory": {
"interval": 30,
"format": "<span color='#585858'>mem</span> {}%",
"on-click": "alacritty -e htop"
},
"mpd": {
"format": "{stateIcon} {artist} - {title}<small>{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}</small>",
"format-stopped": "",
"format-disconnected": "",
"interval": 5,
"max-length": 60,
"artist-len": 40,
"title-len": 40,
"random-icons": {
"off": "",
"on": " "
},
"repeat-icons": {
"on": " "
},
"single-icons": {
"on": " ¹"
},
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})",
"tooltip-format-disconnected": "MPD (disconnected)",
"smooth-scrolling-threshold": 20,
"on-click": "mpc toggle",
"on-click-right": "cantata",
"on-scroll-up": "mpc prev",
"on-scroll-down": "mpc next"
},
"network": {
"format-wifi": "<span color='#585858'>wifi</span> {essid}",
"format-ethernet": "<span color='#585858'>net</span> {ifname}",
"format-disconnected": "",
"tooltip-format-wifi": "{essid} ({signalStrength}%)",
"tooltip-format-ethernet": "{ifname}",
"tooltip-format-disconnected": "Disconnected",
"max-length": 50
},
"pulseaudio": {
"format": "<span color='#585858'>vol</span> {volume}%",
"format-bluetooth": "<span color='#585858'>vol </span> {volume}%",
"format-muted": "<span color='#585858'>vol</span> <span color='#ab4642'>{volume}%</span>",
"tooltip-format": "{desc}",
"format-icons": {
"default": ["", "", "", ""],
"headphone": ""
},
"scroll-step": 1,
"on-click": "alacritty -e pulsemixer"
},
"sway/workspaces": {
"format": "{name}",
"smooth-scrolling-threshold": 5
},
"sway/window": {
"format": "",
"on-click": "wofi --conf ~/.config/wofi/config.drun",
"align": 0,
"max-length": 50
},
"sway/language": {
"format": "<span color='#585858'>key</span> {}",
"max-length": 50
},
"temperature": {
"thermal-zone": 1,
"format": "<span color='#585858'>temp</span> {temperatureC}°C"
},
"tray": {
"icon-size": 32,
"spacing": 15
}
}

84
.config/waybar/style.css Normal file
View File

@ -0,0 +1,84 @@
* {
font-family: Iosevka, Ionicons;
font-size: 1.1rem;
}
#waybar {
background-color: transparent;
color: #d8d8d8;
transition: background-color 0.1s ease;
}
#waybar.solo {
background-color: #282828;
}
.modules-left {
padding-left: 0.2rem;
}
.modules-right {
padding-right: 0.2rem;
}
.modules-left label, .modules-right label {
border: 0.2rem solid transparent;
padding: 0.2rem 0.5rem;
}
#workspaces button {
border: 0.2rem solid transparent;
border-radius: 0;
box-shadow: none;
color: #585858;
text-shadow: none;
padding: 0.2rem 0.5rem;
}
#workspaces button:hover {
background: none;
border-top-color: #d8d8d8;
}
#workspaces button.focused {
color: #d8d8d8;
}
#workspaces button.urgent {
color: #ab4642;
}
#mode {
background-color: #ab4642;
border-radius: 0.5rem;
color: #e8e8e8;
}
#mpd.disconnected, #mpd.stopped {
margin: 0;
padding: 0;
}
#mpd.paused, #mpd.playing {
border-radius: 0.5rem;
margin: 0 0.75rem 0 0.25rem;
transition: background-color, color 0.1s ease;
}
#mpd.paused {
background-color: #585858;
color: #e8e8e8;
}
#mpd.playing {
background-color: #ba8baf;
color: #282828;
}
#tray {
margin-right: 0.25rem;
}
#battery.critical {
color: #ab4642;
}

10
.config/wofi/config Normal file
View File

@ -0,0 +1,10 @@
# General settings.
mode=run
insensitive=true
location=2
y=100
# Appearance.
prompt=Run command…
height=50%
width=50%

14
.config/wofi/config.drun Normal file
View File

@ -0,0 +1,14 @@
# General settings.
mode=drun
insensitive=true
no_actions=true
location=2
y=100
# Appearance.
prompt=Launch application…
allow_images=true
columns=3
image_size=48
height=50%
width=50%

53
.config/wofi/style.css Normal file
View File

@ -0,0 +1,53 @@
window {
background-color: #2d2d2d;
border: 0.2rem solid #282828;
border-radius: 0.5rem;
font-family: "Iosevka";
font-size: 1rem;
opacity: 0;
transition: opacity 0.15s ease;
}
window:focus {
opacity: 1;
}
.search {
background-color: #d8d8d8;
border: 0.1rem solid #282828;
box-shadow: none;
color: #282828;
margin: 0 0 1.5rem 0;
padding: 0.75rem 0;
}
.search .left, .search .right {
color: transparent;
}
#outer-box {
margin: 1.5rem;
}
#inner-box {
margin: 0;
}
#entry {
border: 0.1rem solid transparent;
color: #b8b8b8;
margin: 0;
padding: 0.5rem 0.75rem;
transition: 0.1s ease;
}
#entry:selected {
background-color: #ab4642;
border-color: 0.1rem solid #b8b8b8;
color: #e8e8e8;
}
#entry .drun-icon {
padding: 0.5rem;
margin-right: 0.5rem;
}

26
.config/zathura/zathurarc Normal file
View File

@ -0,0 +1,26 @@
# UI options.
set font "Iosevka 12"
# Base16-Default colors.
set default-bg "#181818"
set default-fg "#282828"
set statusbar-fg "#b8b8b8"
set statusbar-bg "#383838"
set inputbar-bg "#181818"
set inputbar-fg "#f8f8f8"
set notification-bg "#181818"
set notification-fg "#f8f8f8"
set notification-error-bg "#181818"
set notification-error-fg "#ab4642"
set notification-warning-bg "#181818"
set notification-warning-fg "#ab4642"
set highlight-color "#f7ca88"
set highlight-active-color "#7cafc2"
set completion-bg "#282828"
set completion-fg "#7cafc2"
set completion-highlight-fg "#f8f8f8"
set completion-highlight-bg "#7cafc2"
set recolor-lightcolor "#181818"
set recolor-darkcolor "#e8e8e8"
set recolor "false"
set recolor-keephue "false"

View File

@ -1,26 +0,0 @@
auto-key-locate keyserver
keyserver hkps://hkps.pool.sks-keyservers.net
keyserver-options no-honor-keyserver-url
keyserver-options ca-cert-file=~/.gnupg/keyserver/sks-keyservers.netCA.pem
keyserver-options no-honor-keyserver-url
keyserver-options debug
keyserver-options verbose
personal-cipher-preferences AES256 AES192 AES CAST5
personal-digest-preferences SHA512 SHA384 SHA256 SHA224
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
cert-digest-algo SHA512
s2k-digest-algo SHA512
s2k-cipher-algo AES256
charset utf-8
fixed-list-mode
no-comments
no-emit-version
keyid-format 0xlong
list-options show-uid-validity
verify-options show-uid-validity
with-fingerprint
require-cross-certification
use-agent

View File

@ -1,6 +1,4 @@
pinentry-program /usr/bin/pinentry-gnome3
pinentry-program /usr/bin/pinentry-qt
default-cache-ttl 60
max-cache-ttl 120
enable-ssh-support
enable-ssh-support

View File

@ -1,32 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIFizCCA3OgAwIBAgIJAK9zyLTPn4CPMA0GCSqGSIb3DQEBBQUAMFwxCzAJBgNV
BAYTAk5PMQ0wCwYDVQQIDARPc2xvMR4wHAYDVQQKDBVza3Mta2V5c2VydmVycy5u
ZXQgQ0ExHjAcBgNVBAMMFXNrcy1rZXlzZXJ2ZXJzLm5ldCBDQTAeFw0xMjEwMDkw
MDMzMzdaFw0yMjEwMDcwMDMzMzdaMFwxCzAJBgNVBAYTAk5PMQ0wCwYDVQQIDARP
c2xvMR4wHAYDVQQKDBVza3Mta2V5c2VydmVycy5uZXQgQ0ExHjAcBgNVBAMMFXNr
cy1rZXlzZXJ2ZXJzLm5ldCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC
ggIBANdsWy4PXWNUCkS3L//nrd0GqN3dVwoBGZ6w94Tw2jPDPifegwxQozFXkG6I
6A4TK1CJLXPvfz0UP0aBYyPmTNadDinaB9T4jIwd4rnxl+59GiEmqkN3IfPsv5Jj
MkKUmJnvOT0DEVlEaO1UZIwx5WpfprB3mR81/qm4XkAgmYrmgnLXd/pJDAMk7y1F
45b5zWofiD5l677lplcIPRbFhpJ6kDTODXh/XEdtF71EAeaOdEGOvyGDmCO0GWqS
FDkMMPTlieLA/0rgFTcz4xwUYj/cD5e0ZBuSkYsYFAU3hd1cGfBue0cPZaQH2HYx
Qk4zXD8S3F4690fRhr+tki5gyG6JDR67aKp3BIGLqm7f45WkX1hYp+YXywmEziM4
aSbGYhx8hoFGfq9UcfPEvp2aoc8u5sdqjDslhyUzM1v3m3ZGbhwEOnVjljY6JJLx
MxagxnZZSAY424ZZ3t71E/Mn27dm2w+xFRuoy8JEjv1d+BT3eChM5KaNwrj0IO/y
u8kFIgWYA1vZ/15qMT+tyJTfyrNVV/7Df7TNeWyNqjJ5rBmt0M6NpHG7CrUSkBy9
p8JhimgjP5r0FlEkgg+lyD+V79H98gQfVgP3pbJICz0SpBQf2F/2tyS4rLm+49rP
fcOajiXEuyhpcmzgusAj/1FjrtlynH1r9mnNaX4e+rLWzvU5AgMBAAGjUDBOMB0G
A1UdDgQWBBTkwyoJFGfYTVISTpM8E+igjdq28zAfBgNVHSMEGDAWgBTkwyoJFGfY
TVISTpM8E+igjdq28zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4ICAQAR
OXnYwu3g1ZjHyley3fZI5aLPsaE17cOImVTehC8DcIphm2HOMR/hYTTL+V0G4P+u
gH+6xeRLKSHMHZTtSBIa6GDL03434y9CBuwGvAFCMU2GV8w92/Z7apkAhdLToZA/
X/iWP2jeaVJhxgEcH8uPrnSlqoPBcKC9PrgUzQYfSZJkLmB+3jEa3HKruy1abJP5
gAdQvwvcPpvYRnIzUc9fZODsVmlHVFBCl2dlu/iHh2h4GmL4Da2rRkUMlbVTdioB
UYIvMycdOkpH5wJftzw7cpjsudGas0PARDXCFfGyKhwBRFY7Xp7lbjtU5Rz0Gc04
lPrhDf0pFE98Aw4jJRpFeWMjpXUEaG1cq7D641RpgcMfPFvOHY47rvDTS7XJOaUT
BwRjmDt896s6vMDcaG/uXJbQjuzmmx3W2Idyh3s5SI0GTHb0IwMKYb4eBUIpQOnB
cE77VnCYqKvN1NVYAqhWjXbY7XasZvszCRcOG+W3FqNaHOK/n/0ueb0uijdLan+U
f4p1bjbAox8eAOQS/8a3bzkJzdyBNUKGx1BIK2IBL9bn/HravSDOiNRSnZ/R3l9G
ZauX0tu7IIDlRCILXSyeazu0aj/vdT3YFQXPcvt5Fkf5wiNTo53f72/jYEJd6qph
WrpoKqrwGwTpRUCMhYIUt65hsTxCiJJ5nKe39h46sg==
-----END CERTIFICATE-----

1
.local/bin/dmenu Symbolic link
View File

@ -0,0 +1 @@
/usr/bin/wofi

View File

@ -1,358 +0,0 @@
#!/bin/bash
set -o pipefail
set -o nounset
# Function definitions
function defaults-set() {
ADB="adb"
BACKEND="droidcamx"
STREAM_BACKEND="gstreamer" # or "droidcam-cli"
WIDTH="1280"
HEIGHT="720"
AUDIO_ENABLED="true"
}
function defaults-set-droidcamx() {
case "$STREAM_BACKEND" in
gstreamer)
MODULE_NAME="v4l2loopback"
MODULE_ARGS="card_label=Phonecam"
;;
droidcam-cli)
MODULE_NAME="v4l2loopback_dc"
MODULE_ARGS="width=${WIDTH} height=${HEIGHT}"
;;
esac
HOST="127.0.0.1"
PORT="4747"
VIDEO_URL="http://$HOST:$PORT/video?${WIDTH}x${HEIGHT}"
VIDEO_SYNC="false"
GSTREAMER_VIDEO_PARAMS="video/x-raw,width=$WIDTH,height=$HEIGHT"
PACKAGE="com.dev47apps.droidcamx"
INTENT="com.dev47apps.droidcamx.DroidCamX"
}
function defaults-set-ipwebcam() {
MODULE_NAME="v4l2loopback"
MODULE_ARGS="card_label=Phonecam"
HOST="127.0.0.1"
PORT="8080"
VIDEO_URL="http://$HOST:$PORT/video"
VIDEO_SYNC="false"
AUDIO_URL="http://$HOST:$PORT/audio.wav"
AUDIO_SYNC="false"
GSTREAMER_VIDEO_PARAMS="video/x-raw,width=$WIDTH,height=$HEIGHT"
GSTREAMER_AUDIO_PARAMS="audio/x-raw,format=S16LE,layout=interleaved,rate=44100,channels=1"
PULSEAUDIO_AUDIO_PARAMS="format=S16LE channels=1"
}
function backend-check-droidcamx() {
$ADB shell pidof $PACKAGE &> /dev/null || return $?
case "$STREAM_BACKEND" in
gstreamer)
gstreamer-check
;;
droidcam-cli)
ps -C droidcam-cli &> /dev/null
;;
*)
echo "Unknown stream backend '$STREAM_BACKEND' selected"
return 1
;;
esac
return $?
}
function backend-start-droidcamx() {
echo "Starting '${INTENT}'..."
$ADB shell am start -n $PACKAGE/$INTENT || return $?
sleep 2
case "$STREAM_BACKEND" in
gstreamer)
echo "Starting GStreamer..."
gstreamer-video-start &
sleep 2 && backend-check-droidcamx
;;
droidcam-cli)
echo "Starting 'droidcam-cli'..."
droidcam-cli $HOST $PORT &
;;
*)
echo "Unknown stream backend '$STREAM_BACKEND' selected"
return 1
;;
esac
return $?
}
function backend-stop-droidcamx() {
case "$STREAM_BACKEND" in
gstreamer)
gstreamer-stop
;;
droidcam-cli)
echo "Stopping 'droidcam-cli'..."
killall droidcam-cli
;;
*)
echo "Unknown stream backend '$STREAM_BACKEND' selected"
return 1
;;
esac
echo "Stopping '$PACKAGE'..."
$ADB shell am force-stop $PACKAGE
}
function backend-check-ipwebcam() {
gstreamer-check
return $?
}
function backend-start-ipwebcam() {
# Start audio pipeline, if enabled.
[[ "$AUDIO_ENABLED" = "true" ]] && {
pulseaudio-start || return $?
gstreamer-audio-start &
}
# Start video pipeline.
gstreamer-video-start &
sleep 2 && backend-check-ipwebcam
return $?
}
function backend-stop-ipwebcam() {
echo "Stopping Gstreamer..."
gstreamer-stop
[[ "$AUDIO_ENABLED" = "true" ]] && {
echo "Unloading Pulseaudio modules..."
pulseaudio-stop
}
return 0
}
function gstreamer-video-start() {
local device="$(gstreamer-get-device)" || return $?
gst-launch-1.0 souphttpsrc location="$VIDEO_URL" do-timestamp=true is-live=true ! multipartdemux ! decodebin ! videoconvert ! videoscale ! "$GSTREAMER_VIDEO_PARAMS" ! v4l2sink device=$device sync="$VIDEO_SYNC"
return 0
}
function gstreamer-audio-start() {
local device="$(gstreamer-get-device)" || return $?
gst-launch-1.0 souphttpsrc location="$AUDIO_URL" do-timestamp=true is-live=true ! "$GSTREAMER_AUDIO_PARAMS" ! queue ! pulsesink device="phonecam" sync="$AUDIO_SYNC"
return 0
}
function gstreamer-check() {
echo "$(ps -C gst-launch-1.0 -o command )" | grep -q -e "souphttpsrc" -e "$VIDEO_URL"
return $?
}
function gstreamer-stop() {
kill $(echo "$(ps -C gst-launch-1.0 -o pid,command)" | awk '/souphttpsrc|$HOST:$PORT/ {print $1}')
}
function gstreamer-get-device() {
for d in /dev/video*; do
echo "$(v4l2-ctl -d $d -D)" | grep -q 'v4l2 loopback' && {
echo "$d"
return 0
}
done
echo "No 'v4l2loopback' device found"
return 1
}
function pulseaudio-start() {
local default=$(pacmd dump | awk '/set-default-sink/ {print $2}')
pactl load-module module-null-sink sink_name="phonecam" sink_properties="device.description='Phonecam'" $PULSEAUDIO_AUDIO_PARAMS
pactl load-module module-echo-cancel sink_name="phonecam_echo_cancel" source_master="phonecam.monitor" sink_master="$default" $PULSEAUDIO_AUDIO_PARAMS aec_method="webrtc" save_aec=true use_volume_sharing=true
pactl set-default-source phonecam.monitor
return 0
}
function pulseaudio-stop() {
pactl unload-module $(pulseaudio-sink-by-name "phonecam_echo_cancel")
pactl unload-module $(pulseaudio-sink-by-name "phonecam")
return 0
}
function pulseaudio-sink-by-name() {
pacmd list-sinks | awk "/name: <$1>/ {f=1; next} f && /module:/ {print \$2; exit}"
}
function module-check() {
# Check if module is loaded. Echo is needed here to avoid SIGPIPE.
echo "$(lsmod)" | grep -q "$MODULE_NAME" && return 0
# Check if module is available.
modinfo -F=null "$MODULE_NAME" || return 2
# Module is available but not loaded.
return 1
}
function module-load() {
# Check for module availability.
module-check && return 0 || [[ $? -eq 2 ]] && return 2
# Module is not loaded but is available, try to load.
sudo modprobe $MODULE_NAME $MODULE_ARGS
return $?
}
function module-unload() {
# Check for module availability.
module-check || return 1
# Unload module.
sudo rmmod $MODULE_NAME
return $?
}
function adb-device-check() {
echo "$($ADB get-state)" | grep -q "device"
return $?
}
function adb-connection-check() {
echo "$($ADB forward --list)" | grep -q "tcp:${PORT} tcp:${PORT}"
return $?
}
function phonecam-start() {
module-check || {
echo "Loading module '$MODULE_NAME' with 'modprobe'..."
module-load || return $?
}
adb-device-check || {
echo "Device not set up for 'adb' connection."
return 1
}
adb-connection-check || {
echo "Forwarding port '$PORT' to local..."
$ADB forward tcp:$PORT tcp:$PORT || return $?
}
backend-check-${BACKEND} || backend-start-${BACKEND} || return $?
return 0
}
function phonecam-stop() {
backend-check-${BACKEND} && backend-stop-${BACKEND}
adb-connection-check && {
echo "Removing port forward for '$PORT'..."
$ADB forward --remove tcp:$PORT
}
module-check && {
echo "Unloading module '$MODULE_NAME'..."
module-unload
}
return 0
}
function phonecam-status() {
local module=$(module-check && echo 'loaded' || { [[ $? -eq 2 ]] && echo 'not-found'; } || echo 'not-loaded')
local device=$(adb-device-check && echo 'connected' || echo 'not-connected')
local connection=$(adb-connection-check && echo 'forwarded' || echo 'not-forwarded')
local server=$(backend-check-${BACKEND} && echo 'started' || echo 'not-started')
echo "Module: $module"
echo "Device: $device"
echo "Connection: $connection"
echo "Server: $server"
return 0
}
function usage() {
echo "Usage: phonecam [COMMAND]"
echo "Commands:"
echo " start Start and connect to phone server."
echo " stop Stop and disconnect from any running phone server."
echo " status Show status of phone server and connection."
return 1
}
# Set configuration defaults.
defaults-set
# Parse any additional command-line arguments.
for i in "$@"; do
case $i in
-w=*|--width=*)
WIDTH="${i#*=}"
;;
-h=*|--height=*)
HEIGHT="${i#*=}"
;;
-b=*|--backend=*)
BACKEND="${i#*=}"
;;
-s=*|--stream-backend=*)
STREAM_BACKEND="${i#*=}"
;;
--disable-audio)
AUDIO_ENABLED="false"
;;
esac
done
# Set defaults for selected backend.
case "${BACKEND}" in
droidcamx)
defaults-set-droidcamx
;;
ipwebcam)
defaults-set-ipwebcam
;;
*)
echo "Invalid backend selected: '${BACKEND}'"
exit 1
esac
# Execute action given.
case "${!#:-}" in
start)
phonecam-start
;;
stop)
phonecam-stop
;;
status)
phonecam-status
;;
*)
usage
;;
esac
exit $?

View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ ! "$(ykman info)" ]]
then
echo "Yubikey not detected."
exit 1
fi
ROFI="rofi -dmenu -i -p TOTP"
OPTION="$(ykman oath list | $ROFI)"
CODE=$(ykman oath code -s "$OPTION")
printf "$CODE" | xclip -selection clipboard

16
.local/bin/yubikey-totp Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ ! "$(ykman info)" ]]
then
echo "Yubikey not detected."
exit 1
fi
DMENU="dmenu -i -p TOTP"
OPTION="$(ykman oath accounts list | $DMENU)"
CODE=$(ykman oath accounts code -s "$OPTION")
printf "$CODE" | wl-copy --paste-once
printf "$CODE" | xclip -selection primary

View File

@ -1,14 +1,19 @@
#
# ~/.bash_profile
#
# Some variables.
# Shared environment variables.
export GOPATH="$HOME/.go"
export PATH="$PATH:$HOME/.local/bin:$GOPATH/bin"
export QT_QPA_PLATFORMTHEME="qt5ct"
export QT_AUTO_SCREEN_SCALE_FACTOR=0
export EDITOR="emacsclient -a nano"
export RIPGREP_CONFIG_PATH="$HOME/.config/ripgrep/ripgreprc"
export GTK_THEME=Adwaita:dark
export QT_QPA_PLATFORMTHEME="qt5ct"
export QT_SCALE_FACTOR=1.5
export PATH="$PATH:$HOME/.local/bin:$GOPATH/bin"
export EDITOR="emacsclient -a emacs"
# Import specific environment variables for user units.
systemctl --user import-environment PATH
# Start Sway if no existing session has started.
if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]
then
exec sway
fi