diff options
254 files changed, 4979 insertions, 0 deletions
@@ -0,0 +1,26 @@ +#!/bin/sh + +# Prompt +PS1='\e[1;36m$(pwd | sed "1s#^$HOME#~#") \e[3$((1+!$?))m$\e[m ' + +export EDITOR=vis +export VISUAL=vis +export PAGER=less +export SHELL=ash +export TERMINAL=foot +export BROWSER=firefox +export GTK_THEME=Catppuccin-Macchiato-Standard-Mauve-Dark +export XCURSOR_THEME=Catppuccin-Mocha-Dark-Cursors +export DBUS_SESSION_BUS_ADDRESS=unix:path="$XDG_RUNTIME_DIR"/bus + +alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' +alias cfg='git --git-dir ~/.cfg --work-tree ~' +alias fs='fossil' +alias parallel=parallel-moreutils +alias s6-rclocal='s6-rc -l "$XDG_RUNTIME_DIR"/s6-rc' + +s6less() { + s6-tai64nlocal < ~/.local/state/s6/logs/"$1"/current | less -R +} diff --git a/.config/QtProject/qtcreator/styles/catppuccin-macchiato.xml b/.config/QtProject/qtcreator/styles/catppuccin-macchiato.xml new file mode 100644 index 0000000..33f1f02 --- /dev/null +++ b/.config/QtProject/qtcreator/styles/catppuccin-macchiato.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<style-scheme version="1.0" name="Catppuccin Macchiato"> + <style name="Text" foreground="#CAD3F5" background="#24273A"/> + <style name="Link" foreground="#91D7E3" underlineStyle="SingleUnderline"/> + <style name="Selection" background="#5B6078"/> + <style name="LineNumber" foreground="#494D64"/> + <style name="SearchResult" foreground="#8BD5CA" bold="true"/> + <style name="SearchScope" foreground="#24273A" background="#CAD3F5"/> + <style name="Parentheses" foreground="#F5A97F" bold="true"/> + <style name="ParenthesesMismatch" foreground="#F5A97F"/> + <style name="AutoComplete" foreground="#CAD3F5"/> + <style name="CurrentLine" foreground="#24273A" background="#494D64"/> + <style name="CurrentLineNumber" foreground="#6E738D"/> + <style name="Occurrences" foreground="#24273A" background="#CAD3F5"/> + <style name="Occurrences.Unused" foreground="#CAD3F5"/> + <style name="Occurrences.Rename" foreground="#24273A" background="#CAD3F5"/> + <style name="Number" foreground="#F5A97F"/> + <style name="String" foreground="#A6DA95"/> + <style name="Type" foreground="#EED49F"/> + <style name="Local" foreground="#CAD3F5"/> + <style name="Parameter"/> + <style name="Global" foreground="#EE99A0"/> + <style name="Field" foreground="#F4DBD6"/> + <style name="Static" foreground="#8BD5CA"/> + <style name="VirtualMethod" foreground="#8AADF4" italic="true"/> + <style name="Function" foreground="#8AADF4"/> + <style name="Keyword" foreground="#C6A0F6"/> + <style name="PrimitiveType" foreground="#EED49F" italic="true"/> + <style name="Operator" foreground="#91D7E3"/> + <style name="Overloaded Operator" foreground="#91D7E3"/> + <style name="Punctuation"/> + <style name="Preprocessor" foreground="#91D7E3"/> + <style name="Label" foreground="#91D7E3"/> + <style name="Comment" foreground="#5B6078" italic="true"/> + <style name="Doxygen.Comment" foreground="#5B6078"/> + <style name="Doxygen.Tag" foreground="#5B6078" bold="true"/> + <style name="VisualWhitespace" foreground="#5B6078"/> + <style name="QmlLocalId" foreground="#A6DA95" italic="true"/> + <style name="QmlExternalId" foreground="#F5A97F" italic="true"/> + <style name="QmlTypeId" foreground="#91D7E3"/> + <style name="QmlRootObjectProperty" foreground="#A6DA95" italic="true"/> + <style name="QmlScopeObjectProperty" foreground="#A6DA95" italic="true"/> + <style name="QmlExternalObjectProperty" foreground="#F5A97F" italic="true"/> + <style name="JsScopeVar" foreground="#8AADF4" italic="true"/> + <style name="JsImportVar" foreground="#CAD3F5" italic="true"/> + <style name="JsGlobalVar" foreground="#ED8796" italic="true"/> + <style name="QmlStateName" foreground="#A6DA95" italic="true"/> + <style name="Binding" foreground="#F5BDE6"/> + <style name="DisabledCode" foreground="#6E738D"/> + <style name="AddedLine" foreground="#A6DA95"/> + <style name="RemovedLine" foreground="#ED8796"/> + <style name="DiffFile" foreground="#91D7E3"/> + <style name="DiffLocation" foreground="#F5A97F"/> + <style name="DiffFileLine" foreground="#24273A" background="#EED49F"/> + <style name="DiffContextLine" foreground="#24273A" background="#91D7E3"/> + <style name="DiffSourceLine" background="#754D5F"/> + <style name="DiffSourceChar" background="#4C3A4C"/> + <style name="DiffDestLine" background="#586E5F"/> + <style name="DiffDestChar" background="#3E4B4C"/> + <style name="LogChangeLine" foreground="#ED8796"/> + <style name="Warning" underlineColor="#F5A97F" underlineStyle="SingleUnderline"/> + <style name="WarningContext" underlineColor="#F5A97F" underlineStyle="DotLine"/> + <style name="Error" underlineColor="#ED8796" underlineStyle="SingleUnderline"/> + <style name="ErrorContext" underlineColor="#ED8796" underlineStyle="DotLine"/> + <style name="Declaration" bold="true"/> + <style name="FunctionDefinition"/> + <style name="OutputArgument" italic="true"/> + <style name="StaticMember" foreground="#F5A97F"/> +</style-scheme> + diff --git a/.config/QtProject/qtcreator/themes/catppuccin-macchiato.creatortheme b/.config/QtProject/qtcreator/themes/catppuccin-macchiato.creatortheme new file mode 100644 index 0000000..42672b8 --- /dev/null +++ b/.config/QtProject/qtcreator/themes/catppuccin-macchiato.creatortheme @@ -0,0 +1,415 @@ +[General] +ThemeName=Catppuccin Macchiato +PreferredStyles=Fusion +DefaultTextEditorColorScheme=catppuccin-macchiato.xml + +[Palette] +shadowBackground=ff181926 +text=ffCAD3F5 +textDisabled=99CAD3F5 +textHighlighted=ffCAD3F5 +toolBarItem=ffCAD3F5 +toolBarItemDisabled=99CAD3F5 +fancyBarsNormalTextColor=ffCAD3F5 +fancyBarsBoldTextColor=ffCAD3F5 +hoverBackground=ff494D64 +selectedBackground=ff494D64 +selectedBackgroundText=ffCAD3F5 +normalBackground=ff1E2030 +alternateBackground=ff24273A +error=ffED8796 +warning=ffEED49F +success=ffA6DA95 +message=ffC6A0F6 +splitter=ff494D64 +textColorLink=ffF4DBD6 +textColorLinkVisited=ffF4DBD6 +backgroundColorDisabled=ff494D64 + +[Colors] +;DS controls theme START +DSpanelBackground=normalBackground + +DSwelcomeScreenBackground=normalBackground +DSsubPanelBackground=shadowBackground +DSthumbnailBackground=normalBackground +DSthumbnailLabelBackground=shadowBackground + +DSgreenLight=success +DSamberLight=message +DSredLight=error + +DSinteraction=selectedBackground +DSerrorColor=error +DSwarningColor=warning +DSdisabledColor=textDisabled + +DSinteractionHover=hoverBackground + +DScontrolBackground=shadowBackground +DScontrolBackgroundInteraction=shadowBackground +DScontrolBackgroundDisabled=backgroundColorDisabled +DScontrolBackgroundGlobalHover=hoverBackground +DScontrolBackgroundHover=hoverBackground + +DScontrolOutline=splitter +DScontrolOutlineInteraction=message +DScontrolOutlineDisabled=splitter + +DStextColor=text +DStextColorDisabled=textDisabled +DStextSelectionColor=selectedBackground +DStextSelectedTextColor=selectedBackgroundText + +DSplaceholderTextColor=textDisabled +DSplaceholderTextColorInteraction=textDisabled + +DSiconColor=text +DSiconColorHover=textHighlighted +DSiconColorInteraction=message +DSiconColorDisabled=textDisabled +DSiconColorSelected=message + +DSlinkIndicatorColor=text +DSlinkIndicatorColorHover=textHighlighted +DSlinkIndicatorColorInteraction=message +DSlinkIndicatorColorDisabled=textDisabled + +DSpopupBackground=shadowBackground +DSpopupOverlayColor=splitter + +DSsliderActiveTrack=message +DSsliderActiveTrackHover=ff7f7f7f +DSsliderActiveTrackFocus=ffaaaaaa +DSsliderInactiveTrack=alternateBackground +DSsliderInactiveTrackHover=ff505050 +DSsliderInactiveTrackFocus=ff7a7a7a +DSsliderHandle=ff4b5362 +DSsliderHandleHover=ff7a7a7a +DSsliderHandleFocus=ff1d545c +DSsliderHandleInteraction=ff4b5362 + +DSscrollBarTrack=normalBackground +DSscrollBarHandle=ff4b5362 + +DSsectionHeadBackground=alternateBackground + +DSstateDefaultHighlight=message +DSstateSeparatorColor=splitter +DSstateBackgroundColor=normalBackground +DSstatePreviewOutline=splitter + +DSchangedStateText=message + +DS3DAxisXColor=error +DS3DAxisYColor=success +DS3DAxisZColor=message + +DSactionBinding=message +DSactionAlias=error +DSactionKeyframe=warning +DSactionJIT=success + +DStableHeaderBackground=ff24273A +DStableHeaderText=ffCAD3F5 + +DSdockContainerBackground=shadowBackground +DSdockContainerSplitter=splitter +DSdockAreaBackground=normalBackground + +DSdockWidgetBackground=shadowBackground +DSdockWidgetSplitter=splitter +DSdockWidgetTitleBar=normalBackground + +DStitleBarText=text +DStitleBarIcon=text +DStitleBarButtonHover=30ffffff +DStitleBarButtonPress=50ffffff + +DStabContainerBackground=shadowBackground +DStabSplitter=splitter + +DStabInactiveBackground=backgroundColorDisabled +DStabInactiveText=text +DStabInactiveIcon=text +DStabInactiveButtonHover=30ffffff +DStabInactiveButtonPress=50ffffff + +DStabActiveBackground=normalBackground +DStabActiveText=text +DStabActiveIcon=text +DStabActiveButtonHover=30ffffff +DStabActiveButtonPress=50ffffff + +DStabFocusBackground=message +DStabFocusText=shadowBackground +DStabFocusIcon=shadowBackground +DStabFocusButtonHover=30ffffff +DStabFocusButtonPress=50ffffff + +DSnavigatorBranch=text +DSnavigatorBranchIndicator=text +DSnavigatorItemBackground=normalBackground +DSnavigatorItemBackgroundHover=hoverBackground +DSnavigatorItemBackgroundSelected=selectedBackground +DSnavigatorText=text +DSnavigatorTextHover=textHighlighted +DSnavigatorTextSelected=message +DSnavigatorIcon=text +DSnavigatorIconHover=textHighlighted +DSnavigatorIconSelected=text +DSnavigatorAliasIconChecked=error +DSnavigatorDropIndicatorBackground=message +DSnavigatorDropIndicatorOutline=message + +DSheaderViewBackground=shadowBackground +DStableViewAlternateBackground=alternateBackground + +DStoolTipBackground=normalBackground +DStoolTipOutline=text +DStoolTipText=text + +DSUnimportedModuleColor=success + +DSBackgroundColorAlternate=alternateBackground +DSBackgroundColorNormal=normalBackground + +;DS controls theme END + +BackgroundColorAlternate=alternateBackground +BackgroundColorDark=shadowBackground +BackgroundColorHover=hoverBackground +BackgroundColorNormal=normalBackground +BackgroundColorDisabled=backgroundColorDisabled +BackgroundColorSelected=selectedBackground +BadgeLabelBackgroundColorChecked=text +BadgeLabelBackgroundColorUnchecked=text +BadgeLabelTextColorChecked=normalBackground +BadgeLabelTextColorUnchecked=normalBackground +CanceledSearchTextColor=error +ComboBoxArrowColor=toolBarItem +ComboBoxArrowColorDisabled=toolBarItemDisabled +ComboBoxTextColor=fancyBarsNormalTextColor +DetailsButtonBackgroundColorHover=hoverBackground +DetailsWidgetBackgroundColor=shadowBackground +DockWidgetResizeHandleColor=splitter +DoubleTabWidget1stSeparatorColor=splitter +DoubleTabWidget1stTabActiveTextColor=text +DoubleTabWidget1stTabBackgroundColor=normalBackground +DoubleTabWidget1stTabInactiveTextColor=text +DoubleTabWidget2ndSeparatorColor=toolBarItemDisabled +DoubleTabWidget2ndTabActiveTextColor=text +DoubleTabWidget2ndTabBackgroundColor=selectedBackground +DoubleTabWidget2ndTabInactiveTextColor=text +EditorPlaceholderColor=shadowBackground +FancyToolBarSeparatorColor=toolBarItemDisabled +FancyTabBarBackgroundColor=shadowBackground +FancyTabBarSelectedBackgroundColor=selectedBackground +FancyTabWidgetDisabledSelectedTextColor=toolBarItemDisabled +FancyTabWidgetDisabledUnselectedTextColor=toolBarItemDisabled +FancyTabWidgetEnabledSelectedTextColor=fancyBarsBoldTextColor +FancyTabWidgetEnabledUnselectedTextColor=fancyBarsBoldTextColor +FancyToolButtonHoverColor=hoverBackground +FancyToolButtonSelectedColor=selectedBackground +FutureProgressBackgroundColor=shadowBackground +IconsBaseColor=toolBarItem +IconsDisabledColor=toolBarItemDisabled +IconsInfoColor=message +IconsInfoToolBarColor=message +IconsWarningColor=warning +IconsWarningToolBarColor=warning +IconsErrorColor=error +IconsErrorToolBarColor=error +IconsRunColor=success +IconsRunToolBarColor=success +IconsStopColor=error +IconsStopToolBarColor=error +IconsInterruptColor=message +IconsInterruptToolBarColor=message +IconsDebugColor=toolBarItem +IconsNavigationArrowsColor=warning +IconsBuildHammerHandleColor=b06112 +IconsBuildHammerHeadColor=toolBarItem +IconsModeWelcomeActiveColor=success +IconsModeEditActiveColor=message +IconsModeDesignActiveColor=warning +IconsModeDebugActiveColor=message +IconsModeProjectActiveColor=success +IconsModeAnalyzeActiveColor=message +IconsModeHelpActiveColor=warning +IconsCodeModelKeywordColor=ff777777 +IconsCodeModelClassColor=ffc0b550 +IconsCodeModelStructColor=ff53b053 +IconsCodeModelFunctionColor=ffd34373 +IconsCodeModelVariableColor=ff2bbbcc +IconsCodeModelEnumColor=ffc0b550 +IconsCodeModelMacroColor=ff476ba0 +IconsCodeModelAttributeColor=ff316511 +IconsCodeModelUniformColor=ff994899 +IconsCodeModelVaryingColor=ffa08833 +IconsCodeModelOverlayBackgroundColor=normalBackground +IconsCodeModelOverlayForegroundColor=text +InfoBarBackground=shadowBackground +InfoBarText=text +MenuBarEmptyAreaBackgroundColor=shadowBackground +MenuBarItemBackgroundColor=shadowBackground +MenuBarItemTextColorDisabled=textDisabled +MenuBarItemTextColorNormal=text +MenuItemTextColorDisabled=textDisabled +MenuItemTextColorNormal=text +MiniProjectTargetSelectorBackgroundColor=shadowBackground +MiniProjectTargetSelectorBorderColor=shadowBackground +MiniProjectTargetSelectorSummaryBackgroundColor=normalBackground +MiniProjectTargetSelectorTextColor=fancyBarsNormalTextColor +PanelStatusBarBackgroundColor=shadowBackground +PanelsWidgetSeparatorLineColor=splitter +PanelTextColorDark=text +PanelTextColorMid=text +PanelTextColorLight=textHighlighted +ProgressBarColorError=error +ProgressBarColorFinished=success +ProgressBarColorNormal=message +ProgressBarTitleColor=text +ProgressBarBackgroundColor=alternateBackground +SplitterColor=splitter +TextColorDisabled=textDisabled +TextColorError=error +TextColorHighlight=textHighlighted +TextColorHighlightBackground=hoverBackground +TextColorLink=textColorLink +TextColorLinkVisited=textColorLinkVisited +TextColorNormal=text +ToggleButtonBackgroundColor=shadowBackground +ToolBarBackgroundColor=shadowBackground +TreeViewArrowColorNormal=hoverBackground +TreeViewArrowColorSelected=text + +OutputPanes_DebugTextColor=text +OutputPanes_ErrorMessageTextColor=error +OutputPanes_MessageOutput=message +OutputPanes_NormalMessageTextColor=text +OutputPanes_StdErrTextColor=error +OutputPanes_StdOutTextColor=text +OutputPanes_WarningMessageTextColor=warning +OutputPanes_TestPassTextColor=success +OutputPanes_TestFailTextColor=error +OutputPanes_TestXFailTextColor=error +OutputPanes_TestXPassTextColor=message +OutputPanes_TestSkipTextColor=message +OutputPanes_TestWarnTextColor=warning +OutputPanes_TestFatalTextColor=error +OutputPanes_TestDebugTextColor=text +OutputPaneButtonFlashColor=error +OutputPaneToggleButtonTextColorChecked=fancyBarsNormalTextColor +OutputPaneToggleButtonTextColorUnchecked=fancyBarsNormalTextColor + +Debugger_LogWindow_LogInput=ff56b6c2 +Debugger_LogWindow_LogStatus=message +Debugger_LogWindow_LogTime=error + +Debugger_WatchItem_ValueNormal=text +Debugger_WatchItem_ValueInvalid=textDisabled +Debugger_WatchItem_ValueChanged=error + +Debugger_Breakpoint_TextMarkColor=message + +Welcome_TextColor=text +Welcome_ForegroundPrimaryColor=text +Welcome_ForegroundSecondaryColor=text +Welcome_BackgroundColor=normalBackground +Welcome_BackgroundPrimaryColor=normalBackground +Welcome_BackgroundSecondaryColor=normalBackground +Welcome_ButtonBackgroundColor=normalBackground +Welcome_DividerColor=splitter +Welcome_HoverColor=hoverBackground +Welcome_AccentColor=message +Welcome_LinkColor=textColorLink +Welcome_DisabledLinkColor=textDisabled + +Timeline_TextColor=text +Timeline_BackgroundColor1=normalBackground +Timeline_BackgroundColor2=shadowBackground +Timeline_DividerColor=splitter +Timeline_HighlightColor=selectedBackground +Timeline_PanelBackgroundColor=alternateBackground +Timeline_PanelHeaderColor=normalBackground +Timeline_HandleColor=ff4b5362 +Timeline_RangeColor=selectedBackground + +VcsBase_FileStatusUnknown_TextColor=text +VcsBase_FileAdded_TextColor=success +VcsBase_FileModified_TextColor=warning +VcsBase_FileDeleted_TextColor=error +VcsBase_FileRenamed_TextColor=message +VcsBase_FileUnmerged_TextColor=error + +Bookmarks_TextMarkColor=message + +TextEditor_SearchResult_ScrollBarColor=success +TextEditor_CurrentLine_ScrollBarColor=message + +ProjectExplorer_TaskError_TextMarkColor=error +ProjectExplorer_TaskWarn_TextMarkColor=warning + +CodeModel_Error_TextMarkColor=error +CodeModel_Warning_TextMarkColor=warning + +QmlDesigner_BackgroundColor=normalBackground +QmlDesigner_HighlightColor=selectedBackground +QmlDesigner_FormEditorSelectionColor=message +QmlDesigner_FormEditorForegroundColor=normalBackground +QmlDesigner_BackgroundColorDarkAlternate=normalBackground +QmlDesigner_BackgroundColorDarker=splitter +QmlDesigner_BorderColor=splitter +QmlDesigner_ButtonColor=normalBackground +QmlDesigner_TabDark=shadowBackground +QmlDesigner_TabLight=text +QmlDesigner_FormeditorBackgroundColor=normalBackground +QmlDesigner_AlternateBackgroundColor=alternateBackground +QmlDesigner_ScrollBarHandleColor=ff4b5362 + +PaletteWindow=shadowBackground +PaletteWindowText=text +PaletteBase=normalBackground +PaletteAlternateBase=alternateBackground +PaletteButton=shadowBackground +PaletteBrightText=error +PaletteText=text +PaletteButtonText=text +PaletteButtonTextDisabled=textDisabled +PaletteToolTipBase=hoverBackground +PaletteHighlight=selectedBackground +PaletteDark=shadowBackground +PaletteHighlightedText=selectedBackgroundText +PaletteToolTipText=text +PaletteLink=textColorLink +PaletteLinkVisited=textColorLinkVisited +PaletteWindowDisabled=backgroundColorDisabled +PaletteWindowTextDisabled=textDisabled +PaletteBaseDisabled=backgroundColorDisabled +PaletteTextDisabled=textDisabled +PaletteMid=text +PalettePlaceholderText=textDisabled + +[Flags] +ComboBoxDrawTextShadow=false +DerivePaletteFromTheme=true +DrawIndicatorBranch=true +DrawSearchResultWidgetFrame=false +DrawTargetSelectorBottom=false +DrawToolBarHighlights=false +DrawToolBarBorders=false +ApplyThemePaletteGlobally=true +FlatToolBars=true +FlatSideBarIcons=true +FlatProjectsMode=true +FlatMenuBar=true +ToolBarIconShadow=true +WindowColorAsBase=true +DarkUserInterface=true + +[Gradients] +DetailsWidgetHeaderGradient\1\color=normalBackground +DetailsWidgetHeaderGradient\1\pos=1 +DetailsWidgetHeaderGradient\size=1 + diff --git a/.config/aerc/accounts.conf b/.config/aerc/accounts.conf new file mode 100644 index 0000000..86170a3 --- /dev/null +++ b/.config/aerc/accounts.conf @@ -0,0 +1,10 @@ +[migadu] +source = maildir://~/mail +outgoing = smtps+plain://sam%40samnystrom.dev@smtp.migadu.com:465 +outgoing-cred-cmd = hiq -1d -F password proto=smtp user=sam@samnystrom.dev +from = Sam Nystrom <sam@samnystrom.dev> +default = INBOX +copy-to = Sent +check-mail = 1h +check-mail-cmd = mbsync primary +check-mail-timeout = 1m diff --git a/.config/aerc/aerc.conf b/.config/aerc/aerc.conf new file mode 100644 index 0000000..eb4f503 --- /dev/null +++ b/.config/aerc/aerc.conf @@ -0,0 +1,466 @@ +# +# aerc main configuration + +[general] +# +# Used as a default path for save operations if no other path is specified. +# ~ is expanded to the current user home dir. +# +#default-save-path= + +# If set to "gpg", aerc will use system gpg binary and keystore for all crypto +# operations. If set to "internal", the internal openpgp keyring will be used. +# If set to "auto", the system gpg will be preferred unless the internal +# keyring already exists, in which case the latter will be used. +# +# Default: auto +#pgp-provider=auto + +# By default, the file permissions of accounts.conf must be restrictive and +# only allow reading by the file owner (0600). Set this option to true to +# ignore this permission check. Use this with care as it may expose your +# credentials. +# +# Default: false +#unsafe-accounts-conf=false + +# Output log messages to specified file. A path starting with ~/ is expanded to +# the user home dir. When redirecting aerc's output to a file using > shell +# redirection, this setting is ignored and log messages are printed to stdout. +# +#log-file= + +# Only log messages above the specified level to log-file. Supported levels +# are: trace, debug, info, warn and error. When redirecting aerc's output to +# a file using > shell redirection, this setting is ignored and the log level +# is forced to trace. +# +# Default: info +#log-level=info + +[ui] +# +# Describes the format for each row in a mailbox view. This field is compatible +# with mutt's printf-like syntax. +# +# Default: %-20.20D %-17.17n %Z %s +#index-format=%-20.20D %-17.17n %Z %s + +# +# See time.Time#Format at https://godoc.org/time#Time.Format +# +# Default: 2006-01-02 03:04 PM (ISO 8601 + 12 hour time) +#timestamp-format=2006-01-02 03:04 PM + +# +# Index-only time format for messages that were received/sent today. +# If this is not specified, timestamp-format is used instead. +# +#this-day-time-format= + +# +# Index-only time format for messages that were received/sent within the last +# 7 days. If this is not specified, timestamp-format is used instead. +# +#this-week-time-format= + +# +# Index-only time format for messages that were received/sent this year. +# If this is not specified, timestamp-format is used instead. +# +#this-year-time-format= + +# +# Width of the sidebar, including the border. +# +# Default: 20 +#sidebar-width=20 + +# +# Message to display when viewing an empty folder. +# +# Default: (no messages) +#empty-message=(no messages) + +# Message to display when no folders exists or are all filtered +# +# Default: (no folders) +#empty-dirlist=(no folders) + +# Enable mouse events in the ui, e.g. clicking and scrolling with the mousewheel +# +# Default: false +#mouse-enabled=false + +# +# Ring the bell when new messages are received +# +# Default: true +#new-message-bell=true + +# Marker to show before a pinned tab's name. +# +# Default: ` +#pinned-tab-marker='`' + +# Describes the format string to use for the directory list +# +# Default: %n %>r +#dirlist-format=%n %>r + +# Delay after which the messages are actually listed when entering a directory. +# This avoids loading messages when skipping over folders and makes the UI more +# responsive. If you do not want that, set it to 0s. +# +# Default: 200ms +#dirlist-delay=200ms + +# Display the directory list as a foldable tree that allows to collapse and +# expand the folders. +# +# Default: false +#dirlist-tree=false + +# If dirlist-tree is enabled, set level at which folders are collapsed by +# default. Set to 0 to disable. +# +# Default: 0 +#dirlist-collapse=0 + +# List of space-separated criteria to sort the messages by, see *sort* +# command in *aerc*(1) for reference. Prefixing a criterion with "-r " +# reverses that criterion. +# +# Example: "from -r date" +# +#sort= + +# Moves to next message when the current message is deleted +# +# Default: true +#next-message-on-delete=true + +# Automatically set the "seen" flag when a message is opened in the message +# viewer. +# +# Default: true +#auto-mark-read=true + +# The directories where the stylesets are stored. It takes a colon-separated +# list of directories. If this is unset or if a styleset cannot be found, the +# following paths will be used as a fallback in that order: +# +# ${XDG_CONFIG_HOME:-~/.config}/aerc/stylesets +# ${XDG_DATA_HOME:-~/.local/share}/aerc/stylesets +# /usr/local/share/aerc/stylesets +# /usr/share/aerc/stylesets +# +#stylesets-dirs= + +# Uncomment to use box-drawing characters for vertical and horizontal borders. +# +# Default: " " +border-char-vertical="│" +border-char-horizontal="─" + +# Sets the styleset to use for the aerc ui elements. +# +# Default: default +styleset-name=catppuccin-macchiato + +# Activates fuzzy search in commands and their arguments: the typed string is +# searched in the command or option in any position, and need not be +# consecutive characters in the command or option. +# +# Default: false +#fuzzy-complete=false + +# How long to wait after the last input before auto-completion is triggered. +# +# Default: 250ms +#completion-delay=250ms + +# The minimum required characters to allow auto-completion to be triggered after +# completion-delay. +# +# Default: 1 +#completion-min-chars=1 + +# +# Global switch for completion popovers +# +# Default: true +#completion-popovers=true + +# Uncomment to use UTF-8 symbols to indicate PGP status of messages +# +# Default: ASCII +#icon-unencrypted= +#icon-encrypted=✔ +#icon-signed=✔ +#icon-signed-encrypted=✔ +#icon-unknown=✘ +#icon-invalid=⚠ + +# Reverses the order of the message list. By default, the message list is +# ordered with the newest (highest UID) message on top. Reversing the order +# will put the oldest (lowest UID) message on top. This can be useful in cases +# where the backend does not support sorting. +# +# Default: false +#reverse-msglist-order = false + +# Reverse display of the mesage threads. Default order is the the intial +# message is on the top with all the replies being displayed below. The +# reverse option will put the initial message at the bottom with the +# replies on top. +# +# Default: false +#reverse-thread-order=false + +# Sort the thread siblings according to the sort criteria for the messages. If +# sort-thread-siblings is false, the thread siblings will be sorted based on +# the message UID in ascending order. This option is only applicable for +# client-side threading with a backend that enables sorting. Note that there's +# a performance impact when sorting is activated. +# +# Default: false +#sort-thread-siblings=false + +#[ui:account=foo] +# +# Enable a threaded view of messages. If this is not supported by the backend +# (IMAP server or notmuch), threads will be built by the client. +# +# Default: false +#threading-enabled=false + +# Force client-side thread building +# +# Default: false +#force-client-threads=false + +# Debounce client-side thread building +# +# Default: 50ms +#client-threads-delay=50ms + +[statusline] +# Describes the format string for the statusline. +# +# Default: [%a] %S %>%T +#render-format=[%a] %S %>%T + +# Specifies the separator between grouped statusline elements. +# +# Default: " | " +#separator=" | " + +# Defines the mode for displaying the status elements. +# Options: text, icon +# +# Default: text +#display-mode=text + +[viewer] +# +# Specifies the pager to use when displaying emails. Note that some filters +# may add ANSI codes to add color to rendered emails, so you may want to use a +# pager which supports ANSI codes. +# +# Default: less -R +#pager=less -R + +# +# If an email offers several versions (multipart), you can configure which +# mimetype to prefer. For example, this can be used to prefer plaintext over +# html emails. +# +# Default: text/plain,text/html +#alternatives=text/plain,text/html + +# +# Default setting to determine whether to show full headers or only parsed +# ones in message viewer. +# +# Default: false +#show-headers=false + +# +# Layout of headers when viewing a message. To display multiple headers in the +# same row, separate them with a pipe, e.g. "From|To". Rows will be hidden if +# none of their specified headers are present in the message. +# +# Default: From|To,Cc|Bcc,Date,Subject +#header-layout=From|To,Cc|Bcc,Date,Subject + +# Whether to always show the mimetype of an email, even when it is just a single part +# +# Default: false +#always-show-mime=false + +# Parses and extracts http links when viewing a message. Links can then be +# accessed with the open-link command. +# +# Default: true +#parse-http-links=true + +[compose] +# +# Specifies the command to run the editor with. It will be shown in an embedded +# terminal, though it may also launch a graphical window if the environment +# supports it. Defaults to $EDITOR, or vi. +#editor= + +# +# Default header fields to display when composing a message. To display +# multiple headers in the same row, separate them with a pipe, e.g. "To|From". +# +# Default: To|From,Subject +#header-layout=To|From,Subject + +# +# Specifies the command to be used to tab-complete email addresses. Any +# occurrence of "%s" in the address-book-cmd will be replaced with what the +# user has typed so far. +# +# The command must output the completions to standard output, one completion +# per line. Each line must be tab-delimited, with an email address occurring as +# the first field. Only the email address field is required. The second field, +# if present, will be treated as the contact name. Additional fields are +# ignored. +# +# This parameter can also be set per account in accounts.conf. +#address-book-cmd= + +# Specifies the command to be used to select attachments. Any occurence of '%s' +# in the file-picker-cmd will be replaced the argument <arg> to :attach -m +# <arg>. +# +# The command must output the selected files to standard output, one file per +# line. +#file-picker-cmd= + +# +# Allow to address yourself when replying +# +# Default: true +#reply-to-self=true + +# +# Warn before sending an email that matches the specified regexp but does not +# have any attachments. Leave empty to disable this feature. +# +# Uses Go's regexp syntax, documented at https://golang.org/s/re2syntax. The +# "(?im)" flags are set by default (case-insensitive and multi-line). +# +# Example: +# no-attachment-warning=^[^>]*attach(ed|ment) +# +#no-attachment-warning= + +[multipart-converters] +# +# Converters allow to generate multipart/alternative messages by converting the +# main text/plain part into any other MIME type. Only exact MIME types are +# accepted. The commands are invoked with sh -c and are expected to output +# valid UTF-8 text. +# +# Example (obviously, this requires that you write your main text/plain body +# using the markdown syntax): +#text/html=pandoc -f markdown -t html --standalone + +[filters] +# +# Filters allow you to pipe an email body through a shell command to render +# certain emails differently, e.g. highlighting them with ANSI escape codes. +# +# The commands are invoked with sh -c. The following folders are appended to +# the system $PATH to allow referencing filters from their name only: +# +# ${XDG_CONFIG_HOME:-~/.config}/aerc/filters +# ${XDG_DATA_HOME:-~/.local/share}/aerc/filters +# $PREFIX/share/aerc/filters +# /usr/share/aerc/filters +# +# The following variables are defined in the filter command environment: +# +# AERC_MIME_TYPE the part MIME type/subtype +# AERC_FORMAT the part content type format= parameter +# AERC_FILENAME the attachment filename (if any) +# AERC_SUBJECT the message Subject header value +# AERC_FROM the message From header value +# +# The first filter which matches the email's mimetype will be used, so order +# them from most to least specific. +# +# You can also match on non-mimetypes, by prefixing with the header to match +# against (non-case-sensitive) and a comma, e.g. subject,text will match a +# subject which contains "text". Use header,~regex to match against a regex. +# +text/plain=colorize +text/calendar=calendar +message/delivery-status=colorize +message/rfc822=colorize +#text/html=pandoc -f html -t plain | colorize +text/html=html | colorize +#text/*=bat -fP --file-name="$AERC_FILENAME" +#application/x-sh=bat -fP -l sh +#image/*=catimg -w $(tput cols) - +#subject,~Git(hub|lab)=lolcat -f +#from,thatguywhodoesnothardwraphismessages=wrap -w 100 | colorize + +[openers] +# +# Openers allow you to specify the command to use for the :open action on a +# per-MIME-type basis. +# +# {} is expanded as the temporary filename to be opened. If it is not +# encountered in the command, the temporary filename will be appened to the end +# of the command. +# +# Examples: +# text/html=surf -dfgms +# text/plain=gvim {} +125 +# message/rfc822=thunderbird + +[triggers] +# +# Triggers specify commands to execute when certain events occur. +# +# Example: +# new-email=exec notify-send "New email from %n" "%s" + +# +# Executed when a new email arrives in the selected folder +#new-email= + +[templates] +# Templates are used to populate email bodies automatically. +# + +# The directories where the templates are stored. It takes a colon-separated +# list of directories. If this is unset or if a template cannot be found, the +# following paths will be used as a fallback in that order: +# +# ${XDG_CONFIG_HOME:-~/.config}/aerc/templates +# ${XDG_DATA_HOME:-~/.local/share}/aerc/templates +# /usr/local/share/aerc/templates +# /usr/share/aerc/templates +# +#template-dirs= + +# The default template to be used for new messages. +# +# default: new_message +#new-message=new_message + +# The default template to be used for quoted replies. +# +# default: quoted_reply +#quoted-reply=quoted_reply + +# The default template to be used for forward as body. +# +# default: forward_as_body +#forwards=forward_as_body diff --git a/.config/aerc/binds.conf b/.config/aerc/binds.conf new file mode 100644 index 0000000..29acaff --- /dev/null +++ b/.config/aerc/binds.conf @@ -0,0 +1,136 @@ +# Binds are of the form <key sequence> = <command to run> +# To use '=' in a key sequence, substitute it with "Eq": "<Ctrl+Eq>" +# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit +<C-p> = :prev-tab<Enter> +<C-n> = :next-tab<Enter> +<C-t> = :term<Enter> +? = :help keys<Enter> + +[messages] +q = :quit<Enter> + +j = :next<Enter> +<Down> = :next<Enter> +<C-d> = :next 50%<Enter> +<C-f> = :next 100%<Enter> +<PgDn> = :next 100%<Enter> + +k = :prev<Enter> +<Up> = :prev<Enter> +<C-u> = :prev 50%<Enter> +<C-b> = :prev 100%<Enter> +<PgUp> = :prev 100%<Enter> +gg = :select 0<Enter> +G = :select -1<Enter> + +J = :next-folder<Enter> +K = :prev-folder<Enter> +H = :collapse-folder<Enter> +L = :expand-folder<Enter> + +v = :mark -t<Enter> +V = :mark -v<Enter> + +T = :toggle-threads<Enter> + +<Enter> = :view<Enter> +d = :prompt 'Really delete this message?' 'delete-message'<Enter> +D = :delete<Enter> +A = :archive flat<Enter> + +C = :compose<Enter> + +rr = :reply -a<Enter> +rq = :reply -aq<Enter> +Rr = :reply<Enter> +Rq = :reply -q<Enter> +rt = :reply -a -Tthanks<Enter> + +ga = :pipe -mb git am -3<Enter> + +c = :cf<space> +$ = :term<space> +! = :term<space> +| = :pipe<space> + +/ = :search<space> +\ = :filter<space> +n = :next-result<Enter> +N = :prev-result<Enter> +<Esc> = :clear<Enter> + +[messages:folder=Drafts] +<Enter> = :recall<Enter> + +[view] +/ = :toggle-key-passthrough<Enter>/ +q = :close<Enter> +O = :open<Enter> +S = :save<space> +| = :pipe<space> +D = :delete<Enter> +A = :archive flat<Enter> + +<C-l> = :open-link <space> + +f = :forward<Enter> +rr = :reply -a<Enter> +rq = :reply -aq<Enter> +Rr = :reply<Enter> +Rq = :reply -q<Enter> + +H = :toggle-headers<Enter> +<C-k> = :prev-part<Enter> +<C-j> = :next-part<Enter> +J = :next<Enter> +K = :prev<Enter> + +[view::passthrough] +$noinherit = true +$ex = <C-x> +<Esc> = :toggle-key-passthrough<Enter> + +[compose] +# Keybindings used when the embedded terminal is not selected in the compose +# view +$noinherit = true +$ex = <C-x> +<C-k> = :prev-field<Enter> +<C-j> = :next-field<Enter> +<A-p> = :switch-account -p<Enter> +<A-n> = :switch-account -n<Enter> +<tab> = :next-field<Enter> +<backtab> = :prev-field<Enter> +<C-p> = :prev-tab<Enter> +<C-n> = :next-tab<Enter> + +[compose::editor] +# Keybindings used when the embedded terminal is selected in the compose view +$noinherit = true +$ex = <C-x> +<C-k> = :prev-field<Enter> +<C-j> = :next-field<Enter> +<C-p> = :prev-tab<Enter> +<C-n> = :next-tab<Enter> + +[compose::review] +# Keybindings used when reviewing a message to be sent +y = :send<Enter> +n = :abort<Enter> +v = :preview<Enter> +p = :postpone<Enter> +q = :choose -o d discard abort -o p postpone postpone<Enter> +e = :edit<Enter> +a = :attach<space> +d = :detach<space> + +V = :header -f X-Sourcehut-Patchset-Update NEEDS_REVISION<Enter> +A = :header -f X-Sourcehut-Patchset-Update APPLIED<Enter> +R = :header -f X-Sourcehut-Patchset-Update REJECTED<Enter> + +[terminal] +$noinherit = true +$ex = <C-x> + +<C-p> = :prev-tab<Enter> +<C-n> = :next-tab<Enter> diff --git a/.config/aerc/stylesets/catppuccin-frappe b/.config/aerc/stylesets/catppuccin-frappe new file mode 100644 index 0000000..78e8e92 --- /dev/null +++ b/.config/aerc/stylesets/catppuccin-frappe @@ -0,0 +1,47 @@ +*.default=true +*.normal=true + +default.fg=#c6d0f5 + +error.fg=#e78284 +warning.fg=#ef9f76 +success.fg=#a6d189 + +tab.fg=#737994 +tab.bg=#292c3c +tab.selected.fg=#c6d0f5 +tab.selected.bg=#303446 +tab.selected.bold=true + +border.fg=#232634 +border.bold=true + +msglist_unread.bold=true +msglist_flagged.fg=#e5c890 +msglist_flagged.bold=true +msglist_result.fg=#8caaee +msglist_result.bold=true +msglist_*.selected.bold=true +msglist_*.selected.bg=#414559 + +dirlist_*.selected.bold=true +dirlist_*.selected.bg=#414559 + +statusline_default.fg=#949cbb +statusline_default.bg=#414559 +statusline_error.bold=true +statusline_success.bold=true + +[viewer] +url.fg=#8caaee +url.underline=true +header.bold=true +signature.dim=true +diff_meta.bold=true +diff_chunk.fg=#8caaee +diff_chunk_func.fg=#8caaee +diff_chunk_func.bold=true +diff_add.fg=#a6d189 +diff_del.fg=#e78284 +quote_*.fg=#737994 +quote_1.fg=#949cbb diff --git a/.config/aerc/stylesets/catppuccin-latte b/.config/aerc/stylesets/catppuccin-latte new file mode 100644 index 0000000..1be8fe2 --- /dev/null +++ b/.config/aerc/stylesets/catppuccin-latte @@ -0,0 +1,47 @@ +*.default=true +*.normal=true + +default.fg=#4c4f69 + +error.fg=#d20f39 +warning.fg=#fe640b +success.fg=#40a02b + +tab.fg=#9ca0b0 +tab.bg=#e6e9ef +tab.selected.fg=#4c4f69 +tab.selected.bg=#eff1f5 +tab.selected.bold=true + +border.fg=#dce0e8 +border.bold=true + +msglist_unread.bold=true +msglist_flagged.fg=#df8e1d +msglist_flagged.bold=true +msglist_result.fg=#1e66f5 +msglist_result.bold=true +msglist_*.selected.bold=true +msglist_*.selected.bg=#ccd0da + +dirlist_*.selected.bold=true +dirlist_*.selected.bg=#ccd0da + +statusline_default.fg=#7c7f93 +statusline_default.bg=#ccd0da +statusline_error.bold=true +statusline_success.bold=true + +[viewer] +url.fg=#1e66f5 +url.underline=true +header.bold=true +signature.dim=true +diff_meta.bold=true +diff_chunk.fg=#1e66f5 +diff_chunk_func.fg=#1e66f5 +diff_chunk_func.bold=true +diff_add.fg=#40a02b +diff_del.fg=#d20f39 +quote_*.fg=#9ca0b0 +quote_1.fg=#7c7f93 diff --git a/.config/aerc/stylesets/catppuccin-macchiato b/.config/aerc/stylesets/catppuccin-macchiato new file mode 100644 index 0000000..34d8163 --- /dev/null +++ b/.config/aerc/stylesets/catppuccin-macchiato @@ -0,0 +1,47 @@ +*.default=true +*.normal=true + +default.fg=#cad3f5 + +error.fg=#ed8796 +warning.fg=#f5a97f +success.fg=#a6da95 + +tab.fg=#6e738d +tab.bg=#1e2030 +tab.selected.fg=#cad3f5 +tab.selected.bg=#24273a +tab.selected.bold=true + +border.fg=#181926 +border.bold=true + +msglist_unread.bold=true +msglist_flagged.fg=#eed49f +msglist_flagged.bold=true +msglist_result.fg=#8aadf4 +msglist_result.bold=true +msglist_*.selected.bold=true +msglist_*.selected.bg=#363a4f + +dirlist_*.selected.bold=true +dirlist_*.selected.bg=#363a4f + +statusline_default.fg=#939ab7 +statusline_default.bg=#363a4f +statusline_error.bold=true +statusline_success.bold=true + +[viewer] +url.fg=#8aadf4 +url.underline=true +header.bold=true +signature.dim=true +diff_meta.bold=true +diff_chunk.fg=#8aadf4 +diff_chunk_func.fg=#8aadf4 +diff_chunk_func.bold=true +diff_add.fg=#a6da95 +diff_del.fg=#ed8796 +quote_*.fg=#6e738d +quote_1.fg=#939ab7 diff --git a/.config/aerc/stylesets/catppuccin-mocha b/.config/aerc/stylesets/catppuccin-mocha new file mode 100644 index 0000000..4e90b99 --- /dev/null +++ b/.config/aerc/stylesets/catppuccin-mocha @@ -0,0 +1,47 @@ +*.default=true +*.normal=true + +default.fg=#cdd6f4 + +error.fg=#f38ba8 +warning.fg=#fab387 +success.fg=#a6e3a1 + +tab.fg=#6c7086 +tab.bg=#181825 +tab.selected.fg=#cdd6f4 +tab.selected.bg=#1e1e2e +tab.selected.bold=true + +border.fg=#11111b +border.bold=true + +msglist_unread.bold=true +msglist_flagged.fg=#f9e2af +msglist_flagged.bold=true +msglist_result.fg=#89b4fa +msglist_result.bold=true +msglist_*.selected.bold=true +msglist_*.selected.bg=#313244 + +dirlist_*.selected.bold=true +dirlist_*.selected.bg=#313244 + +statusline_default.fg=#9399b2 +statusline_default.bg=#313244 +statusline_error.bold=true +statusline_success.bold=true + +[viewer] +url.fg=#89b4fa +url.underline=true +header.bold=true +signature.dim=true +diff_meta.bold=true +diff_chunk.fg=#89b4fa +diff_chunk_func.fg=#89b4fa +diff_chunk_func.bold=true +diff_add.fg=#a6e3a1 +diff_del.fg=#f38ba8 +quote_*.fg=#6c7086 +quote_1.fg=#9399b2 diff --git a/.config/aerc/templates/thanks b/.config/aerc/templates/thanks new file mode 100644 index 0000000..b77048e --- /dev/null +++ b/.config/aerc/templates/thanks @@ -0,0 +1,3 @@ +X-Sourcehut-Patchset-Update: APPLIED + +Thanks! diff --git a/.config/bottom/bottom.toml b/.config/bottom/bottom.toml new file mode 100644 index 0000000..1000677 --- /dev/null +++ b/.config/bottom/bottom.toml @@ -0,0 +1,167 @@ +# This is a default config file for bottom. All of the settings are commented +# out by default; if you wish to change them uncomment and modify as you see +# fit. + +# This group of options represents a command-line flag/option. Flags explicitly +# added when running (ie: btm -a) will override this config file if an option +# is also set here. + +[flags] +# Whether to hide the average cpu entry. +#hide_avg_cpu = false +# Whether to use dot markers rather than braille. +#dot_marker = false +# The update rate of the application. +#rate = 1000 +# Whether to put the CPU legend to the left. +#left_legend = false +# Whether to set CPU% on a process to be based on the total CPU or just current usage. +#current_usage = false +# Whether to set CPU% on a process to be based on the total CPU or per-core CPU% (not divided by the number of cpus). +#unnormalized_cpu = false +# Whether to group processes with the same name together by default. +#group_processes = false +# Whether to make process searching case sensitive by default. +#case_sensitive = false +# Whether to make process searching look for matching the entire word by default. +#whole_word = false +# Whether to make process searching use regex by default. +#regex = false +# Defaults to Celsius. Temperature is one of: +#temperature_type = "k" +#temperature_type = "f" +#temperature_type = "c" +#temperature_type = "kelvin" +#temperature_type = "fahrenheit" +#temperature_type = "celsius" +# The default time interval (in milliseconds). +#default_time_value = 60000 +# The time delta on each zoom in/out action (in milliseconds). +#time_delta = 15000 +# Hides the time scale. +#hide_time = false +# Override layout default widget +#default_widget_type = "proc" +#default_widget_count = 1 +# Expand selected widget upon starting the app +#expanded_on_startup = true +# Use basic mode +#basic = false +# Use the old network legend style +#use_old_network_legend = false +# Remove space in tables +#hide_table_gap = false +# Show the battery widgets +#battery = false +# Disable mouse clicks +#disable_click = false +# Built-in themes. Valid values are "default", "default-light", "gruvbox", "gruvbox-light", "nord", "nord-light" +#color = "default" +# Show memory values in the processes widget as values by default +#mem_as_value = false +# Show tree mode by default in the processes widget. +#tree = false +# Shows an indicator in table widgets tracking where in the list you are. +#show_table_scroll_position = false +# Show processes as their commands by default in the process widget. +#process_command = false +# Displays the network widget with binary prefixes. +#network_use_binary_prefix = false +# Displays the network widget using bytes. +#network_use_bytes = false +# Displays the network widget with a log scale. +#network_use_log = false +# Hides advanced options to stop a process on Unix-like systems. +#disable_advanced_kill = false +# Shows GPU(s) memory +#enable_gpu_memory = false +# How much data is stored at once in terms of time. +#retention = "10m" + +# These are all the components that support custom theming. Note that colour support +# will depend on terminal support. + +# Layout - layouts follow a pattern like this: +# [[row]] represents a row in the application. +# [[row.child]] represents either a widget or a column. +# [[row.child.child]] represents a widget. +# +# All widgets must have the type value set to one of ["cpu", "mem", "proc", "net", "temp", "disk", "empty"]. +# All layout components have a ratio value - if this is not set, then it defaults to 1. +# The default widget layout: +#[[row]] +# ratio=30 +# [[row.child]] +# type="cpu" +#[[row]] +# ratio=40 +# [[row.child]] +# ratio=4 +# type="mem" +# [[row.child]] +# ratio=3 +# [[row.child.child]] +# type="temp" +# [[row.child.child]] +# type="disk" +#[[row]] +# ratio=30 +# [[row.child]] +# type="net" +# [[row.child]] +# type="proc" +# default=true + + +# Filters - you can hide specific temperature sensors, network interfaces, and disks using filters. This is admittedly +# a bit hard to use as of now, and there is a planned in-app interface for managing this in the future: +#[disk_filter] +#is_list_ignored = true +#list = ["/dev/sda\\d+", "/dev/nvme0n1p2"] +#regex = true +#case_sensitive = false +#whole_word = false + +#[mount_filter] +#is_list_ignored = true +#list = ["/mnt/.*", "/boot"] +#regex = true +#case_sensitive = false +#whole_word = false + +#[temp_filter] +#is_list_ignored = true +#list = ["cpu", "wifi"] +#regex = false +#case_sensitive = false +#whole_word = false + +#[net_filter] +#is_list_ignored = true +#list = ["virbr0.*"] +#regex = true +#case_sensitive = false +#whole_word = false + +[colors] +table_header_color = "#f4dbd6" +all_cpu_color = "#f4dbd6" +avg_cpu_color = "#ee99a0" +cpu_core_colors = ["#ed8796","#f5a97f","#eed49f","#a6da95","#7dc4e4","#c6a0f6"] +ram_color = "#a6da95" +swap_color = "#f5a97f" +rx_color = "#a6da95" +tx_color = "#ed8796" +widget_title_color = "#f0c6c6" +border_color = "#5b6078" +highlighted_border_color = "#f5bde6" +text_color = "#cad3f5" +graph_color = "#a5adcb" +cursor_color = "#f5bde6" +selected_text_color = "#181926" +selected_bg_color = "#c6a0f6" +high_battery_color = "#a6da95" +medium_battery_color = "#eed49f" +low_battery_color = "#ed8796" +gpu_core_colors = ["#7dc4e4","#c6a0f6","#ed8796","#f5a97f","#eed49f","#a6da95"] +arc_color = "#91d7e3" diff --git a/.config/foot/foot.ini b/.config/foot/foot.ini new file mode 100644 index 0000000..181caf8 --- /dev/null +++ b/.config/foot/foot.ini @@ -0,0 +1,65 @@ +font=Fira Code Nerd Font:size=11 +dpi-aware=off +bold-text-in-bright=palette-based + +[colors] +# Flexoki +foreground=cecdc3 +background=100f0f +regular0=100f0f +regular1=af3029 +regular2=66800b +regular3=ad8301 +regular4=205ea6 +regular5=a02f6f +regular6=24837b +regular7=f2f0e5 +bright0=1c1b1a +bright1=d14d41 +bright2=879a39 +bright3=d0a215 +bright4=4385be +bright5=ce5d97 +bright6=3aa99f +bright7=fffcf0 + +# Habamax +#foreground=bcbcbc +#background=1c1c1c +#bright0=767676 +#bright1=d7875f +#bright2=afd7af +#bright3=d7d787 +#bright4=87afd7 +#bright5=d7afd7 +#bright6=87afaf +#bright7=bcbcbc +#regular0=1c1c1c +#regular1=d75f5f +#regular2=87af87 +#regular3=afaf87 +#regular4=5f87af +#regular5=af87af +#regular6=5f8787 +#regular7=9e9e9e + + +# Catppuccin +# foreground=cdd6f4 # Text +# background=1e1e2e # Base +# regular0=45475a # Surface 1 +# regular1=f38ba8 # red +# regular2=a6e3a1 # green +# regular3=f9e2af # yellow +# regular4=89b4fa # blue +# regular5=f5c2e7 # pink +# regular6=94e2d5 # teal +# regular7=bac2de # Subtext 1 +# bright0=585b70 # Surface 2 +# bright1=f38ba8 # red +# bright2=a6e3a1 # green +# bright3=f9e2af # yellow +# bright4=89b4fa # blue +# bright5=f5c2e7 # pink +# bright6=94e2d5 # teal +# bright7=a6adc8 # Subtext 0 diff --git a/.config/git/config b/.config/git/config new file mode 100644 index 0000000..c21bb15 --- /dev/null +++ b/.config/git/config @@ -0,0 +1,24 @@ +[user] + email = sam@samnystrom.dev + name = Sam Nystrom + +[init] + defaultBranch = main + +[interactive] + singleKey = true + +[merge] + conflictstyle = diff3 + +[diff] + colorMoved = default + +[sendemail] + annotate = yes + verify = off + +[commit] + verbose = true +[push] + autoSetupRemote = true diff --git a/.config/gitui/key_bindings.ron b/.config/gitui/key_bindings.ron new file mode 100644 index 0000000..e575acc --- /dev/null +++ b/.config/gitui/key_bindings.ron @@ -0,0 +1,14 @@ +( + focus_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)), + focus_below: Some(( code: Char('j'), modifiers: ( bits: 0,),)), + focus_above: Some(( code: Char('k'), modifiers: ( bits: 0,),)), + focus_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)), + + move_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)), + move_down: Some(( code: Char('j'), modifiers: ( bits: 0,),)), + move_up: Some(( code: Char('k'), modifiers: ( bits: 0,),)), + move_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)), + + stash_open: Some(( code: Char('l'), modifiers: ( bits: 0,),)), + open_help: Some(( code: F(1), modifiers: ( bits: 0,),)), +) diff --git a/.config/gitui/theme.ron b/.config/gitui/theme.ron new file mode 100644 index 0000000..9818424 --- /dev/null +++ b/.config/gitui/theme.ron @@ -0,0 +1,23 @@ +( + selected_tab: Some(Reset), + command_fg: Some(Rgb(205, 214, 244)), + selection_bg: Some(Rgb(88, 91, 112)), + selection_fg: Some(Rgb(205, 214, 244)), + cmdbar_bg: Some(Rgb(24, 24, 37)), + cmdbar_extra_lines_bg: Some(Rgb(24, 24, 37)), + disabled_fg: Some(Rgb(127, 132, 156)), + diff_line_add: Some(Rgb(166, 227, 161)), + diff_line_delete: Some(Rgb(243, 139, 168)), + diff_file_added: Some(Rgb(249, 226, 175)), + diff_file_removed: Some(Rgb(235, 160, 172)), + diff_file_moved: Some(Rgb(203, 166, 247)), + diff_file_modified: Some(Rgb(250, 179, 135)), + commit_hash: Some(Rgb(180, 190, 254)), + commit_time: Some(Rgb(186, 194, 222)), + commit_author: Some(Rgb(116, 199, 236)), + danger_fg: Some(Rgb(243, 139, 168)), + push_gauge_bg: Some(Rgb(137, 180, 250)), + push_gauge_fg: Some(Rgb(30, 30, 46)), + tag_fg: Some(Rgb(245, 224, 220)), + branch_fg: Some(Rgb(148, 226, 213)) +) diff --git a/.config/gtk-3.0/settings.ini b/.config/gtk-3.0/settings.ini new file mode 100644 index 0000000..82feaed --- /dev/null +++ b/.config/gtk-3.0/settings.ini @@ -0,0 +1,4 @@ +[Settings] +gtk-theme-name=Catppuccin-Macchiato-Standard-Mauve-Dark +gtk-cursor-theme-name=Catppuccin-Mocha-Dark-Cursors +gtk-cursor-theme-size=24 diff --git a/.config/himitsu/config.ini b/.config/himitsu/config.ini new file mode 100644 index 0000000..08d8d50 --- /dev/null +++ b/.config/himitsu/config.ini @@ -0,0 +1,2 @@ +[himitsud] +prompter=hiprompt-wmenu diff --git a/.config/hut/config b/.config/hut/config new file mode 100644 index 0000000..ca0abc5 --- /dev/null +++ b/.config/hut/config @@ -0,0 +1,3 @@ +instance "sr.ht" { + access-token "APpCjmoAAAAAVHBhZ2VzLnNyLmh0L1BST0ZJTEU6UlcgcGFnZXMuc3IuaHQvU0lURVM6UlcgcGFnZXMuc3IuaHQvUEFHRVM6UlcgcGFnZXMuc3IuaHQvQUNMUzpSVwAKc3RvbmtzMzE0MQyt21pTWxymju2RhrNN54H0xv4Lqf5Lrd2ybjkPnSWZ" +} diff --git a/.config/mako/config b/.config/mako/config new file mode 100644 index 0000000..6cc1f9c --- /dev/null +++ b/.config/mako/config @@ -0,0 +1,13 @@ +font=FiraCode Nerd Font 10 +border-size=2 +border-radius=3 +margin=20 + +background-color=#24273a +text-color=#cad3f5 +border-color=#8aadf4 +progress-color=over #363a4f + +[urgency=high] +border-color=#f5a97f + diff --git a/.config/nvim/.stylua.toml b/.config/nvim/.stylua.toml new file mode 100644 index 0000000..6cb677e --- /dev/null +++ b/.config/nvim/.stylua.toml @@ -0,0 +1,3 @@ +line_endings = "Unix" +quote_style = "ForceSingle" +call_parentheses = "Always" diff --git a/.config/nvim/README.md b/.config/nvim/README.md new file mode 100644 index 0000000..63f50b4 --- /dev/null +++ b/.config/nvim/README.md @@ -0,0 +1,7 @@ +# Neovim Config + +## Credits + +- [Winston](https://github.com/nekowinston) for his excellent [config](https://github.com/nekowinston/dotfiles/tree/main/home/apps/neovim) +- [Lazyvim](https://lazyvim.org) + diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..f6f4491 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,18 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("options") + +require("lazy").setup("plugins", { + install = { colorscheme = { "catppuccin" } }, +}) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..e72ad5d --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,24 @@ +{ + "LuaSnip": { "branch": "master", "commit": "2c08f32a570c07b8130144813266e21393da80d3" }, + "catppuccin": { "branch": "main", "commit": "65bf0b16f57a3db70d6a93ac68882dd9a31d0565" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "export-colorscheme.nvim": { "branch": "master", "commit": "805bc285c9ba0e6da5c7c08fc89734f19d72e473" }, + "flexoki": { "branch": "main", "commit": "975654bce67514114db89373539621cff42befb5" }, + "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, + "lazy.nvim": { "branch": "main", "commit": "cf8ecc2c5e4332760431a33534240b0cbc6680ab" }, + "neogit": { "branch": "master", "commit": "001f43f50d9589d837cec59004fd92486ab06870" }, + "nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" }, + "nvim-lspconfig": { "branch": "master", "commit": "59a6766cbf32c7e4cf3ed685ccad7ffe1dde8c40" }, + "nvim-surround": { "branch": "main", "commit": "dca2e998ff26681ee422b92c6ed39b3d2908d8a9" }, + "nvim-treesitter": { "branch": "master", "commit": "39016abc99853c3e9d70f1bec7e2fa661b9a81bf" }, + "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, + "vim-buftabline": { "branch": "master", "commit": "73b9ef5dcb6cdf6488bc88adb382f20bc3e3262a" }, + "which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" } +} diff --git a/.config/nvim/lua/options.lua b/.config/nvim/lua/options.lua new file mode 100644 index 0000000..bd14907 --- /dev/null +++ b/.config/nvim/lua/options.lua @@ -0,0 +1,13 @@ +vim.o.number = true +vim.o.relativenumber = true +vim.o.timeout = true +vim.o.timeoutlen = 300 +vim.o.softtabstop = 0 + +vim.o.laststatus = 2 +vim.o.statusline = "%f %y%h%w%m%r%=%l:%c %P" + +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +vim.api.nvim_set_keymap('n', '\\', ':noh<cr>', {}) diff --git a/.config/nvim/lua/plugins/catppuccin.lua b/.config/nvim/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..155f929 --- /dev/null +++ b/.config/nvim/lua/plugins/catppuccin.lua @@ -0,0 +1,19 @@ +return { + { "jpe90/export-colorscheme.nvim", name = "export-colorscheme.nvim" }, + { "kepano/flexoki-neovim", name = "flexoki" }, + { + "catppuccin/nvim", + name = "catppuccin", + priority = 1000, + config = function() + require("catppuccin").setup({ + flavour = "mocha", + integrations = { + neogit = true, + which_key = true, + }, + }) + vim.cmd.colorscheme("catppuccin") + end, + }, +} diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua new file mode 100644 index 0000000..fc897eb --- /dev/null +++ b/.config/nvim/lua/plugins/cmp.lua @@ -0,0 +1,95 @@ +return { + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "nvim-lua/plenary.nvim", + "hrsh7th/cmp-nvim-lsp", + "saadparwaiz1/cmp_luasnip", + { + "L3MON4D3/LuaSnip", + dependencies = { "rafamadriz/friendly-snippets" }, + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + end, + }, + }, + event = "InsertEnter", + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + + cmp.setup({ + mapping = cmp.mapping.preset.insert({ + ["<C-b>"] = cmp.mapping.scroll_docs(-4), + ["<C-f>"] = cmp.mapping.scroll_docs(4), + ["<C-Space>"] = cmp.mapping.complete(), + ["<C-e>"] = cmp.mapping.abort(), + ["<CR>"] = cmp.mapping.confirm({ select = true }), + ["<Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + ["<S-Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end + }, + sources = cmp.config.sources({ + { name = "luasnip" }, + { name = "nvim_lsp" }, + { name = "path" }, + }, { + { name = "buffer" }, + }), + }) + end, + }, + { + "hrsh7th/cmp-cmdline", + dependencies = { + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + }, + event = "CmdlineEnter", + config = function() + local cmp = require("cmp") + cmp.setup.cmdline({ "/", "?" }, { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "buffer" }, + }), + }) + cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + }, { + { + name = "cmdline", + option = { + ignore_cmds = { "Man", "!" }, + }, + }, + }) + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua new file mode 100644 index 0000000..7004143 --- /dev/null +++ b/.config/nvim/lua/plugins/editor.lua @@ -0,0 +1,4 @@ +return { + { "ap/vim-buftabline", event = "VeryLazy" }, + { "kylechui/nvim-surround", event = "VeryLazy", opts = {} }, +} diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..a435df7 --- /dev/null +++ b/.config/nvim/lua/plugins/git.lua @@ -0,0 +1,27 @@ +return { + { + "sindrets/diffview.nvim", + cmd = { + "DiffviewLog", + "DiffviewOpen", + "DiffviewClose", + "DiffviewRefresh", + "DiffviewFocusFiles", + "DiffviewFileHistory", + "DiffviewToggleFiles", + }, + }, + { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + }, + cmd = "Neogit", + opts = { + integrations = { + diffview = true, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..7a67265 --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,64 @@ +return { + { + "neovim/nvim-lspconfig", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + }, + event = { "BufReadPre", "BufNewFile" }, + config = function() + local lspconfig = require("lspconfig") + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local common = { + capabilities = capabilities, + } + + local lsps = { + "gopls", + "lua_ls", + "pylsp", + "ts_ls", + "cssls", + "html", + } + + for _, lsp in ipairs(lsps) do + lspconfig[lsp].setup(common) + end + + local wk = require("which-key") + wk.register({ + { "[d", vim.diagnostic.goto_prev, desc = "Previous diagnostic" }, + { "]d", vim.diagnostic.goto_next, desc = "Next diagnostic" }, + }) + + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + callback = function(ev) + wk.register({ + { "gD", vim.lsp.buf.declaration, desc = "Go to declaration" }, + { "gd", vim.lsp.buf.definition, desc = "Go to definition" }, + { "gr", vim.lsp.buf.references, desc = "Go to references" }, + { "gi", vim.lsp.buf.implementation, desc = "Go to implementation" }, + { "K", vim.lsp.buf.hover, desc = "Show LSP hover info" }, + { "<C-k>", vim.lsp.buf.signature_help, desc = "Show signature help" }, + { "<leader>D", vim.lsp.buf.type_definition, desc = "Type definition" }, + { "<leader>rn", vim.lsp.buf.rename, desc = "Rename" }, + { "<leader>ca", vim.lsp.buf.code_action, desc = "Code action" }, + { "<leader>F", function() vim.lsp.buf.format({ async = true }) end, desc = "Format buffer" }, + ["<leader>w"] = { + name = "+LSP workspace", + a = { vim.lsp.buf.add_workspace_folder, "Add workspace folder" }, + r = { vim.lsp.buf.remove_workspace_folder, "Remove workspace folder" }, + l = { + function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, + "List workspace folders", + }, + }, + }, {buffer=ev.buf}) + end, + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..8dfcce3 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,17 @@ +return { + { + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + }, + keys = { + { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find files" }, + { "<leader>fF", "<cmd>Telescope git_files<cr>", desc = "Find git files" }, + { "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Live grep" }, + { "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Find buffers" }, + { "<leader>fh", "<cmd>Telescope help_tags<cr>", desc = "Help tags" }, + }, + cmd = "Telescope", + }, +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..fe48d9f --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,35 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("nvim-treesitter.configs").setup({ + auto_install = true, + ensure_installed = { + "bash", + "clojure", + "css", + "html", + "ini", + "javascript", + "json", + "kotlin", + "lua", + "markdown", + "perl", + "python", + "regex", + "rust", + "scss", + "sql", + "svelte", + "toml", + "tsx", + "typescript", + "yaml", + }, + highlight = { enable = true }, + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/which-key.lua b/.config/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..f636915 --- /dev/null +++ b/.config/nvim/lua/plugins/which-key.lua @@ -0,0 +1,9 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + config = function() + require("which-key").register({ + { "<leader>f", group = "Telescope" }, + }) + end, +} diff --git a/.config/river/init b/.config/river/init new file mode 100755 index 0000000..9f1172a --- /dev/null +++ b/.config/river/init @@ -0,0 +1,156 @@ +#!/bin/sh -e + +riverctl map normal Super+Shift Return spawn foot +riverctl map normal Super P spawn wmenu-run + +# Super+Q to close the focused view +riverctl map normal Super Q close + +# Super+Shift+E to exit river +riverctl map normal Super+Shift E exit + +# Super+J and Super+K to focus the next/previous view in the layout stack +riverctl map normal Super J focus-view next +riverctl map normal Super K focus-view previous + +# Super+Shift+J and Super+Shift+K to swap the focused view with the next/previous +# view in the layout stack +riverctl map normal Super+Shift J swap next +riverctl map normal Super+Shift K swap previous + +# Super+Period and Super+Comma to focus the next/previous output +riverctl map normal Super Period focus-output next +riverctl map normal Super Comma focus-output previous + +# Super+Shift+{Period,Comma} to send the focused view to the next/previous output +riverctl map normal Super+Shift Period send-to-output next +riverctl map normal Super+Shift Comma send-to-output previous + +# Super+Return to bump the focused view to the top of the layout stack +riverctl map normal Super Return zoom + +# Super+H and Super+L to decrease/increase the main ratio of rivertile(1) +riverctl map normal Super H send-layout-cmd rivertile "main-ratio -0.05" +riverctl map normal Super L send-layout-cmd rivertile "main-ratio +0.05" + +# Super+Shift+H and Super+Shift+L to increment/decrement the main count of rivertile(1) +riverctl map normal Super+Shift H send-layout-cmd rivertile "main-count +1" +riverctl map normal Super+Shift L send-layout-cmd rivertile "main-count -1" + +# Super+Alt+{H,J,K,L} to move views +riverctl map normal Super+Alt H move left 100 +riverctl map normal Super+Alt J move down 100 +riverctl map normal Super+Alt K move up 100 +riverctl map normal Super+Alt L move right 100 + +#riverctl map normal Super+Alt+Shift H move left 1 +#riverctl map normal Super+Alt+Shift J move down 1 +#riverctl map normal Super+Alt+Shift K move up 1 +#riverctl map normal Super+Alt+Shift L move right 1 + +# Super+Alt+Control+{H,J,K,L} to snap views to screen edges +riverctl map normal Super+Alt+Control H snap left +riverctl map normal Super+Alt+Control J snap down +riverctl map normal Super+Alt+Control K snap up +riverctl map normal Super+Alt+Control L snap right + +# Super+Alt+Shift+{H,J,K,L} to resize views +riverctl map normal Super+Alt+Shift H resize horizontal -100 +riverctl map normal Super+Alt+Shift J resize vertical 100 +riverctl map normal Super+Alt+Shift K resize vertical -100 +riverctl map normal Super+Alt+Shift L resize horizontal 100 + +# Super + Left Mouse Button to move views +riverctl map-pointer normal Super BTN_LEFT move-view + +# Super + Right Mouse Button to resize views +riverctl map-pointer normal Super BTN_RIGHT resize-view + +# Super + Middle Mouse Button to toggle float +riverctl map-pointer normal Super BTN_MIDDLE toggle-float + +for i in $(seq 1 9); do + tags=$((1 << ($i - 1))) + riverctl map normal Super $i set-focused-tags $tags + riverctl map normal Super+Shift $i set-view-tags $tags + riverctl map normal Super+Control $i toggle-focused-tags $tags + riverctl map normal Super+Shift+Control $i toggle-view-tags $tags +done + +# Super+0 to focus all tags +# Super+Shift+0 to tag focused view with all tags +all_tags="$(((1 << 32) - 1))" +riverctl map normal Super 0 set-focused-tags $all_tags +riverctl map normal Super+Shift 0 set-view-tags $all_tags + +# Super+Space to toggle float +riverctl map normal Super Space toggle-float + +# Super+F to toggle fullscreen +riverctl map normal Super F toggle-fullscreen + +# Super+{Up,Right,Down,Left} to change layout orientation +riverctl map normal Super Up send-layout-cmd rivertile "main-location top" +riverctl map normal Super Right send-layout-cmd rivertile "main-location right" +riverctl map normal Super Down send-layout-cmd rivertile "main-location bottom" +riverctl map normal Super Left send-layout-cmd rivertile "main-location left" + +# Declare a passthrough mode. This mode has only a single mapping to return to +# normal mode. This makes it useful for testing a nested wayland compositor +riverctl declare-mode passthrough + +# Super+F11 to enter passthrough mode +riverctl map normal Super F11 enter-mode passthrough + +# Super+F11 to return to normal mode +riverctl map passthrough Super F11 enter-mode normal + +# Various media key mapping examples for both normal and locked mode which do +# not have a modifier +for mode in normal locked; do + riverctl map $mode None XF86AudioRaiseVolume spawn 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+' + riverctl map $mode None XF86AudioLowerVolume spawn 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-' + riverctl map $mode None XF86AudioMute spawn 'wpctl set-mute toggle' + + # Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl) + # riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause' + # riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause' + # riverctl map $mode None XF86AudioPrev spawn 'playerctl previous' + # riverctl map $mode None XF86AudioNext spawn 'playerctl next' + + riverctl map $mode None XF86MonBrightnessUp spawn 'brightctl +5' + riverctl map $mode None XF86MonBrightnessDown spawn 'brightctl -5' +done + +riverctl keyboard-layout -variant colemak_dh us + +riverctl xcursor-theme Catppuccin-Mocha-Dark-Cursors 16 + +# Set background and border color +riverctl background-color 0x1e1e2e +riverctl border-color-focused 0x9399b2 +riverctl border-color-unfocused 0x1e1e2e + +# Set keyboard repeat rate +riverctl set-repeat 40 300 + +for dev in $(riverctl list-inputs | grep '^pointer'); do + riverctl input "$dev" left-handed enabled + riverctl input "$dev" accel-profile flat +done + +# Make certain views start floating +# riverctl rule-add -app-id "float" float +# riverctl rule-add -title "popup title with spaces" float + +# Set app-ids and titles of views which should use client side decorations +# riverctl rule-add -app-id "gedit" csd + +# Set the default layout generator to be rivertile and start it. +# River will send the process group of the init executable SIGTERM on exit. +riverctl default-layout rivertile + +riverctl spawn 'printf %s\\n "$WAYLAND_DISPLAY" >"$XDG_RUNTIME_DIR"/wl_env/WAYLAND_DISPLAY' +riverctl spawn 'printf %s\\n "$DISPLAY" >"$XDG_RUNTIME_DIR"/wl_env/DISPLAY' +dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP=wlroots +printf \\n >"$XDG_RUNTIME_DIR"/service/river/data/ready diff --git a/.config/river/rivertile b/.config/river/rivertile new file mode 100755 index 0000000..3bc502a --- /dev/null +++ b/.config/river/rivertile @@ -0,0 +1,2 @@ +#!/command/execlineb -s0 +rivertile -view-padding 4 -outer-padding 4 -main-ratio 0.5 ${@} diff --git a/.config/s6-rc/dbus-log/consumer-for b/.config/s6-rc/dbus-log/consumer-for new file mode 100644 index 0000000..e2182f1 --- /dev/null +++ b/.config/s6-rc/dbus-log/consumer-for @@ -0,0 +1 @@ +dbus diff --git a/.config/s6-rc/dbus-log/notification-fd b/.config/s6-rc/dbus-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/dbus-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/dbus-log/pipeline-name b/.config/s6-rc/dbus-log/pipeline-name new file mode 100644 index 0000000..0d56fa6 --- /dev/null +++ b/.config/s6-rc/dbus-log/pipeline-name @@ -0,0 +1 @@ +dbus-pipeline diff --git a/.config/s6-rc/dbus-log/run b/.config/s6-rc/dbus-log/run new file mode 100755 index 0000000..0b9b1ea --- /dev/null +++ b/.config/s6-rc/dbus-log/run @@ -0,0 +1,4 @@ +#!/bin/execlineb -P +importas -i HOME HOME +exec -c +s6-log -d3 -- t ${HOME}/.local/state/s6/logs/dbus diff --git a/.config/s6-rc/dbus-log/type b/.config/s6-rc/dbus-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/dbus-log/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/dbus/data/check b/.config/s6-rc/dbus/data/check new file mode 100755 index 0000000..0444e0b --- /dev/null +++ b/.config/s6-rc/dbus/data/check @@ -0,0 +1,3 @@ +#!/bin/execlineb -P +importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR +test -S ${XDG_RUNTIME_DIR}/bus diff --git a/.config/s6-rc/dbus/finish b/.config/s6-rc/dbus/finish new file mode 100755 index 0000000..b22f9dc --- /dev/null +++ b/.config/s6-rc/dbus/finish @@ -0,0 +1,3 @@ +#!/command/execlineb -P +s6-permafailon 60 10 1-255 +exit diff --git a/.config/s6-rc/dbus/notification-fd b/.config/s6-rc/dbus/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/dbus/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/dbus/producer-for b/.config/s6-rc/dbus/producer-for new file mode 100644 index 0000000..7be2401 --- /dev/null +++ b/.config/s6-rc/dbus/producer-for @@ -0,0 +1 @@ +dbus-log diff --git a/.config/s6-rc/dbus/run b/.config/s6-rc/dbus/run new file mode 100755 index 0000000..bbf8767 --- /dev/null +++ b/.config/s6-rc/dbus/run @@ -0,0 +1,5 @@ +#!/bin/execlineb -P +fdmove -c 2 1 +importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR +s6-notifyoncheck +dbus-daemon --session --nofork --nopidfile --nosyslog --address unix:path=${XDG_RUNTIME_DIR}/bus diff --git a/.config/s6-rc/dbus/type b/.config/s6-rc/dbus/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/dbus/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/default/contents.d/dbus b/.config/s6-rc/default/contents.d/dbus new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/default/contents.d/dbus diff --git a/.config/s6-rc/default/contents.d/pipewire b/.config/s6-rc/default/contents.d/pipewire new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/default/contents.d/pipewire diff --git a/.config/s6-rc/default/contents.d/pipewire-pulse b/.config/s6-rc/default/contents.d/pipewire-pulse new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/default/contents.d/pipewire-pulse diff --git a/.config/s6-rc/default/contents.d/statusbar b/.config/s6-rc/default/contents.d/statusbar new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/default/contents.d/statusbar diff --git a/.config/s6-rc/default/contents.d/wayland b/.config/s6-rc/default/contents.d/wayland new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/default/contents.d/wayland diff --git a/.config/s6-rc/default/contents.d/wbg b/.config/s6-rc/default/contents.d/wbg new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/default/contents.d/wbg diff --git a/.config/s6-rc/default/contents.d/wireplumber b/.config/s6-rc/default/contents.d/wireplumber new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/default/contents.d/wireplumber diff --git a/.config/s6-rc/default/contents.d/wlsunset b/.config/s6-rc/default/contents.d/wlsunset new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/default/contents.d/wlsunset diff --git a/.config/s6-rc/default/contents.d/xdg-desktop-portal b/.config/s6-rc/default/contents.d/xdg-desktop-portal new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/default/contents.d/xdg-desktop-portal diff --git a/.config/s6-rc/default/type b/.config/s6-rc/default/type new file mode 100644 index 0000000..757b422 --- /dev/null +++ b/.config/s6-rc/default/type @@ -0,0 +1 @@ +bundle diff --git a/.config/s6-rc/eww-log/consumer-for b/.config/s6-rc/eww-log/consumer-for new file mode 100644 index 0000000..3817e7a --- /dev/null +++ b/.config/s6-rc/eww-log/consumer-for @@ -0,0 +1 @@ +eww diff --git a/.config/s6-rc/eww-log/notification-fd b/.config/s6-rc/eww-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/eww-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/eww-log/pipeline-name b/.config/s6-rc/eww-log/pipeline-name new file mode 100644 index 0000000..f2d8804 --- /dev/null +++ b/.config/s6-rc/eww-log/pipeline-name @@ -0,0 +1 @@ +eww-pipeline diff --git a/.config/s6-rc/eww-log/run b/.config/s6-rc/eww-log/run new file mode 100755 index 0000000..64b7783 --- /dev/null +++ b/.config/s6-rc/eww-log/run @@ -0,0 +1,4 @@ +#!/bin/execlineb -P +importas -i HOME HOME +exec -c +s6-log -d3 -- t ${HOME}/.local/state/s6/logs/eww diff --git a/.config/s6-rc/eww-log/type b/.config/s6-rc/eww-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/eww-log/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/eww/data/check b/.config/s6-rc/eww/data/check new file mode 100755 index 0000000..f460ac1 --- /dev/null +++ b/.config/s6-rc/eww/data/check @@ -0,0 +1,2 @@ +#!/command/execlineb -P +redirfd -w 1 /dev/null fdmove -c 2 1 eww ping diff --git a/.config/s6-rc/eww/dependencies.d/wayland b/.config/s6-rc/eww/dependencies.d/wayland new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/eww/dependencies.d/wayland diff --git a/.config/s6-rc/eww/finish b/.config/s6-rc/eww/finish new file mode 100755 index 0000000..b22f9dc --- /dev/null +++ b/.config/s6-rc/eww/finish @@ -0,0 +1,3 @@ +#!/command/execlineb -P +s6-permafailon 60 10 1-255 +exit diff --git a/.config/s6-rc/eww/notification-fd b/.config/s6-rc/eww/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/eww/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/eww/producer-for b/.config/s6-rc/eww/producer-for new file mode 100644 index 0000000..f49fd8d --- /dev/null +++ b/.config/s6-rc/eww/producer-for @@ -0,0 +1 @@ +eww-log diff --git a/.config/s6-rc/eww/run b/.config/s6-rc/eww/run new file mode 100755 index 0000000..a0258fa --- /dev/null +++ b/.config/s6-rc/eww/run @@ -0,0 +1,6 @@ +#!/bin/execlineb -P +fdmove -c 2 1 +importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR +s6-envdir ${XDG_RUNTIME_DIR}/wl_env +s6-notifyoncheck +eww daemon --no-daemonize diff --git a/.config/s6-rc/eww/type b/.config/s6-rc/eww/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/eww/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/pipewire-log/consumer-for b/.config/s6-rc/pipewire-log/consumer-for new file mode 100644 index 0000000..3b94baf --- /dev/null +++ b/.config/s6-rc/pipewire-log/consumer-for @@ -0,0 +1 @@ +pipewire diff --git a/.config/s6-rc/pipewire-log/notification-fd b/.config/s6-rc/pipewire-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/pipewire-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/pipewire-log/pipeline-name b/.config/s6-rc/pipewire-log/pipeline-name new file mode 100644 index 0000000..b5dbcd0 --- /dev/null +++ b/.config/s6-rc/pipewire-log/pipeline-name @@ -0,0 +1 @@ +pipewire-pipeline diff --git a/.config/s6-rc/pipewire-log/run b/.config/s6-rc/pipewire-log/run new file mode 100755 index 0000000..8f71caf --- /dev/null +++ b/.config/s6-rc/pipewire-log/run @@ -0,0 +1,4 @@ +#!/bin/execlineb -P +importas -i HOME HOME +exec -c +s6-log -d3 -- t ${HOME}/.local/state/s6/logs/pipewire diff --git a/.config/s6-rc/pipewire-log/type b/.config/s6-rc/pipewire-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/pipewire-log/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/pipewire-pulse-log/consumer-for b/.config/s6-rc/pipewire-pulse-log/consumer-for new file mode 100644 index 0000000..c6be362 --- /dev/null +++ b/.config/s6-rc/pipewire-pulse-log/consumer-for @@ -0,0 +1 @@ +pipewire-pulse diff --git a/.config/s6-rc/pipewire-pulse-log/notification-fd b/.config/s6-rc/pipewire-pulse-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/pipewire-pulse-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/pipewire-pulse-log/pipeline-name b/.config/s6-rc/pipewire-pulse-log/pipeline-name new file mode 100644 index 0000000..dc367a2 --- /dev/null +++ b/.config/s6-rc/pipewire-pulse-log/pipeline-name @@ -0,0 +1 @@ +pipewire-pulse-pipeline diff --git a/.config/s6-rc/pipewire-pulse-log/run b/.config/s6-rc/pipewire-pulse-log/run new file mode 100755 index 0000000..240b819 --- /dev/null +++ b/.config/s6-rc/pipewire-pulse-log/run @@ -0,0 +1,4 @@ +#!/bin/execlineb -P +importas -i HOME HOME +exec -c +s6-log -d3 -- t ${HOME}/.local/state/s6/logs/pipewire-pulse diff --git a/.config/s6-rc/pipewire-pulse-log/type b/.config/s6-rc/pipewire-pulse-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/pipewire-pulse-log/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/pipewire-pulse/dependencies.d/pipewire b/.config/s6-rc/pipewire-pulse/dependencies.d/pipewire new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/pipewire-pulse/dependencies.d/pipewire diff --git a/.config/s6-rc/pipewire-pulse/finish b/.config/s6-rc/pipewire-pulse/finish new file mode 100755 index 0000000..b22f9dc --- /dev/null +++ b/.config/s6-rc/pipewire-pulse/finish @@ -0,0 +1,3 @@ +#!/command/execlineb -P +s6-permafailon 60 10 1-255 +exit diff --git a/.config/s6-rc/pipewire-pulse/producer-for b/.config/s6-rc/pipewire-pulse/producer-for new file mode 100644 index 0000000..d7dcdf1 --- /dev/null +++ b/.config/s6-rc/pipewire-pulse/producer-for @@ -0,0 +1 @@ +pipewire-pulse-log diff --git a/.config/s6-rc/pipewire-pulse/run b/.config/s6-rc/pipewire-pulse/run new file mode 100644 index 0000000..30cb174 --- /dev/null +++ b/.config/s6-rc/pipewire-pulse/run @@ -0,0 +1,3 @@ +#!/bin/execlineb -P +fdmove -c 2 1 +pipewire-pulse diff --git a/.config/s6-rc/pipewire-pulse/type b/.config/s6-rc/pipewire-pulse/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/pipewire-pulse/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/pipewire/dependencies.d/dbus b/.config/s6-rc/pipewire/dependencies.d/dbus new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/pipewire/dependencies.d/dbus diff --git a/.config/s6-rc/pipewire/finish b/.config/s6-rc/pipewire/finish new file mode 100755 index 0000000..b22f9dc --- /dev/null +++ b/.config/s6-rc/pipewire/finish @@ -0,0 +1,3 @@ +#!/command/execlineb -P +s6-permafailon 60 10 1-255 +exit diff --git a/.config/s6-rc/pipewire/producer-for b/.config/s6-rc/pipewire/producer-for new file mode 100644 index 0000000..ea63659 --- /dev/null +++ b/.config/s6-rc/pipewire/producer-for @@ -0,0 +1 @@ +pipewire-log diff --git a/.config/s6-rc/pipewire/run b/.config/s6-rc/pipewire/run new file mode 100755 index 0000000..e8fb02c --- /dev/null +++ b/.config/s6-rc/pipewire/run @@ -0,0 +1,3 @@ +#!/bin/execlineb -P +fdmove -c 2 1 +pipewire diff --git a/.config/s6-rc/pipewire/type b/.config/s6-rc/pipewire/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/pipewire/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/river-log/consumer-for b/.config/s6-rc/river-log/consumer-for new file mode 100644 index 0000000..5f58d4e --- /dev/null +++ b/.config/s6-rc/river-log/consumer-for @@ -0,0 +1 @@ +river diff --git a/.config/s6-rc/river-log/notification-fd b/.config/s6-rc/river-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/river-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/river-log/pipeline-name b/.config/s6-rc/river-log/pipeline-name new file mode 100644 index 0000000..77c6e7a --- /dev/null +++ b/.config/s6-rc/river-log/pipeline-name @@ -0,0 +1 @@ +river-pipeline diff --git a/.config/s6-rc/river-log/run b/.config/s6-rc/river-log/run new file mode 100755 index 0000000..ff52209 --- /dev/null +++ b/.config/s6-rc/river-log/run @@ -0,0 +1,4 @@ +#!/bin/execlineb -P +importas -i HOME HOME +exec -c +s6-log -d3 -- t ${HOME}/.local/state/s6/logs/river diff --git a/.config/s6-rc/river-log/type b/.config/s6-rc/river-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/river-log/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/river/dependencies.d/dbus b/.config/s6-rc/river/dependencies.d/dbus new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/river/dependencies.d/dbus diff --git a/.config/s6-rc/river/finish b/.config/s6-rc/river/finish new file mode 100755 index 0000000..4c78186 --- /dev/null +++ b/.config/s6-rc/river/finish @@ -0,0 +1,5 @@ +#!/bin/execlineb -S2 +importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR +foreground { s6-rc -l ${XDG_RUNTIME_DIR}/s6-rc -bDa change } +s6-svscanctl -t ${XDG_RUNTIME_DIR}/service +exit 125 diff --git a/.config/s6-rc/river/notification-fd b/.config/s6-rc/river/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/river/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/river/producer-for b/.config/s6-rc/river/producer-for new file mode 100644 index 0000000..051e7e4 --- /dev/null +++ b/.config/s6-rc/river/producer-for @@ -0,0 +1 @@ +river-log diff --git a/.config/s6-rc/river/run b/.config/s6-rc/river/run new file mode 100755 index 0000000..de4fd8a --- /dev/null +++ b/.config/s6-rc/river/run @@ -0,0 +1,28 @@ +#!/bin/execlineb -P +fdmove -c 2 1 +multisubstitute { + importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR + importas -i HOME HOME +} +if { mkdir -p ${XDG_RUNTIME_DIR}/wl_env } +if { + forx -E var { + XDG_SESSION_TYPE=wayland + XDG_SESSION_DESKTOP=wlroots + XDG_CURRENT_DESKTOP=wlroots + MOZ_ENABLE_WAYLAND=1 + QT_QPA_PLATFORM=wayland + SDL_VIDEODRIVER=wayland + _JAVA_AWT_WM_NONREPARENTING=1 + } + multidefine -d= ${var} { key val } + redirfd -w 1 ${XDG_RUNTIME_DIR}/wl_env/${key} + heredoc 0 ${val} cat +} +s6-envdir ${XDG_RUNTIME_DIR}/wl_env +if { mkdir -p ./data } +if { rm -f ./data/ready } +if { mkfifo ./data/ready } +background { redirfd -r 0 ./data/ready fdmove 1 3 cat } +cd ${HOME} +river diff --git a/.config/s6-rc/river/type b/.config/s6-rc/river/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/river/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/rivertile-log/consumer-for b/.config/s6-rc/rivertile-log/consumer-for new file mode 100644 index 0000000..d73f7d3 --- /dev/null +++ b/.config/s6-rc/rivertile-log/consumer-for @@ -0,0 +1 @@ +rivertile diff --git a/.config/s6-rc/rivertile-log/notification-fd b/.config/s6-rc/rivertile-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/rivertile-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/rivertile-log/pipeline-name b/.config/s6-rc/rivertile-log/pipeline-name new file mode 100644 index 0000000..0b1402c --- /dev/null +++ b/.config/s6-rc/rivertile-log/pipeline-name @@ -0,0 +1 @@ +rivertile-pipeline diff --git a/.config/s6-rc/rivertile-log/run b/.config/s6-rc/rivertile-log/run new file mode 100755 index 0000000..9ae3251 --- /dev/null +++ b/.config/s6-rc/rivertile-log/run @@ -0,0 +1,4 @@ +#!/command/execlineb -P +importas -i HOME HOME +exec -c +s6-log -d3 -- t ${HOME}/.local/state/s6/logs/rivertile diff --git a/.config/s6-rc/rivertile-log/type b/.config/s6-rc/rivertile-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/rivertile-log/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/rivertile/dependencies.d/river b/.config/s6-rc/rivertile/dependencies.d/river new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/rivertile/dependencies.d/river diff --git a/.config/s6-rc/rivertile/producer-for b/.config/s6-rc/rivertile/producer-for new file mode 100644 index 0000000..30d5062 --- /dev/null +++ b/.config/s6-rc/rivertile/producer-for @@ -0,0 +1 @@ +rivertile-log diff --git a/.config/s6-rc/rivertile/run b/.config/s6-rc/rivertile/run new file mode 100755 index 0000000..68b9075 --- /dev/null +++ b/.config/s6-rc/rivertile/run @@ -0,0 +1,8 @@ +#!/command/execlineb -P +fdmove -c 2 1 +multisubstitute { + importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR + importas -i HOME HOME +} +s6-envdir ${XDG_RUNTIME_DIR}/wl_env +${HOME}/.config/river/rivertile diff --git a/.config/s6-rc/rivertile/type b/.config/s6-rc/rivertile/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/rivertile/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/sandbar-log/consumer-for b/.config/s6-rc/sandbar-log/consumer-for new file mode 100644 index 0000000..a73c0ba --- /dev/null +++ b/.config/s6-rc/sandbar-log/consumer-for @@ -0,0 +1 @@ +sandbar diff --git a/.config/s6-rc/sandbar-log/notification-fd b/.config/s6-rc/sandbar-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/sandbar-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/sandbar-log/pipeline-name b/.config/s6-rc/sandbar-log/pipeline-name new file mode 100644 index 0000000..fbbf07e --- /dev/null +++ b/.config/s6-rc/sandbar-log/pipeline-name @@ -0,0 +1 @@ +sandbar-pipeline diff --git a/.config/s6-rc/sandbar-log/run b/.config/s6-rc/sandbar-log/run new file mode 100755 index 0000000..f269e87 --- /dev/null +++ b/.config/s6-rc/sandbar-log/run @@ -0,0 +1,4 @@ +#!/command/execlineb -P +importas -i HOME HOME +exec -c +s6-log -d3 -- t ${HOME}/.local/state/s6/logs/sandbar diff --git a/.config/s6-rc/sandbar-log/type b/.config/s6-rc/sandbar-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/sandbar-log/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/sandbar/consumer-for b/.config/s6-rc/sandbar/consumer-for new file mode 100644 index 0000000..9f6b34e --- /dev/null +++ b/.config/s6-rc/sandbar/consumer-for @@ -0,0 +1 @@ +statusline diff --git a/.config/s6-rc/sandbar/dependencies.d/wayland b/.config/s6-rc/sandbar/dependencies.d/wayland new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/sandbar/dependencies.d/wayland diff --git a/.config/s6-rc/sandbar/finish b/.config/s6-rc/sandbar/finish new file mode 100755 index 0000000..b22f9dc --- /dev/null +++ b/.config/s6-rc/sandbar/finish @@ -0,0 +1,3 @@ +#!/command/execlineb -P +s6-permafailon 60 10 1-255 +exit diff --git a/.config/s6-rc/sandbar/producer-for b/.config/s6-rc/sandbar/producer-for new file mode 100644 index 0000000..1b1bb42 --- /dev/null +++ b/.config/s6-rc/sandbar/producer-for @@ -0,0 +1 @@ +sandbar-log diff --git a/.config/s6-rc/sandbar/run b/.config/s6-rc/sandbar/run new file mode 100755 index 0000000..b9858fc --- /dev/null +++ b/.config/s6-rc/sandbar/run @@ -0,0 +1,5 @@ +#!/command/execlineb -P +fdmove -c 2 1 +importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR +s6-envdir ${XDG_RUNTIME_DIR}/wl_env +pipeline { loopwhilex cat } sandbar diff --git a/.config/s6-rc/sandbar/type b/.config/s6-rc/sandbar/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/sandbar/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/statusbar/contents.d/sandbar-pipeline b/.config/s6-rc/statusbar/contents.d/sandbar-pipeline new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/statusbar/contents.d/sandbar-pipeline diff --git a/.config/s6-rc/statusbar/type b/.config/s6-rc/statusbar/type new file mode 100644 index 0000000..757b422 --- /dev/null +++ b/.config/s6-rc/statusbar/type @@ -0,0 +1 @@ +bundle diff --git a/.config/s6-rc/statusline/finish b/.config/s6-rc/statusline/finish new file mode 100755 index 0000000..b22f9dc --- /dev/null +++ b/.config/s6-rc/statusline/finish @@ -0,0 +1,3 @@ +#!/command/execlineb -P +s6-permafailon 60 10 1-255 +exit diff --git a/.config/s6-rc/statusline/producer-for b/.config/s6-rc/statusline/producer-for new file mode 100644 index 0000000..a73c0ba --- /dev/null +++ b/.config/s6-rc/statusline/producer-for @@ -0,0 +1 @@ +sandbar diff --git a/.config/s6-rc/statusline/run b/.config/s6-rc/statusline/run new file mode 100755 index 0000000..35012fe --- /dev/null +++ b/.config/s6-rc/statusline/run @@ -0,0 +1,2 @@ +#!/command/execlineb -P +statusline diff --git a/.config/s6-rc/statusline/type b/.config/s6-rc/statusline/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/statusline/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/sway-log/consumer-for b/.config/s6-rc/sway-log/consumer-for new file mode 100644 index 0000000..e1fa762 --- /dev/null +++ b/.config/s6-rc/sway-log/consumer-for @@ -0,0 +1 @@ +sway diff --git a/.config/s6-rc/sway-log/notification-fd b/.config/s6-rc/sway-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/sway-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/sway-log/pipeline-name b/.config/s6-rc/sway-log/pipeline-name new file mode 100644 index 0000000..2ca2ab9 --- /dev/null +++ b/.config/s6-rc/sway-log/pipeline-name @@ -0,0 +1 @@ +sway-pipeline diff --git a/.config/s6-rc/sway-log/run b/.config/s6-rc/sway-log/run new file mode 100755 index 0000000..cc61312 --- /dev/null +++ b/.config/s6-rc/sway-log/run @@ -0,0 +1,4 @@ +#!/bin/execlineb -P +importas -i HOME HOME +exec -c +s6-log -d3 -- t ${HOME}/.local/state/s6/logs/sway diff --git a/.config/s6-rc/sway-log/type b/.config/s6-rc/sway-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/sway-log/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/sway/dependencies.d/dbus b/.config/s6-rc/sway/dependencies.d/dbus new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/sway/dependencies.d/dbus diff --git a/.config/s6-rc/sway/finish b/.config/s6-rc/sway/finish new file mode 100755 index 0000000..4c78186 --- /dev/null +++ b/.config/s6-rc/sway/finish @@ -0,0 +1,5 @@ +#!/bin/execlineb -S2 +importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR +foreground { s6-rc -l ${XDG_RUNTIME_DIR}/s6-rc -bDa change } +s6-svscanctl -t ${XDG_RUNTIME_DIR}/service +exit 125 diff --git a/.config/s6-rc/sway/notification-fd b/.config/s6-rc/sway/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/sway/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/sway/producer-for b/.config/s6-rc/sway/producer-for new file mode 100644 index 0000000..1d76e06 --- /dev/null +++ b/.config/s6-rc/sway/producer-for @@ -0,0 +1 @@ +sway-log diff --git a/.config/s6-rc/sway/run b/.config/s6-rc/sway/run new file mode 100755 index 0000000..4a4e701 --- /dev/null +++ b/.config/s6-rc/sway/run @@ -0,0 +1,28 @@ +#!/bin/execlineb -P +fdmove -c 2 1 +multisubstitute { + importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR + importas -i HOME HOME +} +if { mkdir -p ${XDG_RUNTIME_DIR}/wl_env } +if { + forx -E var { + XDG_SESSION_TYPE=wayland + XDG_SESSION_DESKTOP=sway + XDG_CURRENT_DESKTOP=sway + MOZ_ENABLE_WAYLAND=1 + QT_QPA_PLATFORM=wayland + SDL_VIDEODRIVER=wayland + _JAVA_AWT_WM_NONREPARENTING=1 + } + multidefine -d= ${var} { key val } + redirfd -w 1 ${XDG_RUNTIME_DIR}/wl_env/${key} + heredoc 0 ${val} cat +} +s6-envdir ${XDG_RUNTIME_DIR}/wl_env +if { mkdir -p ./data } +if { rm -f ./data/ready } +if { mkfifo ./data/ready } +background { redirfd -r 0 ./data/ready fdmove 1 3 cat } +cd ${HOME} +sway diff --git a/.config/s6-rc/sway/type b/.config/s6-rc/sway/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/sway/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/swayidle-log/consumer-for b/.config/s6-rc/swayidle-log/consumer-for new file mode 100644 index 0000000..41abd49 --- /dev/null +++ b/.config/s6-rc/swayidle-log/consumer-for @@ -0,0 +1,2 @@ +swayidle +swayidle-nosleep diff --git a/.config/s6-rc/swayidle-log/notification-fd b/.config/s6-rc/swayidle-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/swayidle-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/swayidle-log/pipeline-name b/.config/s6-rc/swayidle-log/pipeline-name new file mode 100644 index 0000000..37c41f5 --- /dev/null +++ b/.config/s6-rc/swayidle-log/pipeline-name @@ -0,0 +1 @@ +swayidle-pipeline diff --git a/.config/s6-rc/swayidle-log/run b/.config/s6-rc/swayidle-log/run new file mode 100755 index 0000000..98548eb --- /dev/null +++ b/.config/s6-rc/swayidle-log/run @@ -0,0 +1,4 @@ +#!/bin/execlineb -P +importas -i HOME HOME +exec -c +s6-log -d3 -- t ${HOME}/.local/state/s6/logs/swayidle diff --git a/.config/s6-rc/swayidle-log/type b/.config/s6-rc/swayidle-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/swayidle-log/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/swayidle-nosleep/dependencies.d/wayland b/.config/s6-rc/swayidle-nosleep/dependencies.d/wayland new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/swayidle-nosleep/dependencies.d/wayland diff --git a/.config/s6-rc/swayidle-nosleep/finish b/.config/s6-rc/swayidle-nosleep/finish new file mode 100755 index 0000000..b22f9dc --- /dev/null +++ b/.config/s6-rc/swayidle-nosleep/finish @@ -0,0 +1,3 @@ +#!/command/execlineb -P +s6-permafailon 60 10 1-255 +exit diff --git a/.config/s6-rc/swayidle-nosleep/producer-for b/.config/s6-rc/swayidle-nosleep/producer-for new file mode 100644 index 0000000..490cb3b --- /dev/null +++ b/.config/s6-rc/swayidle-nosleep/producer-for @@ -0,0 +1 @@ +swayidle-log diff --git a/.config/s6-rc/swayidle-nosleep/run b/.config/s6-rc/swayidle-nosleep/run new file mode 100755 index 0000000..bc4fcd9 --- /dev/null +++ b/.config/s6-rc/swayidle-nosleep/run @@ -0,0 +1,8 @@ +#!/bin/execlineb -P +fdmove -c 2 1 +multisubstitute { + importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR + importas -i HOME HOME +} +s6-envdir ${XDG_RUNTIME_DIR}/wl_env +swayidle -C ${HOME}/.config/swayidle/config-nosleep diff --git a/.config/s6-rc/swayidle-nosleep/type b/.config/s6-rc/swayidle-nosleep/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/swayidle-nosleep/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/swayidle/dependencies.d/wayland b/.config/s6-rc/swayidle/dependencies.d/wayland new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/swayidle/dependencies.d/wayland diff --git a/.config/s6-rc/swayidle/finish b/.config/s6-rc/swayidle/finish new file mode 100755 index 0000000..b22f9dc --- /dev/null +++ b/.config/s6-rc/swayidle/finish @@ -0,0 +1,3 @@ +#!/command/execlineb -P +s6-permafailon 60 10 1-255 +exit diff --git a/.config/s6-rc/swayidle/producer-for b/.config/s6-rc/swayidle/producer-for new file mode 100644 index 0000000..490cb3b --- /dev/null +++ b/.config/s6-rc/swayidle/producer-for @@ -0,0 +1 @@ +swayidle-log diff --git a/.config/s6-rc/swayidle/run b/.config/s6-rc/swayidle/run new file mode 100755 index 0000000..bde027f --- /dev/null +++ b/.config/s6-rc/swayidle/run @@ -0,0 +1,5 @@ +#!/bin/execlineb -P +fdmove -c 2 1 +importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR +s6-envdir ${XDG_RUNTIME_DIR}/wl_env +swayidle diff --git a/.config/s6-rc/swayidle/type b/.config/s6-rc/swayidle/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/swayidle/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/wayland/contents.d/river b/.config/s6-rc/wayland/contents.d/river new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/wayland/contents.d/river diff --git a/.config/s6-rc/wayland/contents.d/rivertile b/.config/s6-rc/wayland/contents.d/rivertile new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/wayland/contents.d/rivertile diff --git a/.config/s6-rc/wayland/type b/.config/s6-rc/wayland/type new file mode 100644 index 0000000..757b422 --- /dev/null +++ b/.config/s6-rc/wayland/type @@ -0,0 +1 @@ +bundle diff --git a/.config/s6-rc/wbg-log/consumer-for b/.config/s6-rc/wbg-log/consumer-for new file mode 100644 index 0000000..bb4038a --- /dev/null +++ b/.config/s6-rc/wbg-log/consumer-for @@ -0,0 +1 @@ +wbg diff --git a/.config/s6-rc/wbg-log/notification-fd b/.config/s6-rc/wbg-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/wbg-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/wbg-log/pipeline-name b/.config/s6-rc/wbg-log/pipeline-name new file mode 100644 index 0000000..b78a029 --- /dev/null +++ b/.config/s6-rc/wbg-log/pipeline-name @@ -0,0 +1 @@ +wbg-pipeline diff --git a/.config/s6-rc/wbg-log/run b/.config/s6-rc/wbg-log/run new file mode 100755 index 0000000..f2f9494 --- /dev/null +++ b/.config/s6-rc/wbg-log/run @@ -0,0 +1,4 @@ +#!/command/execlineb -P +importas -i HOME HOME +exec -c +s6-log -d3 -- t ${HOME}/.local/state/s6/logs/wbg diff --git a/.config/s6-rc/wbg-log/type b/.config/s6-rc/wbg-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/wbg-log/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/wbg/dependencies.d/wayland b/.config/s6-rc/wbg/dependencies.d/wayland new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/wbg/dependencies.d/wayland diff --git a/.config/s6-rc/wbg/finish b/.config/s6-rc/wbg/finish new file mode 100755 index 0000000..b22f9dc --- /dev/null +++ b/.config/s6-rc/wbg/finish @@ -0,0 +1,3 @@ +#!/command/execlineb -P +s6-permafailon 60 10 1-255 +exit diff --git a/.config/s6-rc/wbg/producer-for b/.config/s6-rc/wbg/producer-for new file mode 100644 index 0000000..35b7757 --- /dev/null +++ b/.config/s6-rc/wbg/producer-for @@ -0,0 +1 @@ +wbg-log diff --git a/.config/s6-rc/wbg/run b/.config/s6-rc/wbg/run new file mode 100755 index 0000000..73da181 --- /dev/null +++ b/.config/s6-rc/wbg/run @@ -0,0 +1,8 @@ +#!/command/execlineb -P +fdmove -c 2 1 +multisubstitute { + importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR + importas -i HOME HOME +} +s6-envdir ${XDG_RUNTIME_DIR}/wl_env +wbg ${HOME}/wallpaper diff --git a/.config/s6-rc/wbg/type b/.config/s6-rc/wbg/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/wbg/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/wireplumber-log/consumer-for b/.config/s6-rc/wireplumber-log/consumer-for new file mode 100644 index 0000000..ec8e30f --- /dev/null +++ b/.config/s6-rc/wireplumber-log/consumer-for @@ -0,0 +1 @@ +wireplumber diff --git a/.config/s6-rc/wireplumber-log/notification-fd b/.config/s6-rc/wireplumber-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/wireplumber-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/wireplumber-log/pipeline-name b/.config/s6-rc/wireplumber-log/pipeline-name new file mode 100644 index 0000000..e70298a --- /dev/null +++ b/.config/s6-rc/wireplumber-log/pipeline-name @@ -0,0 +1 @@ +wireplumber-pipeline diff --git a/.config/s6-rc/wireplumber-log/run b/.config/s6-rc/wireplumber-log/run new file mode 100755 index 0000000..291099b --- /dev/null +++ b/.config/s6-rc/wireplumber-log/run @@ -0,0 +1,4 @@ +#!/bin/execlineb -P +importas -i HOME HOME +exec -c +s6-log -d3 -- t ${HOME}/.local/state/s6/logs/wireplumber diff --git a/.config/s6-rc/wireplumber-log/type b/.config/s6-rc/wireplumber-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/wireplumber-log/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/wireplumber/dependencies.d/pipewire b/.config/s6-rc/wireplumber/dependencies.d/pipewire new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/wireplumber/dependencies.d/pipewire diff --git a/.config/s6-rc/wireplumber/dependencies.d/xdg-desktop-portal b/.config/s6-rc/wireplumber/dependencies.d/xdg-desktop-portal new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/wireplumber/dependencies.d/xdg-desktop-portal diff --git a/.config/s6-rc/wireplumber/finish b/.config/s6-rc/wireplumber/finish new file mode 100755 index 0000000..b22f9dc --- /dev/null +++ b/.config/s6-rc/wireplumber/finish @@ -0,0 +1,3 @@ +#!/command/execlineb -P +s6-permafailon 60 10 1-255 +exit diff --git a/.config/s6-rc/wireplumber/producer-for b/.config/s6-rc/wireplumber/producer-for new file mode 100644 index 0000000..e9cd359 --- /dev/null +++ b/.config/s6-rc/wireplumber/producer-for @@ -0,0 +1 @@ +wireplumber-log diff --git a/.config/s6-rc/wireplumber/run b/.config/s6-rc/wireplumber/run new file mode 100755 index 0000000..5780663 --- /dev/null +++ b/.config/s6-rc/wireplumber/run @@ -0,0 +1,3 @@ +#!/bin/execlineb -P +fdmove -c 2 1 +wireplumber diff --git a/.config/s6-rc/wireplumber/type b/.config/s6-rc/wireplumber/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/wireplumber/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/wlsunset-log/consumer-for b/.config/s6-rc/wlsunset-log/consumer-for new file mode 100644 index 0000000..0c4949d --- /dev/null +++ b/.config/s6-rc/wlsunset-log/consumer-for @@ -0,0 +1 @@ +wlsunset diff --git a/.config/s6-rc/wlsunset-log/notification-fd b/.config/s6-rc/wlsunset-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/wlsunset-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/wlsunset-log/pipeline-name b/.config/s6-rc/wlsunset-log/pipeline-name new file mode 100644 index 0000000..4f56ed0 --- /dev/null +++ b/.config/s6-rc/wlsunset-log/pipeline-name @@ -0,0 +1 @@ +wlsunset-pipeline diff --git a/.config/s6-rc/wlsunset-log/run b/.config/s6-rc/wlsunset-log/run new file mode 100755 index 0000000..668705a --- /dev/null +++ b/.config/s6-rc/wlsunset-log/run @@ -0,0 +1,4 @@ +#!/bin/execlineb -P +importas -i HOME HOME +exec -c +s6-log -d3 -- t ${HOME}/.local/state/s6/logs/wlsunset diff --git a/.config/s6-rc/wlsunset-log/type b/.config/s6-rc/wlsunset-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/wlsunset-log/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/wlsunset/dependencies.d/wayland b/.config/s6-rc/wlsunset/dependencies.d/wayland new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/wlsunset/dependencies.d/wayland diff --git a/.config/s6-rc/wlsunset/finish b/.config/s6-rc/wlsunset/finish new file mode 100755 index 0000000..b22f9dc --- /dev/null +++ b/.config/s6-rc/wlsunset/finish @@ -0,0 +1,3 @@ +#!/command/execlineb -P +s6-permafailon 60 10 1-255 +exit diff --git a/.config/s6-rc/wlsunset/producer-for b/.config/s6-rc/wlsunset/producer-for new file mode 100644 index 0000000..8e4f411 --- /dev/null +++ b/.config/s6-rc/wlsunset/producer-for @@ -0,0 +1 @@ +wlsunset-log diff --git a/.config/s6-rc/wlsunset/run b/.config/s6-rc/wlsunset/run new file mode 100755 index 0000000..933e919 --- /dev/null +++ b/.config/s6-rc/wlsunset/run @@ -0,0 +1,5 @@ +#!/bin/execlineb -P +fdmove -c 2 1 +importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR +s6-envdir ${XDG_RUNTIME_DIR}/wl_env +wlsunset -l 36.2 -L 81.7 diff --git a/.config/s6-rc/wlsunset/type b/.config/s6-rc/wlsunset/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/wlsunset/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/xdg-desktop-portal-log/consumer-for b/.config/s6-rc/xdg-desktop-portal-log/consumer-for new file mode 100644 index 0000000..8f7c009 --- /dev/null +++ b/.config/s6-rc/xdg-desktop-portal-log/consumer-for @@ -0,0 +1 @@ +xdg-desktop-portal diff --git a/.config/s6-rc/xdg-desktop-portal-log/notification-fd b/.config/s6-rc/xdg-desktop-portal-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/xdg-desktop-portal-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/xdg-desktop-portal-log/pipeline-name b/.config/s6-rc/xdg-desktop-portal-log/pipeline-name new file mode 100644 index 0000000..f31d587 --- /dev/null +++ b/.config/s6-rc/xdg-desktop-portal-log/pipeline-name @@ -0,0 +1 @@ +xdg-desktop-portal-pipeline diff --git a/.config/s6-rc/xdg-desktop-portal-log/run b/.config/s6-rc/xdg-desktop-portal-log/run new file mode 100755 index 0000000..0f16b96 --- /dev/null +++ b/.config/s6-rc/xdg-desktop-portal-log/run @@ -0,0 +1,4 @@ +#!/bin/execlineb -P +importas -i HOME HOME +exec -c +s6-log -d3 -- t ${HOME}/.local/state/s6/logs/xdg-desktop-portal diff --git a/.config/s6-rc/xdg-desktop-portal-log/type b/.config/s6-rc/xdg-desktop-portal-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/xdg-desktop-portal-log/type @@ -0,0 +1 @@ +longrun diff --git a/.config/s6-rc/xdg-desktop-portal/dependencies.d/dbus b/.config/s6-rc/xdg-desktop-portal/dependencies.d/dbus new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/xdg-desktop-portal/dependencies.d/dbus diff --git a/.config/s6-rc/xdg-desktop-portal/dependencies.d/pipewire b/.config/s6-rc/xdg-desktop-portal/dependencies.d/pipewire new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/xdg-desktop-portal/dependencies.d/pipewire diff --git a/.config/s6-rc/xdg-desktop-portal/dependencies.d/wayland b/.config/s6-rc/xdg-desktop-portal/dependencies.d/wayland new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/s6-rc/xdg-desktop-portal/dependencies.d/wayland diff --git a/.config/s6-rc/xdg-desktop-portal/finish b/.config/s6-rc/xdg-desktop-portal/finish new file mode 100755 index 0000000..b22f9dc --- /dev/null +++ b/.config/s6-rc/xdg-desktop-portal/finish @@ -0,0 +1,3 @@ +#!/command/execlineb -P +s6-permafailon 60 10 1-255 +exit diff --git a/.config/s6-rc/xdg-desktop-portal/notification-fd b/.config/s6-rc/xdg-desktop-portal/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/.config/s6-rc/xdg-desktop-portal/notification-fd @@ -0,0 +1 @@ +3 diff --git a/.config/s6-rc/xdg-desktop-portal/producer-for b/.config/s6-rc/xdg-desktop-portal/producer-for new file mode 100644 index 0000000..67fad61 --- /dev/null +++ b/.config/s6-rc/xdg-desktop-portal/producer-for @@ -0,0 +1 @@ +xdg-desktop-portal-log diff --git a/.config/s6-rc/xdg-desktop-portal/run b/.config/s6-rc/xdg-desktop-portal/run new file mode 100755 index 0000000..5c814c3 --- /dev/null +++ b/.config/s6-rc/xdg-desktop-portal/run @@ -0,0 +1,6 @@ +#!/bin/execlineb -P +fdmove -c 2 1 +importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR +s6-envdir ${XDG_RUNTIME_DIR}/wl_env +dbus-waiter -n3 -b org.freedesktop.portal.Desktop +/usr/libexec/xdg-desktop-portal diff --git a/.config/s6-rc/xdg-desktop-portal/type b/.config/s6-rc/xdg-desktop-portal/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/.config/s6-rc/xdg-desktop-portal/type @@ -0,0 +1 @@ +longrun diff --git a/.config/sway/config b/.config/sway/config new file mode 100644 index 0000000..82d7345 --- /dev/null +++ b/.config/sway/config @@ -0,0 +1,186 @@ +include catppuccin-mocha + +set $mod Mod4 +set $left h +set $down j +set $up k +set $right l +set $term foot +set $menu wmenu-run + +input type:pointer { + left_handed enabled +} + +input type:keyboard { + repeat_delay 300 + repeat_rate 40 +} + + bindsym $mod+Return exec $term + bindsym $mod+p exec $menu + bindsym $mod+Shift+q kill + bindsym $mod+Shift+c reload + bindsym $mod+Shift+e exec wmenu-yesno 'Really exit?' swaymsg exit + floating_modifier $mod normal + + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + bindsym $mod+Shift+$left move left 10px + bindsym $mod+Shift+$down move down 10px + bindsym $mod+Shift+$up move up 10px + bindsym $mod+Shift+$right move right 10px + + bindsym $mod+Shift+Left move left 10px + bindsym $mod+Shift+Down move down 10px + bindsym $mod+Shift+Up move up 10px + bindsym $mod+Shift+Right move right 10px + + bindsym $mod+Mod1+Shift+$left move left 1px + bindsym $mod+Mod1+Shift+$down move down 1px + bindsym $mod+Mod1+Shift+$up move up 1px + bindsym $mod+Mod1+Shift+$right move right 1px + + bindsym $mod+Mod1+Shift+Left move left 1px + bindsym $mod+Mod1+Shift+Down move down 1px + bindsym $mod+Mod1+Shift+Up move up 1px + bindsym $mod+Mod1+Shift+Right move right 1px + + bindsym $mod+1 workspace number 1 + bindsym $mod+2 workspace number 2 + bindsym $mod+3 workspace number 3 + bindsym $mod+4 workspace number 4 + bindsym $mod+5 workspace number 5 + bindsym $mod+6 workspace number 6 + bindsym $mod+7 workspace number 7 + bindsym $mod+8 workspace number 8 + bindsym $mod+9 workspace number 9 + + bindsym $mod+Shift+1 move container to workspace number 1 + bindsym $mod+Shift+2 move container to workspace number 2 + bindsym $mod+Shift+3 move container to workspace number 3 + bindsym $mod+Shift+4 move container to workspace number 4 + bindsym $mod+Shift+5 move container to workspace number 5 + bindsym $mod+Shift+6 move container to workspace number 6 + bindsym $mod+Shift+7 move container to workspace number 7 + bindsym $mod+Shift+8 move container to workspace number 8 + bindsym $mod+Shift+9 move container to workspace number 9 + + bindsym $mod+b splith + bindsym $mod+v splitv + + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + bindsym $mod+f fullscreen + + bindsym $mod+Shift+space floating toggle + bindsym $mod+space focus mode_toggle + + bindsym $mod+a focus parent + + bindsym $mod+Shift+minus move scratchpad + bindsym $mod+minus scratchpad show + +mode "resize" { + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + bindsym Mod1+$left resize shrink width 1px + bindsym Mod1+$down resize grow height 1px + bindsym Mod1+$up resize shrink height 1px + bindsym Mod1+$right resize grow width 1px + + bindsym Mod1+Left resize shrink width 1px + bindsym Mod1+Down resize grow height 1px + bindsym Mod1+Up resize shrink height 1px + bindsym Mod1+Right resize grow width 1px + + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +bindsym XF86MonBrightnessUp exec brightctl +5 +bindsym XF86MonBrightnessDown exec brightctl -5 +bindsym XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_SINK@ 5%+ +bindsym XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_SINK@ 5%- +bindsym XF86AudioMute exec wpctl set-mute @DEFAULT_SINK@ toggle + +font 'FiraCode Nerd Font 11' + +set $gap 6 + +gaps inner $gap + +titlebar_border_thickness 2 + +# target border bg text indicator child_border +client.focused $overlay0 $overlay0 $text $overlay0 $overlay0 +client.focused_inactive $surface0 $surface0 $text $overlay0 $surface0 +client.unfocused $mantle $mantle $text $overlay0 $mantle +client.urgent $red $red $base $overlay0 $red +client.background $base + +bar { + position top + output eDP-1 + + status_command statusbar + separator_symbol '' + pango_markup enabled + status_padding 6 + status_edge_padding 0 + workspace_min_width 32 + gaps $gap + + font 'FiraCode Nerd Font 11' + + colors { + background $base + statusline $text + # separator + # focused_background + # focused_statusline + # focused_separator + focused_workspace $blue $blue $base + active_workspace $surface0 $surface0 $overlay2 + inactive_workspace $base $base $overlay2 + urgent_workspace $base $base $red + binding_mode $base $base $red + } +} + +output HEADLESS-1 { + resolution 472x96 + position 1920,0 + bg '#000000' solid_color +} +workspace 10 output HEADLESS-1 +bindsym $mod+0 workspace number 10 +bindsym $mod+Shift+0 move container to workspace number 10 + +exec printf %s\\n "$WAYLAND_DISPLAY" >"$XDG_RUNTIME_DIR"/wl_env/WAYLAND_DISPLAY +exec printf %s\\n "$DISPLAY" >"$XDG_RUNTIME_DIR"/wl_env/DISPLAY +exec printf %s\\n "$SWAYSOCK" >"$XDG_RUNTIME_DIR"/wl_env/SWAYSOCK +exec printf %s\\n "$I3SOCK" >"$XDG_RUNTIME_DIR"/wl_env/I3SOCK +exec dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP=sway +exec printf \\n >"$XDG_RUNTIME_DIR"/service/sway/data/ready + +include /etc/sway/config.d/* diff --git a/.config/swayidle/config b/.config/swayidle/config new file mode 100644 index 0000000..f95ca57 --- /dev/null +++ b/.config/swayidle/config @@ -0,0 +1,3 @@ +timeout 180 'brightctl -20' resume 'brightctl +20' +timeout 285 'swaymsg output \* power off' resume 'swaymsg output \* power on' +timeout 300 'powerctl mem & waylock' diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs new file mode 100644 index 0000000..7f9a959 --- /dev/null +++ b/.config/user-dirs.dirs @@ -0,0 +1,15 @@ +# This file is written by xdg-user-dirs-update +# If you want to change or add directories, just edit the line you're +# interested in. All local changes will be retained on the next run. +# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped +# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an +# absolute path. No other format is supported. +# +XDG_DESKTOP_DIR="$HOME/Desktop" +XDG_DOWNLOAD_DIR="$HOME/Downloads" +XDG_TEMPLATES_DIR="$HOME/Templates" +XDG_PUBLICSHARE_DIR="$HOME/Public" +XDG_DOCUMENTS_DIR="$HOME/Documents" +XDG_MUSIC_DIR="$HOME/Music" +XDG_PICTURES_DIR="$HOME/Pictures" +XDG_VIDEOS_DIR="$HOME/Videos" diff --git a/.config/user-dirs.locale b/.config/user-dirs.locale new file mode 100644 index 0000000..96d80cd --- /dev/null +++ b/.config/user-dirs.locale @@ -0,0 +1 @@ +C
\ No newline at end of file diff --git a/.config/vis/lexers/execline.lua b/.config/vis/lexers/execline.lua new file mode 100644 index 0000000..cb79c8d --- /dev/null +++ b/.config/vis/lexers/execline.lua @@ -0,0 +1,64 @@ +-- Copyright 2023 Sam Nystrom <sam@samnystrom.dev> +-- Execline LPeg lexer. + +local l = require('lexer') +local token, word_match = l.token, l.word_match +local P, R, S = lpeg.P, lpeg.R, lpeg.S + +local M = {_NAME = 'execline'} + +-- Whitespace. +local ws = token(l.WHITESPACE, l.space^1) + +-- Comments. +local comment = token(l.COMMENT, l.starts_line(S('#')) * l.nonnewline^0) + +-- Strings. +local sq_str = l.range("'") +local dq_str = l.range('"') +local string = token(l.STRING, sq_str + dq_str) + +-- Numbers. +local dec = l.digit^1 * ('_' * l.digit^1)^0 +local oct_num = '0' * S('01234567_')^1 +local integer = S('+-')^-1 * (l.hex_num + oct_num + dec) +local number = token(l.NUMBER, (l.float + integer)) + +-- Keywords. +local keyword = token(l.KEYWORD, word_match{ + 'execlineb', 'execline-cd', 'posix-cd', 'execline-umask', 'posix-umask', + 'emptyenv', 'envfile', 'export', 'unexport', 'fdclose', 'fdblock', 'fdmove', + 'fdswap', 'fdreserve', 'redirfd', 'piperw', 'heredoc', 'wait', 'getcwd', + 'getpid', 'exec', 'tryexec', 'exit', 'trap', 'withstdinas', + 'foreground', 'background', 'case', 'if', 'ifelse', 'ifte', 'ifthenelse', + 'backtick', 'pipeline', 'runblock', + 'define', 'importas', 'elglob', 'elgetpositionals', 'multidefine', + 'multisubstitute', + 'forx', 'forstdin', 'forbacktickx', 'loopwhilex', + 'elgetopt', 'shift', 'dollarat', + 'eltest', 'homeof', + 'execline' +}) + +-- Identifiers. +local identifier = token(l.IDENTIFIER, l.word) + +local variable = token(l.VARIABLE, '$' * (l.word + l.range('{}', true, true, true))) + +-- Operators. +local operator = token(l.OPERATOR, S('{}')) + +M._rules = { + {'whitespace', ws}, + {'keyword', keyword}, + {'identifier', identifier}, + {'string', string}, + {'comment', comment}, + {'number', number}, + {'variable', variable}, + {'operator', operator}, +} + +M._LEXBYLINE = true + +return M diff --git a/.config/vis/lexers/hare.lua b/.config/vis/lexers/hare.lua new file mode 100644 index 0000000..0aacad3 --- /dev/null +++ b/.config/vis/lexers/hare.lua @@ -0,0 +1,82 @@ +-- Copyright 2023 Sam Nystrom <sam@samnystrom.dev> +-- Hare LPeg lexer + +local l = require('lexer') +local C, Cmt, P, R, S = lpeg.C, lpeg.Cmt, lpeg.P, lpeg.R, lpeg.S + +local lex = l.new('hare') + +-- Whitespace +lex:add_rule('whitespace', l.token(l.WHITESPACE, l.space^1)) + +-- Comments +lex:add_rule('comment', l.token(l.COMMENT, l.to_eol('//', true))) + +-- Keywords +lex:add_rule('keyword', l.token(l.KEYWORD, l.word_match{ + 'as', 'is', + 'if', 'else', 'match', 'switch', + 'break', 'continue', 'defer', 'return', 'yield', + 'const', 'def', 'let', + 'fn', + 'case', + 'for', + 'export', 'static', + 'enum', 'struct', 'union', + 'type', +})) + +-- Builtins +lex:add_rule('function', l.token(l.FUNCTION, l.word_match{ + 'abort', 'assert', + 'align', 'len', 'offset', + 'alloc', 'free', + 'append', 'insert', 'delete', + -- C ABI + 'vastart', 'vaarg', 'vaend', +})) + +-- Types +lex:add_rule('type', l.token(l.TYPE, l.word_match{ + 'bool', + 'f32', 'f64', + 'i8', 'i16', 'i32', 'i64', 'u8', 'u16', 'u32', 'u64', + 'size', 'int', 'uint', 'uintptr', + 'never', + 'nullable', + 'opaque', + 'rune', 'str', + 'void', + -- C ABI + 'valist', +})) + +-- Constants +lex:add_rule('constant', l.token(l.CONSTANT, l.word_match{'true', 'false', 'null'})) + +-- Numbers +--[[local identifier = P('r#')^-1 * l.word +local function opt_cap(patt) return C(patt^-1) end +local float = l.digit * + (Cmt(opt_cap('.' * l.digit) * opt_cap(S('eE') * S('+-')^-1 * l.digit) * + opt_cap(P('f32') + 'f64'), function(input, index, decimals, exponent, type) + return decimals ~= "" or exponent ~= "" or type ~= "" + end) + '.' * -(S('._') + identifier)) +local bin = P('0b') * S('01') +local oct = P('0o') * lpeg.R('07') +local hex = P('0x') * l.xdigit +local integer = (bin + oct + hex + decimal_literal) * + (S('iu') * (P('8') + '16' + '32' + '64' + '128' + 'size'))^-1 +--]] +lex:add_rule('number', l.token(l.NUMBER, l.float + l.integer)) + +-- Strings +lex:add_rule('string', l.token(l.STRING, l.range('"') + l.range('\''))) + +-- Operators +lex:add_rule('operator', l.token(l.OPERATOR, S('+-/*<>!=@~&|^?:;,.()[]{}'))) + +lex:add_fold_point(l.OPERATOR, '{', '}') +lex:add_fold_point(l.COMMENT, l.fold_consecutive_lines('//')) + +return lex diff --git a/.config/vis/lexers/roff.lua b/.config/vis/lexers/roff.lua new file mode 100644 index 0000000..59657a7 --- /dev/null +++ b/.config/vis/lexers/roff.lua @@ -0,0 +1,32 @@ +-- Copyright 2023 Sam Nystrom <sam@samnystrom.dev> +-- Roff LPeg lexer. + +local l = require('lexer') +local token, word_match = l.token, l.word_match +local P, R, S = lpeg.P, lpeg.R, lpeg.S + +local M = {_NAME = 'roff'} + +-- Whitespace +local ws = token(l.WHITESPACE, l.space^1) + +-- Comments +local comment = token(l.COMMENT, '\\"' * l.nonnewline^0) + +-- Strings +local string = token(l.STRING, l.delimited_range('"')) + +-- Keywords +local word = (l.alpha + '_') * (l.alnum + S('_.'))^0 +local keyword = token(l.KEYWORD, l.starts_line('.') * l.word) + +M._rules = { + {'whitespace', ws}, + {'keyword', keyword}, + {'string', string}, + {'comment', comment}, +} + +M._LEXBYLINE = true + +return M diff --git a/.config/vis/themes/flexoki.lua b/.config/vis/themes/flexoki.lua new file mode 100644 index 0000000..e540a00 --- /dev/null +++ b/.config/vis/themes/flexoki.lua @@ -0,0 +1,125 @@ +local mode = 'dark' -- one of 'dark' or 'light' + +local colors = { + black = '#100f0f', + base950 = '#1c1b1a', + base900 = '#282726', + base850 = '#343331', + base800 = '#403e3c', + base700 = '#575653', + base600 = '#6f6e69', + base500 = '#878580', + base300 = '#b7b5ac', + base200 = '#cecdc3', + base150 = '#dad8ce', + base100 = '#e6e4d9', + base50 = '#f2f0e5', + paper = '#fffcf0', + red600 = '#af3029', + orange600 = '#bc5215', + yellow600 = '#ad8301', + green600 = '#66800b', + cyan600 = '#24837b', + blue600 = '#205ea6', + purple600 = '#5e409d', + magenta600 = '#a02f6f', + red400 = '#d14d41', + orange400 = '#da702c', + yellow400 = '#d0a215', + green400 = '#879a39', + cyan400 = '#3aa99f', + blue400 = '#4385be', + purple400 = '#8b7ec8', + magenta400 = '#ce5d97', +} + +if mode == 'light' then + colors.bg = colors.paper + colors.bg2 = colors.base50 + colors.ui = colors.base100 + colors.ui2 = colors.base150 + colors.ui3 = colors.base200 + colors.tx3 = colors.base300 + colors.tx2 = colors.base600 + colors.tx = colors.black + + colors.re = colors.red600 + colors.ng = colors.orange600 + colors.ye = colors.yellow600 + colors.gr = colors.green600 + colors.cy = colors.cyan600 + colors.bl = colors.blue600 + colors.pu = colors.purple600 + colors.ma = colors.magenta600 + + colors.re2 = colors.red400 + colors.ng2 = colors.orange400 + colors.ye2 = colors.yellow400 + colors.gr2 = colors.green400 + colors.cy2 = colors.cyan400 + colors.bl2 = colors.blue400 + colors.pu2 = colors.purple400 + colors.ma2 = colors.magenta400 +else + colors.bg = colors.black + colors.bg2 = colors.base950 + colors.ui = colors.base900 + colors.ui2 = colors.base850 + colors.ui3 = colors.base800 + colors.tx3 = colors.base700 + colors.tx2 = colors.base500 + colors.tx = colors.base200 + + colors.re = colors.red400 + colors.ng = colors.orange400 + colors.ye = colors.yellow400 + colors.gr = colors.green400 + colors.cy = colors.cyan400 + colors.bl = colors.blue400 + colors.pu = colors.purple400 + colors.ma = colors.magenta400 + + colors.re2 = colors.red600 + colors.ng2 = colors.orange600 + colors.ye2 = colors.yellow600 + colors.gr2 = colors.green600 + colors.cy2 = colors.cyan600 + colors.bl2 = colors.blue600 + colors.pu2 = colors.purple600 + colors.ma2 = colors.magenta600 +end + +vis.lexers.STYLE_DEFAULT = 'fore:'..colors.tx..',back:'..colors.bg +vis.lexers.STYLE_NOTHING = '' +vis.lexers.STYLE_CLASS = 'fore:'..colors.ng +vis.lexers.STYLE_COMMENT = 'fore:'..colors.tx3 +vis.lexers.STYLE_CONSTANT = 'fore:'..colors.ye +vis.lexers.STYLE_DEFINITION = 'fore:'..colors.ng +vis.lexers.STYLE_ERROR = 'fore:'..colors.re2..',bold' +vis.lexers.STYLE_FUNCTION = 'fore:'..colors.ng +vis.lexers.STYLE_KEYWORD = 'fore:'..colors.gr +vis.lexers.STYLE_LABEL = 'fore:'..colors.gr +vis.lexers.STYLE_NUMBER = 'fore:'..colors.pu +vis.lexers.STYLE_OPERATOR = 'fore:'..colors.tx2 +vis.lexers.STYLE_REGEX = 'fore:'..colors.cy +vis.lexers.STYLE_STRING = 'fore:'..colors.cy +vis.lexers.STYLE_PREPROCESSOR = 'fore:'..colors.ma +vis.lexers.STYLE_TAG = 'fore:'..colors.cy +vis.lexers.STYLE_TYPE = 'fore:'..colors.gr +vis.lexers.STYLE_VARIABLE = 'fore:'..colors.re..',bold' +vis.lexers.STYLE_WHITESPACE = 'fore:'..colors.tx3 +vis.lexers.STYLE_EMBEDDED = 'fore:'..colors.re..',bold' +vis.lexers.STYLE_IDENTIFIER = 'fore:'..colors.bl + +vis.lexers.STYLE_LINENUMBER = 'fore:'..colors.tx3 +vis.lexers.STYLE_LINENUMBER_CURSOR = 'fore:'..colors.tx +vis.lexers.STYLE_CURSOR = 'fore:'..colors.bg..',back:'..colors.tx +vis.lexers.STYLE_CURSOR_PRIMARY = 'fore:'..colors.bg..',back:'..colors.tx +vis.lexers.STYLE_CURSOR_LINE = 'back:'..colors.bg2 +vis.lexers.STYLE_COLOR_COLUMN = 'back:'..colors.ui +vis.lexers.STYLE_SELECTION = 'back:'..colors.ui +vis.lexers.STYLE_STATUS = 'fore:'..colors.tx2..',back:'..colors.ui +vis.lexers.STYLE_STATUS_FOCUSED = 'fore:'..colors.tx..',back:'..colors.ui2 +vis.lexers.STYLE_SEPARATOR = 'fore:'..colors.ui3 +vis.lexers.STYLE_INFO = 'fore:'..colors.ye..',bold' +vis.lexers.STYLE_EOF = 'fore:'..colors.tx3
\ No newline at end of file diff --git a/.config/vis/visrc.lua b/.config/vis/visrc.lua new file mode 100644 index 0000000..982056e --- /dev/null +++ b/.config/vis/visrc.lua @@ -0,0 +1,65 @@ +require('vis') + +require('plugins/vis-backspace') +require('plugins/vis-ctags') +require('plugins/vis-cursors') +require('plugins/vis-editorconfig') +require('plugins/vis-quickfix') + +for _, ext in ipairs({ "%.jsx$", "%.ts", "%.tsx$" }) do + table.insert(vis.ftdetect.filetypes.javascript.ext, ext) +end + +for _, ext in ipairs({ "^Containerfile$", "%.Containerfile$" }) do + table.insert(vis.ftdetect.filetypes.dockerfile.ext, ext) +end + +vis.ftdetect.filetypes.hare = { + ext = { "%.ha$" }, +} + +shebangs = { + awk = { "awk" }, + bash = { "bash", "sh" }, + execline = { "execlineb" }, + perl = { "perl" }, + python = { "python", "python3" }, +} + +vis.events.subscribe(vis.events.WIN_OPEN, function(win) + local shebang = vis.win.file.lines[1] + local cmd = shebang:match("^#!%g*/([^/%s]+)") + if cmd == "env" then + cmd = shebang:match("^#!%g*/env (%g+)") + end + for syntax, cmds in pairs(shebangs) do + for _, c in ipairs(cmds) do + if c == cmd then + vis:command("set syntax " .. syntax) + return + end + end + end +end) + +vis.events.subscribe(vis.events.INIT, function() + vis:command('set escdelay 25') + vis:command('set autoindent') + vis:command('set theme flexoki') +end) + +vis.events.subscribe(vis.events.WIN_OPEN, function(win) + vis:command('set relativenumbers') +end) + +function automake_handler() + vis:command('make') +end + +vis:option_register('automake', 'bool', function(value, toggle) + if toggle then + vis.events.subscribe(vis.events.FILE_SAVE_POST, automake_handler) + else + vis.events.unsubscribe(vis.events.FILE_SAVE_POST, automake_handler) + end +end, 'Run :make automatically after saving') diff --git a/.config/waywall/flake.lock b/.config/waywall/flake.lock new file mode 100644 index 0000000..128df5b --- /dev/null +++ b/.config/waywall/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1763966396, + "narHash": "sha256-6eeL1YPcY1MV3DDStIDIdy/zZCDKgHdkCmsrLJFiZf0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5ae3b07d8d6527c42f17c876e404993199144b6a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/.config/waywall/flake.nix b/.config/waywall/flake.nix new file mode 100644 index 0000000..a463acc --- /dev/null +++ b/.config/waywall/flake.nix @@ -0,0 +1,57 @@ +{ + description = "Ninjabrain Bot - Minecraft speedrunning utility"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + ninjabrain-bot = pkgs.stdenv.mkDerivation { + pname = "ninjabrain-bot"; + version = "1.5.1"; + + src = pkgs.fetchurl { + url = "https://github.com/Ninjabrain1/Ninjabrain-Bot/releases/download/1.5.1/Ninjabrain-Bot-1.5.1.jar"; + sha256 = "sha256-Rxu9A2EiTr69fLBUImRv+RLC2LmosawIDyDPIaRcrdw="; + }; + + dontUnpack = true; + + nativeBuildInputs = [ pkgs.makeWrapper ]; + + installPhase = '' + mkdir -p $out/bin $out/share/ninjabrain-bot + cp $src $out/share/ninjabrain-bot/ninjabrain-bot.jar + + makeWrapper ${pkgs.jre8}/bin/java $out/bin/ninjabrain-bot \ + --add-flags "-Dawt.useSystemAAFontSettings=on" \ + --add-flags "-jar $out/share/ninjabrain-bot/ninjabrain-bot.jar" \ + --prefix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath [ + pkgs.libxkbcommon + pkgs.xorg.libX11 + pkgs.xorg.libXt + ]} + ''; + + meta = with pkgs.lib; { + description = "Stronghold calculator for Minecraft speedrunning"; + homepage = "https://github.com/Ninjabrain1/Ninjabrain-Bot"; + license = licenses.mit; + platforms = platforms.linux; + }; + }; + in + { + packages.default = ninjabrain-bot; + apps.default = { + type = "app"; + program = "${ninjabrain-bot}/bin/ninjabrain-bot"; + }; + } + ); +} diff --git a/.config/waywall/init.lua b/.config/waywall/init.lua new file mode 100644 index 0000000..853ac64 --- /dev/null +++ b/.config/waywall/init.lua @@ -0,0 +1,224 @@ +local waywall = require("waywall") +local helpers = require("waywall.helpers") + +local Scene = require("waywork.scene") +local Modes = require("waywork.modes") +local Keys = require("waywork.keys") +local Processes = require("waywork.processes") + +local scene = Scene.SceneManager.new(waywall) +local ModeManager = Modes.ModeManager.new(waywall) + +local waywall_config_path = os.getenv("HOME") .. "/.config/waywall" + +--[[ +celeste menu colors: + +light pink: ff92b1 +lavender: 9768e4 +med green: 419462 +pale yellow: ffff99 +gray blue: 759cb2 +dark gray blue: 36527c +dark gray: 3b566b +cyan: 53cfde +brick red: ba5358 +med yellow: fff672 +royal purple: 8d24ed +pale pink: eb82ff +sky blue: 54b0ff +cornflower blue: 606de7 +gold: ffea42 +med blue: 448ede +deep red: 8a2939 +brightish red: f53c4c + +--]] + +local bg_color = "#ffffff" + +local pie_colors = { + entities = { pie = "#e446c4", text = "#e145c2", out = "#f225fc" }, + unspecified = { pie = "#46ce66", text = "#45cc65", out = "#56f440" }, + blockEntities = { pie = "#ec6e4e", text = "#e96d4d", out = "#f48769" }, + destroyProgress = { pie = "#cc6c46", text = "#ca6b45", out = "#c78b56" }, + mob_spawner = { pie = "#4ee4cc", text = "#4de1ca", out = "#63f9fb" }, + chest = { pie = "#c66ee4", text = "#c46de1", out = "#e75dfc" }, +} + +local normal_sens = 12.800000599064097 +local tall_sens = 0.8634803836976988 + +local pie_dst = { x = 1200, y = 400, w = 340, h = 340 } +local percent_dst = { x = 1280, y = 800, w = 34 * 6, h = 25 * 6 } +local eye_dst = { x = 30, y = 340, w = 700, h = 400 } + +local f3_root = { x = 1200, y = 150 } +local f3_scale = 5 +local f3_text_color = "#48106e" + +function add_f3_scene(name, row, col, len, groups) + scene:register(name, { + kind = "mirror", + options = { + src = { x = col * 6 + 1, y = row * 9 + 1, w = len * 6, h = 9 }, + dst = { x = f3_root.x, y = f3_root.y, w = len * 6 * f3_scale, h = 9 * f3_scale }, + color_key = { + input = "#dddddd", + output = f3_text_color, + }, + depth = 1, + }, + groups = groups, + }) + f3_root.y = f3_root.y + 9 * f3_scale +end + +add_f3_scene("c_counter", 3, 0, 11, { "thin", "tall" }) +add_f3_scene("e_counter", 4, 0, 8, { "thin", "tall" }) + +for _, name in ipairs({ "wide", "thin", "tall" }) do + scene:register(name .. "_bg", { + kind = "image", + path = waywall_config_path .. "/resources/" .. name .. "_bg.png", + options = { + dst = { x = 0, y = 0, w = 1920, h = 1080 }, + }, + groups = { name }, + }) +end + +scene:register("bubble", { + kind = "image", + path = waywall_config_path .. "/resources/bubble_pie.png", + options = { + dst = pie_dst, + depth = -1 + }, + groups = { "thin", "tall" }, +}) + +for name, colors in pairs(pie_colors) do + scene:register("thin_pie_" .. name, { + kind = "mirror", + options = { + src = { x = 9, y = 680, w = 321, h = 160 }, + dst = pie_dst, + color_key = { input = colors.pie, output = colors.out }, + }, + groups = { "thin" }, + }) + + scene:register("tall_pie_" .. name, { + kind = "mirror", + options = { + src = { x = 9, y = 15984, w = 321, h = 160 }, + dst = pie_dst, + color_key = { input = colors.pie, output = colors.out }, + }, + groups = { "tall" }, + }) + scene:register("thin_percent_" .. name, { + kind = "mirror", + options = { + src = { x = 247, y = 859, w = 34, h = 25 }, + dst = percent_dst, + color_key = { input = colors.text, output = colors.out }, + depth = 1, + }, + groups = { "thin" }, + }) + scene:register("tall_percent_" .. name, { + kind = "mirror", + options = { + src = { x = 247, y = 16163, w = 34, h = 25 }, + dst = percent_dst, + color_key = { input = colors.text, output = colors.out }, + depth = 1, + }, + groups = { "tall" }, + }) +end + +scene:register("eye_measure", { + kind = "mirror", + options = { + src = { x = 140, y = 7902, w = 60, h = 580 }, + dst = eye_dst, + }, + groups = { "tall" }, +}) + +scene:register("eye_overlay", { + kind = "image", + path = waywall_config_path .. "/resources/measuring_overlay.png", + options = { dst = eye_dst }, + groups = { "tall" }, +}) + +ModeManager:define("thin", { + width = 340, + height = 1080, + on_enter = function() scene:enable_group("thin", true) end, + on_exit = function() scene:enable_group("thin", false) end, +}) + +ModeManager:define("tall", { + width = 340, + height = 16384, + on_enter = function() + scene:enable_group("tall", true) + waywall.set_sensitivity(tall_sens) + end, + on_exit = function() + scene:enable_group("tall", false) + waywall.set_sensitivity(normal_sens) + end, + toggle_guard = function() return not waywall.get_key("F3") end, +}) + +ModeManager:define("wide", { + width = 1920, + height = 300, + on_enter = function() scene:enable_group("wide", true) end, + on_exit = function() scene:enable_group("wide", false) end, +}) + +local ninbot_path = waywall_config_path .. "/result/bin/ninjabrain-bot" +local ensure_ninbot = Processes.ensure_application(waywall, ninbot_path)("[Nn]injabrain.*\\.jar") + +return { + input = { + layout = "us", + variant = "colemak_dh", + repeat_rate = 40, + repeat_delay = 300, + sensitivity = normal_sens, + confine_pointer = false, + remaps = { + ["MB5"] = "F3", + ["Enter"] = "Esc", + }, + }, + theme = { + background = bg_color, + ninb_anchor = "bottomright", + ninb_opacity = 1.0, + }, + experimental = { + debug = false, + jit = false, + tearing = false, + scene_add_text = true, + }, + actions = Keys.actions({ + ["*-F2"] = function() return ModeManager:toggle("thin") end, + ["*-F4"] = function() return ModeManager:toggle("tall") end, + ["*-apostrophe"] = function() return ModeManager:toggle("wide") end, + ["*-Alt_L"] = function() + ensure_ninbot() + helpers.toggle_floating() + end, + ["*-Shift-f"] = waywall.toggle_fullscreen, + }), +} diff --git a/.config/waywall/resources/bubble_pie.png b/.config/waywall/resources/bubble_pie.png Binary files differnew file mode 100644 index 0000000..b721bbf --- /dev/null +++ b/.config/waywall/resources/bubble_pie.png diff --git a/.config/waywall/resources/measuring_overlay.png b/.config/waywall/resources/measuring_overlay.png Binary files differnew file mode 100644 index 0000000..eb3a666 --- /dev/null +++ b/.config/waywall/resources/measuring_overlay.png diff --git a/.config/waywall/resources/tall_bg.png b/.config/waywall/resources/tall_bg.png Binary files differnew file mode 100644 index 0000000..873ad11 --- /dev/null +++ b/.config/waywall/resources/tall_bg.png diff --git a/.config/waywall/resources/thin_bg.png b/.config/waywall/resources/thin_bg.png Binary files differnew file mode 100644 index 0000000..8e8e617 --- /dev/null +++ b/.config/waywall/resources/thin_bg.png diff --git a/.config/waywall/resources/wide_bg.png b/.config/waywall/resources/wide_bg.png Binary files differnew file mode 100644 index 0000000..e353758 --- /dev/null +++ b/.config/waywall/resources/wide_bg.png diff --git a/LICENSE b/.config/waywall/waywork/LICENSE index c388b70..c388b70 100644 --- a/LICENSE +++ b/.config/waywall/waywork/LICENSE diff --git a/README.md b/.config/waywall/waywork/README.md index 5850eb0..5850eb0 100644 --- a/README.md +++ b/.config/waywall/waywork/README.md diff --git a/core.lua b/.config/waywall/waywork/core.lua index f8cd76b..f8cd76b 100644 --- a/core.lua +++ b/.config/waywall/waywork/core.lua diff --git a/keys.lua b/.config/waywall/waywork/keys.lua index 1bb18e1..1bb18e1 100644 --- a/keys.lua +++ b/.config/waywall/waywork/keys.lua diff --git a/modes.lua b/.config/waywall/waywork/modes.lua index 3bf0047..3bf0047 100644 --- a/modes.lua +++ b/.config/waywall/waywork/modes.lua diff --git a/processes.lua b/.config/waywall/waywork/processes.lua index 4ba61e8..4ba61e8 100644 --- a/processes.lua +++ b/.config/waywall/waywork/processes.lua diff --git a/scene.lua b/.config/waywall/waywork/scene.lua index bbb670a..bbb670a 100644 --- a/scene.lua +++ b/.config/waywall/waywork/scene.lua diff --git a/.config/xdg-desktop-portal-wlr/config b/.config/xdg-desktop-portal-wlr/config new file mode 100644 index 0000000..9a287cf --- /dev/null +++ b/.config/xdg-desktop-portal-wlr/config @@ -0,0 +1,5 @@ +[screencast] +max_fps=60 +chooser_type=simple +chooser_cmd=swaymsg -t get_outputs | jq -r '.[] \| .name' | wmenu -p output: +#slurp -f %o -or diff --git a/.mbsyncrc b/.mbsyncrc new file mode 100644 index 0000000..3519718 --- /dev/null +++ b/.mbsyncrc @@ -0,0 +1,21 @@ +IMAPAccount migadu +Host imap.migadu.com +SSLType IMAPS +User sam@samnystrom.dev +PassCmd "cat ~/.mailpw" + +IMAPStore migadu +Account migadu + +MaildirStore local +Path ~/mail/ +Inbox ~/mail/INBOX +SubFolders Verbatim + +Channel primary +Far :migadu: +Near :local: +Patterns INBOX * +Create Both +Remove Both +Expunge Both diff --git a/.profile b/.profile new file mode 100644 index 0000000..0132791 --- /dev/null +++ b/.profile @@ -0,0 +1,23 @@ +#!/bin/sh + +# Add PATH entries if they aren't already in PATH +# We can't use external commands yet in case PATH is empty +for p in /command /bin /sbin /usr/bin /usr/sbin /var/lib/flatpak/exports/bin /usr/local/bin /usr/local/sbin ~/.local/bin ~/.cargo/bin ~/bin; do + case ":$PATH:" in + *:"$p":*) ;; + *) export PATH="$p:$PATH" ;; + esac +done + +# Create a tmpdir for XDG_RUNTIME_DIR if it is not set +if [ -z "$XDG_RUNTIME_DIR" ]; then + rundir="/run/user/$(id -u)" + if [ -d "$rundir" ]; then + export XDG_RUNTIME_DIR="$rundir" + else + export XDG_RUNTIME_DIR="$(mktemp -d)" + fi +fi + +export ENV=~/.ashrc +. $ENV diff --git a/.vim/UltiSnips/editorconfig.snippets b/.vim/UltiSnips/editorconfig.snippets new file mode 100644 index 0000000..ebe0d3c --- /dev/null +++ b/.vim/UltiSnips/editorconfig.snippets @@ -0,0 +1,10 @@ +snippet template "Basic template" b +root = true + +[*] +charset = utf-8 +line_endings = lf +insert_final_newline = true +indent_style = tab +indent_size = 4 +endsnippet diff --git a/.vim/UltiSnips/nroff.snippets b/.vim/UltiSnips/nroff.snippets new file mode 100644 index 0000000..5ca610f --- /dev/null +++ b/.vim/UltiSnips/nroff.snippets @@ -0,0 +1,24 @@ +snippet prob "Problem" bA +.HEADING 1 "Problem $1" + +prob$0 +endsnippet + +snippet part "Part" bA +.HEADING 2 "Part $1" +$0 +endsnippet + +snippet EQ "eqn" bA +.EQ +$0 +.EN +endsnippet + +snippet -- "en dash" i +\[en] +endsnippet + +snippet --- "em dash" iA +\[em] +endsnippet diff --git a/.vim/UltiSnips/sh.snippets b/.vim/UltiSnips/sh.snippets new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.vim/UltiSnips/sh.snippets diff --git a/.vim/UltiSnips/tex.snippets b/.vim/UltiSnips/tex.snippets new file mode 100644 index 0000000..96d1855 --- /dev/null +++ b/.vim/UltiSnips/tex.snippets @@ -0,0 +1,186 @@ +global !p +def math(): + return vim.eval('vimtex#syntax#in_mathzone()') == '1' +def env(name): + x, y = vim.eval(f"vimtex#env#is_inside('{name}')") + return x != '0' and y != '0' +endglobal + +snippet begin "Begin/end" bA +\begin{$1} +$0 +\end{$1} +endsnippet + +snippet enum "Enumerate" bA +\begin{enumerate} + \item $0 +\end{enumerate} +endsnippet + +snippet item "Itemize" bA +\begin{itemize} + \item $0 +\end{itemize} +endsnippet + +snippet desc "Description" bA +\begin{description} + \item[$1] $0 +\end{description} +endsnippet + +snippet define "Definition" bA +\begin{definition}[$1] +$0 +\end{definition} +endsnippet + +snippet note "Note" bA +\begin{note} +$0 +\end{note} +endsnippet + +snippet example "Example" bA +\begin{example} +$1 +\end{example} +\begin{solution} +$0 +\end{solution} +endsnippet + +snippet table "Table" b +\begin{table}[${1:htpb}] +\centering +\caption{${2:caption}} +\begin{tabular}{@{} ${5:c c} @{}} + $0${5/((?<=.)[clr])|./(?1: & )/g} +\end{tabular} +\end{table} +endsnippet + +snippet fig "Figure" b +\begin{figure}[${1:htpb}] + \centering + ${2:\includegraphics[width=0.8\textwidth]{$3}} + \caption{${4:$3}} +\end{figure} +endsnippet + +snippet plot "Plot" w +\begin{figure}[$1] +\centering +\begin{tikzpicture} + \begin{axis}[ + title=$2, + xlabel=$3, + ylabel=$4 + ] + \addplot[$5]{$6}; + \end{axis} +\end{tikzpicture} +\caption{$7} +\end{figure} +endsnippet + +context "env('tikzpicture')" +snippet arrow "Arrow" w +\draw[thick, ->] ($1,$2) -- ($3,$4);$0 +endsnippet + +context "math()" +snippet // "Fraction" iA +\frac{$1}{$2}$0 +endsnippet + +context "math()" +snippet '((\d*\.?\d+)|(\d*)(\\)?([A-Za-z]+)((\^|_)(\{\d+\}|\d))*)/' "Fraction" wrA +\frac{`!p snip.rv = match.group(1)`}{$1}$0 +endsnippet + +priority 1000 +context "math()" +snippet '^.*\)/' "Fraction" wrA +`!p +depth = 1 +i = len(match.string) - 3 +while depth > 0 and i >= 0: + if match.string[i] == ')': depth += 1 + if match.string[i] == '(': depth -= 1 + i -= 1 +snip.rv = match.string[0:i+1] + '\\frac{' + match.string[i+2:-2] +`}{$1}$0 +endsnippet + +context "math()" +snippet tt "Text" iA +\text{$1}$0 +endsnippet + +snippet ... "Ellipsis" iA +\ldots +endsnippet + +snippet == "Equals" iA +&= $1 \\\\ +endsnippet + +snippet != "neq" iA +\neq +endsnippet + +snippet >= "geq" iA +\ge +endsnippet + +snippet <= "leq" iA +\le +endsnippet + +snippet __ "Subscript" iA +_{$1}$0 +endsnippet + +snippet ^^ "Superscript" iA +^{$1}$0 +endsnippet + +snippet ** "cdot" iA +\cdot +endsnippet + +snippet '"' "quote" riA +\`\`$1''$0 +endsnippet + +snippet qty "Quantity" iA +\qty{$1}{$2}$0 +endsnippet + +snippet unit "Unit" i +\unit{$1}$0 +endsnippet + +priority 10 +context "math()" +snippet bar "bar" iA +\overline{$1}$0 +endsnippet + +priority 100 +context "math()" +snippet '([a-zA-Z])bar' "bar" riA +\overline{`!p snip.rv=match.group(1)`} +endsnippet + +priority 10 +snippet deg "deg" iA +\deg{$1}$0 +endsnippet + +priority 100 +snippet '([0-9]+)deg' "deg" riA +\deg{`!p snip.rv=match.group(1)`} +endsnippet @@ -0,0 +1,197 @@ +vim9script + +set nocompatible +set encoding=utf-8 + +set number +set relativenumber + +set scrolloff=3 +set sidescroll=3 + +set ignorecase +set smartcase + +set splitbelow + +set noswapfile + +set autoindent +set backspace=indent,eol,start + +set ttimeout +set ttimeoutlen=50 + +set incsearch +set hlsearch + +g:mapleader = " " +g:maplocalleader = " " + +filetype indent plugin on +filetype plugin on + +set omnifunc=syntaxcomplete#Complete +set completefunc=syntaxcomplete#Complete +# Don't scan #include'd files for completions +set complete-=i + +set foldmethod=indent + +# Delete comment character when joining commented lines +set formatoptions+=j + +set termguicolors +colorscheme catppuccin_mocha +syntax enable + +g:is_posix = 1 + +set laststatus=2 +set statusline=%f\ %y%h%w%m%r%=%l:%c\ %P + +&t_SI = "\<Esc>[6 q" +&t_SR = "\<Esc>[4 q" +&t_EI = "\<Esc>[2 q" + +nnoremap \ :noh<cr> +nnoremap Y y$ + +nnoremap <leader>n :bnext!<cr> +nnoremap <leader>p :bprev!<cr> +nnoremap <leader>d :bdelete<cr> +nnoremap <leader>D :bdelete!<cr> + +g:buftabline_indicators = 1 + +g:tex_flavor = "latex" +g:vimtex_view_method = "zathura_simple" +set conceallevel=2 +g:tex_conceal = "abdmg" +hi Conceal ctermbg=none + +g:UltiSnipsExpandTrigger = "<tab>" +g:UltiSnipsJumpForwardTrigger = "<tab>" +g:UltiSnipsJumpBackwardTrigger = "<s-tab>" + +def FigModifiedCallback(job: job, status: number) + const path = job_info(job).cmd[-1] + system("inkscape " + .. "--export-latex " + .. "--export-filename=" .. shellescape(fnamemodify(path, ":r")) .. ".pdf " + .. shellescape(path)) + + if job_status(g:inkscape_job) == "run" + g:inotify_job = job_start(["inotifywait", "-e", "modify", path], { + in_io: "null", + out_io: "null", + err_io: "null", + exit_cb: "FigModifiedCallback", + }) + endif +enddef + +def FigInkscapeCallback(job: job, status: number) + job_stop(g:inotify_job) +enddef + +def FigOpenInkscape(path: string) + g:inkscape_job = job_start(["inkscape", path], { + in_io: "null", + out_io: "null", + err_io: "null", + exit_cb: "FigInkscapeCallback", + }) + g:inotify_job = job_start(["inotifywait", "-e", "modify", path], { + in_io: "null", + out_io: "null", + err_io: "null", + exit_cb: "FigModifiedCallback", + }) +enddef + +def FigAdd() + const name = input("Name of figure file: ") + const figures_dir = b:vimtex.root .. "/figures/" + mkdir(figures_dir, "p") + const path = figures_dir .. name .. ".svg" + if !filewritable(path) + const svg =<< trim END +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + width="210mm" + height="297mm" + viewBox="0 0 210 297" + version="1.1" + id="svg1" + inkscape:version="1.3 (0e150ed6c4, 2023-07-21)" + sodipodi:docname="drawing.svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <sodipodi:namedview + id="namedview1" + pagecolor="#ffffff" + bordercolor="#000000" + borderopacity="0.25" + inkscape:showpageshadow="2" + inkscape:pageopacity="0.0" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" + inkscape:document-units="mm" + inkscape:zoom="0.77949635" + inkscape:cx="396.40981" + inkscape:cy="561.25984" + inkscape:window-width="1918" + inkscape:window-height="1054" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="layer1" /> + <defs + id="defs1" /> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" /> +</svg> + END + writefile(svg, path) + endif + append(line("."), [ + '\begin{figure}[ht]', + ' \centering', + ' \incfig{' .. name .. '}', + ' \caption{}', + ' \label{fig:' .. name .. '}', + '\end{figure}', + ]) + execute("w") + cursor(line(".") + 4, 11) + execute("startinsert") + FigOpenInkscape(path) +enddef + +def FigEdit() + const figures = split(globpath(b:vimtex.root .. "/figures", "*.svg"), "\n") + final choices = map(copy(figures), '(v:key + 1) .. ". " .. fnamemodify(v:val, ":t:r")') + const idx = inputlist(insert(choices, "Select a figure to edit:")) + const path = figures[idx - 1] + FigOpenInkscape(path) +enddef + +command! FigAdd call FigAdd() +command! FigEdit call FigEdit() +nnoremap <leader>fa :FigAdd<CR> +nnoremap <leader>fe :FigEdit<CR> + +nnoremap <leader>ev :vsplit $MYVIMRC<CR> +nnoremap <leader>sv :source $MYVIMRC<CR> + +autocmd FileType tex g:UltiSnipsSnippetDirectories += [b:vimtex.root .. "/UltiSnips"] + +runtime! macros/matchit.vim +runtime! ftplugin/man.vim @@ -0,0 +1,12 @@ +Copyright (c) 2023 Sam Nystrom <sam@samnystrom.dev> + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/bin/av1ify b/bin/av1ify new file mode 100755 index 0000000..a68ad3d --- /dev/null +++ b/bin/av1ify @@ -0,0 +1,17 @@ +#!/bin/execlineb -s1 +backtick -E webm { heredoc 0 ${1} sed "s/\.[^.]*$/.webm/" } +# nice -n 20 +time +ffmpeg + -i ${1} + -c:v libsvtav1 + -g 240 + -preset 4 + -pix_fmt yuv420p10le + -svtav1-params film-grain-denoise=0:film-grain=20:tune=0 + -crf 34 + -c:a libopus + -b:a 96k + -ac 2 + ${@} + ${webm} @@ -0,0 +1,2 @@ +#!/command/execlineb -s0 +nix run --offline nixpkgs#bun -- ${@} diff --git a/bin/capsremap.c b/bin/capsremap.c new file mode 100644 index 0000000..8a78f4b --- /dev/null +++ b/bin/capsremap.c @@ -0,0 +1,110 @@ +// SPDX-FIleCopyrightText: 2017 Francisco Lopes da Silva +// SPDX-FIleCopyrightText: 2023 Sam Nystrom <sam@samnystrom.dev> +// SPDX-License-Identifier: MIT + +// Map the caps lock key to escape and caps+hjkl to the arrow keys + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <stdbool.h> +#include <linux/input.h> + +const struct input_event +syn = {.type = EV_SYN, .code = SYN_REPORT, .value = 0}, +esc_up = {.type = EV_KEY, .code = KEY_ESC , .value = 0}, +esc_down = {.type = EV_KEY, .code = KEY_ESC , .value = 1}; + +const int delay = 10000; + +void hjkl_to_arrow(struct input_event *event) { + switch (event->code) { + case KEY_H: + event->code = KEY_LEFT; + break; + case KEY_J: + event->code = KEY_DOWN; + break; + case KEY_K: + event->code = KEY_UP; + break; + case KEY_L: + event->code = KEY_RIGHT; + break; + } +} + +int main(int argc, char** argv) { + setbuf(stdin, NULL); + setbuf(stdout, NULL); + + enum { START, CAPSLOCK_HELD, CAPSLOCK_IS_MODIFIER } state = START; + + // Handle cases where caps lock is released before hjkl is released so + // the subsequent hjkl release is properly rewritten as an arrow key + int down_key = KEY_RESERVED; + + struct input_event event; + while (fread(&event, sizeof(event), 1, stdin) == 1) { + if (event.type == EV_MSC && event.code == MSC_SCAN) { + continue; + } + if (event.type != EV_KEY && event.type != EV_REL && event.type != EV_ABS) { + fwrite(&event, sizeof(event), 1, stdout); + continue; + } + + switch (state) { + case START: + if (event.type == EV_KEY && event.code == KEY_CAPSLOCK && event.value) { + state = CAPSLOCK_HELD; + } else { + if (event.type == EV_KEY && event.code == down_key && event.value == 0) { + hjkl_to_arrow(&event); + down_key = KEY_RESERVED; + } + fwrite(&event, sizeof(event), 1, stdout); + } + break; + case CAPSLOCK_HELD: + if (event.type == EV_KEY && event.code == KEY_CAPSLOCK) { + if (event.value == 0) { + fwrite(&esc_down, sizeof(esc_down), 1, stdout); + fwrite(&syn, sizeof(syn), 1, stdout); + usleep(delay); + fwrite(&esc_up, sizeof(esc_up), 1, stdout); + state = START; + } + } else { + if (event.type == EV_KEY && event.value) { + down_key = event.code; + hjkl_to_arrow(&event); + state = CAPSLOCK_IS_MODIFIER; + } + if (event.type == EV_KEY && event.code == down_key && event.value == 0) { + down_key = KEY_RESERVED; + hjkl_to_arrow(&event); + } + fwrite(&event, sizeof(event), 1, stdout); + } + break; + case CAPSLOCK_IS_MODIFIER: + if (event.type == EV_KEY && event.code == KEY_CAPSLOCK) { + if (event.value == 0) { + state = START; + } + } else { + if (event.type == EV_KEY && event.value) { + down_key = event.code; + hjkl_to_arrow(&event); + } + if (event.type == EV_KEY && event.code == down_key && event.value == 0) { + down_key = KEY_RESERVED; + hjkl_to_arrow(&event); + } + fwrite(&event, sizeof(event), 1, stdout); + } + break; + } + } +} @@ -0,0 +1,4 @@ +#!/bin/execlineb -P +if { rm -f ${XDG_RUNTIME_DIR}/dwl-stdout } +if { mkfifo ${XDG_RUNTIME_DIR}/dwl-stdout } +/usr/local/bin/dwl -s "superd & cat > \"$XDG_RUNTIME_DIR\"/dwl-stdout" diff --git a/bin/ff-catwalk.c b/bin/ff-catwalk.c new file mode 100644 index 0000000..69b827e --- /dev/null +++ b/bin/ff-catwalk.c @@ -0,0 +1,50 @@ +#include <stdio.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include <endian.h> + +int +main(int argc, char *argv[]) +{ + if (argc != 5) { + fprintf(stderr, "Usage: %s LATTE FRAPPE MACCHIATO MOCHA\n", argv[0]); + return 1; + } + FILE *images[4]; + uint32_t headers[16]; + for (int i = 0; i < 4; i++) { + images[i] = fopen(argv[i+1], "r"); + if (!images[i]) { + perror(argv[i+1]); + return 1; + } + if (fread(&headers + i*16, 16, 1, images[i]) != 1 || memcmp(&headers, &headers + i*16, 16)) { + fprintf(stderr, "error: header mismatch"); + return 1; + } + } + uint32_t width = be32toh(headers[2]); + uint32_t height = be32toh(headers[3]); + char *buf = calloc(width, 8); + + fwrite(&headers, 16, 1, stdout); + for (uint32_t row = 0; row < height; row++) { + for (int i = 0; i < 4; i++) { + if (fread(buf, 8, width, images[i]) != width) { + if (ferror(images[i])) { + perror("fread"); + } else { + perror("fread: unexpected EOF"); + } + return 1; + } + uint32_t start = width / 4 * i + width / 8 - width / 4 * row / height; + uint32_t end = start + width / 4; + if (i == 0) start = 0; + if (i == 3) end = width; + fwrite(buf + 8 * start, 8, end - start, stdout); + } + } + return 0; +} diff --git a/bin/ffimv b/bin/ffimv new file mode 100755 index 0000000..1d2cfab --- /dev/null +++ b/bin/ffimv @@ -0,0 +1,9 @@ +#!/bin/execlineb -P +backtick -E tmp { mktemp } +foreground { + if { redirfd -w 1 ${tmp} ff2png } + imv ${tmp} +} +if { rm -f ${tmp} } +importas -ui ? ? +exit ${?} diff --git a/bin/hiprompt-wmenu b/bin/hiprompt-wmenu new file mode 100755 index 0000000..91fd50e --- /dev/null +++ b/bin/hiprompt-wmenu @@ -0,0 +1,28 @@ +#!/bin/sh + +read -r version +[ ! "$version" = 'version' ] && exit 1 +printf 'version 0.0.0\n' + +keys= +while read -r command; do + case "$command" in + 'key '*) + keys="$keys\n${command#key\ }" + ;; + 'prompt '*) + case "${command#prompt\ }" in + disclose) prompt='Disclose keys?' ;; + delete) prompt='Delete keys?' ;; + esac + exec test "$(printf 'Yes\nNo\n%b\n' "$keys" | wmenu -l 20 -p "$prompt")" = Yes + ;; + 'password incorrect'|'unlock') + prompt='Unlock keyring:' + [ "$command" = 'password incorrect' ] && prompt="Password incorrect. $prompt" + pass="$(wmenu -p "$prompt" </dev/null)" + [ -z "$pass" ] && exit 1 + printf 'password %s\n' "$pass" + ;; + esac +done diff --git a/bin/infinity.c b/bin/infinity.c new file mode 100644 index 0000000..10a45b0 --- /dev/null +++ b/bin/infinity.c @@ -0,0 +1,216 @@ +/* + infinity.c: the Book of Infinity, adapted for skalibs. + Original work by David Madore: http://www.madore.org/~david/ + Adaptation by Laurent Bercot: http://skarnet.org/ + License: GNU GPL v2, with the special plea that the text of the Book + not be modified. + The original code can be found at: + http://www.madore.org/~david/programs/programs-1.36.html#prog_infinity +*/ + +#include <string.h> +#include <stdlib.h> + +#include <skalibs/bytestr.h> +#include <skalibs/env.h> +#include <skalibs/buffer.h> +#include <skalibs/stralloc.h> +#include <skalibs/sha256.h> + +static char const STRING1[] = "Wake! For the Sun, who scatter'd into flight\n" ; +static char const STRING2[] = "The Stars before him from the Field of Night,\n" ; +static char const STRING3[] = "\240\240\240Drives Night along with them from Heav'n, and strikes\n" ; +static char const STRING4[] = "The Sult\341n's Turret with a Shaft of Light.\n" ; + +#define die() return(111) + + +typedef struct magic_string_state_s magic_string_state_t, *magic_string_state_t_ref ; +struct magic_string_state_s +{ + char vowel ; + char sequent ; +} ; + +#define MAGIC_STRING_STATE_ZERO { 0, 0 } ; + +static char const *magic_string (unsigned char data_byte, magic_string_state_t_ref st, char final) +{ + char const *s ; + char oldsequent = st->sequent ; + if (((data_byte % 7) == 0 ) && st->sequent && !final) + { + st->sequent = 0 ; + return " " ; + } + st->sequent = 1 ; + if (st->vowel) + { + st->vowel = 0 ; + if (data_byte < 40) s = "a" ; + else if (data_byte < 80) s = "e" ; + else if (data_byte < 115) s = "i" ; + else if (data_byte < 145) s = "o" ; + else if (data_byte < 175) s = "u" ; + else if (data_byte < 195) s = "y" ; + else if (data_byte < 200) s = "ai" ; + else if (data_byte < 205) s = "ei" ; + else if (data_byte < 210) s = "oi" ; + else if (data_byte < 215) s = "au" ; + else if (data_byte < 220) s = "eu" ; + else if (data_byte < 225) s = "ou" ; + else if (data_byte < 230) s = "ae" ; + else if (data_byte < 235) s = "oe" ; + else if (data_byte < 240) s = "aa" ; + else if (data_byte < 250) s = "'" ; + else + { + s = "" ; + st->sequent = oldsequent ; + } + } + else + { + st->vowel = 1 ; + if ( data_byte < 12 ) s = "p" ; + else if (data_byte < 24) s = "b" ; + else if (data_byte < 36) s = "t" ; + else if (data_byte < 48) s = "d" ; + else if (data_byte < 60) s = "k" ; + else if (data_byte < 72) s = "g" ; + else if (data_byte < 84) s = "s" ; + else if (data_byte < 96) s = "z" ; + else if (data_byte < 108) s = "sh" ; + else if (data_byte < 120) s = "zh" ; + else if (data_byte < 132) s = "f" ; + else if (data_byte < 144) s = "v" ; + else if (data_byte < 156) s = "ch" ; + else if (data_byte < 168) s = "j" ; + else if (data_byte < 174) s = "ks" ; + else if (data_byte < 180) s = "x" ; + else if (data_byte < 192) { s = "h" ; st->vowel = (data_byte < 190) ; } + else if (data_byte < 204) { s = "n" ; st->vowel = (data_byte < 198) ; } + else if (data_byte < 216) { s = "r" ; st->vowel = (data_byte < 210) ; } + else if (data_byte < 222) s = "st" ; + else if (data_byte < 228) s = "zd" ; + else if (data_byte < 234) s = "ts" ; + else if (data_byte < 240) s = "dz" ; + else if (data_byte < 242) s = "pn" ; + else if (data_byte < 244) s = "bn" ; + else if (data_byte < 247) s = "sht" ; + else if (data_byte < 250) s = "zhd" ; + else + { + s = "" ; + st->sequent = oldsequent ; + } + } + return s ; +} + +static int page_make_name (stralloc *sa, char const *seed, unsigned int seedlen) +{ + SHA256Schedule context = SHA256_INIT() ; + magic_string_state_t st = MAGIC_STRING_STATE_ZERO ; + char data[64] ; + + sha256_update(&context, STRING1, sizeof(STRING1) - 1) ; + sha256_update(&context, seed, seedlen) ; + sha256_update(&context, STRING2, sizeof(STRING2) - 1) ; + sha256_update(&context, seed, seedlen) ; + sha256_final(&context, data) ; + sha256_init(&context) ; + sha256_update(&context, STRING3, sizeof(STRING3) - 1) ; + sha256_update(&context, seed, seedlen) ; + sha256_update(&context, STRING4, sizeof(STRING4) - 1) ; + sha256_update(&context, seed, seedlen) ; + sha256_final(&context, data + 32) ; + + { + unsigned int i = 0 ; + for (; i < 64 ; i++) + if (!stralloc_cats(sa, magic_string(data[i], &st, i == 63))) + return 0 ; + } + return 1 ; +} + +int main (void) +{ + stralloc url_start = STRALLOC_ZERO ; + stralloc page_name = STRALLOC_ZERO ; + stralloc new_path = STRALLOC_ZERO ; + stralloc new_page_name = STRALLOC_ZERO ; + char const *script_name = getenv("SCRIPT_NAME") ; + unsigned int new_path_start ; + unsigned int i = 0 ; + + if (!script_name) script_name = "infinity.cgi" ; + + { + char const *x = getenv("PATH_INFO") ; + if (!x || !*x) x = "/" ; + if (!stralloc_cats(&new_path, x)) die() ; + x = getenv("SERVER_NAME") ; + if (x) + { + if (!stralloc_cats(&url_start, "//")) die() ; + if (!stralloc_cats(&url_start, x)) die() ; + x = getenv("SERVER_PORT") ; + if (x && strcmp(x, "80")) + { + if (!stralloc_catb(&url_start, ":", 1)) die() ; + if (!stralloc_cats(&url_start, x)) die() ; + } + } + } + + if (!page_make_name(&page_name, new_path.s, new_path.len)) die() ; + buffer_puts(buffer_1, "Last-Modified: Wed, 24 May 2017 12:20:00 GMT\r\nContent-Type: text/html\r\n\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\r\n<meta http-equiv=\"Content-Language\" content=\"en\" />\r\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\r\n<title>") ; + buffer_put(buffer_1, page_name.s, page_name.len) ; + buffer_puts(buffer_1, "</title>\r\n<meta name=\"robots\" content=\"noindex, nofollow\" />\r\n<meta name=\"description\" content=\"One Page from the Book of Infinity\" />\r\n<meta name=\"keywords\" content=\"infinite web space ") ; + buffer_put(buffer_1, page_name.s, page_name.len) ; + buffer_puts(buffer_1, "\" />\r\n</head>\r\n<body>\r\n<h1>") ; + buffer_put(buffer_1, page_name.s, page_name.len) ; + buffer_puts(buffer_1, "</h1>\r\n<p> You are in a maze of twisty little web pages, all alike. </p>\r\n<p> From here you can get to the following places: </p>\r\n<ul>\r\n") ; + + new_path_start = new_path.len ; + for (; i < 14 ; i++) + { + new_path.len = new_path_start ; + buffer_puts(buffer_1, "<li>") ; + switch (i) + { + case 0 : + case 13 : + { + while (new_path.len > 1) if (new_path.s[--new_path.len - 1] == '/') break ; + if (!i) buffer_puts(buffer_1, "Back to ") ; + else + { + if (!stralloc_catb(&new_path, page_name.s, byte_chr(page_name.s, page_name.len, ' '))) die() ; + if (!stralloc_catb(&new_path, "/", 1)) die() ; + } + break ; + } + default: + { + char const *const zodiac[12] = { "aries", "taurus", "gemini", "cancer", "leo", "virgo", "libra", "scorpius", "sagittarius", "capricornus", "aquarius", "pisces" } ; + if (!stralloc_cats(&new_path, zodiac[i-1])) die() ; + if (!stralloc_catb(&new_path, "/", 1)) die() ; + } + } + buffer_puts(buffer_1, "<a href=\"") ; + if (url_start.s) buffer_put(buffer_1, url_start.s, url_start.len) ; + buffer_puts(buffer_1, script_name) ; + buffer_put(buffer_1, new_path.s, new_path.len) ; + buffer_puts(buffer_1, "\">") ; + new_page_name.len = 0 ; + if (!page_make_name(&new_page_name, new_path.s, new_path.len)) die() ; + buffer_put(buffer_1, new_page_name.s, new_page_name.len) ; + buffer_puts(buffer_1, "</a></li>\r\n") ; + } + buffer_putsflush(buffer_1, "</ul>\r\n</body>\r\n</html>\r\n") ; + return 0 ; +} + diff --git a/bin/init b/bin/init new file mode 100755 index 0000000..436e55a --- /dev/null +++ b/bin/init @@ -0,0 +1,51 @@ +#!/bin/execlineb -P +importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR +importas -i HOME HOME + +foreground { redirfd -w 2 /dev/null + foreground { find ${XDG_RUNTIME_DIR} -maxdepth 1 ! -path ${XDG_RUNTIME_DIR} -exec rm -rf "{}" + } + foreground { mkdir -p + ${HOME}/.local/state/s6/uncaught-logs + ${XDG_RUNTIME_DIR}/service/.s6-svscan + ${XDG_RUNTIME_DIR}/service/s6-svscan-log + } + ln -sf /bin/false ${XDG_RUNTIME_DIR}/service/.s6-svscan/crash +} +execline-cd ${XDG_RUNTIME_DIR}/service +if { + redirfd -w 1 .s6-svscan/finish + heredoc 0 "#!/bin/execlineb -P\ns6-svc -x -- \"${XDG_RUNTIME_DIR}/service/s6-svscan-log\"\n" + cat +} +if { chmod 0755 .s6-svscan/finish } +foreground { redirfd -w 2 /dev/null mkfifo -m 0600 s6-svscan-log/fifo } +if { redirfd -w 1 s6-svscan-log/notification-fd echo 3 } +if { + redirfd -w 1 s6-svscan-log/run + heredoc 0 "#!/bin/execlineb -P +redirfd -rnb 0 fifo +exec -c +s6-log -bpd3 -- t ${HOME}/.local/state/s6/uncaught-logs\n" + cat +} +if { chmod 0755 s6-svscan-log/run } + +redirfd -r 0 /dev/null +redirfd -wnb 1 s6-svscan-log/fifo +fdmove -c 2 1 + +fdreserve 2 +multisubstitute { importas -u fdr FD0 importas -u fdw FD1 } +piperw ${fdr} ${fdw} +background { + fdclose ${fdw} + foreground { fdmove 0 ${fdr} redirfd -w 1 /dev/null cat } + s6-svlisten -U { ./s6-svscan-log } + if { s6-rc-init -bl ${XDG_RUNTIME_DIR}/s6-rc + -c ${HOME}/.local/share/s6-rc/compiled + ${XDG_RUNTIME_DIR}/service } + s6-rc -l ${XDG_RUNTIME_DIR}/s6-rc -bu change default +} +fdclose ${fdr} +emptyenv -c +s6-svscan -d ${fdw} -- ${XDG_RUNTIME_DIR}/service @@ -0,0 +1,2 @@ +#!/command/execlineb -s0 +jaq ${@} diff --git a/bin/pastebin b/bin/pastebin new file mode 100755 index 0000000..87d26cf --- /dev/null +++ b/bin/pastebin @@ -0,0 +1,39 @@ +#!/bin/sh -eu + +expires= +while getopts e:h opt; do + case "$opt" in + e) + if ! printf %d "$OPTARG" >/dev/null 2>&1; then + printf "%s: invalid number '%d'\n" "${0##*/}" "$OPTARG" + exit 1 + fi + expires="$OPTARG" + ;; + h) + cat <<-EOF +Usage: ${0##*/} [-e EXPIRES] [FILE] + +Upload FILE (or stdin) to envs.sh and print the URL + + -e EXPIRES Set the expiration time, either hours or epoch milliseconds + EOF + exit 0 + ;; + ?) + printf 'Usage: %s [-e EXPIRES] [FILE]\n' "${0##*/}" + exit 1 + ;; + esac +done +shift $((OPTIND-1)) +if [ $# -gt 1 ]; then + printf 'Usage: %s [-e EXPIRES] [FILE]\n' "${0##*/}" + exit 1 +fi +file="${1:-/dev/stdin}" +[ "$file" = '-' ] && file="/dev/stdin" + +url="$(curl -fsS -F file=@"$file" ${expires:+-F expires="$expires"} https://envs.sh)" +printf '%s\n' "$url" +wl-copy "$url" diff --git a/bin/readmail b/bin/readmail new file mode 100755 index 0000000..5466088 --- /dev/null +++ b/bin/readmail @@ -0,0 +1,37 @@ +#!/bin/sh + +dir=~/mail/"${1:-INBOX}" + +while true; do + mlist "$dir" | msort -dr | mseq -S | MBLAZE_PAGER=cat mscan + read -r addr cmd || break + if [ -z "$cmd" ]; then + cmd="$addr" + addr=. + fi + case "$cmd" in + g) mbsync primary && minc ~/mail/* >/dev/null ;; + C) mseq -C "$addr" ;; + c*) dir=~/mail/"${cmd#c}" ;; + s) mshow "$addr" && mflag -S "$addr" >/dev/null ;; + a) mrefile "$addr" ~/mail/Archive ;; + m*) mrefile "$addr" ~/mail/"${cmd#m}" ;; + f*) mflag -"${cmd#f}" "$addr" >/dev/null ;; + h) + echo 'Commands:' + echo 'g - fetch mail' + echo 'C - set the sequence to messages' + echo 'cFOLDER - cd to FOLDER' + echo 's - show messages' + echo 'a - archive messages' + echo 'mFOLDER - move messages to FOLDER' + echo 'fFLAGS - set FLAGS on messages. Uppercase sets, lowercase unsets.' + echo ' d=draft, f=flagged, p=passed, r=replied, s=seen, t=trashed.' + echo 'h - print this message' + echo + ;; + q) break ;; + esac +done +echo 'Syncing changes...' +mbsync primary diff --git a/bin/s6-rclocal-compile b/bin/s6-rclocal-compile new file mode 100755 index 0000000..ec87a7d --- /dev/null +++ b/bin/s6-rclocal-compile @@ -0,0 +1,13 @@ +#!/bin/execlineb -S0 +multisubstitute { + importas -i HOME HOME + importas -i XDG_RUNTIME_DIR XDG_RUNTIME_DIR +} +execline-cd ${HOME}/.local/share/s6-rc +elglob -0 old compiled-* +backtick -E now { pipeline { echo } s6-tai64n } +if { s6-rc-compile compiled-${now} ${HOME}/.config/s6-rc } +foreground { s6-rc-update -l ${XDG_RUNTIME_DIR}/s6-rc ${HOME}/.local/share/s6-rc/compiled-${now} } +if { ln -sf compiled-${now} compiled/compiled } +if { mv -f compiled/compiled . } +rm -rf ${old} diff --git a/bin/s6-rclocal-make-logger b/bin/s6-rclocal-make-logger new file mode 100755 index 0000000..dcd691b --- /dev/null +++ b/bin/s6-rclocal-make-logger @@ -0,0 +1,14 @@ +#!/bin/sh +for s in *-log; do + echo 3 > "$s"/notification-fd + echo longrun > "$s"/type + echo "${s%log}"pipeline > "$s"/pipeline-name + echo "${s%-log}" > "$s"/consumer-for + echo "$s" > "${s%-log}"/producer-for + cat <<EOF > "$s"/run +#!/bin/execlineb -P +exec -c +s6-log -d3 -- T /home/samn/.local/state/s6/logs/${s%-log} +EOF + chmod +x "$s"/run +done diff --git a/bin/shuffle b/bin/shuffle new file mode 100755 index 0000000..33f7b95 --- /dev/null +++ b/bin/shuffle @@ -0,0 +1,51 @@ +#!/bin/sh + +printhelp() { + cat <<EOF +Usage: ${0##*/} [-v VOL] [PATHS...] + +Play audio files in PATHS (or .) in random order + + -h Print this help + -v VOL Play with volume VOL (default 100) +EOF + exit 0 +} + +printusage() { + printf 'Usage: %s [-v VOL] [PATHS...]\n' "${0##*/}" + exit 1 +} + +volume=100 +while getopts hv: opt; do + case "$opt" in + h) printhelp ;; + v) + if printf %d "$OPTARG" >/dev/null 2>&1; then + volume="$OPTARG" + else + printf "%s: invalid number '%s'\n" "${0##*/}" "$OPTARG" + exit 1 + fi + ;; + ?) printusage ;; + esac +done + +shift $((OPTIND-1)) + +if [ $# -lt 1 ]; then + # set -- "$(. "${XDG_CONFIG_HOME:-"$HOME"/.config}/user-dirs.dirs" && printf '%s' "$XDG_MUSIC_DIR")" + set -- . +fi + +prev1= +prev2= +while true; do + file="$(find -L "$@" -type f \( -name '*.m4a' -o -name '*.opus' \) ! -path "$prev1" ! -path "$prev2" -exec shuf -n1 -e '{}' +)" + prev1="$prev2" + prev2="$file" + printf 'Playing %s\n' "${file#$dir/}" + mpv --volume="$volume" "$file" +done diff --git a/bin/slim b/bin/slim new file mode 100755 index 0000000..c07d986 --- /dev/null +++ b/bin/slim @@ -0,0 +1,3 @@ +#!/command/execlineb +backtick -E dims { slurp } +grim -g ${dims} diff --git a/bin/statusline b/bin/statusline new file mode 100755 index 0000000..b442b91 --- /dev/null +++ b/bin/statusline @@ -0,0 +1,81 @@ +#!/usr/bin/env lua5.4 + +local stdio = require('posix.stdio') +local poll = require('posix.poll') + +function get_output(prog) + local f = assert(io.popen(prog)) + local output = f:read('*a') + f:close() + return output +end + +function volume() + local output = get_output('wpctl get-volume @DEFAULT_AUDIO_SINK@') + local muted = output:find('MUTED') ~= nil + local _, _, volume = output:find('^Volume: ([0-9.]+)') + volume = math.floor(volume * 100) + + local symbol = 'ERROR' + if muted then + symbol = ' ' + elseif volume == 0 then + symbol = '' + elseif volume <= 50 then + symbol = '' + else + symbol = ' ' + end + return string.format('%s %d%%', symbol, volume) +end + +function network() + local output = get_output('iwctl station wlan0 get-networks') + local _, _, ssid = output:find('>.- (.-) ') + return ssid and ' ' .. ssid or ' ' +end + +local current_brightness = 0 + +function brightness() + return ' ' .. current_brightness .. '%' +end + +function battery() + local f = io.open('/sys/class/power_supply/BAT0/capacity', 'r') + local capacity = tonumber(f:read('*a')) + f:close() + f = io.open('/sys/class/power_supply/BAT0/status', 'r') + local status = f:read('*a') + f:close() + + local symbol = 'ERROR' + local i = capacity > 0 and (capacity - 1) // 10 + 1 or 1 + if status == 'Discharging\n' or status == 'Not charging\n' then + symbol = ({"", "", "", "", "", "", "", "", "", ""})[i] -- + elseif status == 'Charging\n' then + symbol = ({"", "", "", "", "", "", "", "", "", ""})[i] + elseif status == 'Full\n' then + symbol = "" + end + return symbol .. ' ' .. capacity .. '%' +end + +function clock() + return os.date(' %b %d %H:%M:%S') +end + +local brightness_file = assert(io.popen('brightctl -l')) + +while true do + if poll.rpoll(stdio.fileno(brightness_file), 1000) > 0 then + current_brightness = tonumber(brightness_file:read('l')) + end + io.write(string.format('all status %s | %s | %s | %s | %s\n', + volume(), + network(), + brightness(), + battery(), + clock() + )) +end diff --git a/bin/statusline.ha b/bin/statusline.ha new file mode 100644 index 0000000..4eed68d --- /dev/null +++ b/bin/statusline.ha @@ -0,0 +1,319 @@ +// SPDX-FileCopyrightText: 2024 Sam Nystrom <sam@samnystrom.dev> +// SPDX-License-Identifier: ISC + +use encoding::utf8; +use fmt; +use fs; +use io; +use memio; +use os; +use os::exec; +use strconv; +use strings; +use time; +use time::date; + +def ROSEWATER: str = "#f5e0dc"; +def FLAMINGO: str = "#f2cdcd"; +def PINK: str = "#f5c2e7"; +def MAUVE: str = "#cba6f7"; +def RED: str = "#f38ba8"; +def MAROON: str = "#eba0ac"; +def PEACH: str = "#fab387"; +def YELLOW: str = "#f9e2af"; +def GREEN: str = "#a6e3a1"; +def TEAL: str = "#94e2d5"; +def SKY: str = "#89dceb"; +def SAPPHIRE: str = "#74c7ec"; +def BLUE: str = "#89b4fa"; +def LAVENDER: str = "#b4befe"; +def TEXT: str = "#cdd6f4"; +def SUBTEXT1: str = "#bac2de"; +def SUBTEXT0: str = "#a6adc8"; +def OVERLAY2: str = "#9399b2"; +def OVERLAY1: str = "#7f849c"; +def OVERLAY0: str = "#6c7086"; +def SURFACE2: str = "#585b70"; +def SURFACE1: str = "#45475a"; +def SURFACE0: str = "#313244"; +def BASE: str = "#1e1e2e"; +def MANTLE: str = "#181825"; +def CRUST: str = "#11111b"; + +def FG: [_]str = [MAUVE, RED, YELLOW, GREEN, SAPPHIRE]; +def BG: str = BASE; +def TXT: str = BASE; + +type error = !(exec::error | !exec::exit_status | utf8::invalid | strconv::invalid | strconv::overflow | io::error | fs::error); + +fn strerror(err: error) const str = { + match (err) { + case let err: io::error => + return io::strerror(err); + case let err: fs::error => + return fs::strerror(err); + case let err: exec::error => + return exec::strerror(err); + case let err: !exec::exit_status => + return "command exited nonzero"; + case utf8::invalid => + return "invalid UTF-8"; + case strconv::invalid => + return "invalid number"; + case strconv::overflow => + return "invalid number"; + }; +}; + +type json = ([](str, json) | []json | str | f64 | int | bool | void); + +fn print_json_str(out: io::handle, s: str) (void | io::error) = { + fmt::fprint(out, "\"")?; + let it = strings::iter(s); + for (let r => strings::next(&it)) { + switch (r) { + case '\b' => + fmt::fprint(out, "\b")?; + case '\f' => + fmt::fprint(out, "\f")?; + case '\n' => + fmt::fprint(out, "\n")?; + case '\r' => + fmt::fprint(out, "\r")?; + case '\t' => + fmt::fprint(out, "\t")?; + case '\"' => + fmt::fprint(out, "\\\"")?; + case '\\' => + fmt::fprint(out, "\\\\")?; + case => + if (r: u32 < 0x20) { + fmt::fprintf(out, "\\u{:.4x}", r: u32)?; + } else { + fmt::fprint(out, r)?; + }; + }; + }; + fmt::fprint(out, "\"")?; +}; + +fn dump(out: io::handle, value: json) (void | io::error) = { + match (value) { + case let obj: [](str, json) => + fmt::fprint(out, "{")?; + for (let i = 0z; i < len(obj); i += 1) { + if (i > 0) fmt::fprint(out, ",")?; + print_json_str(out, obj[i].0)?; + fmt::fprint(out, ":")?; + dump(out, obj[i].1)?; + }; + fmt::fprint(out, "}")?; + case let arr: []json => + fmt::fprint(out, "[")?; + for (let i = 0z; i < len(arr); i += 1) { + if (i > 0) fmt::fprint(out, ",")?; + dump(out, arr[i])?; + }; + fmt::fprint(out, "]")?; + case let s: str => + print_json_str(out, s)?; + case let x: f64 => + fmt::fprint(out, x)?; + case let n: int => + fmt::fprint(out, n)?; + case let b: bool => + fmt::fprint(out, b)?; + case void => + fmt::fprint(out, "null")?; + }; +}; + +type span = (str, (str | void), (str | void)); + +fn spans(spans: (str | span)...) str = { + let buf = memio::dynamic(); + defer io::close(&buf)!; + for (let sp .. spans) { + match (sp) { + case let s: str => + fmt::fprint(&buf, s)!; + case let span: span => + let (s, fg, bg) = span; + fmt::fprint(&buf, "<span")!; + match (fg) { + case let fg: str => + fmt::fprintf(&buf, " foreground=\"{}\"", fg)!; + case void => void; + }; + match (bg) { + case let bg: str => + fmt::fprintf(&buf, " background=\"{}\"", bg)!; + case void => void; + }; + fmt::fprintf(&buf, ">{}</span>", s)!; + }; + }; + return strings::dup(memio::string(&buf)!); +}; + +fn run(name: str, args: str...) (str | error) = { + let cmd = exec::cmd(name, args...)?; + let pipe = exec::pipe(); + exec::addfile(&cmd, os::stdout_file, pipe.1); + let proc = exec::start(&cmd)?; + io::close(pipe.1)?; + let output = io::drain(pipe.0)?; + io::close(pipe.0)?; + let status = exec::wait(&proc)?; + exec::check(&status)?; + return strings::fromutf8(output)?; +}; + +fn get_volume() ((uint, bool) | error) = { + let output = run("wpctl", "get-volume", "@DEFAULT_AUDIO_SINK@")?; + defer free(output); + let muted = strings::contains(output, "MUTED"); + let volume = strconv::stof64(strings::cut(strings::cut(strings::rtrim(output), " ").1, " ").0)?; + return ((volume * 100.0): uint, muted); +}; + +fn volume() (void | error) = { + let (volume, muted) = get_volume()?; + let symbol = if (muted) " " else if (volume == 0) "" else if (volume <= 50) "" else " "; + let text = fmt::asprintf(" {} {}%", symbol, volume); + defer free(text); + let text = spans((" ", FG[0], BG), (text, TXT, FG[0]), (" ", BG, FG[0])); + defer free(text); + dump(os::stdout, [("full_text", text), ("markup", "pango"), ("separator_block_width", 0)]: [](str, json))!; +}; + +fn network() (void | error) = { + let output = run("iwctl", "station", "wlan0", "get-networks")?; + defer free(output); + let line = ""; + let iter = strings::tokenize(output, "\n"); + for (let s => strings::next_token(&iter)) { + if (strings::contains(s, '>')) { + line = s; + break; + }; + }; + let ssid = strings::cut(strings::cut(strings::cut(line, " ").1, " ").1, " ").0; + let text = if (ssid != "") + fmt::asprintf(" {}", ssid) + else + fmt::asprint(" "); + defer free(text); + let text = spans(("", FG[1], BG), (text, TXT, FG[1]), (" ", BG, FG[1])); + defer free(text); + dump(os::stdout, [("full_text", text), ("markup", "pango"), ("separator_block_width", 0)]: [](str, json))!; +}; + +fn get_brightness() (uint | error) = { + let output = run("brightctl")?; + defer free(output); + return strconv::stou(strings::rtrim(output))?; +}; + +fn brightness() (void | error) = { + let text = fmt::asprintf(" {}%", get_brightness()?); + defer free(text); + let text = spans(("", FG[2], BG), (text, TXT, FG[2]), (" ", BG, FG[2])); + defer free(text); + dump(os::stdout, [("full_text", text), ("markup", "pango"), ("separator_block_width", 0)]: [](str, json))!; +}; + +fn battery() (void | error) = { + let file = os::open("/sys/class/power_supply/BAT0/capacity")?; + let content = io::drain(file)?; + io::close(file)?; + defer free(content); + let capacity = strconv::stou(strings::rtrim(strings::fromutf8(content)?))?; + + let file = os::open("/sys/class/power_supply/BAT0/status")?; + let content = io::drain(file)?; + io::close(file)?; + defer free(content); + let status = strings::rtrim(strings::fromutf8(content)?); + + let symbol = "ERROR"; + let i = if (capacity == 0) 0u else (capacity - 1) / 10; + switch (status) { + case "Discharging" => + symbol = ["", "", "", "", "", "", "", "", "", ""][i]; // + case "Charging" => + symbol = ["", "", "", "", "", "", "", "", "", ""][i]; + case "Full" => + symbol = ""; + case => void; + }; + let text = fmt::asprintf(" {} {}%", symbol, capacity); + defer free(text); + let text = spans(("", FG[3], BG), (text, TXT, FG[3]), (" ", BG, FG[3])); + defer free(text); + dump(os::stdout, [("full_text", text), ("markup", "pango"), ("separator_block_width", 0)]: [](str, json))!; +}; + +fn clock() (void | error) = { + // this used to be %-d which disabled padding, but hare doesn't support it + let buf = memio::dynamic(); + defer io::close(&buf)!; + date::format(&buf, " %b %d %H:%M:%S ", &date::now())?; + let buf_text = memio::string(&buf)!; + let text = spans(("", FG[4], BG), (buf_text, TXT, FG[4]), (" ", FG[4], BG)); + defer free(text); + dump(os::stdout, [("full_text", text), ("markup", "pango"), ("separator_block_width", 0)]: [](str, json))!; +}; + +export fn main() void = { + dump(os::stdout, [("version", 1), ("click_events", false)]: [](str, json))!; + fmt::println()!; + fmt::println("[")!; + + let last_vol = 0u; + let last_brt = 0u; + let last_mute = false; + let sleep_dur = time::SECOND; + + for (true) { + let (vol, mute) = match (get_volume()) { + case let x: (uint, bool) => + yield x; + case let err: error => + fmt::errorln("statusbar: error:", strerror(err))!; + yield (last_vol, last_mute); + }; + let brt = match (get_brightness()) { + case let x: uint => + yield x; + case let err: error => + fmt::errorln("statusbar: error:", strerror(err))!; + yield last_brt; + }; + + if (last_vol != vol || last_mute != mute || last_brt != brt) { + sleep_dur = time::MILLISECOND * 100; + } else if (sleep_dur < time::SECOND) { + sleep_dur += time::MILLISECOND * 100; + } else { + sleep_dur = time::SECOND; + }; + last_vol = vol; + last_mute = mute; + last_brt = brt; + + let segments: []*fn() (void | error) = [&volume, &network, &brightness, &battery, &clock]; + fmt::print("[")!; + for (let i = 0z; i < len(segments); i += 1) { + if (i > 0) fmt::print(",")!; + match (segments[i]()) { + case void => void; + case let err: error => + fmt::errorln("statusbar: error:", strerror(err))!; + }; + }; + fmt::println("],")!; + + time::sleep(sleep_dur); + }; +}; diff --git a/bin/statusline.sh b/bin/statusline.sh new file mode 100755 index 0000000..61eb799 --- /dev/null +++ b/bin/statusline.sh @@ -0,0 +1,79 @@ +#!/bin/sh + +volume() { + volume="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" + volume="$(dc -e "${volume#Volume:\ } 100 * p")" + volume="${volume%.*}" + if [ "$volume" -eq 0 ]; then + symbol= + elif [ "$volume" -le 50 ]; then + symbol= + else + symbol= + fi + printf '%s %d%%' "$symbol" "$volume" +} + +network() { + ssid="$(iwctl station wlan0 get-networks | awk -F' ' '/>/{print $3}')" + if [ -n "$ssid" ]; then + printf ' %s' "$ssid" + else + printf ' ' + fi +} + +brightness() { + printf ' %d%%' "$(brightctl)" +} + +battery() { + cap="$(cat /sys/class/power_supply/BAT0/capacity)" + stat="$(cat /sys/class/power_supply/BAT0/status)" + + symbol= + index=$(((cap-1)/10+1)) + case "$stat" in + Discharging) + symbol="$(printf ' ' | cut -d' ' -f$index)" + ;; + Charging) + symbol="$(printf ' ' | cut -d' ' -f$index)" + ;; + Full) + symbol= + ;; + esac + printf '%s %d%%' "$symbol" "$cap" +} + +clock() { + printf ' %s' "$(date '+%b %-d %H:%M:%S')" +} + +# Make the volume and brightness sections appear to update in real time by +# polling more frequently when the user is changing them. +last_vol= +last_brt= +sleep_for=10 +while true; do + vol="$(volume)" + brt="$(brightness)" + if [ "$last_vol" != "$vol" ] || [ "$last_brt" != "$brt" ]; then + sleep_for=1 + elif [ $sleep_for != 10 ]; then + sleep_for=$((sleep_for+1)) + else + sleep_for=10 + fi + last_vol="$vol" + last_brt="$brt" + + printf '%s | %s | %s | %s | %s\n' \ + "$vol" \ + "$(network)" \ + "$brt" \ + "$(battery)" \ + "$(clock)" + sleep $((sleep_for/10)).$((sleep_for%10)) +done diff --git a/bin/waylock b/bin/waylock new file mode 100755 index 0000000..c295ab8 --- /dev/null +++ b/bin/waylock @@ -0,0 +1,2 @@ +#!/command/execlineb -s0 +/usr/bin/waylock -init-color 0x100F0F -input-color 0xCECDC3 -fail-color 0xAF3029 ${@} diff --git a/bin/wmenu b/bin/wmenu new file mode 100755 index 0000000..9df525d --- /dev/null +++ b/bin/wmenu @@ -0,0 +1,13 @@ +#!/bin/execlineb -s0 +multisubstitute { + define bg "100f0f" + define fg "cecdc3" + define accent "4385be" +} +emptyenv -P +/usr/bin/wmenu + -f "Fira Code Nerd Font 12" + -N ${bg} -n ${fg} + -M ${accent} -m ${bg} + -S ${accent} -s ${bg} + ${@} diff --git a/bin/wmenu-run b/bin/wmenu-run new file mode 100755 index 0000000..6d80a33 --- /dev/null +++ b/bin/wmenu-run @@ -0,0 +1,2 @@ +#!/bin/sh +exec $(IFS=:; find -L ${PATH} -type f -perm -555 -exec basename -a '{}' + | sort -u | wmenu -p run:) diff --git a/bin/wmenu-yesno b/bin/wmenu-yesno new file mode 100755 index 0000000..e719215 --- /dev/null +++ b/bin/wmenu-yesno @@ -0,0 +1,4 @@ +#!/command/execlineb -s1 +backtick -ED No answer { heredoc 0 "Yes\nNo\n" wmenu -p ${1} } +if -t { test ${answer} = Yes } +exec ${@} |
