From 71d6a601089717afbf3aa9a23cd6608525fc7627 Mon Sep 17 00:00:00 2001 From: vorboyvo Date: Tue, 12 Nov 2024 11:46:24 -0500 Subject: [PATCH] Added clifm, zathura, libertinus font, typst. Moved gammastep to its own file to be imported. --- hosts/randolph/home.nix | 21 +- programs/clifm.nix | 7 + programs/clifm/clifmrc | 532 ++++++++++++++++++++++++++++++++++ programs/clifm/mimelist.clifm | 200 +++++++++++++ programs/gammastep.nix | 16 + 5 files changed, 761 insertions(+), 15 deletions(-) create mode 100644 programs/clifm.nix create mode 100644 programs/clifm/clifmrc create mode 100644 programs/clifm/mimelist.clifm create mode 100644 programs/gammastep.nix diff --git a/hosts/randolph/home.nix b/hosts/randolph/home.nix index 6d40c3c..a0c20fc 100644 --- a/hosts/randolph/home.nix +++ b/hosts/randolph/home.nix @@ -6,10 +6,12 @@ let terminal = pkgs.alacritty; in { imports = [ + ../../programs/gammastep.nix ../../programs/kdeconnect.nix ../../programs/ssh.nix ../../programs/zsh.nix ../../programs/taskwarrior.nix + ../../programs/clifm.nix ]; home.username = "alice"; home.homeDirectory = "/home/alice"; @@ -32,25 +34,11 @@ in { }; }; - # Configure internationalization - # i18n.inputMethod.enabled = "fcitx5"; - # Configure xdg-desktop-portal (for file picker, etc.) # xdg.portal = { # enable = true; # }; - # Configure gammastep (night shift) - services.gammastep = { - enable = true; - temperature.day = 6500; - temperature.night = 4000; - # boul robert-bourassa/boul rené-lévesque : 45.498743909804354, -73.5703457606738 - latitude = 45.4987; - longitude = -73.5703; - # tray = true; - }; - # Install packages home.packages = with pkgs; let @@ -63,6 +51,7 @@ in { in [ gcc tree-sitter ] ++ # Basic dev tools [ marksman nil ] ++ # Language servers except those installed through package sections [ texliveFull texlab ] ++ # LaTeX + [ typst typstyle tinymist ] ++ # Typst (with ocamlPackages; [ ocaml opam @@ -91,11 +80,12 @@ in { proselint # for prose lint glib ] ++ # Basic utilities - [ bitwarden-cli htop snore hledger hledger-ui ] + [ bitwarden-cli htop snore hledger hledger-ui clifm ] ++ # Personalized selection of command-line (CLI/TUI) apps [ terminal ] ++ # Terminal emulator [ qutebrowser + zathura evince imv vlc @@ -130,6 +120,7 @@ in { highway-gothic merriweather-sans paratype-pt-serif + libertinus font-awesome ] ++ # Fonts # [ papirus-icon-theme ] ++ # Icons diff --git a/programs/clifm.nix b/programs/clifm.nix new file mode 100644 index 0000000..20644e6 --- /dev/null +++ b/programs/clifm.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + + home.packages = with pkgs; [ clifm ]; + xdg.configFile."clifm/profiles/default/clifmrc".source = ./clifm/clifmrc; + xdg.configFile."clifm/profiles/default/mimelist.clifm".source = ./clifm/mimelist.clifm; + +} diff --git a/programs/clifm/clifmrc b/programs/clifm/clifmrc new file mode 100644 index 0000000..3d0b6c1 --- /dev/null +++ b/programs/clifm/clifmrc @@ -0,0 +1,532 @@ + ########################################### + # CLIFM # + # The command line file manager # + ########################################### + +# This is Clifm's main configuration file. + +# Lines starting with either '#' or ';' are commented (ignored). +# Options starting with a ';' hold the default value, but are commented. +# To override a default value, uncomment the corresponding option. + + +#=====================================# +# 1. INTERFACE # +#=====================================# + +# Show hidden files (i.e. files starting with a dot). +;ShowHiddenFiles=false + +# Files listed in a '.hidden' file in the current directory will be hidden +# whenever hidden files are not shown (i.e. ShowHiddenFiles is set to false). +# Both plain file names and wildcards are supported. +;ReadDotHidden=false + +# Use a regular expression to filter files from the files list. +# Example: "!.*~$" to exclude backup files (ending with ~), or "^\." to +# list only hidden files. File type filters are also supported. Example: +# "=d" to list directories only, or "!=l" to exclude symlinks. +# Run 'help file-filters' for more information. +;Filter="" + +# List directories first. +;ListDirsFirst=true + +# The amount of files contained by a directory is informed next +# to the directory name. However, this feature might slow things down +# when, for example, listing files on a remote server. The files counter +# can be disabled here, via the --no-files-counter option, or using the +# 'fc' command while in the program itself. +# Note: Classify (see below) must be set to true. +;FilesCounter=true + +# If running with colors, append directory indicator to directories. If +# running without colors (via the --no-color option), append file type +# indicator at the end of file names: +# '/' for directories +# '@' for symbolic links +# '=' for sockets +# '|' for FIFO/pipes +# '*' for for executable files +# '+' for block special files +# '-' for character special files +# '?' for unknown file types +# Bear in mind that when running in light mode the check for executable +# files won't be performed, and thereby no indicator will be added to +# executable files. +# Note: Setting this option to false disables the files counter. +;Classify=true + +# Symbolic links are colored as the target file name. An indicator character +# (by default '@') is placed at the beginning of the name to mark it as a +# symbolic link. +# The color of this indicator can be customized via the 'lc' code in the +# color scheme file (InterfaceColors field). +;ColorLinksAsTarget=false + +# Mas, the files list pager. Possible values are: +# 0/false: Disable the pager. +# 1/true: Run the pager whenever the list of files does not fit on the screen. +# >1: Run the pager whenever the amount of files in the current directory is +# greater than or equal to this value (say, 1000). +;Pager=0 +Pager=60 + +# How to list files in the pager. Possible values: +# auto: use the current listing mode +# long: list files in long view +# short: list files in short view +;PagerView=auto + +# How to list files: 0 = vertically (like ls(1) would), 1 = horizontally. +;ListingMode=0 + +# How to sort listed files. +# Available options: none, name, version, extension, type, blocks, size, +# links, atime, btime, ctime, mtime, inode, owner, and group. +;Sort=version + +# By default, files are sorted from less to more (ex: from 'a' to 'z' if +# using the "name" method). To invert this ordering, set SortReverse to +# true (you can also use the --sort-reverse option or the 'st rev' command). +;SortReverse=false + +# Display extended file metadata next to file names (long listing format). +;LongViewMode=false +LongViewMode=true + +# Properties fields to be displayed for each file name in long view mode: +# f = files counter (for directories) +# B = file allocated blocks +# d = inode number +# l = number of hard links +# p|n = permissions: either symbolic (p) or numeric/octal (n) +# i|I = user/group IDs: either as number (i) or name (I) +# G = if i|I is set, don't print groups +# a|b|m|c = last (a)ccess, (b)irth, (m)odification, or status (c)hange time +# s|S = size (either human readable (s) or bytes (S)) +# x = extended attributes/capabilities/ACLs (marked as '@') (requires p|n) +# A single dash ("-") disables all fields +# +# Note that, exception made of 'x' and 'G', fields will be displayed in the +# order specified here. +# +# Example: display only permissions (numeric) and size (human readable): +#PropFields="ns" +# or, to display file permissions, modification time, and size (in bytes): +#PropFields="pmS" +;PropFields="xfpIsm" + +# Number of spaces between fields in long view. Possible values: 1-2. +;PropFieldsGap=1 + +# Style used to print timestamps in long view mode. +# Available styles: default, relative, iso, long-iso, full-iso, +FORMAT +# FORMAT is interpreted like in strftime(3). +# Defaults to "+%b %e %H:%M" for recent files (< 6 months) and "+%b %e %Y" +# for older files. +# Examples: +;TimeStyle="full-iso" +;TimeStyle="relative" +;TimeStyle="+%F %T" + +# If sorting files by time, use the same time files are sorted by for the time +# field in long view (disregarding the value set in PropFields). +;TimeFollowsSort=true + +# Append an 'a', 'b', 'c', or 'm' to the timestamp (long view only) to indicate +# the kind of timestamp, i.e, access, birth, status change, or modification +# time respectively. In case of relative times, uppercase characters are used +# instead for better visibility. +;TimestampMark=false + +# Same as TimeStyle, but for the 'p/pp' command. +# Available styles: default, iso, long-iso, full-iso, full-iso-nano, +FORMAT +# Nano-second precision is available via the %N modifier. +;PTimeStyle="+%Y-%m-%d %H:%M:%S.%N %z" + +# If running in long view, print directories full size (i.e. recursively). +;FullDirSize=false + +# Print files apparent size instead of actual device usage. +;ApparentSize=true + +# In light mode, extra file type checks (except those provided by +# the d_type field of the dirent structure (see readdir(3)) +# are disabled to speed up the listing process. stat(3) and access(3) +# are not executed at all, so that we cannot know in advance if a file +# is readable by the current user, if it is executable, SUID, SGID, if a +# symlink is broken, and so on. The file extension check is ignored as +# well, so that the color per extension feature is disabled. +;LightMode=false + +# Clear the screen before listing files. +# Possible values: 'true', 'false', 'internal' (restrict this behavior to +# internal commands only: shell commands won't clear the screen). +# Note: if set to 'internal', the current list of files won't be refreshed +# even if an external command creates, removes, or renames a file in the +# current directory. +;ClearScreen=true + +# Maximum file name length for listed files. If TrimNames is set to true, +# names larger than MaxFilenameLen will be truncated at MaxFilenameLen +# using a tilde (~). +# Set it to -1 (or empty) to remove this limit. +# If running in long mode, this setting is overriden by MinFilenameTrim +# whenever MaxFilenameLen is smaller than MinFilenameTrim. +;MaxFilenameLen=20 +MaxFilenameLen=-1 + +# Trim file names longer than MaxFilenameLen. +;TrimNames=true + +# Minimum length at which a file name can be trimmed in long view mode. +# When running in long mode, this setting overrides MaxFilenameLen +# whenever MaxFilenameLen is smaller than MinFilenameTrim. +;MinFilenameTrim=20 + +# A comma separated list of workspace names in the form NUM=NAME. +# Example: "1=MAIN,2=EXTRA,3=GIT" or "1=α,2=β,3=γ" +;WorkspaceNames="" + +# If set to true, settings changed in the current workspace (only via +# the command line or keyboard shortcuts) are kept private to that +# workspace and made persistent (for the current session only), even +# when switching workspaces. +;PrivateWorkspaceSettings=false + +# Print the disk usage of the file system the current directory belongs to +# in the form "FREE/TOTAL (FREE_PERCENTAGE) FS_TYPE DEV_NAME". +;DiskUsage=false + +# Print a map of the current position in the directory history list, +# showing previous, current, and next entries. +;DirhistMap=false + +# Print the list of selected files after the files list. Since this +# list could become quite extensive, you can limit the number of printed +# entries using the MaxPrintSelfiles option below. +;PrintSelfiles=false +PrintSelfiles=true + +# Maximum amount of selected files to be printed if PrinSelFiles is set +# to true. Possible values: -1 = no limit, 0 = auto (never print more +# than half terminal height), or any positive value. +;MaxPrintSelfiles=0 + +# Color schemes (or just themes) are stored in the colors directory +# ($XDG_DATA_DIRS/clifm/colors, usually /usr/local/share/clifm/colors +# or /usr/share/clifm/colors). You can place your custom themes in +# $HOME/.config/clifm/colors. +# +# Use the 'cs' command or the '--color-scheme' command line option to set +# a theme. +# +# Run 'cs edit' to edit the current theme. +# +# Each theme includes color definitions, just as definitions for the +# prompt, the warning prompt, the dividing line, and the FZF window. +# +# Use TAB to list available themes: 'cs TAB'. +# +# Visit https://github.com/leo-arch/clifm-colors to get a few extra themes. +# +# Defaults to 'default-256', or 'default' (16 colors) if 256 colors support +# is not detected. +;ColorScheme=default-256 +ColorScheme=aqua + +# Enable/disable icons. +# By default, emojis (widely available today) are used as icons. +# Nerd-fonts and icons-in-terminal are supported as well, though Clifm +# needs to be recompiled in order to enable support. Consult our Wiki +# (https://github.com/leo-arch/clifm/wiki) for more information. +;Icons=false +Icons=true + + +#=====================================# +# 2. COMMAND LINE # +#=====================================# + +# Set quoting style used to expand ELN's (regular files only). +# Quoting styles: 'backslash' (default), 'single', or 'double' quotes. +# Useful when using shells not supporting backslashes as quoting +# mechanisms (ex: nushell or xonsh). +;QuotingStyle=backslash + +# Enable fuzzy matching for filename/path completions and suggestions. +;FuzzyMatching=false + +# Fuzzy algorithm. Available options are: +# 1 = faster, not Unicode aware +# 2 = slower, Unicode aware (note that this second algorithm will +# nonetheless fallback to the first one whenever the query string +# does not contain unicode characters, minimizing thus the performance +# penalty). +;FuzzyAlgorithm=2 + +# TAB completion mode: 'standard', 'fzf', 'fnf' or 'smenu'. Defaults +# to 'fzf' if the binary is found in PATH. Othwerwise, the standard +# mode is used. +;TabCompletionMode= + +# File previews for TAB completion (fzf mode only). Possible values: +# 'true', 'false', 'hidden' (enabled, but hidden; toggle with Alt-p). +;FzfPreview=true + +# Enable auto-suggestions +;AutoSuggestions=true + +# The following suggestion checks will be performed in the order +# specified by SuggestionStrategy. Available checks are: +# a = Aliases names +# c = Path completion +# e = ELN's +# f = File names in current directory +# h = Commands history +# j = Jump database +# Use a single dash (-) to skip all these checks. +;SuggestionStrategy=ehfjac + +# Suggest file names using the corresponding file type color (set +# via the color scheme file). +;SuggestFiletypeColor=false + +# Suggest a brief description for internal commands. +;SuggestCmdDesc=true + +# Enable syntax highlighting. +;SyntaxHighlighting=true + +# Allow external, shell commands. +;ExternalCommands=true + + +#=====================================# +# 3. COMMANDS # +#=====================================# + +# List files automatically after changing the current directory. +;AutoLs=true + +# If set to true, a command name that is the name of a directory or a +# file, is executed as if it were the argument to the the 'cd' or the +# 'open' commands respectively: 'DIR' is equivalent 'cd DIR' and +# 'FILE' to 'open FILE'. +;Autocd=true +;AutoOpen=true + +# Run autocommand files (.cfm.in and .cfm.out) found in the current +# directory. For more information consult the manpage. +;ReadAutocmdFiles=false + +# Run in read-only mode (internal commands able to modify the file +# system are disabled). Consult the manpage for the list of affected +# commands. +;Readonly=false + +# Make the 'r' command trash files instead of removing them. +;TrashAsRm=false +TrashAsRm=true + +# If set to true, do not ask for confirmation before trashing files. +;TrashForce=true + +# If set to true, do not ask for confirmation before removing files +# with the 'r' command. +# Note: use the '-f' parameter to turn this option on for a single +# command. Example: 'r -f FILE'. +;rmForce=false + +# Set the default copy command. Available options are: +# 0 = 'cp -iRp', 1 = 'cp -Rp', 2 = 'advcp -giRp', 3 = 'advcp -gRp', +# 4 = 'wcp', and 5 = 'rsync -avP' +# 2-5 include a progress bar. +# Only 0 and 2 will prompt before overwrite. +;cpCmd=0 + +# Set the default move command. Available options are: +# 0 = 'mv -i', 1 = 'mv', 2 = 'advmv -gi', and 3 = 'advmv -g' +# 2 and 3 include a progress bar. +# Only 0 and 2 will prompt before overwrite. +;mvCmd=0 + +# How should the 'l' command create symbolic links. Possible values: +# absolute = Make the target an absolute path +# relative = Make the target relative to the link location (like 'ln -rs') +# literal = Do not resolve the target at all (like 'ln -s') +;LinkCreationMode=literal + +# Choose the resource opener to open files with their default associated +# application (e.g. Ranger's rifle or xdg-open). If not set, 'lira', +# Clifm's built-in opener, is used instead. +;Opener= + +# Only used when opening a directory via a new Clifm instance (with the +# 'x' command), this option specifies the command to be used to launch a +# terminal emulator to run Clifm on it. +TerminalCmd="$TERM -e" + +# Set the file mode creation mask. Defaults to the value inherited from +# the shell (though 077 is recommended). +# This option is ignored in secure mode (umask is forcefully set to 077). +;Umask=077 + +# We have three search strategies: 0 = glob-only, 1 = regex-only, +# and 2 = glob-regex. Used by the quick search function. +;SearchStrategy=2 + +# When a directory rank in the jump database falls below MinJumpRank, it +# will be removed. If set to 0, directories are kept indefinitely. +;MinJumpRank=10 + +# When the sum of all ranks in the jump database reaches MaxJumpTotalRank, +# all ranks will be reduced using a dynamic factor so that the total sum falls +# below MaxJumpTotalRank again. Those entries falling below MinJumpRank will +# be deleted. +;MaxJumpTotalRank=100000 + +# Automatically purge the jump database from non-existing directories at +# startup. Note that this will remove paths pointing to unmounted removable +# devices and remote file systems. +;PurgeJumpDB=false + +# Print the list of commands executed in the current directory (the list is +# cleared after changing the directory). +;PrintDirCmds=false + + +#=====================================# +# 4. LOGS AND HISTORY # +#=====================================# + +# Send errors, warnings, and notices to the notification daemon. +;DesktopNotifications=true + +# Log errors and warnings. +;LogMsgs=false +# Log commands entered in the command line. +;LogCmds=false +# Keep only the last N lines of the log file. +;MaxLog=1000 + +# A regular expression to prevent command lines from being added to the +# history list. Set this line to the empty string to disable history filters. +;HistIgnore="^[q,Q]$|^quit$|^exit$|^ .*|^#.*|^[0-9]+$|^\.+$" + +# Limit the size of the commands history file to MaxHistory entries. +;MaxHistory=1000 + +# Same as HistIgnore, but for the directory history list. +;DirhistIgnore="" + +# Limit the size of the directory history file to MaxDirhist entries. +;MaxDirhist=100 + + +#=====================================# +# 5. MISC # +#=====================================# + +# Enable case sensitive listing for files in the current directory. +;CaseSensitiveList=false + +# Enable case sensitive lookup for the directory jumper function (via +# the 'j' command). +;CaseSensitiveDirJump=false + +# Enable case sensitive completion for file names. +;CaseSensitivePathComp=false + +# Enable case sensitive search. +;CaseSensitiveSearch=false + +# When sorting files (either by 'version' or 'name'), skip +# non-alphanumeric characters. Ex: '__file' is sorted as 'file'. +# This also applies to hidden files: if set to false, '.hidden' will +# be listed before 'afile', otherwise, after 'gfile'. +;SkipNonAlnumPrefix=false + +# Set a custom starting path. If not specified, it defaults to the current +# working directory. If set, it overrides RestoreLastPath. +;StartingPath= + +# Start Clifm in the last visited directory (and in the last used +# workspace). This option is overriden by StartingPath (if set). +;RestoreLastPath=true +RestoreLastPath=false + +# Set readline editing mode: 0 for vi and 1 for emacs (default). +;RlEditMode=1 + +# Write the last visited directory to $XDG_CONFIG_HOME/clifm/.last to be +# later accessed by the corresponding shell function at program exit. +# To enable this feature consult the manpage. +;CdOnQuit=false + +# Share the Selection Box among different profiles. +;ShareSelbox=false + +# Print a usage tip at startup. +;Tips=true + +# Just a kind welcome message at startup. +;WelcomeMessage=true + +# Set a custom welcome message. +# Colors are available via escape codes. E.g.: "\e[34mWelcome!\e[0m". +# An ending new line character will be appended automatically. +;WelcomeMessageStr="" + +# Print Clifm's logo screen at startup. +;SplashScreen=false + + +#=====================================# +# 6. ALIASES # +#=====================================# + +# Bind '?' to the interactive help plugin. Run 'actions' to print the +# list of available plugins. +#alias ?='ih' +# Bind 'b' to the directory history navigation plugin. +#alias b='dh' +# Replace the standard deselect command (ds) by the fzfdesel plugin. +#alias ds='**' +# You can use this alias to quickly change to the current virtual directory. +#alias vtd='cd $CLIFM_VIRTUAL_DIR' +# Replace the built-in bulk rename function (br) by vidir(1). +#br='vidir' + +#=====================================# +# 7. PROMPT COMMANDS # +#=====================================# + +# Write below the commands you want to be executed before each prompt. Ex: +#promptcmd /usr/local/share/clifm/plugins/git_status.sh +#promptcmd date | awk '{print $1", "$2,$3", "$4}' + +#=====================================# +# 8. AUTOCOMMANDS # +#=====================================# + +# Control Clifm's settings on a per directory basis. For more information +# consult the manpage. + +# Remote file systems are slow: let's speed this up by enabling the light +# mode and disabling the files counter. +#autocmd /media/remotes/** lm=1,fc=0 + +# Just a friendly reminder. +#autocmd ~/important !printf "Keep your fingers outta here!\n" && read -n1 + +# Plenty of images and vids? Launch the files previewer plugin. +#autocmd ~/Downloads !/usr/local/share/clifm/plugins/fzfnav.sh + +# Use the nord color scheme and disable hidden files in the ~/Documents +# directory. +#autocmd ~/Documents/** cs=nord,hf=0 + +# I want files in the third workspace to be listed in long view. +#autocmd @ws3 lv=1 diff --git a/programs/clifm/mimelist.clifm b/programs/clifm/mimelist.clifm new file mode 100644 index 0000000..f43cbe5 --- /dev/null +++ b/programs/clifm/mimelist.clifm @@ -0,0 +1,200 @@ + ################################### + # Configuration file for Lira # + # Clifm's resource opener # + ################################### + +#----------------------------- +# Description +#----------------------------- + +# Commented and blank lines are ignored. + +# The below settings cover the most common filetypes. +# It is recommended to edit this file placing your prefered applications +# at the beginning of the apps list to speed up the opening process. + +# The file is read top to bottom and left to right; the first existent +# application found will be used. + +# Applications defined here are NOT desktop files, but commands (arguments +# can be used as well). Bear in mind that these commands will be executed +# directly without shell intervention, so that no shell goodies (like pipes, +# conditions, loops, etc) are available. In case you need something more +# complex than a single command (including shell capabilities) write your +# own script and place the path to the script in place of the command. +# For example: +# X:^text/.*:~/scripts/my_cool_script.sh + +# Use 'X' to specify a GUI environment and '!X' for non-GUI environments: +# X = GUI only +# !X = Non-GUI only (like the kernel console or an SSH session) +# If the current line applies to both GUI and non-GUI environments, just omit +# the X. Ex: 'text/plain=vi + +# Use 'N' to match file names instead of MIME types. +# 'N:.*\.txt$=vi' to open all .txt files with vi (either GUI or non-GUI) +# 'X:N:.*\.txt$=geany' (GUI only) +# '!X:N:.*\.txt$=vi' (non-GUI only) + +# Regular expressions are allowed for both file types and file names. + +# Use the '%f' placeholder to specify the position of the file name to be +# opened in the command. Example: +# 'mpv %f --no-terminal' -> 'mpv FILE --no-terminal' +# If %f is not specified, the file name will be added to the end of the +# command. Ex: 'mpv --no-terminal' -> 'mpv --no-terminal FILE' + +# To silence STDERR and/or STDOUT use !E and !O respectively (they can be +# used together). Examples: +# Silence STDERR only and run in the foreground: +# mpv %f !E +# Silence both (STDERR and STDOUT) and run in the background: +# mpv %f !EO & +# For Ranger users, "!EO" is equivalent to "flag f" in rifle.conf. + +# The '%x' flag can be used as a shorthand for "%f !EO &". Example: +# mpv %x + +# Running the opening application in the background: +# For GUI applications: +# APP %x +# For terminal applications: +# TERM -e APP %x +# Replace 'TERM' and 'APP' by the corresponding values. The -e option +# might vary depending on the terminal emulator used (TERM). +# +# Bear in mind that this will hide error messages. To print error +# messages compose the command as follows: +# cmd %f !O & +# This will run 'cmd' in the background silencing STDOUT only. + +# Note on graphical applications: If the opening application is already +# running, the file will be opened, usually in a new tab, and Clifm won't +# wait for the file to be closed (because the procecss already returned). +# To avoid this, instruct the application to execute a new instance. For example: +# geany -i, gedit -s, kate -n, pluma --new-window, and so on. + +# Environment variables can be used as well. Example: +# X:text/plain=$EDITOR %f &;$VISUAL;nano;vi + +# Use Ranger's rifle (or whatever opener you prefer) to open all files +#.*=rifle + +################################ +# 1. File names/extensions # +################################ + +# Match a full file name +#X:N:some_filename=cmd + +# Match all file names starting with 'str' +#X:N:^str.*=cmd + +# Match files with extension 'ext' +#X:N:.*\.ext$=cmd + +#----------------------------- +# Clifm config files +#----------------------------- + +X:N:(.*\.clifm$|clifmrc)=$EDITOR;$VISUAL;kak;micro;nvim;vim;vi;mg;emacs;nano;mili;leafpad;mousepad;featherpad;gedit -s;kate -n;pluma --new-window +!X:N:(.*\.clifm$|clifmrc)=$EDITOR;$VISUAL;kak;micro;nvim;vim;vi;mg;emacs;nano + +#----------------------------- +# Digital books +#----------------------------- + +X:N:.*\.djvu$=djview %x;zathura %x;xreader %x;evince %x;atril %x +X:N:.*\.(fb2|epub)$=mupdf %x;zathura %x;xreader %x;ebook-viewer %x;FBReader %x;foliate %x +X:N:.*\.mobi$=mupdf %x;ebook-viewer %x;FBReader %x;foliate %x +X:N:.*\.(cbr|cbz|cb7|cbt|cba)$=mcomix %x;xreader %x;YACReader %x;qcomicbook %x;zathura %x;foliate %x +X:N:.*\.chm$=xchm %x + +# .abw files are Abiword documents. +# These are basically XML, but you most likely want to open it with a word processor. +X:N:.*\.abw$=abiword %x;libreoffice %x;soffice %x;ooffice %x + +################################ +# 2. MIME types # +################################ + +#----------------------------- +# Directories +#----------------------------- +# Only for the open-with command (ow) and the --open command line switch. +# In graphical environments directories will be opened in a new window. + +X:inode/directory=xterm -e clifm %x;xterm -e vifm %x;pcmanfm %x;thunar %x;xterm -e ncdu %x +!X:inode/directory=vifm;ranger;nnn;ncdu + +#----------------------------- +# Web content +#----------------------------- + +X:^text/html$=$BROWSER;surf %x;vimprobable %x;vimprobable2 %x;qutebrowser %x;dwb %x;jumanji %x;luakit %x;uzbl %x;uzbl-tabbed %x;uzbl-browser %x;uzbl-core %x;iceweasel %x;midori %x;opera %x;firefox %x;seamonkey %x;brave %x;chromium-browser %x;chromium %x;google-chrome %x;epiphany %x;konqueror %x;elinks;links2;links;lynx;w3m +!X:^text/html$=$BROWSER;elinks;links2;links;lynx;w3m + +#----------------------------- +# Text +#----------------------------- + +X:^text/rtf$=libreoffice %x;soffice %x;ooffice %x +X:(^text/.*|application/(json|javascript)|inode/x-empty)=$TERM -e $EDITOR %x;$TERM -e $VISUAL $x;kak;micro;dte;nvim;vim;vi;mg;emacs;nano;mili;leafpad %x;mousepad %x;featherpad %x;nedit %x;kate %x;gedit %x;pluma %x;io.elementary.code %x;liri-text %x;xed %x;atom %x;nota %x;gobby %x;kwrite %x;xedit %x +!X:(^text/.*|application/(json|javascript)|inode/x-empty)=$EDITOR;$VISUAL;kak;micro;dte;nvim;vim;vi;mg;emacs;nano + +#----------------------------- +# Office documents +#----------------------------- + +^application/.*(open|office)document\.spreadsheet.*=sc-im +X:^application/(msword|vnd.ms-excel|vnd.ms-powerpoint|.*(open|office)document.*)=libreoffice %x;soffice %x;ooffice %x + +#----------------------------- +# Archives +#----------------------------- +# Note: 'ad' is Clifm's built-in archives utility (based on atool(1)). Remove it if you +# prefer another application. + +X:^application/(zip|gzip|zstd|x-7z-compressed|x-xz|x-bzip*|x-tar|x-iso9660-image)=ad;xarchiver %x;lxqt-archiver %x;ark %x +!X:^application/(zip|gzip|zstd|x-7z-compressed|x-xz|x-bzip*|x-tar|x-iso9660-image)=ad + +#----------------------------- +# PDF +#----------------------------- + +X:.*/pdf$=mupdf %x;sioyek %x;llpp %x;lpdf %x;zathura %x;mupdf-x11 %x;apvlv %x;xpdf %x;xreader %x;evince %x;atril %x;okular %x;epdfview %x;qpdfview %x + +#----------------------------- +# Images +#----------------------------- + +X:^image/gif$=animate %x;pqiv %x;sxiv -a %x;nsxiv -a %x;feh %x +X:^image/svg=display;inkscape %x +X:^image/.*=sxiv %x;nsxiv %x;pqiv %x;gpicview %x;qview %x;qimgv %x;mirage %x;ristretto %x;loupe %x;eog %x;eom %x;xviewer %x;viewnior %x;nomacs %x;geeqie %x;gwenview %x;gthumb %x;gimp %x +!X:^image/.*=fim;img2txt;cacaview;fbi;fbv + +#----------------------------- +# Video and audio +#----------------------------- + +X:^video/.*=ffplay %x;mplayer %x;mplayer2 %x;mpv %x;vlc %x;gmplayer %x;smplayer %x;celluloid %x;qmplayer2 %x;haruna %x;totem %x +X:^audio/.*=mpv %x;gmplayer %x;smplayer %x;vlc %x;totem %x;ffplay %x;mplayer;mplayer2 +!X:^audio/.*=ffplay -nodisp -autoexit -hide_banner %f !EO;mplayer %f !EO;mpv --no-terminal + +#----------------------------- +# Fonts +#----------------------------- + +X:^font/.*=fontforge;fontpreview + +#----------------------------- +# Torrent +#----------------------------- + +X:application/x-bittorrent=rtorrent;transimission-gtk %x;transmission-qt %x;deluge-gtk %x;ktorrent %x + +#----------------------------- +# Fallback +#----------------------------- +# Let's fallback to an external opener as last resource +.*=handlr open;mimeopen -n;rifle;mimeo;xdg-open;open; diff --git a/programs/gammastep.nix b/programs/gammastep.nix new file mode 100644 index 0000000..8449ec9 --- /dev/null +++ b/programs/gammastep.nix @@ -0,0 +1,16 @@ +{...}: +let + montreal = { + # robert-bourassa/rené-lévesque + latitude = 45.4987; + longitude = -73.5703; + }; +in +{ + services.gammastep = { + enable = true; + temperature.day = 6500; + temperature.night = 4000; + inherit (montreal) latitude longitude; + }; +}