Commit 906a451b authored by AdminXVII's avatar AdminXVII

Merge branch 'master' of gitlab.redox-os.org:redox-os/ion-plugins

parents 9c8aa52b a9e3fcb3
Pipeline #5643 passed with stages
in 1 minute and 14 seconds
......@@ -12,38 +12,29 @@ git clone https://gitlab.redox-os.org/redox-os/ion-plugins ~/.config/ion/plugins
```
### 2. Use it in your config (~/.config/ion/initrc)
#### For now
```
source ~/.config/ion/plugins/themes/<theme>/init.ion
source ~/.config/ion/plugins/<plugin>/init.ion
...
```
#### Planned API
```
... rest of initrc
source ~/.config/ion/plugins/init.ion
load_theme robbyrussel
load [ git yarn ... ]
```
## What's provided
### Plugins
Use them by adding their identifiers to the `load` array parameter. A list of plugins is simply the folders that are included in the repo
## How to use plugins
Use them by sourcing their files. A list of plugins can be found [here](http://redox-os.pages.redox-os.org/ion-plugins/).
#### Adding your own
## Creating your own
Plugins are stored in a directory under ~/.config/ion/plugins with the following structure:
```
plugins/
my-plugin/
- init.ion
- README.md
<section>/
- <plugin>.ion
...
```
The init.ion is read at the shell lauch and should register its functions.
The ion script is read at the shell launch and should register its functions.
A comment describing the plugin should be placed at the begining of the file if you wish to send it upstream. It will be sourced for the pages documentation.
### Themes
Themes are stored under ~/.config/ion/plugins/themes. You can load the one you like with `load_theme <your theme>`
## Themes
Themes are provided for example in the themes folder. Note however that it is highly recommended that you create your own, as it is quite simple to build with colors in Ion. For more complex logic, plugins provide with helpers.
For native rust theming, see the [candypaint](https://gitlab.redox-os.org/coleman/candypaint) repo.
For powerline, see [powerline-rs](https://gitlab.com/jD91mZM2/powerline-rs#ion).
## Contributors
Feel free to pick an issue and/or send patches for additional features.
......
# This plugin adds useful aliases for common [Yum](http://yum.baseurl.org/) commands.
# This plugin adds useful aliases for common [Yum](http://yum.baseurl.org/) and `dnf` commands.
#
# `dnf` is the new package manager for RPM-based distributions, which
# replaces `yum`.
## Aliases
## Yum
alias ys = 'yum search' # search package
alias yp = 'yum info' # show package info
......@@ -16,3 +19,19 @@ alias yr = 'sudo yum remove' # remove package
alias ygr = 'sudo yum groupremove' # remove pagage group
alias yrl = 'sudo yum remove --remove-leaves' # remove package and leaves
alias yc = 'sudo yum clean all' # clean cache
## DNF
alias dnfl="dnf list" # List packages
alias dnfli="dnf list installed" # List installed packages
alias dnfgl="dnf grouplist" # List package groups
alias dnfmc="dnf makecache" # Generate metadata cache
alias dnfp="dnf info" # Show package information
alias dnfs="dnf search" # Search package
alias dnfu="sudo dnf upgrade" # Upgrade package
alias dnfi="sudo dnf install" # Install package
alias dnfgi="sudo dnf groupinstall" # Install package group
alias dnfr="sudo dnf remove" # Remove package
alias dnfgr="sudo dnf groupremove" # Remove package group
alias dnfc="sudo dnf clean all" # Clean cache
......@@ -15,7 +15,11 @@ section.faq(ref="rootEl")
div(:class="generateQuestionClasses(i)" @click="makeActive(i)")
p.accordion__title-text(v-html="item['title']")
.buttons
button.button--green(@click.stop="$emit('update', item)") Add
button.button--green(
v-if="value.indexOf(item) === -1"
@click.stop="$emit('update', item)"
) Select
button.button--red(v-else @click.stop="$emit('update', item)") Remove
button(:class="generateButtonClasses(i)")
collapse-transition
div.accordion__value(v-if="i === activeQuestionIndex")
......@@ -31,7 +35,11 @@ section.faq(ref="rootEl")
code.block
span(v-for="description, name in item.funcs") fn {{ name }} -- {{ description }}
br
button.button--green(@click="$emit('update', item)") Add
button.button--green(
v-if="value.indexOf(item) === -1"
@click.stop="$emit('update', item)"
) Select
button.button--red(v-else @click.stop="$emit('update', item)") Remove
</template>
<script>
......@@ -40,9 +48,7 @@ import { CollapseTransition } from 'vue2-transitions';
export default {
name: 'VueFaqAccordion',
components: {
CollapseTransition,
},
components: { CollapseTransition },
data() {
return {
activeTab: 0,
......@@ -51,15 +57,14 @@ export default {
};
},
props: {
/**
* Array of items
* Object style {questionProperty: string, answerProperty: string, tabName: string}
* You can change object keys names using other props (questionProperty, answerProperty, tabName)
*/
items: {
type: Array,
required: true,
},
value: {
type: Array,
required: true,
},
},
computed: {
categories() {
......@@ -103,7 +108,6 @@ export default {
}, 300);
},
generateCategoryClasses(category) {
console.log(this.activeTab, category);
return [
'faq__nav-item',
this.activeTab === category
......@@ -234,13 +238,14 @@ export default {
}
&__toggle-button {
position: relative;
width: 1em;
height: 1em;
width: 1.25em;
height: 1.25em;
transition: all 0.3s;
transform-origin: 50% 50%;
padding-left: 16px;
padding-left: 1.25em;
margin-left: 2em;
cursor: pointer;
vertical-align: middle;
&::before,
&::after {
......
......@@ -26,25 +26,33 @@ html {
}
}
$button: #3b8070;
.button--green {
.button {
display: inline-block;
border-radius: 4px;
border: 1px solid #3b8070;
text-decoration: none;
padding: 10px 30px;
border-radius: .25em;
padding: 0 3em;
color: #fff;
background-color: $button;
cursor: pointer;
height: 3em;
}
&:hover {
background: darken($button, 10%);
}
@mixin button_color($color, $name) {
.button--#{$name} {
@extend .button;
background-color: $color;
&:hover {
background: darken($color, 10%);
}
&:active {
background: darken($button, 15%);
&:active {
background: darken($color, 15%);
}
}
}
@include button_color(#3b8070, green);
@include button_color(#BC5666, red);
code {
display: inline-block;
border-radius: .5em;
......
......@@ -12,7 +12,7 @@ section.container
pre
code.block {{ initrc }}
.selection
plugin-selector(:items="items" @update="toggle(`${$event.category}/${event.title}.ion`)")
plugin-selector(:items="items" :value="selection" @update="toggle($event)")
</template>
<script>
......@@ -33,7 +33,7 @@ export default {
if (this.selection.length !== 0) {
initrc += '\n\n# Your list of plugins';
}
return [...this.selection].reduce((rest, item) => `${rest}\nsource ~/.config/ion/plugins/${item}`, initrc);
return [...this.selection].reduce((rest, item) => `${rest}\nsource ~/.config/ion/plugins/${item.category}/${item.title}.ion`, initrc);
},
},
methods: {
......@@ -131,7 +131,7 @@ h1 {
}
.explanations {
height: 50vh;
min-height: 50vh;
margin: 10vh 10vw 0;
}
}
......
This diff is collapsed.
# This plugin adds aliases for common commands of the [Go Programming Language](https://golang.org/)
alias gob='go build'
alias goc='go clean'
alias god='go doc'
alias gof='go fmt'
alias gofa='go fmt ./...'
alias gog='go get'
alias goi='go install'
alias gol='go list'
alias gom='go mod'
alias gop='cd $GOPATH'
alias gopb='cd $GOPATH/bin'
alias gops='cd $GOPATH/src'
alias gor='go run'
alias got='go test'
alias gov='go vet'
# The plugin adds several aliases for common [brew](https://brew.sh) commands.
alias brewp='brew pin'
alias brews='brew list -1'
alias brewsp='brew list --pinned'
alias bubo='brew update && brew outdated'
alias bubc='brew upgrade && brew cleanup'
alias bubu='bubo && bubc'
alias bcubo='brew update && brew cask outdated'
alias bcubc='brew cask reinstall $(brew cask outdated) && brew cleanup'
# Common aliases for bundler
alias be="bundle exec"
alias bl="bundle list"
alias bp="bundle package"
alias bo="bundle open"
alias bout="bundle outdated"
alias bu="bundle update"
alias bi="bundle_install"
alias bcn="bundle clean"
# Aliases for [CakePHP](https://cakephp.org/).
alias c3='bin/cake'
alias c3cache='bin/cake orm_cache clear'
alias c3migrate='bin/cake migrations migrate'
# Some Useful CloudFoundry Aliases & Functions
alias cfl = 'cf login'
alias cft = 'cf target'
alias cfa = 'cf apps'
alias cfs = 'cf services'
alias cfm = 'cf marketplace'
alias cfp = 'cf push'
alias cfcs = 'cf create-service'
alias cfbs = 'cf bind-service'
alias cfus = 'cf unbind-service'
alias cfds = 'cf delete-service'
alias cfup = 'cf cups'
alias cflg = 'cf logs'
alias cfr = 'cf routes'
alias cfe = 'cf env'
alias cfsh = 'cf ssh'
alias cfsc = 'cf scale'
alias cfev = 'cf events'
alias cfdor = 'cf delete-orphaned-routes'
alias cfbpk = 'cf buildpacks'
alias cfdm = 'cf domains'
alias cfsp = 'cf spaces'
alias cfap = 'cf app'
alias cfpm = 'cf push -f'
alias cflr = 'cf logs --recent'
alias cfsrt = 'cf start'
alias cfstp = 'cf stop'
alias cfstg = 'cf restage'
alias cfdel = 'cf delete'
alias cfsrtall = 'cf apps | awk '"'"'/stopped/ { system("cf start " $1)}'"'"
alias cfstpall = 'cf apps | awk '"'"'/started/ { system("cf stop " $1)}'"'"
# Based upon the work of Daniel Gomes (me@danielcsgomes.com)
# Adds a few useful aliases as well as composer's global binaries' paths to $PATH
alias c = 'composer'
alias csu = 'composer self-update'
alias cu = 'composer update'
alias cr = 'composer require'
alias crm = 'composer remove'
alias ci = 'composer install'
alias ccp = 'composer create-project'
alias cdu = 'composer dump-autoload'
alias cdo = 'composer dump-autoload --optimize-autoloader'
alias cgu = 'composer global update'
alias cgr = 'composer global require'
alias cgrm = 'composer global remove'
# install composer in the current directory
alias cget = 'curl -s https://getcomposer.org/installer | php'
# Add Composer's global binaries to PATH, using Composer if available.
if which composer &> /dev/null
export PATH = $PATH:$(composer global config bin-dir --absolute ^>/dev/null)
else
if test -d $HOME/.composer/vendor/bin
export PATH=$PATH:$HOME/.composer/vendor/bin
end
if test -d $HOME/.config/composer/vendor/bin
export PATH=$PATH:$HOME/.config/composer/vendor/bin
end
end
# This plugin provides aliases for frequent [docker-compose](https://docs.docker.com/compose/) commands
# Based upon the work of [tristola](https://github.com/tristola)
#
# Docker-compose related aliases
# Use dco as alias for docker-compose, since dc on *nix is 'dc - an arbitrary precision calculator'
# https://www.gnu.org/software/bc/manual/dc-1.05/html_mono/dc.html
alias dco='docker-compose'
alias dcb='docker-compose build'
alias dce='docker-compose exec'
alias dcps='docker-compose ps'
alias dcrestart='docker-compose restart'
alias dcrm='docker-compose rm'
alias dcr='docker-compose run'
alias dcstop='docker-compose stop'
alias dcup='docker-compose up'
alias dcupd='docker-compose up -d'
alias dcdn='docker-compose down'
alias dcl='docker-compose logs'
alias dclf='docker-compose logs -f'
alias dcpull='docker-compose pull'
alias dcstart='docker-compose start'
fn drf choice:str
if eq $choice ''
drush core-config
else
drush core-config --choice=$choice
end
end
fn drnew
cd
echo "Website's name: "
read WEBSITE_NAME
let HOST = "http://$(hostname -i)/"
if exists -f WEBSITE_NAME
let MINUTES = $(date +%M:%S)
let WEBSITE_NAME = "Drupal-$MINUTES"
echo "Your website will be named: $WEBSITE_NAME"
end
drush dl drupal --drupal-project-rename=$WEBSITE_NAME
echo "Type your localhost directory: (Leave empty for /var/www/html/)"
read DIRECTORY
let DIRECTORY ?= "/var/www/html/"
echo "Moving to $DIRECTORY$WEBSITE_NAME"
sudo mv $WEBSITE_NAME $DIRECTORY
cd $DIRECTORY$WEBSITE_NAME
echo "Database's user: "
read DATABASE_USR
echo "Database's password: "
read -s DATABASE_PWD
echo "Database's name for your project: "
read DATABASE
let DB_URL = "mysql://$DATABASE_USR:$DATABASE_PWD\@localhost/$DATABASE"
drush site-install standard --db-url=$DB_URL --site-name=$WEBSITE_NAME
# TODO: zsh's open_command
xdg-open $HOST$WEBSITE_NAME
echo "Done"
end
# Aliases, sorted alphabetically.
alias dr = 'drush'
alias drca = 'drush cc all' # Deprecated for Drush 8
alias drcb = 'drush cc block' # Deprecated for Drush 8
alias drcg = 'drush cc registry' # Deprecated for Drush 8
alias drcj = 'drush cc css-js'
alias drcm = 'drush cc menu'
alias drcml = 'drush cc module-list'
alias drcr = 'drush core-cron'
alias drct = 'drush cc theme-registry'
alias drcv = 'drush cc views'
alias drdmp = 'drush sql-dump --ordered-dump --result-file=dump.sql'
alias dren = 'drush en -y '
alias drf = 'drush features'
alias drfi = 'drush field-info'
alias drfr = 'drush features-revert -y'
alias drfu = 'drush features-update -y'
alias drfra = 'drush features-revert-all'
alias drif = 'drush image-flush --all'
alias dris = 'drush pm-disable -y'
alias drpm = 'drush pm-list --type=module'
alias drpu = 'drush pm-uninstall -y'
alias drst = 'drush core-status'
alias drup = 'drush updatedb'
alias drups = 'drush updatedb-status'
alias drv = 'drush version'
alias drvd = 'drush variable-del'
alias drvg = 'drush variable-get'
alias drvs = 'drush variable-set'
# ## Based upon the work of [BilalBudhani](https://github.com/BilalBudhani), [eubenesa](https://github.com/eubenesa), [scottkidder](https://github.com/scottkidder]
# Ember CLI (https://www.ember-cli.com/)
# Visit https://www.ember-cli.com/ to view user guide
alias es='ember serve'
alias ea='ember addon'
alias eb='ember build'
alias ed='ember destroy'
alias eg='ember generate'
alias eh='ember help'
alias ein='ember init'
alias ei='ember install'
alias et='ember test'
alias ets='ember test --serve'
alias eu='ember update'
# version
alias ev='ember version'
# This plugin adds some aliases and functions for FirewallD using the `firewalld-cmd` command
alias fw = 'sudo firewall-cmd'
alias fwp = 'sudo firewall-cmd --permanent'
alias fwr = 'sudo firewall-cmd --reload'
alias fwrp = 'sudo firewall-cmd --runtime-to-permanent'
fn fwl
# converts output to zsh array ()
let zones = @split($(sudo firewall-cmd --get-active-zones | grep -v 'interfaces\|sources') '\n')
for i in @zones
sudo firewall-cmd --zone $i --list-all
end
echo 'Direct Rules:'
sudo firewall-cmd --direct --get-all-rules
end
alias angular='frontend angular'
alias angularjs='frontend angularjs'
alias bem='frontend bem'
alias bootsnipp='frontend bootsnipp'
alias bundlephobia='frontend bundlephobia'
alias caniuse='frontend caniuse'
alias codepen='frontend codepen'
alias compassdoc='frontend compassdoc'
alias cssflow='frontend cssflow'
alias dartlang='frontend dartlang'
alias emberjs='frontend emberjs'
alias flowtype='frontend flowtype'
alias fontello='frontend fontello'
alias github='frontend github'
alias html5please='frontend html5please'
alias jestjs='frontend jestjs'
alias jquery='frontend jquery'
alias lodash='frontend lodash'
alias mdn='frontend mdn'
alias nodejs='frontend nodejs'
alias npmjs='frontend npmjs'
alias qunit='frontend qunit'
alias reactjs='frontend reactjs'
alias smacss='frontend smacss'
alias stackoverflow='frontend stackoverflow'
alias typescript='frontend typescript'
alias unheap='frontend unheap'
alias vuejs='frontend vuejs'
# define search context URLS
let _frontend_urls:hmap[str] = [
angular='https://angular.io/?search=' \
angularjs='https://google.com/search?as_sitesearch=angularjs.org&as_q=' \
bem='https://google.com/search?as_sitesearch=bem.info&as_q=' \
bootsnipp='https://bootsnipp.com/search?q=' \
bundlephobia='https://bundlephobia.com/result?p=' \
caniuse='https://caniuse.com/#search=' \
codepen='https://codepen.io/search?q=' \
compassdoc='http://compass-style.org/search?q=' \
cssflow='http://www.cssflow.com/search?q=' \
dartlang='https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:' \
emberjs='https://www.google.com/search?as_sitesearch=emberjs.com/&as_q=' \
flowtype='https://google.com/search?as_sitesearch=flow.org/en/docs/&as_q=' \
fontello='http://fontello.com/#search=' \
github='https://github.com/search?q=' \
html5please='https://html5please.com/#' \
jestjs='https://www.google.com/search?as_sitesearch=jestjs.io&as_q=' \
jquery='https://api.jquery.com/?s=' \
lodash='https://devdocs.io/lodash/index#' \
mdn='https://developer.mozilla.org/search?q=' \
nodejs='https://www.google.com/search?as_sitesearch=nodejs.org/en/docs/&as_q=' \
npmjs='https://www.npmjs.com/search?q=' \
qunit='https://api.qunitjs.com/?s=' \
reactjs='https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=' \
smacss='https://google.com/search?as_sitesearch=smacss.com&as_q=' \
stackoverflow='https://stackoverflow.com/search?q=' \
typescript='https://google.com/search?as_sitesearch=www.typescriptlang.org/docs&as_q=' \
unheap='http://www.unheap.com/?s=' \
vuejs='https://www.google.com/search?as_sitesearch=vuejs.org&as_q=' \
]
fn frontend engine:str terms:[str]
# check whether the search context is supported
if test -z @_frontend_urls[$engine]
echo "Search context \"$engine\" currently not supported."
echo ""
echo "Valid contexts are:"
echo ""
echo " angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow,"
echo " dartlang, emberjs, fontello, github, html5please, jest, jquery, lodash,"
echo " mdn, npmjs, nodejs, qunit, reactjs, smacss, stackoverflow, unheap, vuejs, bundlephobia"
echo ""
return 1
end
# build search url:
# join arguments passed with '%20', then append to search context URL
# TODO substitute for proper urlencode method
let url = "@_frontend_urls[$engine]$join(@terms '%20')"
echo "Opening $url ..."
# TODO: open_command like zsh
xdg-open "$url"
end
# # Git-Flow plugin
#
# This plugin adds aliases for the [`git-flow`](https://github.com/nvie/gitflow) command.
# [More information about `git-flow` commands](https://github.com/nvie/gitflow/wiki/Command-Line-Arguments)
alias gfl='git flow'
alias gfli='git flow init'
alias gcd='git checkout develop'
alias gch='git checkout hotfix'
alias gcr='git checkout release'
alias gflf='git flow feature'
alias gflh='git flow hotfix'
alias gflr='git flow release'
alias gflfs='git flow feature start'
alias gflhs='git flow hotfix start'
alias gflrs='git flow release start'
alias gflff='git flow feature finish'
alias gflfp='git flow feature publish'
alias gflhf='git flow hotfix finish'
alias gflrf='git flow release finish'
alias gflfp='git flow feature publish'
alias gflhp='git flow hotfix publish'
alias gflrp='git flow release publish'
alias gflfpll='git flow feature pull'
# # git-hubflow plugin
#
# This plugin adds completion for [HubFlow](https://datasift.github.io/gitflow/) (GitFlow for GitHub), as well as some
# aliases for common commands. HubFlow is a git extension to make it easy to use GitFlow with GitHub. Based on the
# original gitflow extension for git.
#
# The hubflow tool has to be [installed](https://github.com/datasift/gitflow#installation) separately.
alias ghf='git hf'
alias ghff='git hf feature'
alias ghfr='git hf release'
alias ghfh='git hf hotfix'
alias ghfs='git hf support'
alias ghfu='git hf update'
# Set up hub wrapper for git, if it is available; https://github.com/github/hub
if which hub &> /dev/null
alias git = 'hub'
end
fn empty_gh repo:str -- Creates a new repo with a blank README.md in it and pushes it up to GitHub.
mkdir $repo
touch "$repo/README.md"
new_gh $repo
end
fn new_gh repo:str -- Add all non-hidden files to git
set -e
cd $repo
git init
# add all non-dot files
print '.*'"\n"'*~' >> .gitignore
git add [^.]*
git add -f .gitignore
git commit -m 'Initial commit.'
hub create
git push -u origin master
end
fn exist_gh repo:str -- Add an existing repo to github
set -e
cd $repo
hub create
git push -u origin master
end
# Shorten GitHub url, example:
# https://github.com/nvogel/dotzsh > https://git.io/8nU25w
# source: https://github.com/nvogel/dotzsh
# documentation: https://github.com/blog/985-git-io-github-url-shortener
fn git_io url:str -- Generate a short url for a github url
curl -i -s https://git.io -F "url=$url" | grep "Location" | cut -f 2 -d " "
end
# Enable gpg-agent if it is not running-
# --use-standard-socket will work from version 2 upwards
export AGENT_SOCK = $(gpgconf --list-dirs | grep agent-socket | cut -d : -f 2)
if not test -S $AGENT_SOCK
gpg-agent --daemon --use-standard-socket &> /dev/null
end
export GPG_TTY = $(tty)
# Set SSH to use gpg-agent if it's enabled
let GNUPGCONFIG = "$or($GNUPGHOME $HOME/.gnupg)/gpg-agent.conf"
if test -r $GNUPGCONFIG && /usr/bin/env grep -q enable-ssh-support $GNUPGCONFIG
export SSH_AUTH_SOCK = $AGENT_SOCK.ssh
export SSH_AGENT_PID = ''
end
# # Hanami Plugin #
# This plugin adds convenient ways to work with [Hanami](https://hanamirb.org/) via console.
# It's inspired by Rails plugin, so if you've used it, you'll feel like home.
#
# ## Usage ##
#
# For example, type `hc` into your console when you're within Hanami project directory to run
# the application console. Have a look at available shortcuts below. You can read more about
# these commands [on the official website](https://hanamirb.org/guides/command-line/applications/).
alias hc='hanami console'
alias hd='hanami destroy'
alias hg='hanami generate'
alias hgm='hanami generate migration'
alias hs='hanami server'
alias hsp='hanami server -p'
alias hr='hanami routes'
alias hdc='hanami db create'
alias hdd='hanami db drop'
alias hdp='hanami db prepare'
alias hda='hanami db apply'
alias hdv='hanami db version'
alias hdrs='hdd && hdp'
alias hdtp='HET hdp'
alias hrg='hr | grep'
# This plugin adds some jhbuild aliases and increase the completion function provided by zsh.
# ## Based upon the work of [Miguel Vaello](https://github.com/miguxbe)
alias jh='jhbuild'
# Build
alias jhb='jhbuild build'
alias jhbo='jhbuild buildone'
# Checks