Drop down terminals

Every day solutions to every day challenges. + Brilliant stuff

Moderators: b1o, jkerr82508

Forum rules
Please feel free to post your tip it does not have to be advanced. Also ask questions directly related to the tip here. But do not start new threads with questions or ask for help here. That is what the help section is for. forum rules: http://bjoernvold.com/forum/viewtopic.php?f=8&t=568
User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: Drop down terminals (Consoles)

Postby dedanna1029 » 28 Oct 2010, 15:58

viking60 wrote:You can autostart byobu by entering "byobu" in the custom command in the "Title and Command" tab

Yep. That got it, I think. Also a good idea to set "When command exits" to "Restart command"

It's not moody for me at all - have been having a blast with it since last night.
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Drop down terminals (Consoles)

Postby viking60 » 28 Oct 2010, 16:14

Ok your .bashrc is FUBARED.

You have double sets of data.

Code: Select all

# Check for an interactive session
#[ -z "$PS1" ] && return

#alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
bash_prompt_cmd() {
RTN=$?



smiley() {
    if [ $1 == 0 ] ; then
echo ":)"
    else
echo ":("
       fi
    }
smileyc() {
    if [ $1 == 0 ] ; then
echo $GREEN
else
echo $RED
       fi
    }
 if [ $(tput colors) -gt 0 ] ; then
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
RST=$(tput op)
fi
smiley=$(smiley $RTN)
smileyc=$(smileyc $RTN)
        local CY="\[\e[1;31m\]" # Each is 12 chars long
        local BL="\[\e[1;34m\]"
        local WH="\[\e[1;37m\]"
        local BR="\[\e[0;33m\]"
        local RE="\[\e[1;31m\]"
        local PROMPT="${CY}$"
        [ $UID -eq "0" ] && PROMPT="${RE}#"

        # Add the first part of the prompt: username,host, and time
        local PROMPT_PWD=""
        local PS1_T1="$BL.:[ $CY`whoami`@`hostname` $BL: $CY\t $BL:$CY "
        local ps_len=$(( ${#PS1_T1} - 12 * 6 + 6 + 4 )) #Len adjust for colors, time and var
        local PS1_T2=" $BL]:.\n\[\$smileyc\]\$smiley\[$RST\] "
        local startpos=""

        PROMPT_PWD="${PWD/#$HOME/~}"
        local overflow_prefix="..."
        local pwdlen=${#PROMPT_PWD}
        local maxpwdlen=$(( COLUMNS - ps_len ))
        # Sometimes COLUMNS isn't initiliased, if it isn't, fall back on 80
        [ $maxpwdlen -lt 0 ] && maxpwdlen=$(( 80 - ps_len ))

        if [ $pwdlen -gt $maxpwdlen ] ; then
                startpos=$(( $pwdlen - maxpwdlen + ${#overflow_prefix} ))
                PROMPT_PWD="${overflow_prefix}${PROMPT_PWD:$startpos:$maxpwdlen}"
        fi     
        export PS1="${PS1_T1}${PROMPT_PWD}${PS1_T2}"
}
PROMPT_COMMAND=bash_prompt_cmd


Replace it with this and you should be good. This is for your normal user - DO NOT USE IT FOR THE ROOT PROMPT.
I think this will solve a lot of the problems you have had lately.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: Drop down terminals (Consoles)

Postby dedanna1029 » 28 Oct 2010, 16:44

That's what I have already, dear Boss, near as I can tell. However, I did replace it with what you have there, and it does seem to have fixed it for now.

Edit: Nope it didn't. :(

Code: Select all

.:[ dedanna@dedanna.rocks.net : 09:48:55 : ~ ]:.
:) crontab -l
bash: /usr/bin/crontab: Permission denied
.:[ dedanna@dedanna.rocks.net : 09:49:02 : ~ ]:.
:( su
Password:
bash: bash_prompt_cmd: command not found
[root@dedanna dedanna]#


Looks now like I'll have to fix root's too. :\
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Drop down terminals (Consoles)

Postby viking60 » 28 Oct 2010, 18:09

Yes you had that and then you had some more. Looked like a paste error. Now forget the cron thing here it is only confusing and mixes things up.
Anyway I think I will stick to quake.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: Drop down terminals (Consoles)

Postby dedanna1029 » 28 Oct 2010, 18:27

Okay, I'm sticking with tilda. :mrgreen:
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: Drop down terminals (Consoles)

Postby dedanna1029 » 31 Oct 2010, 09:50

Hey, just wanted to mention right quick that I've been running tilda now for some almost four days straight - narry a problem, narry a bug - it does every single thing I need it to when I need it to. It's so cool to be able to roll it up out of my way as well with the F1 key - it can go always on top or not, doesn't matter; it will still roll up & down (at least it does for me) either way.

I've never had a terminal like this where it felt a privilege to be using it (but I do now), it's that smooth for me. :)

byobu's been running the whole time, the transparency on it is awesome, it just plain ROCKS.
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Drop down terminals (Consoles)

Postby viking60 » 31 Oct 2010, 10:17

Yes it is nice but did not go to well with my Graphic card of the Arch box I have it on Mandriva though - no problem there. Regarding transparency it is the same as a plain terminal or Guake. They all can have it. Roll up is elegant, and nicely animated. But F1 in Tilda does exactly the same as F12 in Guake - minus the animation. One thing that Tilda has and Guake does not is the ability to chose not to have it on every desktop. That is good. In Guake you get the terminal on every desktop. And Tilda lets you adjust the size in both directions while Guake only allows that in one direction.
Both are a nice improvement to the terminal.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Drop down terminals (Consoles)

Postby viking60 » 10 May 2011, 00:56

Just thought I should mention it here.
Guake works out of the box in Gnome3.
And so does Tilda :-D I think it looks even better in Gnome3.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: Drop down terminals (Consoles)

Postby dedanna1029 » 14 Apr 2012, 20:34

Ditto here...

Image

Tilda in front center left, Guake at top rear on Linux Mint 12 with byobu. :D
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Drop down terminals (Konsoles)

Postby viking60 » 27 May 2015, 12:11

Old Tip but most of it is still valid.

A new lightweight dropdown terminal has come and - it is xfce4-terminal (version 0.6.1 or newer).

There are no settings in the standard version but you can start the drop-down version with:

Code: Select all

xfce4-terminal --drop-down

This will turn your normal xfce4-terminal into a dropdown terminal and give you an extra drop-down settings menu.

You will need to make some keybinding for this so I assigned F1 in my openbox:
~/.config/openbox/rc.xml

Code: Select all

 </keybind>
     <keybind key="F1">
    <action name="Execute">
      <command>xfce4-terminal --drop-down</command>
    </action>
  </keybind>


Now I can hit F1 and the lightweight xfce4-terminal works pretty much like guake. Here I have split it with Tmux so I run Glances and clock to the right and Cmatrix to the left.
Image

If you use a "Normal" Desktop environment like Xfce4, KDE or Gnome; you should be able to assign Hot-keys in your "Settings".

Remember to uncheck the "Use shortcut to Focus visible Window" in the xfce4-terminal settings to make the Hot-Key work properly in Openbox- if you do not uncheck it the Hot-Key will not close the terminal.

You can also toggle with the mouse by clicking the icon tray.

The default hotkey for closing xfce4-terminal is
CTRL+SHIFT+q

One nice thing about xfce4-terminal are the tabs. They are not in any point and click settings but you can start them for the CLI or ALT+F2
Since I already have three terminal Windows split with Tmux I can add another tab or several and start start Atop of Iftop of whatever.
That really makes the terminal a really good tool +1

So to start one terminal with Tmux (Glances,Clock and standard terminal in one window - split in three) and Atop in another tab I launched this command:

Code: Select all

xfce4-terminal --drop-down --title "Viking terminal" -e "tmux attach" --tab --title "Atop" -e atop

And it worked like a charm. :jackpot
Pic coming up....
:A
Image

If I click the Atop Tab on the bottom right I will get to the Window running Atop (Big surprise there :-D ) I could of course start yet another tab running Iftop - In fact I think I will :-D
This could be a problem since Iftop needs root rights to run: So I did a

Code: Select all

xfce4-terminal --drop-down --title "Viking terminal" -e "tmux attach" --tab --title "Atop" -e atop --tab --title "Iftop" -e "sudo iftop"

and...
:drummer
:drummer
:B It worked just fine. I have three Tabs and I was prompted for my password and iftop started running as did Tmux and Atop. This will be how I start my terminal every time from now on.

Opps I think I need an empty terminal extra to play around with that does not start anything :lol:

Code: Select all

xfce4-terminal --drop-down --title "Viking terminal" -e "tmux attach" --tab --title "Atop" -e atop --tab --title "Iftop" -e "sudo iftop" --tab --title "Terminal"   

Now I have a terminal worthy of Valhalla :berserkf
:A
Image

The format is:
    --tab create new tab
    -T Title
    -e execute command

If you want to add a new tab after you have opened xfce4-terminal then you can right-click to get a menu that lets you do that.
I like the flexibility of this thing....
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: Drop down terminals (Konsoles)

Postby dedanna1029 » 12 Jun 2015, 03:55

Oh, you have just made dedanna one very happy person!
Just wait until the laptop gets here. Play time!
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: Drop down terminals (Konsoles)

Postby dedanna1029 » 09 Sep 2015, 09:55

You have indeed made dedanna one happy person. It turns out that Tilda is no longer in the Mageia repos, unless it's under a repo that isn't enabled (and I have all but the very bad ones enabled). So, time for the xfce4 terrminal, and the drop-down trick.
I have a slight problem I need to cure first, however. I've installed something from Gnome, gods know what, and now I have no way not to do anything but have every window fully maximized, and I can't find a button to make it the restore size. So, I'm off to chase that down. For all I know it's just a matter of the XFCE4 theme.
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html


Return to “Tips & Tricks”