Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#26 Le 01/06/2010, à 22:32

Megalo

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Kookaburra > Serait-il possible que tu partages ton bashrc, je l'avais trouvé il y a longtemps sur un site dont je ne me rappelle plus et je l'ai perdu depuis ?

Hors ligne

#27 Le 04/06/2010, à 22:17

Kookaburra

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Megalo a écrit :

Kookaburra > Serait-il possible que tu partages ton bashrc, je l'avais trouvé il y a longtemps sur un site dont je ne me rappelle plus et je l'ai perdu depuis ?

Celui-là ?


# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# Pager
export PAGER=most

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
#case "$TERM" in
#    xterm-color) color_prompt=yes;;
#esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
   # We have color support; assume it's compliant with Ecma-48
   # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
   # a case would tend to support setf rather than setaf.)
   color_prompt=yes
    else
   color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='\[\033[1;34m\] ┌────[\u@\h]──────────────────────────────────────────[\t]────┐ \n └───>(${PWD}) \$ \[\033[0;34m\]'
else
    PS1=' ┌────[\u@\h]──────────────────────────────────────────[\t]────┐ \n └───>(${PWD}) \$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

#if [ -f ~/.bash_aliases ]; then
#    . ~/.bash_aliases
#fi

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    alias dir='dir --color=auto'
    alias vdir='vdir --color=auto'
    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# some more aliases
alias sl="sudo gedit /etc/apt/sources.list"
alias serv="ssh -XC serveur"
alias sr="screen -raAd"
alias srD="screen -S Dimi"
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias install='sudo aptitude install'
alias update='sudo aptitude update'
alias upgrade='sudo aptitude dist-upgrade'
alias dupgrade='sudo aptitude update && sudo aptitude dist-upgrade'
alias agi='sudo aptitude install'
alias agu='sudo aptitude update'
alias agg='sudo aptitude dist-upgrade'
alias agug='sudo aptitude update && sudo aptitude dist-upgrade'

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi


#------------------------------------------////
# Colors:
#------------------------------------------////
black='\e[0;30m'
blue='\e[0;34m'
green='\e[0;32m'
cyan='\e[0;36m'
red='\e[0;31m'
purple='\e[0;35m'
brown='\e[0;33m'
lightgray='\e[0;37m'
darkgray='\e[1;30m'
lightblue='\e[1;34m'
lightgreen='\e[1;32m'
lightcyan='\e[1;36m'
lightred='\e[1;31m'
lightpurple='\e[1;35m'
yellow='\e[1;33m'
white='\e[1;37m'
nc='\e[0m'

#------------------------------------------////
# System Information:
#------------------------------------------////
clear
echo -e ""
echo -e "  ${lightblue}Today :\t\t" `date`
echo -e "  ${lightblue}System :       `lsb_release -i | cut -f 2` - `lsb_release -c | cut -f 2` - `lsb_release -r | cut -f 2`"
echo -e "  ${lightblue}Kernel :       `uname -o` `uname -r` - `uname -m`"

echo -e ""

smile

PS  : dans les alias, il y a des trucs perso, à virer ou à adapter à ton cas tongue

Dernière modification par Kookaburra (Le 04/06/2010, à 22:19)


Portable17p : CrunchBangLinux // EeePC : ArchLinux
Openbox Addict : http://kookadimi.deviantart.com
Mes photos : http://www.fluidr.com/photos/kookadimi/sets
Votre téléphone mobile dispose de plus de puissance que l'ensemble des ordinateurs de la NASA en 1969. La NASA a lancé un homme sur la Lune. Vous lancez un oiseau sur des cochons...

Hors ligne

#28 Le 06/06/2010, à 20:54

Megalo

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Merci beaucoup, c'était exactement ça smile

Hors ligne

#29 Le 30/08/2010, à 11:31

petitchevalroux

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Oula il faut que je vienne plus souvent sur le fofo moi big_smile. Donc moi aussi j'utilise screen depuis maintenant presque deux ans et c'est génial comme soft. Par contre le screenrc ... j'ai pas encore fait mais je m'y attache de ce pas.

Pour info j'ai fait un petit screencast de screen pour ceux qui ne comprenne pas l'utilité big_smile

Hors ligne

#30 Le 16/09/2010, à 08:43

NikeOfAllTrades

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Salut à tous.

J'ai découvert screen il y a quelque jours et j'aime plutot bien smile. Néanmoins j'ai quelques petits problèmes.

J'essaie de l'intégrer correctement avec gnome-terminal, de telle sorte que dés que je lance un terminal j'obtienne directement un screen. Jusque la j'ai simplement été mettre 'screen -q' dans 'Executer un commande personnalisée' de gnome-terminal. Seul problème: quand je ferme la fenêtre, au lieux de killer l'instance de screen ça fait un detach, il me faut donc killer les vieilles instances au bout d'un temps (oui c'est vrai, il en faudrait beaucoup pour que ça cause des problèmes de ram, mais j'aime que les choses soient bien faites ^^). Quelqu'un a une idée pour killer automatiquement ces instances et tous les processus qui y sont rattachés à la fin de l'exécution du gnome-terminal?

Merci d'avance.

Hors ligne

#31 Le 16/09/2010, à 08:55

BorX

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Si tu aimes que les choses soient bien faites, je te déconseille de fermer gnome-terminal en cliquant simplement sur la croix.
Il est préférable de quitter le ou les terminaux qui y sont lancés, soit avec logout, soit avec exit, soit avec CTRL-D.

Il en va de même pour screen.
Afin de le fermer proprement, c'est mieux de quitter tous les terminaux qu'il contient.

En revanche, une option intéressante serait sinon de lancer screen avec les options -D -R.
Tu retrouverais ainsi le screen détaché tel que tu l'avais laissé plutôt que d'en lancer de nouveaux.

Hors ligne

#32 Le 18/10/2010, à 23:44

lifala

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

salut je viens e découvrir screen en lisant Le livre du zéro.

J'ai utilisé celui proposé mais on ne voit pas l'heur et je ne sais pas comment y régler.
voici le screenrc

#shell /bin/zsh
# config de screen par bennyben
# raccourcis avec Ctrl-x puis une touche
# ou alors Ctrl-meta-une touche, voire Shirt-Ctrl-Meta

# $Id: screenrc,v 1.8 2002/03/20 22:20:21 laz Exp $
#
# /etc/screenrc
#
#   This is the system wide screenrc.
#
#   You can use this file to change the default behavior of screen system wide
#   or copy it to ~/.screenrc and use it as a starting point for your own
#   settings.
#
#   Commands in this file are used to set options, bind screen functions to
#   keys, redefine terminal capabilities, and to automatically establish one or
#   more windows at the beginning of your screen session.
#
#   This is not a comprehensive list of options, look at the screen manual for
#   details on everything that you can put in this file.
#

# ------------------------------------------------------------------------------
# SCREEN SETTINGS
# ------------------------------------------------------------------------------

startup_message off
#nethack on

#defflow on # will force screen to process ^S/^Q
deflogin on
autodetach on

# turn visual bell on
vbell on
vbell_msg "   Wuff  ----  Wuff!!  "

# define a bigger scrollback, default is 100 lines
defscrollback 1024

# ------------------------------------------------------------------------------
# SCREEN KEYBINDINGS
# ------------------------------------------------------------------------------

# Remove some stupid / dangerous key bindings
#bind '^k'
#bind 'L'
#bind '^\'
# Make them better
#bind '\\' quit
#bind 'K' kill
#bind 'I' login on
#bind 'O' login off
#bind '}' history

#bind 'R' colon "screen -ln rlogin faui -8^b^b^b"
#bind 'P' colon "^p"

# escape ""
#escape "^xx"
#bindkey \033^b break
#
#
    # ctrl-meta-insert
#
#bindkey \033^V digraph
#bindkey \033^. dumptermcap
#bindkey \033^F fit
#bindkey \033^f flow
#bindkey \033^I focus
#bindkey \033^h hardcopy

#bindkey \033^{ history
#bindkey \033^i info
#bindkey \033^m lastmsg
#bindkey \033^, license
#bindkey \033^H log
#bindkey \033^L login
#bindkey \033^M monitor
#bindkey \033^n next

#bindkey \033^N number
#bindkey \033^Q only
#bindkey \033^X other
#bindkey \033^B pow_break
#bindkey \033^D pow_detach
#bindkey \033^\ quit
#bindkey \033^< readbuf
#bindkey \033^l redisplay
#bindkey \033^X remove
#bindkey \033^= removebuf
#bindkey \033^Z reset
#bindkey \033^' select
#bindkey \033^_ silence
#bindkey \033^S split
#bindkey \033^z suspend
#bindkey \033^t time
#bindkey \033^A title
#bindkey \033^G vbell
#bindkey \033^v version
#bindkey \033^W width
#bindkey \033^r wrap
#bindkey \033^> writebuf
#bindkey \033^s xoff
#bindkey \033^q xon

#bindkey \033^x next
#bindkey \033^w prev
#bindkey \033^n next
#bindkey \033^p prev
#bindkey \033^c screen
#bindkey \033^d detach
#bindkey \033: colon
#bindkey \033? help
#bindkey \033^l clear
#bindkey \033² displays
#bindkey \033^P hardcopy
#bindkey \033^k kill
#bindkey \033^L log
#bindkey \033^m monitor
#bindkey \033ù silence
#bindkey \033^t title
#bindkey \033^S split
#bindkey \033^f fit
#bindkey \033^q xon
#bindkey \033^s xoff
#bindkey \033\033[2\^ copy
#bindkey \033^k digraph
#bindkey \033^a focus up
#bindkey \033^z focus down
#bindkey \033* lockscreen

# An example of a "screen scraper" which will launch urlview on the current
# screen window
#
#bind ^B eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"

# on Debian backspace should send char `\177':
bindkey -k kb stuff "\177"

# ------------------------------------------------------------------------------
# TERMINAL SETTINGS
# ------------------------------------------------------------------------------

# The vt100 description does not mention "dl". *sigh*
termcapinfo vt100 dl=5\E[M

# turn sending of screen messages to hardstatus off
#hardstatus off
hardstatus on
# Set the hardstatus prop on gui terms to set the titlebar/icon title
termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007
# use this for the hard status string
#hardstatus string "%h%? users: %u%?"

# An alternative hardstatus to display a bar at the bottom listing the
# windownames and highlighting the current windowname in blue. (This is only
# enabled if there is no hardstatus setting for your terminal)
#
#hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
#  version d'avant, allégée avec seulement les window en cours et celle courante en jaune
#  et fond bleu
#hardstatus alwayslastline "%{= BY}%-Lw%{= YB}%50>%n%f* %t%{= BY}%+Lw%<"
# nouvelle version :
# heure (avec secondes), nom de la machine en rouge, load de la machine
# puis fenetres avec celle courante en jaune, le tout en fond bleu
hardstatus alwayslastline "%{b kB}%{s gB}%c:%s%{b kB} %{b kR}%H %{b kB}%{s yB}%l%{b kB} %{b kB}%{rs Y}%-Lw%{BY}%50>%n%{R}%f%{B} %t%{YB}%+Lw%<"

# set these terminals up to be 'optimal' instead of vt100
termcapinfo xterm*|linux*|rxvt*|Eterm* OP

# Change the xterm initialization string from is2=\E[!p\E[?3;4l\E[4l\E>
# (This fixes the "Aborted because of window size change" konsole symptoms found
#  in bug #134198)
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'

termcapinfo xterm*|linux*|rxvt*|Eterm* ti@:te@

# Do not use xterms alternate window buffer (won't add lines to scrollback bfr)
#termcapinfo xterm|xterms|xs ti=\E7\E[?47l

# ------------------------------------------------------------------------------
# STARTUP SCREENS
# ------------------------------------------------------------------------------

# Example of automatically running some programs in windows on screen startup.
#
#   The following will open top in the first window, an ssh session to monkey
#   in the next window, and then open mutt and tail in windows 8 and 9
#   respectively.
#
# screen top
# screen -t monkey ssh monkey
# screen -t mail 8 mutt
# screen -t daemon 9 tail -f /var/log/daemon.log

sorendition =s WB 
msgwait 3
bell "^GBell in window %"

Pour démarrer des applications ou dois-je regardé?

merci

Dernière modification par lifala (Le 26/10/2010, à 20:35)


conky 1 --- conky 2 --- conkyForecast 2.09 --- Tuto Finch
Lucid minimal + openbox

Hors ligne

#33 Le 01/11/2010, à 19:37

JB-home

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

voilà pour moi :

# ------------------------------------------------------------------------------
# STARTUP SCREENS
# ------------------------------------------------------------------------------

screen -t htop htop
select htop
split -v
focus down
screen -t ncmpcpp ncmpcpp
select ncmpcpp
split -v
focus down
screen -t cone cone
select cone
split -v
focus down
screen -t newsbeuter newsbeuter
select newsbeuter
split -v
focus down
screen -t irssi irssi
select irssi

Tilda + screen ( irssi / htop / ncmpcpp / newsbeuter / cone )

je me serai passé de screen s'il était possible de démarré tilda avec plusieurs onglets...

Dernière modification par z0rg> (Le 01/11/2010, à 21:20)

Hors ligne

#34 Le 18/11/2010, à 10:12

sachacr

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Bonjours à tous,

J'utilise screen depuis un moment mais je n'avais pas encore personnalisé mon .screenrc.
J'ai copier plus ou moins le screenrc de ce topic mais le split vertical ne fonctionne pas :s
y'a t'il quelque chose à modifier dans les fichier de conf pour l'activer ? Ou est ce qu'il faut un émulateur de terminale style Tilda etc pour avoir le split vertical ?

Je vous poste aussi mon .screenrc :

#shell /bin/zsh
# config de screen par bennyben
# raccourcis avec Ctrl-x puis une touche
# ou alors Ctrl-meta-une touche, voire Shirt-Ctrl-Meta

# $Id: screenrc,v 1.8 2002/03/20 22:20:21 laz Exp $
#
# /etc/screenrc
#
#   This is the system wide screenrc.
#
#   You can use this file to change the default behavior of screen system wide
#   or copy it to ~/.screenrc and use it as a starting point for your own
#   settings.
#
#   Commands in this file are used to set options, bind screen functions to
#   keys, redefine terminal capabilities, and to automatically establish one or
#   more windows at the beginning of your screen session.
#
#   This is not a comprehensive list of options, look at the screen manual for
#   details on everything that you can put in this file.
#

# ------------------------------------------------------------------------------
# SCREEN SETTINGS
# ------------------------------------------------------------------------------

startup_message off
#nethack on

#defflow on # will force screen to process ^S/^Q
deflogin on
autodetach on

# turn visual bell on
vbell on
vbell_msg "   Wuff  ----  Wuff!!  "

# define a bigger scrollback, default is 100 lines
defscrollback 1024

# ------------------------------------------------------------------------------
# SCREEN KEYBINDINGS
# ------------------------------------------------------------------------------

# Remove some stupid / dangerous key bindings
#bind '^k'
#bind 'L'
#bind '^\'
# Make them better
#bind '\\' quit
#bind 'K' kill
#bind 'I' login on
#bind 'O' login off
#bind '}' history

#bind 'R' colon "screen -ln rlogin faui -8^b^b^b"
#bind 'P' colon "^p"

# escape ""
#escape "^xx"
#bindkey \033^b break
#
#
    # ctrl-meta-insert
#
#bindkey \033^V digraph
#bindkey \033^. dumptermcap
#bindkey \033^F fit
#bindkey \033^f flow
#bindkey \033^I focus
#bindkey \033^h hardcopy

#bindkey \033^{ history
#bindkey \033^i info
#bindkey \033^m lastmsg
#bindkey \033^, license
#bindkey \033^H log
#bindkey \033^L login
#bindkey \033^M monitor
#bindkey \033^n next

#bindkey \033^N number
#bindkey \033^Q only
#bindkey \033^X other
#bindkey \033^B pow_break
#bindkey \033^D pow_detach
#bindkey \033^\ quit
#bindkey \033^< readbuf
#bindkey \033^l redisplay
#bindkey \033^X remove
#bindkey \033^= removebuf
#bindkey \033^Z reset
#bindkey \033^' select
#bindkey \033^_ silence
#bindkey \033^S split
#bindkey \033^z suspend
#bindkey \033^t time
#bindkey \033^A title
#bindkey \033^G vbell
#bindkey \033^v version
#bindkey \033^W width
#bindkey \033^r wrap
#bindkey \033^> writebuf
#bindkey \033^s xoff
#bindkey \033^q xon

#bindkey \033^x next
#bindkey \033^w prev
#bindkey \033^n next
#bindkey \033^p prev
#bindkey \033^c screen
#bindkey \033^d detach
#bindkey \033: colon
#bindkey \033? help
#bindkey \033^l clear
#bindkey \033² displays
#bindkey \033^P hardcopy
#bindkey \033^k kill
#bindkey \033^L log
#bindkey \033^m monitor
#bindkey \033ù silence
#bindkey \033^t title
#bindkey \033^S split
#bindkey \033^f fit
#bindkey \033^q xon
#bindkey \033^s xoff
#bindkey \033\033[2\^ copy
#bindkey \033^k digraph
#bindkey \033^a focus up
#bindkey \033^z focus down
#bindkey \033* lockscreen

# An example of a "screen scraper" which will launch urlview on the current
# screen window
#
#bind ^B eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"

# on Debian backspace should send char `\177':
bindkey -k kb stuff "\177"

# ------------------------------------------------------------------------------
# TERMINAL SETTINGS
# ------------------------------------------------------------------------------

# The vt100 description does not mention "dl". *sigh*
termcapinfo vt100 dl=5\E[M

# turn sending of screen messages to hardstatus off
#hardstatus off
hardstatus on
# Set the hardstatus prop on gui terms to set the titlebar/icon title
termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007
# use this for the hard status string
#hardstatus string "%h%? users: %u%?"

# An alternative hardstatus to display a bar at the bottom listing the
# windownames and highlighting the current windowname in blue. (This is only
# enabled if there is no hardstatus setting for your terminal)
#
#hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
#  version d'avant, allégée avec seulement les window en cours et celle courante en jaune
#  et fond bleu
#hardstatus alwayslastline "%{= BY}%-Lw%{= YB}%50>%n%f* %t%{= BY}%+Lw%<"
# nouvelle version :
# heure (avec secondes), nom de la machine en rouge, load de la machine
# puis fenetres avec celle courante en jaune, le tout en fond bleu
hardstatus alwayslastline "%{b kB}%{s gB}%c:%s%{b kB} %{b kR}%H %{b kB}%{s yB}%l%{b kB} %{b kB}%{rs Y}%-Lw%{BY}%50>%n%{R}%f%{B} %t%{YB}%+Lw%<"

# set these terminals up to be 'optimal' instead of vt100
termcapinfo xterm*|linux*|rxvt*|Eterm* OP

# Change the xterm initialization string from is2=\E[!p\E[?3;4l\E[4l\E>
# (This fixes the "Aborted because of window size change" konsole symptoms found
#  in bug #134198)
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'

termcapinfo xterm*|linux*|rxvt*|Eterm* ti@:te@

# Do not use xterms alternate window buffer (won't add lines to scrollback bfr)
#termcapinfo xterm|xterms|xs ti=\E7\E[?47l

# ------------------------------------------------------------------------------
# STARTUP SCREENS
# ------------------------------------------------------------------------------

# Example of automatically running some programs in windows on screen startup.
#
#   The following will open top in the first window, an ssh session to monkey
#   in the next window, and then open mutt and tail in windows 8 and 9
#   respectively.
#
# screen top
# screen -t monkey ssh monkey
# screen -t mail 8 mutt
# screen -t daemon 9 tail -f /var/log/daemon.log

sorendition =s WB 
msgwait 3
bell "^GBell in window %"

#-------------------------------------------------------------------------------
#                    PROGRAMME A LANCER
#-------------------------------------------------------------------------------

#       Le split vertical ne marche pas :s
#       split -v

split
        screen -t       TTY0    0
        select          TTY0

focus down

        screen -t       TTY1    1
        select          TTY1

Dernière modification par sachacr (Le 18/11/2010, à 15:07)

Hors ligne

#35 Le 07/12/2010, à 02:03

fabux

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Salut,

j'ai découvert un autre usage de screen grâce à vous: MERCI smile
Par contre je n'arrive pas à avoir la date dans le hardstatus en français avec le bon encodage (j'ai aussi ce problème avec elinks mais j'ai pas trop cherché)
voilà ce que j'ai (voir en bas à gauche)
1291682495.png
et mon screenrc:

# ------------------------------------------------------------------------------
# SCREEN SETTINGS
# ------------------------------------------------------------------------------
#encodage
#setenv LANG en_US #si "lang=fr_FR screen -c screenFULLrc" ok mais en anglais
#setenv LANG fr_FR.iso8819-15
#setenv LANG en_US.iso8819-15
#setenv LC_CTYPE fr_FR.UTF-8
#defutf8 on
#encodage pour les accents
#defencoding utf8
#defencoding iso8859-15
#encoding utf8 iso8859-15 #marche mais plus d'encodage ensuite dans RSS

#startup_message off
#nethack on

#defflow on # will force screen to process ^S/^Q
deflogin on
#autodetach off

# turn visual bell on
vbell off
#vbell_msg "   Wuff  ----  Wuff!!  "

# define a bigger scrollback, default is 100 lines
defscrollback 1024


# ------------------------------------------------------------------------------
# SCREEN KEYBINDINGS
# ------------------------------------------------------------------------------

#\033p alt+p
#^p ctrl+p
bindkey ² next
bindkey \033p prev

# Remove some stupid / dangerous key bindings
bind ^k
#bind L
bind ^\
# Make them better
bind \\ quit
bind K kill
bind I login on
bind O login off
bind } history

# An example of a "screen scraper" which will launch urlview on the current
# screen window
#
#bind ^B eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"

# ------------------------------------------------------------------------------
# TERMINAL SETTINGS
# ------------------------------------------------------------------------------

# The vt100 description does not mention "dl". *sigh*
termcapinfo vt100 dl=5\E[M

# turn sending of screen messages to hardstatus off
hardstatus on
# Set the hardstatus prop on gui terms to set the titlebar/icon title
termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007
# use this for the hard status string
#hardstatus string "%h%? users: %u%?"
#caption always
#caption string "%{kw}%-w%{wr}%n %t%{-}%+w"


# An alternative hardstatus to display a bar at the bottom listing the
# windownames and highlighting the current windowname in blue. (This is only
# enabled if there is no hardstatus setting for your terminal)
#
#affichage en bas de screen 
#voir pour ajouter un warning
hardstatus alwayslastline
hardstatus string "%{= kG}%{g}[ %{+b b}%D %d %M %Y %c:%s%{-b g} ] [ %{y}%?%-w%{+b b} %n-%t %{-b y}%+w%?%{g} ]"


# set these terminals up to be 'optimal' instead of vt100
termcapinfo xterm*|linux*|rxvt*|Eterm* OP

# Change the xterm initialization string from is2=\E[!p\E[?3;4l\E[4l\E>
# (This fixes the "Aborted because of window size change" konsole symptoms found
#  in bug #134198)
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'

# To get screen to add lines to xterm's scrollback buffer, uncomment the
# following termcapinfo line which tells xterm to use the normal screen buffer
# (which has scrollback), not the alternate screen buffer.
#
termcapinfo xterm|xterms|xs|rxvt ti@:te@

# Enable non-blocking mode to better cope with flaky ssh connections.
defnonblock 5

# ------------------------------------------------------------------------------
# STARTUP SCREENS
# ------------------------------------------------------------------------------

# Example of automatically running some programs in windows on screen startup.
#
#   The following will open top in the first window, an ssh session to monkey
#   in the next window, and then open mutt and tail in windows 8 and 9
#   respectively.
#

screen -t Zik 0 bash -c '/home/fabux/Scripts/ZICscreen.sh'
screen -t Top 1 top -d1
screen -t Bash 2 bash
screen -t Mail 3 cone
screen -t RSS 4 newsbeuter
screen -t IM 5 centerim-utf8
#screen -t Internet 6 w3m -N google.fr /usr/share/doc/w3m/MANUAL.html#Key:orig doc.ubuntu-fr.org forum.ubuntu-fr.org
screen -t Net 6 elinks google.fr /usr/share/doc/w3m/MANUAL.html#Key:orig doc.ubuntu-fr.org forum.ubuntu-fr.org
#select cone
#split
#split -v
#select bash
focus down
select 3

Si vous aviez une idée pour avoir la date en français avec le bon encodage svp.

J'en profite aussi pour demander 2-3 choses:
- est-ce possible d'ajouter dans mon hardstatus une 3ème partie sur la droite avec les infos récupérées de mocp? edit: ça c'est bon. Il faut utiliser backtick
- une autre barre d'info en haut ?
- le signal comme quoi j'ai une autre fenêtre qui demande une attention se règle où/comment (position, couleur) ? (genre j'ai un mail sur le screen 3 ou une demande de mdp sur le screen 2)
- lancer une commande si on quitte le terminal ? (genre on fait ^\, yes et ça fait mocp -x)
- toujours mocp: aujourd'hui je passe par un script pour vérifier qu'il n'est pas déjà lancer (j'ai tendance à quitter screen sans tout clore) avec dedans

mocp -S && mocp -o s -f -p && mocp

il y a peut-être plus simple ?

@z0rg> rien à voir mais grâce à toi j'utilise désormais cone merci. Par contre j'ai un souci avec une boite mail imap free. À tout hasard tu n'aurais pas une piste pour m'aider ? big_smile

edit: ajout commentaire pour backtick.
Pour l'encodage je continue de chercher (marche avec terminfo xterm* KJ=iso8859-15 mais ça me fais le même problème qu'avec encoding...)

Dernière modification par fabux (Le 07/12/2010, à 15:25)

Hors ligne

#36 Le 08/12/2010, à 17:29

fabux

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

J'ai cherché comme Qid à splitter une partie mais conserver le reste en full tout en basculant de l'un à l'autre. (ex: avoir musique et irc sur un split et bash dans une fenêtre en full).
Pour le moment, je n'ai rien paufiné (raccourci, lancement auto en split dans le screen parent, réglage du 2ème hardstatut qui apparait), mais ça fonctionne en m'appuyant sur le principe du screen dans screen expliqué ici.
En gros, on lance un screen détaché et on lance une deuxième session screen "normal" (donc screen -ls retourne 2 lignes 1 attached; l'autre detached)
Dans ce deuxième screen:  C-a c (par défaut qui créé une 2ème "fenêtre") et dans cette nouvelle fenêtre screen -r.
Reste plus qu'a spliter la session ré-attacher (C-a a S)

Hors ligne

#37 Le 02/02/2011, à 18:09

vjaunet

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Bonjour,

je suis utilisateur de screen depuis environ 3 ans, mais je viens de rencontrer un problème quant a son utilisation avec emacs et fortran.
Lorsque j'ouvre un screen, puis ouvre un fichier fortran avec emacs, la coloration syntaxique ne fonctionne plus. C'est assez génant, et le problème
ne se posait pas avec mon installation précédente.
Je suis a peu près sûr que la solution doit vous paraître toute simple... Et je suppose qu'une modification du .screenrc doit suffire.

une idée ?
merci d'avance.

vincent

ubuntu 10.4 64 bits
GNU Emacs 23.1.1

Hors ligne

#38 Le 03/02/2011, à 11:04

vjaunet

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

J'ai fini par trouver :
rajouter "term xterm" dans le .screenrc

++

Hors ligne

#39 Le 17/02/2011, à 18:59

benoit2600

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

bonjour, est-il possible de se connecter a une session screen a plusieurs ?

( j'utilise screen pour démarrer un serveur minecraft, et c'est a partir de lui que se fait l'administration, or nous somme plusieurs admins)

Et est-il possible de bloquer le nombre de session ayant le même nom  ?
Car des fois, je crée une session du nom de "minecraft", alors qu'une autre est déjà ouverte, et du coup, pour pouvoir visualiser la première, je dois rentrer le nom du pid, ce qui n'est pas prattique :-/

Hors ligne

#40 Le 28/03/2011, à 17:00

jacabo

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Bonjour !
j'arrive après la bataille, mais est-ce que vous pourriez me dire ou on trouve le tuto pour apprendre a faire des screenrc ?
parce que j'adore screen smile , mais que les touches ne me conviennent pas DU TOUT sad


-----BEGIN GEEK CODE BLOCK-----
  GCS d-- s+:+ a+ c++++ C++++ B+++ 7---- w--- L+ M-- u++ W+++ H++++ Z++  F--- PS- PE+ Y+ PGP T+++ S++++ J++ R+++ m+++ tv-- b++++ DI++ D++
  e+++ h---- A-- r+++ y+++
------END GEEK CODE BLOCK------ ___________ \o/_____________

Hors ligne

#41 Le 28/03/2011, à 19:36

fabux

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

les exemples donnés ici, le man de screen of course, une recherche sur le web avec pour terme "screenrc "...
Tu as aussi cette page en anglais mais plutôt fournie.
Tu peux toujours en faire un et le lancer avec screen -c chemin/de/ton/screenrc. Exemple : un fichier .screenrcTest dans ton dossier perso que tu lances avec screen -c ~/.screenrcTest

Pour les bindkeys tu as 2-3 exemples dans ce thread, tu peux en voir d'autre ici pour te donner une idée de comment faire.

Hors ligne

#42 Le 29/03/2011, à 06:33

jacabo

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Merci smile je m'y met.


-----BEGIN GEEK CODE BLOCK-----
  GCS d-- s+:+ a+ c++++ C++++ B+++ 7---- w--- L+ M-- u++ W+++ H++++ Z++  F--- PS- PE+ Y+ PGP T+++ S++++ J++ R+++ m+++ tv-- b++++ DI++ D++
  e+++ h---- A-- r+++ y+++
------END GEEK CODE BLOCK------ ___________ \o/_____________

Hors ligne

#43 Le 19/04/2011, à 11:17

sachacr

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Un petit up pour mon problème je n'arrive toujours pas à avoir de split vertical quand je lance mon screen il me dit que la commande split ne prend pas d'arguments...
split : no argument required

donc je peu pas lui passer le -v :s

J'utilise screen version 4.0.3-3 sur une CentOS 5.6

Vous avez une idée ?

Dernière modification par sachacr (Le 19/04/2011, à 11:18)

Hors ligne

#44 Le 19/04/2011, à 12:07

fabux

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Est-ce que tu peux spliter avec les raccourcis (ctrl+ a + | ) ?

Hors ligne

#45 Le 19/04/2011, à 12:27

sachacr

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Non j'ai essayé avec ce raccourci et il ne fonctionne pas :s

Hors ligne

#46 Le 19/04/2011, à 20:57

fabux

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Excuse-moi je voulais dire ctrl+a puis | et non les trois en même temps mais je penses que tu auras rectifié.
Dans le doute je résume : tu lances screen, puis ctrl+a que tu relâches pour enfin faire le pipe | (altgr+6) .
Sinon tu as essayé de déplacer split -v ? (le mettre après ton premier screen -t ?) dans ton screenrc.
Enfin si tu fais un screen --help est-ce que tu vois l'option -v ?

Hors ligne

#47 Le 20/04/2011, à 08:04

sachacr

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Oui j'avais bien rectifié pour le raccourcis.

J'ai essayé de déplacer mon split -v un peu plus bas mais sans succès.

et lorsque je tape screen --help j'obtiens :

[root@host ~]# screen --help
Use: screen [-opts] [cmd [args]]
 or: screen -r [host.tty]

Options:
-a            Force all capabilities into each window's termcap.
-A -[r|R]     Adapt all windows to the new display width & height.
-c file       Read configuration file instead of '.screenrc'.
-d (-r)       Detach the elsewhere running screen (and reattach here).
-dmS name     Start as daemon: Screen session in detached mode.
-D (-r)       Detach and logout remote (and reattach here).
-D -RR        Do whatever is needed to get a screen session.
-e xy         Change command characters.
-f            Flow control on, -fn = off, -fa = auto.
-h lines      Set the size of the scrollback history buffer.
-i            Interrupt output sooner when flow control is on.
-l            Login mode on (update /var/run/utmp), -ln = off.
-list         or -ls. Do nothing, just list our SockDir.
-L            Turn on output logging.
-m            ignore $STY variable, do create a new screen session.
-O            Choose optimal output rather than exact vt100 emulation.
-p window     Preselect the named window if it exists.
-q            Quiet startup. Exits with non-zero return code if unsuccessful.
-r            Reattach to a detached screen process.
-R            Reattach if possible, otherwise start a new session.
-s shell      Shell to execute rather than $SHELL.
-S sockname   Name this session <pid>.sockname instead of <pid>.<tty>.<host>.
-t title      Set title. (window's name).
-T term       Use term as $TERM for windows, rather than "screen".
-U            Tell screen to use UTF-8 encoding.
-v            Print "Screen version 4.00.03 (FAU) 23-Oct-06".
-wipe         Do nothing, just clean up SockDir.
-x            Attach to a not detached screen. (Multi display mode).
-X            Execute <cmd> as a screen command in the specified session.
[root@host ~]#

Autre précision j'utilise putty pour me connecter à un serveur distant est ce que ça peu jouer ?

Dernière modification par sachacr (Le 20/04/2011, à 08:06)

Hors ligne

#48 Le 20/04/2011, à 09:44

fabux

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Décidément, c'est pas dans le help mais le man qu'il faut voir s'il est question de split vertical (mais ce n'est pas dis que le man change dès qu'il y a une option en moins ou plus)

Bref, pas dis que putty puisse te permettre de splitter. Ça marche en horizontal (ctrl+a suivi de s)?
Pourquoi putty tu es sous windows? Si oui peut-être essayer depuis un live ou une machine "normale" big_smile

Hors ligne

#49 Le 20/04/2011, à 10:05

sachacr

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

Oui heureusement le split horizontale fonctionne.
Je suis effectivement sous Windows et je ne peu pas me connecter avec une machine sous linux malheureusement...
j'ai regarder dans le man aucunes traces de split vertical je sais pas si c'est le cas chez tout le monde ?

Hors ligne

#50 Le 20/04/2011, à 10:33

fabux

Re : [config] Partagez vos '.screenrc' (screen = multiplexeur de terminaux)

 man screen | grep split
       C-a tab     (focus)       Switch the input focus to the next region.  See also split, remove, only.
       C-a Q       (only)        Delete all regions but the current one.  See also split, remove, focus.
       C-a S       (split)       Split  the  current  region  horizontally into two new ones.  See also only, remove,
       C-a X       (remove)      Kill the current region.  See also split, only, focus.
       C-a |       (split -v)    Split the current region vertically into two new ones.
       caption always|splitonly [string]
       window  is  shown  on the display (split screen mode). But if the type is set to always screen shows a caption
       even if only one window is displayed. The default is splitonly.
       split [-v]

Hors ligne